Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / styles / import-added-through-js-crash.html
1 <html>
2 <head>
3 <style>
4 </style>
5 <script src="../inspector-test.js"></script>
6 <script src="../elements-test.js"></script>
7 <script>
8
9 function addImportRule()
10 {
11     document.styleSheets[0].insertRule("@import url(resources/import-added-through-js-crash.css)", 0);
12 }
13
14 function test()
15 {
16     WebInspector.showPanel("elements");
17     InspectorTest.runTestSuite([
18         function selectNode(next)
19         {
20             InspectorTest.selectNodeAndWaitForStyles("inspected", next);
21         },
22
23         function addImportRules(next)
24         {
25             InspectorTest.waitForStyles("inspected", callback);
26             InspectorTest.evaluateInPage("addImportRule()");
27
28             function callback()
29             {
30                 InspectorTest.waitForStyles("inspected", next);
31                 InspectorTest.evaluateInPage("addImportRule()");
32             }
33         }
34     ]);
35 }
36
37 </script>
38 </head>
39
40 <body onload="runTest()">
41 <p>
42 Tests that adding @import rules into a stylesheet through JavaScript does not crash the inspected page.
43 </p>
44
45 <div>
46     <p id="inspected"></p>
47 </div>
48 </body>
49 </html>