tor-browser

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

test_ShortestPaths_02.html (1680B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 Test that the ShortestPaths component renders a suggestion to select a node when there is no graph.
      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 
     12    <script type="application/javascript"
     13            src="chrome://global/content/third_party/d3/d3.js">
     14    </script>
     15    <script type="application/javascript"
     16            src="chrome://devtools/content/shared/vendor/dagre-d3.js">
     17    </script>
     18 </head>
     19 <body>
     20    <!-- Give the container height so that the whole tree is rendered. -->
     21    <div id="container" style="height: 900px;"></div>
     22 
     23    <pre id="test">
     24        <script src="head.js" type="application/javascript"></script>
     25        <script type="application/javascript">
     26         "use strict";
     27         window.onload = async function() {
     28           try {
     29             const container = document.getElementById("container");
     30 
     31             await renderComponent(ShortestPaths(immutableUpdate(TEST_SHORTEST_PATHS_PROPS,
     32                                                                 { graph: null })),
     33                                   container);
     34 
     35             ok(container.textContent.includes(L10N.getStr("shortest-paths.select-node")),
     36                "The node selection prompt is displayed");
     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>