Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / elements / styles / disable-property-workingcopy-update.html
1 <html>
2 <head>
3 <link rel="stylesheet" href="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>
8
9 function test()
10 {
11     var cssSourceFrame;
12     WebInspector.showPanel("elements");
13     WebInspector.StylesSourceMapping.MinorChangeUpdateTimeoutMs = 10;
14
15     InspectorTest.runTestSuite([
16         function selectContainer(next)
17         {
18             InspectorTest.selectNodeAndWaitForStyles("inspected", next);
19         },
20
21         function showEditor(next)
22         {
23             var headers = WebInspector.cssModel.styleSheetHeaders();
24             for (var i = 0; i < headers.length; ++i) {
25                 if (headers[i].sourceURL.endsWith(".css")) {
26                     InspectorTest.showUISourceCode(headers[i].rawLocationToUILocation(0).uiSourceCode, callback);
27                     break;
28                 }
29             }
30
31             function callback(sourceFrame)
32             {
33                 cssSourceFrame = sourceFrame;
34                 InspectorTest.dumpSourceFrameContents(cssSourceFrame);
35                 next();
36             }
37         },
38
39         function togglePropertyOff(next)
40         {
41             toggleProperty(false, next);
42         },
43
44         function dumpDisabledText(next)
45         {
46             InspectorTest.dumpSourceFrameContents(cssSourceFrame);
47             InspectorTest.dumpSelectedElementStyles(true);
48             next();
49         },
50
51         function togglePropertyOn(next)
52         {
53             toggleProperty(true, next);
54         },
55
56         function dumpEnabledText(next)
57         {
58             InspectorTest.dumpSourceFrameContents(cssSourceFrame);
59             InspectorTest.dumpSelectedElementStyles(true);
60             next();
61         }
62     ]);
63
64     function toggleProperty(value, next)
65     {
66         WebInspector.showPanel("elements");
67         InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", callback);
68         InspectorTest.waitForStyles("inspected", callback);
69         InspectorTest.toggleMatchedStyleProperty("font-weight", value);
70
71         var barrierCounter = 2;
72         function callback()
73         {
74             if (!--barrierCounter)
75                 next();
76         }
77     }
78 }
79 </script>
80 </head>
81
82 <body onload="runTest()">
83 <p>
84 Tests that style property disablement is propagated into the stylesheet UISourceCode working copy.
85 </p>
86
87 <div id="inspected">
88 </div>
89
90 </body>
91 </html>