Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Side by Side Diff: LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html

Issue 653263004: DevTools: CSSAgent::enable should report an error if DOM agent hasn't been enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script type="text/javascript" src="../http/tests/inspector-protocol/inspector-p rotocol-test.js"></script> 4 <script type="text/javascript" src="../http/tests/inspector-protocol/inspector-p rotocol-test.js"></script>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 function pageLoaded() 6 function pageLoaded()
7 { 7 {
8 var template = document.querySelector("#tmpl"); 8 var template = document.querySelector("#tmpl");
9 var root = document.querySelector("#host").createShadowRoot(); 9 var root = document.querySelector("#host").createShadowRoot();
10 root.appendChild(template.content.cloneNode(true)); 10 root.appendChild(template.content.cloneNode(true));
11 runTest(); 11 runTest();
12 } 12 }
13 13
14 function test() 14 function test()
15 { 15 {
16 InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded; 16 InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded;
17 InspectorTest.sendCommandOrDie("DOM.enable", {});
17 InspectorTest.sendCommand("CSS.enable", {}, null); 18 InspectorTest.sendCommand("CSS.enable", {}, null);
18 19
19 function styleSheetAdded(msg) 20 function styleSheetAdded(msg)
20 { 21 {
21 var styleSheetHeader = msg.params.header; 22 var styleSheetHeader = msg.params.header;
22 InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styl eSheetHeader.styleSheetId}, onStyleSheetText); 23 InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styl eSheetHeader.styleSheetId}, onStyleSheetText);
23 } 24 }
24 25
25 function onStyleSheetText(payload) 26 function onStyleSheetText(payload)
26 { 27 {
27 InspectorTest.log("Loaded style sheet text: " + payload.result.text); 28 InspectorTest.log("Loaded style sheet text: " + payload.result.text);
28 InspectorTest.completeTest(); 29 InspectorTest.completeTest();
29 } 30 }
30 } 31 }
31 </script> 32 </script>
32 </head> 33 </head>
33 <body onload="pageLoaded()"> 34 <body onload="pageLoaded()">
34 <p>This test checks that style sheets hosted inside shadow roots are reported in CSS.getAllStyleSheets protocol method.</p> 35 <p>This test checks that style sheets hosted inside shadow roots are reported in CSS.getAllStyleSheets protocol method.</p>
35 <div id="host"></div> 36 <div id="host"></div>
36 <template id="tmpl"> 37 <template id="tmpl">
37 <style> .red { color: red; } </style> 38 <style> .red { color: red; } </style>
38 <div id="inner" class="red">hi!</div> 39 <div id="inner" class="red">hi!</div>
39 </template> 40 </template>
40 </body> 41 </body>
41 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698