Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-1 / disable-property-workingcopy-update.html
blob74554ab9cd25bbdd7367c73d5f39ee48f87e5d2f
1 <html>
2 <head>
3 <link rel="stylesheet" href="../styles/resources/disable-property-workingcopy-update.css">
4 <script src="../../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script src="../../../http/tests/inspector/elements-test.js"></script>
7 <script>
9 function test()
11 var cssSourceFrame;
12 WebInspector.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 10;
14 InspectorTest.runTestSuite([
15 function selectContainer(next)
17 InspectorTest.selectNodeAndWaitForStyles("inspected", next);
20 function showEditor(next)
22 var headers = InspectorTest.cssModel.styleSheetHeaders();
23 for (var i = 0; i < headers.length; ++i) {
24 if (headers[i].sourceURL.endsWith(".css")) {
25 var cssLocation = new WebInspector.CSSLocation(InspectorTest.cssModel, headers[i].id, headers[i].sourceURL, 0);
26 InspectorTest.showUISourceCode(WebInspector.cssWorkspaceBinding.rawLocationToUILocation(cssLocation).uiSourceCode, callback);
27 break;
31 function callback(sourceFrame)
33 cssSourceFrame = sourceFrame;
34 InspectorTest.dumpSourceFrameContents(cssSourceFrame);
35 next();
39 function togglePropertyOff(next)
41 toggleProperty(false, next);
44 function dumpDisabledText(next)
46 InspectorTest.dumpSourceFrameContents(cssSourceFrame);
47 InspectorTest.dumpSelectedElementStyles(true);
48 next();
51 function togglePropertyOn(next)
53 toggleProperty(true, next);
56 function dumpEnabledText(next)
58 InspectorTest.dumpSourceFrameContents(cssSourceFrame);
59 InspectorTest.dumpSelectedElementStyles(true);
60 next();
62 ]);
64 function toggleProperty(value, next)
66 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", callback);
67 InspectorTest.waitForStyles("inspected", callback);
68 InspectorTest.toggleMatchedStyleProperty("font-weight", value);
70 var barrierCounter = 2;
71 function callback()
73 if (!--barrierCounter)
74 next();
78 </script>
79 </head>
81 <body onload="runTest()">
82 <p>
83 Tests that style property disablement is propagated into the stylesheet UISourceCode working copy.
84 </p>
86 <div id="inspected">
87 </div>
89 </body>
90 </html>