| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector/inspector-test.js"></script> | 3 <script src="../inspector/inspector-test.js"></script> |
| 4 <script src="../inspector/elements-test.js"></script> | 4 <script src="../inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function createShadowRoot() | 7 function createShadowRoot() |
| 8 { | 8 { |
| 9 if (window.testRunner) | 9 if (window.testRunner) |
| 10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
| 11 var template = document.querySelector('#tmpl'); | 11 var template = document.querySelector('#tmpl'); |
| 12 var root = document.querySelector('#host').webkitCreateShadowRoot(); | 12 var root = document.querySelector('#host').webkitCreateShadowRoot(); |
| 13 root.appendChild(template.content.cloneNode(true)); | 13 root.appendChild(template.content.cloneNode(true)); |
| 14 if (window.testRunner) | 14 if (window.testRunner) |
| 15 testRunner.showWebInspector(); | 15 testRunner.showWebInspector(); |
| 16 runTest(); | 16 runTest(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function test() | 19 function test() |
| 20 { | 20 { |
| 21 InspectorTest.runTestSuite([ | 21 InspectorTest.runTestSuite([ |
| 22 function testInit(next) | 22 function testInit(next) |
| 23 { | 23 { |
| 24 WebInspector.settings.showShadowDOM.set(true); | |
| 25 InspectorTest.selectNodeAndWaitForStyles("inner", next); | 24 InspectorTest.selectNodeAndWaitForStyles("inner", next); |
| 26 }, | 25 }, |
| 27 | 26 |
| 28 function testDumpStyles(next) | 27 function testDumpStyles(next) |
| 29 { | 28 { |
| 30 InspectorTest.dumpSelectedElementStyles(true); | 29 InspectorTest.dumpSelectedElementStyles(true); |
| 31 next(); | 30 next(); |
| 32 } | 31 } |
| 33 ]); | 32 ]); |
| 34 } | 33 } |
| 35 </script> | 34 </script> |
| 36 </head> | 35 </head> |
| 37 | 36 |
| 38 <body onload="createShadowRoot()"> | 37 <body onload="createShadowRoot()"> |
| 39 <p> | 38 <p> |
| 40 This test checks that style sheets hosted inside shadow roots | 39 This test checks that style sheets hosted inside shadow roots |
| 41 could be inspected. | 40 could be inspected. |
| 42 </p> | 41 </p> |
| 43 <div id="host"></div> | 42 <div id="host"></div> |
| 44 <template id="tmpl"> | 43 <template id="tmpl"> |
| 45 <style> .red { color: red; } </style> | 44 <style> .red { color: red; } </style> |
| 46 <div id="inner" class="red">hi!</div> | 45 <div id="inner" class="red">hi!</div> |
| 47 </template> | 46 </template> |
| 48 </body> | 47 </body> |
| 49 </html> | 48 </html> |
| OLD | NEW |