OLD | NEW |
1 function initialize_cssTest() | 1 function initialize_cssTest() |
2 { | 2 { |
3 | 3 |
| 4 InspectorTest.dumpStyleSheetText = function(styleSheetId, callback) |
| 5 { |
| 6 InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styl
eSheetId }, onStyleSheetText); |
| 7 function onStyleSheetText(result) |
| 8 { |
| 9 InspectorTest.log("==== Style sheet text ===="); |
| 10 InspectorTest.log(result.text); |
| 11 callback(); |
| 12 } |
| 13 } |
| 14 |
| 15 InspectorTest.setPropertyText = function(styleSheetId, expectError, options, cal
lback) |
| 16 { |
| 17 var styleId = { styleSheetId: styleSheetId, ordinal: options.styleIndex }; |
| 18 delete options.styleIndex; |
| 19 options.styleId = styleId; |
| 20 if (expectError) |
| 21 InspectorTest.sendCommand("CSS.setPropertyText", options, onResponse); |
| 22 else |
| 23 InspectorTest.sendCommandOrDie("CSS.setPropertyText", options, onSuccess
); |
| 24 |
| 25 function onSuccess() |
| 26 { |
| 27 InspectorTest.dumpStyleSheetText(styleSheetId, callback); |
| 28 } |
| 29 |
| 30 function onResponse(message) |
| 31 { |
| 32 if (!message.error) { |
| 33 InspectorTest.log("ERROR: protocol method call did not return expect
ed error. Instead, the following message was received: " + JSON.stringify(messag
e)); |
| 34 InspectorTest.completeTest(); |
| 35 return; |
| 36 } |
| 37 InspectorTest.log("Expected protocol error: " + message.error.message); |
| 38 callback(); |
| 39 } |
| 40 } |
| 41 |
4 InspectorTest.requestMainFrameId = function(callback) | 42 InspectorTest.requestMainFrameId = function(callback) |
5 { | 43 { |
6 InspectorTest.sendCommandOrDie("Page.enable", {}, pageEnabled); | 44 InspectorTest.sendCommandOrDie("Page.enable", {}, pageEnabled); |
7 | 45 |
8 function pageEnabled() | 46 function pageEnabled() |
9 { | 47 { |
10 InspectorTest.sendCommandOrDie("Page.getResourceTree", {}, resourceTreeL
oaded); | 48 InspectorTest.sendCommandOrDie("Page.getResourceTree", {}, resourceTreeL
oaded); |
11 } | 49 } |
12 | 50 |
13 function resourceTreeLoaded(payload) | 51 function resourceTreeLoaded(payload) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 var ruleMatch = ruleMatches[i]; | 136 var ruleMatch = ruleMatches[i]; |
99 var origin = ruleMatch.rule.origin; | 137 var origin = ruleMatch.rule.origin; |
100 if (origin !== "inspector" && origin !== "regular") | 138 if (origin !== "inspector" && origin !== "regular") |
101 continue; | 139 continue; |
102 InspectorTest.dumpRuleMatch(ruleMatch); | 140 InspectorTest.dumpRuleMatch(ruleMatch); |
103 } | 141 } |
104 callback(); | 142 callback(); |
105 } | 143 } |
106 } | 144 } |
107 | 145 |
108 } | 146 } |
OLD | NEW |