OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 var UPDATE_COUNT = 5; | 9 var UPDATE_COUNT = 5; |
10 var rebuildCount = 0; | 10 var rebuildCount = 0; |
11 | 11 |
12 InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback); | 12 InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback); |
13 function selectCallback() | 13 function selectCallback() |
14 { | 14 { |
15 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_inn
erRebuildUpdate", sniffRebuild, true); | 15 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_inn
erRebuildUpdate", sniffRebuild, true); |
16 var stylesPane = WebInspector.panels.elements.sidebarPanes.styles; | 16 var stylesPane = WebInspector.panels.elements.sidebarPanes.styles; |
17 for (var i = 0; i < UPDATE_COUNT; ++i) | 17 for (var i = 0; i < UPDATE_COUNT; ++i) |
18 stylesPane.setNode(stylesPane.node()); | 18 WebInspector.context.setFlavor(WebInspector.DOMNode, stylesPane.node
()); |
19 | 19 |
20 InspectorTest.deprecatedRunAfterPendingDispatches(completeCallback); | 20 InspectorTest.deprecatedRunAfterPendingDispatches(completeCallback); |
21 } | 21 } |
22 | 22 |
23 function completeCallback() | 23 function completeCallback() |
24 { | 24 { |
25 if (rebuildCount >= UPDATE_COUNT) | 25 if (rebuildCount >= UPDATE_COUNT) |
26 InspectorTest.addResult("ERROR: got " + rebuildCount + " rebuilds fo
r " + UPDATE_COUNT + " consecutive updates"); | 26 InspectorTest.addResult("ERROR: got " + rebuildCount + " rebuilds fo
r " + UPDATE_COUNT + " consecutive updates"); |
27 else | 27 else |
28 InspectorTest.addResult("OK: rebuilds throttled"); | 28 InspectorTest.addResult("OK: rebuilds throttled"); |
(...skipping 11 matching lines...) Expand all Loading... |
40 | 40 |
41 <body onload="runTest()"> | 41 <body onload="runTest()"> |
42 <p> | 42 <p> |
43 Tests that Styles sidebar DOM rebuilds are throttled during consecutive updates.
<a href="https://bugs.webkit.org/show_bug.cgi?id=78086">Bug 78086</a>. | 43 Tests that Styles sidebar DOM rebuilds are throttled during consecutive updates.
<a href="https://bugs.webkit.org/show_bug.cgi?id=78086">Bug 78086</a>. |
44 </p> | 44 </p> |
45 | 45 |
46 <div id="inspected"></div> | 46 <div id="inspected"></div> |
47 | 47 |
48 </body> | 48 </body> |
49 </html> | 49 </html> |
OLD | NEW |