Chromium Code Reviews| Index: LayoutTests/inspector/elements/styles/edit-value-inside-property.html |
| diff --git a/LayoutTests/inspector/elements/styles/edit-value-inside-property.html b/LayoutTests/inspector/elements/styles/edit-value-inside-property.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ffc5836f67108f205d5a2f294b3858d2c8a76a3e |
| --- /dev/null |
| +++ b/LayoutTests/inspector/elements/styles/edit-value-inside-property.html |
| @@ -0,0 +1,60 @@ |
| +<html> |
| +<head> |
| +<script src="../../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../../http/tests/inspector/elements-test.js"></script> |
| +<script> |
| + |
| +function test() |
| +{ |
| + InspectorTest.selectNodeAndWaitForStyles("inspected", testEmulateKeypress); |
| + |
| + function testEmulateKeypress() |
| + { |
| + var treeElement = InspectorTest.getMatchedStylePropertyTreeItem("font-size"); |
| + treeElement.startEditing(treeElement.valueElement); |
| + var selection = window.getSelection(); |
| + var range = selection.getRangeAt(0); |
| + var newRange = document.createRange(); |
| + newRange.setStart(range.startContainer, 1); |
| + newRange.setEnd(range.startContainer, 1); |
| + selection.removeAllRanges(); |
| + selection.addRange(newRange); |
| + // Use eventSender to emit "input" event. |
| + eventSender.keyDown("1"); |
| + InspectorTest.waitForStyleApplied(onStyleApplied); |
| + } |
| + |
| + function onStyleApplied() |
| + { |
| + InspectorTest.nodeWithId("inspected", onNodeFound); |
| + } |
| + |
| + function onNodeFound(node) |
| + { |
| + WebInspector.cssModel.getInlineStylesAsync(node.id, onInlineStyle); |
| + } |
| + |
| + function onInlineStyle(inlineStyle) |
| + { |
| + if (!inlineStyle) { |
| + InspectorTest.addResult("ERROR: Failed to match styles."). |
|
apavlov
2014/10/13 13:39:48
"Failed to get inline style"?
lushnikov
2014/10/13 14:38:23
Done.
|
| + InspectorTest.completeTest(); |
| + return; |
| + } |
| + InspectorTest.addResult("font-size: " + inlineStyle.getPropertyValue("font-size")); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| +<p> |
| +Verifies that property value editing triggers style update in rendering engine. |
| +</p> |
| + |
| +<div id="inspected" style="font-size: 19px"></div> |
| + |
| +</body> |
| +</html> |