| Index: LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html
|
| diff --git a/LayoutTests/inspector-protocol/shadow-dom-rules-in-getAllStyleSheets.html b/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html
|
| similarity index 58%
|
| rename from LayoutTests/inspector-protocol/shadow-dom-rules-in-getAllStyleSheets.html
|
| rename to LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html
|
| index 5feb97cb72b243821587decfc3cf0f9eaddf3cef..7e29e2a76e6c89665a070c22b21235b7941f6165 100644
|
| --- a/LayoutTests/inspector-protocol/shadow-dom-rules-in-getAllStyleSheets.html
|
| +++ b/LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html
|
| @@ -2,33 +2,27 @@
|
| <html>
|
| <head>
|
| <script type="text/javascript" src="../http/tests/inspector-protocol/resources/protocol-test.js"></script>
|
| -<script>
|
| +<script type="text/javascript">
|
| function pageLoaded()
|
| {
|
| - var template = document.querySelector('#tmpl');
|
| - var root = document.querySelector('#host').webkitCreateShadowRoot();
|
| + var template = document.querySelector("#tmpl");
|
| + var root = document.querySelector("#host").webkitCreateShadowRoot();
|
| root.appendChild(template.content.cloneNode(true));
|
| runTest();
|
| }
|
|
|
| function test()
|
| {
|
| - InspectorTest.sendCommand("CSS.enable", {}, step1);
|
| -
|
| - function step1()
|
| - {
|
| - InspectorTest.sendCommand("CSS.getAllStyleSheets", {}, step2);
|
| - }
|
| -
|
| - function step2(payload)
|
| + InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded;
|
| + InspectorTest.sendCommand("CSS.enable", {}, null);
|
| +
|
| + function styleSheetAdded(msg)
|
| {
|
| - var headers = payload.result.headers
|
| - InspectorTest.log("Loaded style sheets count: " + headers.length);
|
| - var styleSheetHeader = headers[0];
|
| - InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styleSheetHeader.styleSheetId}, step3);
|
| + var styleSheetHeader = msg.params.header;
|
| + InspectorTest.sendCommand("CSS.getStyleSheetText", {"styleSheetId": styleSheetHeader.styleSheetId}, onStyleSheetText);
|
| }
|
| -
|
| - function step3(payload)
|
| +
|
| + function onStyleSheetText(payload)
|
| {
|
| InspectorTest.log("Loaded style sheet text: " + payload.result.text);
|
| InspectorTest.completeTest();
|
|
|