Chromium Code Reviews| Index: LayoutTests/inspector-protocol/css/css-replace-range.html |
| diff --git a/LayoutTests/inspector-protocol/css/css-replace-range.html b/LayoutTests/inspector-protocol/css/css-replace-range.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6a1c800ab2fa17e22ed7cf9841ddba0f8dac98d2 |
| --- /dev/null |
| +++ b/LayoutTests/inspector-protocol/css/css-replace-range.html |
| @@ -0,0 +1,58 @@ |
| +<html> |
| +<head> |
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script> |
| +<script type="text/javascript"> |
| +function test() |
| +{ |
| + InspectorTest.eventHandler["CSS.styleSheetAdded"] = styleSheetAdded; |
| + InspectorTest.sendCommandOrDie("CSS.enable", {}); |
| + |
| + var styleSheetId; |
| + |
| + function styleSheetAdded(result) |
| + { |
| + styleSheetId = result.params.header.styleSheetId; |
| + InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styleSheetId }, onInitialStyleSheetText); |
| + } |
| + |
| + function onInitialStyleSheetText(result) |
| + { |
| + InspectorTest.log("==== Initial style sheet text ===="); |
| + InspectorTest.log(result.text); |
| + InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", { |
|
apavlov
2014/02/20 09:58:14
It is hard to follow. Let's dump all intermediate
lushnikov
2014/02/20 14:17:04
Done.
|
| + styleSheetId: styleSheetId, |
| + range: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 0 }, |
| + text: "* { border: 1px }" |
| + }); |
| + InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", { |
| + styleSheetId: styleSheetId, |
| + range: { startLine: 1, startColumn: 5, endLine: 3, endColumn: 0 }, |
| + text: "\n background-color: blue;\n font-size: 12px;\n" |
| + }); |
| + InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", { |
| + styleSheetId: styleSheetId, |
| + range: { startLine: 1, startColumn: 0, endLine: 1, endColumn: 3 }, |
| + text: "p, span:hover" |
| + }); |
| + InspectorTest.sendCommandOrDie("CSS.replaceRangeInStyleSheetText", { |
| + styleSheetId: styleSheetId, |
| + range: { startLine: 4, startColumn: 1, endLine: 4, endColumn: 1 }, |
| + text: "\n* { box-sizing: border-box; }" |
| + }); |
| + InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styleSheetId }, onChangedStyleSheetText); |
| + } |
| + |
| + function onChangedStyleSheetText(result) |
| + { |
| + InspectorTest.log("==== Changed style sheet text ===="); |
| + InspectorTest.log(result.text); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| + |
| +</script> |
| +<link rel="stylesheet" href="resources/replace-range.css"/> |
| +</head> |
| +<body onload="runTest();"> |
| +</body> |
| +</html> |