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

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

Issue 2950713002: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: addressed comments, 4 tests Created 3 years, 6 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
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../http/tests/inspector-protocol/resources/i nspector-protocol-test.js"></script>
5 <script type="text/javascript">
6 function pageLoaded()
7 {
8 var template = document.querySelector("#tmpl");
9 var root = document.querySelector("#host").createShadowRoot();
10 root.appendChild(template.content.cloneNode(true));
11 runTest();
12 }
13
14 function test()
15 {
16 InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded;
17 InspectorTest.sendCommandOrDie("DOM.enable", {});
18 InspectorTest.sendCommand("CSS.enable", {}, null);
19
20 function styleSheetAdded(msg)
21 {
22 var styleSheetHeader = msg.params.header;
23 InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styl eSheetHeader.styleSheetId}, onStyleSheetText);
24 }
25
26 function onStyleSheetText(payload)
27 {
28 InspectorTest.log("Loaded style sheet text: " + payload.result.text);
29 InspectorTest.completeTest();
30 }
31 }
32 </script>
33 </head>
34 <body onload="pageLoaded()">
35 <p>This test checks that style sheets hosted inside shadow roots are reported in CSS.getAllStyleSheets protocol method.</p>
36 <div id="host"></div>
37 <template id="tmpl">
38 <style> .red { color: red; } </style>
39 <div id="inner" class="red">hi!</div>
40 </template>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698