| 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..82862d3eda123251bca30abb5c696adeab1bfb80
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.js
|
| @@ -0,0 +1,23 @@
|
| +(async function() {
|
| + let {page, session, Protocol} = await InspectorTest.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));
|
| + `);
|
| +
|
| + Protocol.DOM.enable();
|
| + Protocol.CSS.enable();
|
| + var msg = await Protocol.CSS.onceStyleSheetAdded();
|
| + var styleSheetHeader = msg.params.header;
|
| + var payload = await Protocol.CSS.getStyleSheetText({styleSheetId: styleSheetHeader.styleSheetId});
|
| + InspectorTest.log('Loaded style sheet text: ' + payload.result.text);
|
| + InspectorTest.completeTest();
|
| +})();
|
|
|