Commit 68c3c49e authored by Lan Wei's avatar Lan Wei Committed by Commit Bot

Simulate user inputs in layout_change_should_fire_mouseover.html

Use testdriver Action API to simulate mouse actions in
uievents/mouse/layout_change_should_fire_mouseover.html.

Bug: 1145677
Change-Id: If90ec00d39b773df06570aeebb0a98dbcdd1c463
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518599Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824163}
parent 4e5a58ed
......@@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
#spacer {
height: 100px;
......@@ -44,6 +47,7 @@
</h4>
<script type="text/javascript">
var testMouseOver = async_test('Tests that the mouseover event is fired and the element has a hover effect when the element underneath the mouse cursor is changed.');
var actions_promise;
var eventList = [];
function addBlue() {
......@@ -61,7 +65,10 @@
function checkEventSequence() {
var result = eventList.join();
assert_equals(result, 'mouseover,mouseenter');
testMouseOver.done();
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
testMouseOver.done();
});
}
function run() {
......@@ -78,6 +85,13 @@
}
});
}
// Inject mouse inputs.
actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: red})
.pointerDown()
.pointerUp()
.send();
</script>
</body>
</html>
importAutomationScript('/pointerevents/pointerevent_common_input.js');
function inject_input() {
return mouseClickInTarget('#red');
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment