| 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 <link rel="stylesheet" type="text/css" href="resources/stylesheet.css"></link> | 5 <link rel="stylesheet" type="text/css" href="resources/stylesheet.css"></link> |
| 6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var frameId; | 9 var frameId; |
| 10 var styleSheetHeader; | 10 var styleSheetHeader; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 if (styleSheetHeader) | 33 if (styleSheetHeader) |
| 34 return; | 34 return; |
| 35 | 35 |
| 36 styleSheetHeader = header; | 36 styleSheetHeader = header; |
| 37 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p3); | 37 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p3); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function step3() | 40 function step3() |
| 41 { | 41 { |
| 42 InspectorTest.log("Adding a rule to the existing stylesheet."); | 42 InspectorTest.log("Adding a rule to the existing stylesheet."); |
| 43 InspectorTest.sendCommandOrDie("CSS.addRule", { styleSheetId: styleSheet
Header.styleSheetId, selector: "#inspected" }, step4); | 43 InspectorTest.addRule(styleSheetHeader.styleSheetId, false, { |
| 44 location: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 0 }
, |
| 45 ruleText: "#inspected {}", |
| 46 }, step4); |
| 44 } | 47 } |
| 45 | 48 |
| 46 function step4() | 49 function step4() |
| 47 { | 50 { |
| 48 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p5); | 51 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p5); |
| 49 } | 52 } |
| 50 | 53 |
| 51 function step5() | 54 function step5() |
| 52 { | 55 { |
| 53 InspectorTest.log("Creating inspector stylesheet."); | 56 InspectorTest.log("Creating inspector stylesheet."); |
| 54 InspectorTest.sendCommandOrDie("CSS.createStyleSheet", { frameId: frameI
d }, step6); | 57 InspectorTest.sendCommandOrDie("CSS.createStyleSheet", { frameId: frameI
d }, step6); |
| 55 } | 58 } |
| 56 | 59 |
| 57 function step6(result) | 60 function step6(result) |
| 58 { | 61 { |
| 59 InspectorTest.log("Adding a rule to the inspector stylesheet."); | 62 InspectorTest.log("Adding a rule to the inspector stylesheet."); |
| 60 InspectorTest.sendCommandOrDie("CSS.addRule", { styleSheetId: result.sty
leSheetId, selector: "#inspected" }, step7); | 63 InspectorTest.addRule(result.styleSheetId, false, { |
| 64 location: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 0 }
, |
| 65 ruleText: "#inspected {}", |
| 66 }, step7); |
| 61 } | 67 } |
| 62 | 68 |
| 63 function step7() | 69 function step7() |
| 64 { | 70 { |
| 65 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p8); | 71 InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#inspected", ste
p8); |
| 66 } | 72 } |
| 67 | 73 |
| 68 function step8() | 74 function step8() |
| 69 { | 75 { |
| 70 InspectorTest.completeTest(); | 76 InspectorTest.completeTest(); |
| 71 } | 77 } |
| 72 }; | 78 }; |
| 73 | 79 |
| 74 window.addEventListener("DOMContentLoaded", function () { | 80 window.addEventListener("DOMContentLoaded", function () { |
| 75 runTest(); | 81 runTest(); |
| 76 }, false); | 82 }, false); |
| 77 | 83 |
| 78 </script> | 84 </script> |
| 79 </head> | 85 </head> |
| 80 <body> | 86 <body> |
| 81 <div id="inspected">Inspected contents</div> | 87 <div id="inspected">Inspected contents</div> |
| 82 </body> | 88 </body> |
| 83 </html> | 89 </html> |
| OLD | NEW |