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

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: Protocol -> dp 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(testRunner) {
2 let {page, session, dp} = await testRunner.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 dp.DOM.enable();
17 dp.CSS.enable();
18 var msg = await dp.CSS.onceStyleSheetAdded();
19 var styleSheetHeader = msg.params.header;
20 var payload = await dp.CSS.getStyleSheetText({styleSheetId: styleSheetHeader.s tyleSheetId});
21 testRunner.log('Loaded style sheet text: ' + payload.result.text);
22 testRunner.completeTest();
23 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698