| Index: LayoutTests/inspector-protocol/css/css-edit-range-inline-attr.html
|
| diff --git a/LayoutTests/inspector-protocol/css/css-edit-range-inline-attr.html b/LayoutTests/inspector-protocol/css/css-edit-range-inline-attr.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7bb5443709a24d1c34096ea46e8b8039f56f7bdd
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector-protocol/css/css-edit-range-inline-attr.html
|
| @@ -0,0 +1,89 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript" src="css-protocol-test.js"></script>
|
| +<script type="text/javascript" src="edit-range-utils.js"></script>
|
| +<script type="text/javascript">
|
| +function test()
|
| +{
|
| + var editStyleSheet;
|
| + var checkProtocolError;
|
| +
|
| + InspectorTest.sendCommandOrDie("CSS.enable", {}, onCSSEnabled);
|
| +
|
| + function onCSSEnabled()
|
| + {
|
| + InspectorTest.requestNodeId("#reddiv", onNodeRecieved);
|
| + }
|
| +
|
| + function onNodeRecieved(nodeId)
|
| + {
|
| + InspectorTest.sendCommandOrDie("CSS.getInlineStylesForNode", {
|
| + nodeId: nodeId,
|
| + }, onInlineStyleRecieved);
|
| + }
|
| +
|
| + function onInlineStyleRecieved(result)
|
| + {
|
| + var styleSheetId = result.inlineStyle.styleId.styleSheetId;
|
| + editStyleSheet = InspectorTest.editStyleSheet.bind(null, styleSheetId);
|
| + checkProtocolError = InspectorTest.checkProtocolError.bind(null, styleSheetId);
|
| + InspectorTest.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId: styleSheetId }, onInitialStyleSheetText);
|
| + }
|
| +
|
| + function onInitialStyleSheetText(result)
|
| + {
|
| + InspectorTest.log("==== Initial style sheet text ====");
|
| + InspectorTest.log(result.text);
|
| + InspectorTest.runTestSuite(testSuite);
|
| + }
|
| +
|
| + var testSuite = [
|
| + function testEditProperty(next)
|
| + {
|
| + editStyleSheet({
|
| + range: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 10 },
|
| + text: "content: 'EDITED PROPERTY'"
|
| + }, InspectorTest.undoAndNext(next));
|
| + },
|
| +
|
| + function testBreakingCommentEditProperty(next)
|
| + {
|
| + checkProtocolError({
|
| + range: { startLine: 0, startColumn: 4, endLine: 0, endColumn: 10 },
|
| + text: "/*<--OPENED COMMENT"
|
| + }, next);
|
| + },
|
| +
|
| + function testInsertFirstProperty(next)
|
| + {
|
| + editStyleSheet({
|
| + range: { startLine: 0, startColumn: 0, endLine: 0, endColumn: 0 },
|
| + text: "content: 'INSERTED PROPERTY';"
|
| + }, InspectorTest.undoAndNext(next));
|
| + },
|
| +
|
| + function testInsertLastProperty(next)
|
| + {
|
| + editStyleSheet({
|
| + range: { startLine: 0, startColumn: 24, endLine: 0, endColumn: 24 },
|
| + text: "content: 'INSERTED PROPERTY';"
|
| + }, InspectorTest.undoAndNext(next));
|
| + },
|
| +
|
| + function testInsertMultipleProperties(next)
|
| + {
|
| + editStyleSheet({
|
| + range: { startLine: 0, startColumn: 11, endLine: 0, endColumn: 11 },
|
| + text: "content: 'INSERTED #1';content: 'INSERTED #2';"
|
| + }, InspectorTest.undoAndNext(next));
|
| + },
|
| +];
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +<body onload="runTest();">
|
| + <div id="reddiv" style="color: red; border: 0px;">Some red text goes here</div>
|
| +</body>
|
| +</html>
|
|
|