| 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) {
|
|
|