| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script type="text/javascript" src="css-protocol-test.js"></script> | 4 <script type="text/javascript" src="css-protocol-test.js"></script> |
| 5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var setPropertyText; | 8 var setPropertyText; |
| 9 var verifyProtocolError; | 9 var verifyProtocolError; |
| 10 var dumpStyleSheet; | 10 var dumpStyleSheet; |
| 11 | 11 |
| 12 InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled); | 12 InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled); |
| 13 | 13 |
| 14 function onCSSEnabled() | 14 function onCSSEnabled() |
| 15 { | 15 { |
| 16 InspectorTest.requestNodeId("#reddiv", onNodeRecieved); | 16 InspectorTest.requestNodeId("#reddiv", onNodeRecieved); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function onNodeRecieved(nodeId) | 19 function onNodeRecieved(nodeId) |
| 20 { | 20 { |
| 21 InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { | 21 InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", { |
| 22 nodeId: nodeId, | 22 nodeId: nodeId, |
| 23 }, onInlineStyleRecieved); | 23 }, onInlineStyleRecieved); |
| 24 } | 24 } |
| 25 | 25 |
| 26 function onInlineStyleRecieved(result) | 26 function onInlineStyleRecieved(result) |
| 27 { | 27 { |
| 28 var styleSheetId = result.inlineStyle.styleId.styleSheetId; | 28 var styleSheetId = result.inlineStyle.styleSheetId; |
| 29 setPropertyText = InspectorTest.setPropertyText.bind(InspectorTest, styl
eSheetId, false); | 29 setPropertyText = InspectorTest.setPropertyText.bind(InspectorTest, styl
eSheetId, false); |
| 30 verifyProtocolError = InspectorTest.setPropertyText.bind(InspectorTest,
styleSheetId, true); | 30 verifyProtocolError = InspectorTest.setPropertyText.bind(InspectorTest,
styleSheetId, true); |
| 31 dumpStyleSheet = InspectorTest.dumpStyleSheetText.bind(null, styleSheetI
d); | 31 dumpStyleSheet = InspectorTest.dumpStyleSheetText.bind(null, styleSheetI
d); |
| 32 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId:
styleSheetId }, onInitialStyleSheetText); | 32 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId:
styleSheetId }, onInitialStyleSheetText); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function onInitialStyleSheetText(result) | 35 function onInitialStyleSheetText(result) |
| 36 { | 36 { |
| 37 InspectorTest.log("==== Initial style sheet text ===="); | 37 InspectorTest.log("==== Initial style sheet text ===="); |
| 38 InspectorTest.log(result.text); | 38 InspectorTest.log(result.text); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 }, | 81 }, |
| 82 ]; | 82 ]; |
| 83 } | 83 } |
| 84 | 84 |
| 85 </script> | 85 </script> |
| 86 </head> | 86 </head> |
| 87 <body onload="runTest();"> | 87 <body onload="runTest();"> |
| 88 <div id="reddiv" style="color: red; border: 0px;">Some red text goes here</d
iv> | 88 <div id="reddiv" style="color: red; border: 0px;">Some red text goes here</d
iv> |
| 89 </body> | 89 </body> |
| 90 </html> | 90 </html> |
| OLD | NEW |