3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
9 InspectorTest
.selectNodeAndWaitForStyles("inspected", testEmulateKeypress
);
11 function testEmulateKeypress()
13 var treeElement
= InspectorTest
.getMatchedStylePropertyTreeItem("font-size");
14 treeElement
.startEditing(treeElement
.valueElement
);
15 var selection
= window
.getSelection();
16 var range
= selection
.getRangeAt(0);
17 var newRange
= document
.createRange();
18 newRange
.setStart(range
.startContainer
, 1);
19 newRange
.setEnd(range
.startContainer
, 1);
20 selection
.removeAllRanges();
21 selection
.addRange(newRange
);
22 // Use eventSender to emit "input" event.
23 eventSender
.keyDown("1");
24 InspectorTest
.waitForStyleApplied(onStyleApplied
);
27 function onStyleApplied()
29 InspectorTest
.nodeWithId("inspected", onNodeFound
);
32 function onNodeFound(node
)
34 InspectorTest
.cssModel
.inlineStylesPromise(node
.id
).then(onInlineStyle
);
37 function onInlineStyle(inlineStyleResult
)
39 if (!inlineStyleResult
|| !inlineStyleResult
.inlineStyle
) {
40 InspectorTest
.addResult("Failed to get inline styles.").
41 InspectorTest
.completeTest();
44 InspectorTest
.addResult("font-size: " + inlineStyleResult
.inlineStyle
.getPropertyValue("font-size"));
45 InspectorTest
.completeTest();
52 <body onload=
"runTest()">
54 Verifies that property value editing triggers style update in rendering engine.
57 <div id=
"inspected" style=
"font-size: 19px"></div>