Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / updates-throttled.html
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script>
6
7 function test()
8 {
9     var UPDATE_COUNT = 5;
10     var rebuildCount = 0;
11
12     InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback);
13     function selectCallback()
14     {
15         InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_innerRebuildUpdate", sniffRebuild, true);
16         var stylesPane = WebInspector.panels.elements.sidebarPanes.styles;
17         for (var i = 0; i < UPDATE_COUNT; ++i)
18             stylesPane.update(stylesPane.node, true);
19
20         InspectorTest.runAfterPendingDispatches(completeCallback);
21     }
22
23     function completeCallback()
24     {
25         if (rebuildCount >= UPDATE_COUNT)
26             InspectorTest.addResult("ERROR: got " + rebuildCount + " rebuilds for " + UPDATE_COUNT + " consecutive updates");
27         else
28             InspectorTest.addResult("OK: rebuilds throttled");
29         InspectorTest.completeTest();
30     }
31
32     function sniffRebuild()
33     {
34         ++rebuildCount;
35     }
36 }
37
38 </script>
39 </head>
40
41 <body onload="runTest()">
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>.
44 </p>
45
46 <div id="inspected"></div>
47
48 </body>
49 </html>