| 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 reopenWebInspector(objectId) | 7 function reopenWebInspector(objectId) |
| 8 { | 8 { |
| 9 window.didReopen = 1; | 9 window.didReopen = 1; |
| 10 testRunner.closeWebInspector(); | 10 testRunner.closeWebInspector(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 root.appendChild(template.content.cloneNode(true)); | 24 root.appendChild(template.content.cloneNode(true)); |
| 25 if (window.testRunner) | 25 if (window.testRunner) |
| 26 testRunner.showWebInspector(); | 26 testRunner.showWebInspector(); |
| 27 runTest(); | 27 runTest(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 function test() | 30 function test() |
| 31 { | 31 { |
| 32 InspectorTest.RuntimeAgent.evaluate("window.didReopen", dispatch); | 32 InspectorTest.RuntimeAgent.evaluate("window.didReopen", dispatch); |
| 33 | 33 |
| 34 function dispatch(error, result, wasThrown) | 34 function dispatch(error, result, exceptionDetails) |
| 35 { | 35 { |
| 36 if (result.type !== "number") { | 36 if (result.type !== "number") { |
| 37 InspectorTest.evaluateInPage("console.log('Opening front-end for the
first time')"); | 37 InspectorTest.evaluateInPage("console.log('Opening front-end for the
first time')"); |
| 38 runTests(reopenInspector); | 38 runTests(reopenInspector); |
| 39 } else { | 39 } else { |
| 40 InspectorTest.evaluateInPage("console.log('Opening front-end second
time')"); | 40 InspectorTest.evaluateInPage("console.log('Opening front-end second
time')"); |
| 41 runTests(InspectorTest.completeTest); | 41 runTests(InspectorTest.completeTest); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 function reopenInspector() | 45 function reopenInspector() |
| 46 { | 46 { |
| 47 InspectorTest.evaluateInPage("reopenWebInspector()"); | 47 InspectorTest.evaluateInPage("reopenWebInspector()"); |
| 48 } | 48 } |
| 49 | 49 |
| 50 function runTests(callback) | 50 function runTests(callback) |
| 51 { | 51 { |
| 52 InspectorTest.selectNodeAndWaitForStyles("inner", step2); | 52 InspectorTest.selectNodeAndWaitForStyles("inner", step2); |
| 53 | 53 |
| 54 function step2() | 54 function step2() |
| 55 { | 55 { |
| 56 InspectorTest.dumpSelectedElementStyles(true); | 56 InspectorTest.dumpSelectedElementStyles(true); |
| 57 callback(); | 57 callback(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 </script> | 61 </script> |
| 62 </head> | 62 </head> |
| 63 | 63 |
| 64 <body onload="createShadowRoot()"> | 64 <body onload="createShadowRoot()"> |
| 65 <p>This test checks that style sheets hosted inside shadow roots could be inspec
ted if inspector is reopened.</p> | 65 <p>This test checks that style sheets hosted inside shadow roots could be inspec
ted if inspector is reopened.</p> |
| 66 <div id="host"></div> | 66 <div id="host"></div> |
| 67 <template id="tmpl"> | 67 <template id="tmpl"> |
| 68 <style> .red { color: red; } </style> | 68 <style> .red { color: red; } </style> |
| 69 <div id="inner" class="red">hi!</div> | 69 <div id="inner" class="red">hi!</div> |
| 70 </template> | 70 </template> |
| 71 </body> | 71 </body> |
| 72 </html> | 72 </html> |
| OLD | NEW |