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

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

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: unified 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 (async function() {
2 let {page, session, Protocol} = await InspectorTest.startHTML(`
3 <div id='host'></div>
4 <template id='tmpl'>
5 <style> .red { color: red; } </style>
6 <div id='inner' class='red'>hi!</div>
7 </template>
8 `, 'This test checks that style sheets hosted inside shadow roots are reported in CSS.styleSheetAdded event.');
9
10 await session.evaluate(`
11 var template = document.querySelector('#tmpl');
12 var root = document.querySelector('#host').createShadowRoot();
13 root.appendChild(template.content.cloneNode(true));
14 `);
15
16 Protocol.DOM.enable();
17 Protocol.CSS.enable();
18 var msg = await Protocol.CSS.onceStyleSheetAdded();
19 var styleSheetHeader = msg.params.header;
20 var payload = await Protocol.CSS.getStyleSheetText({styleSheetId: styleSheetHe ader.styleSheetId});
21 InspectorTest.log('Loaded style sheet text: ' + payload.result.text);
22 InspectorTest.completeTest();
23 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698