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

Unified Diff: LayoutTests/inspector-protocol/css/css-setStyleText.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
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/shadow-dom-rules-in-getAllStyleSheets.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector-protocol/css/css-setStyleText.html
diff --git a/LayoutTests/inspector-protocol/css/css-setStyleText.html b/LayoutTests/inspector-protocol/css/css-setStyleText.html
index de1e1c16d95c3f71bbd7e59434ddbb07d6a6f5c3..e0a1cace49fb271ee89e87581cb59d22cc126eef 100644
--- a/LayoutTests/inspector-protocol/css/css-setStyleText.html
+++ b/LayoutTests/inspector-protocol/css/css-setStyleText.html
@@ -9,25 +9,18 @@ body {
<script>
function test()
{
- InspectorTest.sendCommand("CSS.getAllStyleSheets", {}, onGotStyleSheets);
- var styleId;
+ InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded;
+ InspectorTest.sendCommand("CSS.enable", {}, null);
- function onGotStyleSheets(msg) {
- if (msg.error) {
- InspectorTest.log(msg.error.message);
- InspectorTest.completeTest();
+ var styleId;
+ function styleSheetAdded(msg)
+ {
+ var header = msg.params.header;
+ if (header.origin !== "regular")
return;
- }
- var headers = msg.result.headers;
- for (var i = 0; i < headers.length; ++i) {
- if (headers[i].origin === "regular") {
- styleId = { "styleSheetId": headers[i].styleSheetId, "ordinal": 0 };
- InspectorTest.sendCommand("CSS.setStyleText", { "styleId": styleId, "text": "color: red;" }, onTextSet);
- return;
- }
- }
- InspectorTest.log("Regular stylesheet not found");
- InspectorTest.completeTest();
+ delete InspectorTest.eventHandler["CSS.styleSheetAdded"];
+ styleId = { "styleSheetId": header.styleSheetId, "ordinal": 0 };
+ InspectorTest.sendCommand("CSS.setStyleText", { "styleId": styleId, "text": "color: red;" }, onTextSet);
}
function onTextSet(msg) {
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/shadow-dom-rules-in-getAllStyleSheets.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698