- add third_party src.
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / styles / set-style-text.html
1 <html>
2 <head>
3 <style>
4 #inspected {
5   color: green;
6 }
7 </style>
8 <script src="../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../http/tests/inspector/elements-test.js"></script>
10 <script>
11
12 function test()
13 {
14     WebInspector.showPanel("elements");
15     InspectorTest.selectNodeAndWaitForStyles("inspected", updateStyleText);
16
17     function updateStyleText()
18     {
19         InspectorTest.addResult("Before setStyleText:");
20         InspectorTest.dumpSelectedElementStyles(true);
21         var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
22         section.rule.style.setText("color: red");
23         InspectorTest.runAfterPendingDispatches(textUpdated);
24     }
25
26     function textUpdated()
27     {
28         InspectorTest.addResult("After setStyleText:");
29         InspectorTest.dumpSelectedElementStyles(true);
30         InspectorTest.completeTest();
31     }
32 }
33
34 </script>
35 </head>
36
37 <body onload="runTest()">
38 <p>
39 Tests that CSSStyleDeclaration.setText() works.
40 </p>
41
42 <div id="inspected">Text</div>
43 </body>
44 </html>