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

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

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.js b/third_party/WebKit/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.js
new file mode 100644
index 0000000000000000000000000000000000000000..33bcaf08d3bab22171438b6581819991a706454e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.js
@@ -0,0 +1,21 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startHTML(`
+ <div id='host'></div>
+ <template id='tmpl'>
+ <style> .red { color: red; } </style>
+ <div id='inner' class='red'>hi!</div>
+ </template>
+ `, 'This test checks that style sheets hosted inside shadow roots are reported in CSS.styleSheetAdded event.');
+ await session.evaluate(`
+ var template = document.querySelector('#tmpl');
+ var root = document.querySelector('#host').createShadowRoot();
+ root.appendChild(template.content.cloneNode(true));
+ `);
+ dp.DOM.enable();
+ dp.CSS.enable();
+ var msg = await dp.CSS.onceStyleSheetAdded();
+ var styleSheetHeader = msg.params.header;
+ var payload = await dp.CSS.getStyleSheetText({styleSheetId: styleSheetHeader.styleSheetId});
+ testRunner.log('Loaded style sheet text: ' + payload.result.text);
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698