tor-browser

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

test_inspector-hide.html (2098B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug </title>
      9 
     10  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     11  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
     12  <script type="application/javascript" src="inspector-helpers.js"></script>
     13  <script type="application/javascript">
     14 "use strict";
     15 
     16 window.onload = function() {
     17  SimpleTest.waitForExplicitFinish();
     18  runNextTest();
     19 };
     20 
     21 let gWalker = null;
     22 let gInspectee = null;
     23 
     24 addTest(async function setup() {
     25  const url = document.getElementById("inspectorContent").href;
     26  const { target, doc } = await attachURL(url);
     27  const inspector = await target.getFront("inspector");
     28  gInspectee = doc;
     29  gWalker = inspector.walker;
     30  runNextTest();
     31 });
     32 
     33 addTest(function testRearrange() {
     34  let listFront = null;
     35  const listNode = gInspectee.querySelector("#longlist");
     36 
     37  promiseDone(gWalker.querySelector(gWalker.rootNode, "#longlist").then(front => {
     38    listFront = front;
     39  }).then(() => {
     40    const computed = gInspectee.defaultView.getComputedStyle(listNode);
     41    is(computed.visibility, "visible", "Node should be visible to start with");
     42    return gWalker.hideNode(listFront);
     43  }).then(() => {
     44    const computed = gInspectee.defaultView.getComputedStyle(listNode);
     45    is(computed.visibility, "hidden", "Node should be hidden");
     46    return gWalker.unhideNode(listFront);
     47  }).then(() => {
     48    const computed = gInspectee.defaultView.getComputedStyle(listNode);
     49    is(computed.visibility, "visible", "Node should be visible again.");
     50  }).then(runNextTest));
     51 });
     52 
     53 addTest(function cleanup() {
     54  gWalker = null;
     55  gInspectee = null;
     56  runNextTest();
     57 });
     58 
     59  </script>
     60 </head>
     61 <body>
     62 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
     63 <a id="inspectorContent" target="_blank" href="inspector-traversal-data.html">Test Document</a>
     64 <p id="display"></p>
     65 <div id="content" style="display: none">
     66 
     67 </div>
     68 <pre id="test">
     69 </pre>
     70 </body>
     71 </html>