8 <script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
12 InspectorTest.sendCommand("CSS.getAllStyleSheets", {}, onGotStyleSheets);
15 function onGotStyleSheets(msg) {
17 InspectorTest.log(msg.error.message);
18 InspectorTest.completeTest();
21 var headers = msg.result.headers;
22 for (var i = 0; i < headers.length; ++i) {
23 if (headers[i].origin === "regular") {
24 styleId = { "styleSheetId": headers[i].styleSheetId, "ordinal": 0 };
25 InspectorTest.sendCommand("CSS.setStyleText", { "styleId": styleId, "text": "color: red;" }, onTextSet);
29 InspectorTest.log("Regular stylesheet not found");
30 InspectorTest.completeTest();
33 function onTextSet(msg) {
35 InspectorTest.log(JSON.stringify(msg.error));
36 InspectorTest.completeTest();
39 InspectorTest.log("New cssText:");
40 InspectorTest.log(msg.result.style.cssText);
41 InspectorTest.sendCommand("DOM.undo", {}, onUndo);
45 InspectorTest.sendCommand("CSS.getStyleSheetText", { "styleSheetId": styleId.styleSheetId }, onUndoneText);
46 function onUndoneText(msg)
49 InspectorTest.log(msg.error.message);
50 InspectorTest.completeTest();
53 InspectorTest.log("StyleSheetText after undo:");
54 InspectorTest.log(msg.result.text);
55 InspectorTest.sendCommand("DOM.redo", {}, onRedo);
60 InspectorTest.sendCommand("CSS.getStyleSheetText", { "styleSheetId": styleId.styleSheetId }, onRedoneText);
61 function onRedoneText(msg)
64 InspectorTest.log(msg.error.message);
65 InspectorTest.completeTest();
68 InspectorTest.log("StyleSheetText after redo:");
69 InspectorTest.log(msg.result.text);
70 InspectorTest.completeTest();
76 <body onLoad="runTest();">