Skip to content
Snippets Groups Projects
Commit 3c22abf3 authored by Stone Shih's avatar Stone Shih
Browse files

Bug 1394228 - Intermittent test_touch_action.html test timed out. r=kats.

Wait for chrome process to handle all synthesize requests and then finish the test.

MozReview-Commit-ID: 2qiFEO6l7wN
parent 8d1869e8
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,15 @@ function touchActionSetup(testDriver) {
document.body.addEventListener('touchend', testDriver, { passive: true });
}
function touchActionSetupAndWaitTestDone(testDriver) {
let testDone = new Promise(resolve => {
add_completion_callback(resolve);
});
document.body.addEventListener('touchend', testDriver, { passive: true });
return testDone;
}
function touchScrollRight(aSelector = '#target0', aX = 20, aY = 20) {
var target = document.querySelector(aSelector);
return ok(synthesizeNativeTouchDrag(target, aX + 40, aY, -40, 0), "Synthesized horizontal drag");
......@@ -35,11 +44,13 @@ function waitForResetScrollLeft(aSelector = '#target0') {
// The main body functions to simulate the input events required for the named test
function* pointerevent_touch_action_auto_css_touch_manual(testDriver) {
touchActionSetup(testDriver);
let testDone = touchActionSetupAndWaitTestDone(testDriver);
yield touchScrollRight();
yield waitForApzFlushedRepaints(testDriver);
yield touchScrollDown();
yield testDone.then(testDriver);
subtestDone();
}
function* pointerevent_touch_action_button_test_touch_manual(testDriver) {
......@@ -103,11 +114,13 @@ function* pointerevent_touch_action_inherit_child_pan_x_child_pan_y_touch_manual
}
function* pointerevent_touch_action_inherit_highest_parent_none_touch_manual(testDriver) {
touchActionSetup(testDriver);
let testDone = touchActionSetupAndWaitTestDone(testDriver);
yield touchScrollDown('#target0 > div');
yield waitForApzFlushedRepaints(testDriver);
yield touchScrollRight('#target0 > div');
yield testDone.then(testDriver);
subtestDone();
}
function* pointerevent_touch_action_inherit_parent_none_touch_manual(testDriver) {
......@@ -151,11 +164,13 @@ function* pointerevent_touch_action_pan_x_pan_y_pan_y_touch_manual(testDriver) {
}
function* pointerevent_touch_action_pan_x_pan_y_touch_manual(testDriver) {
touchActionSetup(testDriver);
let testDone = touchActionSetupAndWaitTestDone(testDriver);
yield touchScrollDown();
yield waitForApzFlushedRepaints(testDriver);
yield touchScrollRight();
yield testDone.then(testDriver);
subtestDone();
}
function* pointerevent_touch_action_pan_y_css_touch_manual(testDriver) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment