diff --git a/gfx/layers/apz/test/mochitest/helper_long_tap.html b/gfx/layers/apz/test/mochitest/helper_long_tap.html index 9cb120753856..883822d771f2 100644 --- a/gfx/layers/apz/test/mochitest/helper_long_tap.html +++ b/gfx/layers/apz/test/mochitest/helper_long_tap.html @@ -42,19 +42,13 @@ function recordEvent(e) { } } -function registerListeners() { - window.addEventListener('touchstart', recordEvent, { passive: true, capture: true }); - window.addEventListener('touchend', recordEvent, { passive: true, capture: true }); - window.addEventListener('touchcancel', recordEvent, true); - window.addEventListener('contextmenu', recordEvent, true); -} +window.addEventListener('touchstart', recordEvent, { passive: true, capture: true }); +window.addEventListener('touchend', recordEvent, { passive: true, capture: true }); +window.addEventListener('touchcancel', recordEvent, true); +window.addEventListener('contextmenu', recordEvent, true); -window.onload = function() { - registerListeners(); - waitForAllPaints(function() { - flushApzRepaints(longPressLink); - }); -} +waitUntilApzStable() +.then(longPressLink); diff --git a/gfx/layers/apz/test/mochitest/helper_tap_passive.html b/gfx/layers/apz/test/mochitest/helper_tap_passive.html index 384746e8951f..ac68a3950bb3 100644 --- a/gfx/layers/apz/test/mochitest/helper_tap_passive.html +++ b/gfx/layers/apz/test/mochitest/helper_tap_passive.html @@ -48,17 +48,11 @@ function recordEvent(e) { }); } -function registerListeners() { - window.addEventListener('touchstart', recordEvent, { passive: true, capture: true }); - window.addEventListener('contextmenu', recordEvent, true); -} +window.addEventListener('touchstart', recordEvent, { passive: true, capture: true }); +window.addEventListener('contextmenu', recordEvent, true); -window.onload = function() { - registerListeners(); - waitForAllPaints(function() { - flushApzRepaints(longPressLink); - }); -} +waitUntilApzStable() +.then(longPressLink); diff --git a/gfx/layers/apz/test/mochitest/test_bug1151663.html b/gfx/layers/apz/test/mochitest/test_bug1151663.html index 7db36aba9ede..10810c6caf6b 100644 --- a/gfx/layers/apz/test/mochitest/test_bug1151663.html +++ b/gfx/layers/apz/test/mochitest/test_bug1151663.html @@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1151663 // inside an iframe which means we have no control over the root APZC. var w = null; window.onload = function() { - SpecialPowers.pushPrefEnv({"set": [["apz.test.logging_enabled", true]]}, function() { + pushPrefs([["apz.test.logging_enabled", true]]).then(function() { w = window.open("helper_bug1151663.html", "_blank"); }); }; diff --git a/gfx/layers/apz/test/mochitest/test_bug982141.html b/gfx/layers/apz/test/mochitest/test_bug982141.html index 20df935379df..9984b79ffd63 100644 --- a/gfx/layers/apz/test/mochitest/test_bug982141.html +++ b/gfx/layers/apz/test/mochitest/test_bug982141.html @@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=982141 // inside an iframe which means we have no control over the root APZC. var w = null; window.onload = function() { - SpecialPowers.pushPrefEnv({"set": [["apz.test.logging_enabled", true]]}, function() { + pushPrefs([["apz.test.logging_enabled", true]]).then(function() { w = window.open("helper_bug982141.html", "_blank"); }); };