Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / inspector-enabled / shadow-dom-rules-restart.html
blob4b3ee1d82293fcbf38dc07e343a403304fe32621
1 <html>
2 <head>
3 <script src="../inspector/inspector-test.js"></script>
4 <script src="../inspector/elements-test.js"></script>
5 <script>
7 function reopenWebInspector(objectId)
9 window.didReopen = 1;
10 testRunner.closeWebInspector();
11 setTimeout(function() {
12 testRunner.showWebInspector();
13 runTest();
14 }, 0);
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();
27 runTest();
30 function test()
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);
39 } else {
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);
54 function step2()
56 InspectorTest.dumpSelectedElementStyles(true);
57 callback();
61 </script>
62 </head>
64 <body onload="createShadowRoot()">
65 <p>This test checks that style sheets hosted inside shadow roots could be inspected if inspector is reopened.</p>
66 <div id="host"></div>
67 <template id="tmpl">
68 <style> .red { color: red; } </style>
69 <div id="inner" class="red">hi!</div>
70 </template>
71 </body>
72 </html>