Bug 1394228 - Intermittent test_touch_action.html test timed out. r=kats.
authorStone Shih <sshih@mozilla.com>
Sat, 09 Dec 2017 14:26:14 +0800
changeset 396384 d55477dfbd5a9c16c912197ebd195f116147b909
parent 396383 e5af640b36b7b5ac202d058ab2c07acd738f2cfa
child 396385 80bd0089e77fad6dab95a880c92f3acf14bb2183
push id56975
push userdluca@mozilla.com
push dateThu, 14 Dec 2017 09:59:07 +0000
treeherderautoland@16bcfaad13e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1394228
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/events/test/pointerevents/touch_action_helpers.js
--- a/dom/events/test/pointerevents/touch_action_helpers.js
+++ b/dom/events/test/pointerevents/touch_action_helpers.js
@@ -1,15 +1,24 @@
 // Some common helpers
 
 function touchActionSetup(testDriver) {
   add_completion_callback(subtestDone);
   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");
 }
 
 function touchScrollDown(aSelector = '#target0', aX = 20, aY = 20) {
   var target = document.querySelector(aSelector);
   return ok(synthesizeNativeTouchDrag(target, aX, aY + 40, 0, -40), "Synthesized vertical drag");
@@ -30,21 +39,23 @@ function waitForResetScrollLeft(aSelecto
       }
     });
   });
 }
 
 // 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) {
   touchActionSetup(testDriver);
 
   yield touchScrollDown();
   yield waitForApzFlushedRepaints(testDriver);
   yield setTimeout(testDriver, 2 * scrollReturnInterval);
@@ -98,21 +109,23 @@ function* pointerevent_touch_action_inhe
   yield touchScrollDown('#target0 > div div');
   yield waitForApzFlushedRepaints(testDriver);
   yield touchScrollRight('#target0 > div div');
   yield waitForApzFlushedRepaints(testDriver);
   yield tapComplete();
 }
 
 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) {
   touchActionSetup(testDriver);
 
   yield touchScrollDown();
   yield waitForApzFlushedRepaints(testDriver);
   yield touchScrollRight();
@@ -146,21 +159,23 @@ function* pointerevent_touch_action_pan_
   yield touchScrollDown('#target0 > div div');
   yield waitForApzFlushedRepaints(testDriver);
   yield touchScrollRight('#target0 > div div');
   yield waitForApzFlushedRepaints(testDriver);
   yield tapComplete();
 }
 
 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) {
   touchActionSetup(testDriver);
 
   yield touchScrollDown();
   yield waitForApzFlushedRepaints(testDriver);
   yield touchScrollRight();