3 <script src=
"../inspector/inspector-test.js"></script>
4 <script src=
"../inspector/elements-test.js"></script>
7 function reopenWebInspector(objectId
)
10 testRunner
.closeWebInspector();
11 setTimeout(function() {
12 testRunner
.showWebInspector();
17 function createShadowRoot()
19 delete window
.didReopen
;
20 if (window
.testRunner
)
21 testRunner
.waitUntilDone();
22 var template
= document
.querySelector('#tmpl');
23 var root
= document
.querySelector('#host').createShadowRoot();
24 root
.appendChild(template
.content
.cloneNode(true));
25 if (window
.testRunner
)
26 testRunner
.showWebInspector();
32 InspectorTest
.RuntimeAgent
.evaluate("window.didReopen", dispatch
);
34 function dispatch(error
, result
, wasThrown
)
36 if (result
.type
!== "number") {
37 InspectorTest
.evaluateInPage("console.log('Opening front-end for the first time')");
38 runTests(reopenInspector
);
40 InspectorTest
.evaluateInPage("console.log('Opening front-end second time')");
41 runTests(InspectorTest
.completeTest
);
45 function reopenInspector()
47 InspectorTest
.evaluateInPage("reopenWebInspector()");
50 function runTests(callback
)
52 InspectorTest
.selectNodeAndWaitForStyles("inner", step2
);
56 InspectorTest
.dumpSelectedElementStyles(true);
64 <body onload=
"createShadowRoot()">
65 <p>This test checks that style sheets hosted inside shadow roots could be inspected if inspector is reopened.
</p>
68 <style> .red { color: red; }
</style>
69 <div id=
"inner" class=
"red">hi!
</div>