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

Unified Diff: LayoutTests/inspector-protocol/shadow-dom-rules-in-styleSheetAddedEvent.html

Issue 148523012: DevTools: [CSS] remove getAllStylesheets method from protocol (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix testcase extension Created 6 years, 11 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: 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();

Powered by Google App Engine
This is Rietveld 408576698