Bug 1251905, part 2 - Make the top level tests in test_continuous_wheel_events.html more async. r=masayuki
authorAndrew McCreight <continuation@gmail.com>
Sat, 02 Apr 2016 10:30:30 -0700
changeset 291481 008a7f92c50b4bc032ea817fbb5e66f74e6e2db1
parent 291480 2c53434f2bec6eacc91c67a59ae9782396e17787
child 291482 94d3753f21e27a8579c691cf77ae76da6c625c70
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1251905
milestone48.0a1
Bug 1251905, part 2 - Make the top level tests in test_continuous_wheel_events.html more async. r=masayuki This enables later changes.
dom/events/test/test_continuous_wheel_events.html
--- a/dom/events/test/test_continuous_wheel_events.html
+++ b/dom/events/test/test_continuous_wheel_events.html
@@ -3176,16 +3176,35 @@ function testContinuousTrustedEvents()
                        MozMousePixelScroll: { horizontal: false, vertical: false } };
   }
 
   window.removeEventListener("wheel", wheelEventHandler, true);
   window.removeEventListener("DOMMouseScroll", legacyEventHandler, true);
   window.removeEventListener("MozMousePixelScroll", legacyEventHandler, true);
 }
 
+var gTestContinuation = null;
+
+function continueTest()
+{
+  if (!gTestContinuation) {
+    gTestContinuation = testBody();
+  }
+  var ret = gTestContinuation.next();
+  if (ret.done) {
+    SimpleTest.finish();
+  }
+}
+
+function* testBody()
+{
+  prepareScrollUnits();
+  testContinuousTrustedEvents();
+}
+
 function runTests()
 {
   SpecialPowers.pushPrefEnv({"set": [
     ["mousewheel.transaction.timeout", 100000],
     ["mousewheel.default.delta_multiplier_x", 100],
     ["mousewheel.default.delta_multiplier_y", 100],
     ["mousewheel.default.delta_multiplier_z", 100],
     ["mousewheel.with_alt.delta_multiplier_x", 100],
@@ -3198,19 +3217,14 @@ function runTests()
     ["mousewheel.with_meta.delta_multiplier_y", 100],
     ["mousewheel.with_meta.delta_multiplier_z", 100],
     ["mousewheel.with_shift.delta_multiplier_x", 100],
     ["mousewheel.with_shift.delta_multiplier_y", 100],
     ["mousewheel.with_shift.delta_multiplier_z", 100],
     ["mousewheel.with_win.delta_multiplier_x", 100],
     ["mousewheel.with_win.delta_multiplier_y", 100],
     ["mousewheel.with_win.delta_multiplier_z", 100]
-  ]},
-  function () {
-    prepareScrollUnits();
-    testContinuousTrustedEvents();
-    SimpleTest.finish();
-  });
+  ]}, continueTest);
 }
 </script>
 </pre>
 </body>
 </html>