tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_DominatorTreeItem_01.html (1644B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 Test that we don't display `JS::ubi::RootList` for the root, and instead show "GC Roots".
      5 -->
      6 <head>
      7    <meta charset="utf-8">
      8    <title>Tree component test</title>
      9    <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     10    <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
     11 </head>
     12 <body>
     13    <!-- Give the container height so that the whole tree is rendered. -->
     14    <div id="container" style="height: 900px;"></div>
     15 
     16    <pre id="test">
     17        <script src="head.js" type="application/javascript"></script>
     18        <script type="application/javascript">
     19         "use strict";
     20         window.onload = async function() {
     21           try {
     22             const container = document.getElementById("container");
     23 
     24             await renderComponent(DominatorTreeItem({
     25               item: makeTestDominatorTreeNode({ label: ["other", "JS::ubi::RootList"] }),
     26               depth: 0,
     27               arrow: dom.div(),
     28               focused: true,
     29               getPercentSize: _ => 50,
     30               onViewSourceInDebugger: _ => { },
     31             }), container);
     32 
     33             ok(!container.textContent.includes("JS::ubi::RootList"),
     34                "Should not display `JS::ubi::RootList`");
     35             ok(container.textContent.includes("GC Roots"),
     36                "Should display `GC Roots` instead");
     37           } catch (e) {
     38             ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
     39           } finally {
     40             SimpleTest.finish();
     41           }
     42         };
     43        </script>
     44    </pre>
     45 </body>
     46 </html>