Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / devtools / server / tests / chrome / test_inspector-hide.html
blobea6ed74560bdec762a1bb546567e9d157dc19715
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>
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";
16 window.onload = function() {
17 SimpleTest.waitForExplicitFinish();
18 runNextTest();
21 let gWalker = null;
22 let gInspectee = null;
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 });
33 addTest(function testRearrange() {
34 let listFront = null;
35 const listNode = gInspectee.querySelector("#longlist");
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 });
53 addTest(function cleanup() {
54 gWalker = null;
55 gInspectee = null;
56 runNextTest();
57 });
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">
67 </div>
68 <pre id="test">
69 </pre>
70 </body>
71 </html>