| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <link rel="stylesheet" href="resources/set-style-text.css"/> | 3 <link rel="stylesheet" href="resources/set-style-text.css"/> |
| 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 4 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 5 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot
ocol-test.js"></script> | 5 <script type="text/javascript" src="../../http/tests/inspector-protocol/css-prot
ocol-test.js"></script> |
| 6 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot
ocol-test.js"></script> | 6 <script type="text/javascript" src="../../http/tests/inspector-protocol/dom-prot
ocol-test.js"></script> |
| 7 <script type="text/javascript"> | 7 <script type="text/javascript"> |
| 8 |
| 9 function removeRule() |
| 10 { |
| 11 document.styleSheets[0].removeRule(0); |
| 12 } |
| 13 |
| 8 function test() | 14 function test() |
| 9 { | 15 { |
| 10 var setStyleText; | 16 var setStyleText; |
| 11 var verifyProtocolError; | 17 var verifyProtocolError; |
| 12 var dumpStyleSheet; | 18 var dumpStyleSheet; |
| 13 var documentNodeId; | 19 var documentNodeId; |
| 14 var styleSheetId; | 20 var styleSheetId; |
| 15 | 21 |
| 16 InspectorTest.requestDocumentNodeId(onDocumentNodeId); | 22 InspectorTest.requestDocumentNodeId(onDocumentNodeId); |
| 17 | 23 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 }, dumpAndNext(next)); | 95 }, dumpAndNext(next)); |
| 90 }, | 96 }, |
| 91 | 97 |
| 92 function testSetStyleOpenComment(next) | 98 function testSetStyleOpenComment(next) |
| 93 { | 99 { |
| 94 verifyProtocolError({ | 100 verifyProtocolError({ |
| 95 styleSheetId: styleSheetId, | 101 styleSheetId: styleSheetId, |
| 96 range: { startLine: 13, startColumn: 11, endLine: 15, endColumn:
4 }, | 102 range: { startLine: 13, startColumn: 11, endLine: 15, endColumn:
4 }, |
| 97 text: "\n content: 'EDITED'/* ;\n", | 103 text: "\n content: 'EDITED'/* ;\n", |
| 98 }, dumpAndNext(next)); | 104 }, dumpAndNext(next)); |
| 105 }, |
| 106 |
| 107 function testSetStyleOfRemovedRule(next) |
| 108 { |
| 109 InspectorTest.sendCommandOrDie("Runtime.evaluate", {expression: "rem
oveRule()"}, mutateRule); |
| 110 function mutateRule() |
| 111 { |
| 112 setStyleText({ |
| 113 styleSheetId: styleSheetId, |
| 114 range: { startLine: 0, startColumn: 7, endLine: 2, endColumn
: 0 }, |
| 115 text: "\n content: 'EDITED';\n", |
| 116 }, dumpAndNext(next)); |
| 117 } |
| 99 } | 118 } |
| 100 ]; | 119 ]; |
| 101 } | 120 } |
| 102 | 121 |
| 103 </script> | 122 </script> |
| 104 </head> | 123 </head> |
| 105 <body onload="runTest();"> | 124 <body onload="runTest();"> |
| 106 <p>The test verifies functionality of protocol method CSS.setStyleText.</p> | 125 <p>The test verifies functionality of protocol method CSS.setStyleText.</p> |
| 107 <article id="test"></article> | 126 <article id="test"></article> |
| 108 </body> | 127 </body> |
| 109 </html> | 128 </html> |
| OLD | NEW |