diff --git a/dom/events/test/test_bug607464.html b/dom/events/test/test_bug607464.html index b8740d65a807..47fc3649a60b 100644 --- a/dom/events/test/test_bug607464.html +++ b/dom/events/test/test_bug607464.html @@ -61,7 +61,7 @@ function runTest() { } }, true); - promiseApzRepaintsFlushed(win).then(function() { + promiseOnlyApzControllerFlushed(win).then(function() { scrollDown150PxWithPixelScrolling(scrollbox); }); }, win); diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js index 8921807eec93..4847a1aeab2f 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -249,7 +249,13 @@ function promiseAfterPaint() { }); } -function promiseApzRepaintsFlushed(aWindow = window) { +// This waits until any pending events on the APZ controller thread are +// processed, and any resulting repaint requests are received by the main +// thread. Note that while the repaint requests do get processed by the +// APZ handler on the main thread, the repaints themselves may not have +// occurred by the the returned promise resolves. If you want to wait +// for those repaints, consider using promiseApzFlushedRepaints instead. +function promiseOnlyApzControllerFlushed(aWindow = window) { return new Promise(function(resolve, reject) { var repaintDone = function() { dump("PromiseApzRepaintsFlushed: APZ flush done\n"); @@ -284,7 +290,7 @@ function promiseApzRepaintsFlushed(aWindow = window) { // most tests. async function promiseApzFlushedRepaints() { await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); await promiseAllPaintsDone(); } @@ -583,7 +589,7 @@ async function waitUntilApzStable() { dump("WaitUntilApzStable: done promiseFocus\n"); await promiseAllPaintsDone(); dump("WaitUntilApzStable: done promiseAllPaintsDone\n"); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); dump("WaitUntilApzStable: all done\n"); } @@ -609,7 +615,7 @@ async function forceLayerTreeToCompositor() { } } await promiseAllPaintsDone(null, true); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } function isApzEnabled() { @@ -1148,7 +1154,7 @@ function assertNotCheckerboarded(utils, scrollerId, msgPrefix) { async function waitToClearOutAnyPotentialScrolls(aWindow) { await promiseFrame(aWindow); await promiseFrame(aWindow); - await promiseApzRepaintsFlushed(aWindow); + await promiseOnlyApzControllerFlushed(aWindow); await promiseFrame(aWindow); await promiseFrame(aWindow); } diff --git a/gfx/layers/apz/test/mochitest/browser_test_background_tab_scroll.js b/gfx/layers/apz/test/mochitest/browser_test_background_tab_scroll.js index 0cc3efc4c122..0a6273c55858 100644 --- a/gfx/layers/apz/test/mochitest/browser_test_background_tab_scroll.js +++ b/gfx/layers/apz/test/mochitest/browser_test_background_tab_scroll.js @@ -46,7 +46,7 @@ add_task(async function test_main() { utils.restoreNormalRefresh(); // Flush pending APZ repaints, then read the main-thread scroll // position - await content.window.wrappedJSObject.promiseApzRepaintsFlushed( + await content.window.wrappedJSObject.promiseOnlyApzControllerFlushed( content.window ); return content.window.scrollY; diff --git a/gfx/layers/apz/test/mochitest/browser_test_scrolling_in_extension_popup_window.js b/gfx/layers/apz/test/mochitest/browser_test_scrolling_in_extension_popup_window.js index c964aa8f14df..7053afd7427f 100644 --- a/gfx/layers/apz/test/mochitest/browser_test_scrolling_in_extension_popup_window.js +++ b/gfx/layers/apz/test/mochitest/browser_test_scrolling_in_extension_popup_window.js @@ -16,7 +16,7 @@ Services.scriptloader.loadSubScript( this ); -// This is a simplified/combined version of promiseApzRepaintsFlushed and +// This is a simplified/combined version of promiseOnlyApzControllerFlushed and // promiseAllPaintsDone. We need this function because, unfortunately, there is // no easy way to use paint_listeners.js' functions and apz_test_utils.js' // functions in popup contents opened by extensions either as scripts in the diff --git a/gfx/layers/apz/test/mochitest/helper_bug1271432.html b/gfx/layers/apz/test/mochitest/helper_bug1271432.html index 1e88ebc2141c..1e40421a8f8b 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1271432.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1271432.html @@ -19,7 +19,7 @@ async function test() { // wait for it to layerize fully and then try again await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); scrollerPos = scroller.scrollTop; await promiseMoveMouseAndScrollWheelOver(scroller, dx, dy); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1280013.html b/gfx/layers/apz/test/mochitest/helper_bug1280013.html index 3e2943475e92..5b700e78aa22 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1280013.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1280013.html @@ -29,7 +29,7 @@ async function test() { // scrolling is happening in APZ and is not reflected in the main-thread // scroll position (it is stored in the callback transform instead). We check // this by checking the scroll offset. - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(window.scrollY, 0, "Main-thread scroll position is still at 0"); // Scroll the iframe by 150px. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1326290.html b/gfx/layers/apz/test/mochitest/helper_bug1326290.html index 991018e91097..17b5a36eaaf2 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1326290.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1326290.html @@ -40,7 +40,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // After dragging the scrollbar 20px on a 200px-high scrollable div, we should // have scrolled approx 10% of the 2000px high content. There might have been diff --git a/gfx/layers/apz/test/mochitest/helper_bug1331693.html b/gfx/layers/apz/test/mochitest/helper_bug1331693.html index 0558f675a6f4..6dd0de13cbe1 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1331693.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1331693.html @@ -29,7 +29,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // After dragging the scrollbar 20px on a 200px-high scrollable div, we should // have scrolled approx 10% of the 2000px high content. There might have been diff --git a/gfx/layers/apz/test/mochitest/helper_bug1462961.html b/gfx/layers/apz/test/mochitest/helper_bug1462961.html index 7d85f4b6b4bc..d37d04180075 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1462961.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1462961.html @@ -33,7 +33,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // In this case we just want to make sure the scroll position moved from 0 // which indicates the thumb dragging worked properly. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1490393-2.html b/gfx/layers/apz/test/mochitest/helper_bug1490393-2.html index c70681156456..749110449ee5 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1490393-2.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1490393-2.html @@ -38,7 +38,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // In this case we just want to make sure the scroll position moved from 0 // which indicates the thumb dragging worked properly. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1490393.html b/gfx/layers/apz/test/mochitest/helper_bug1490393.html index 7ae29c5d1628..6c18a2d24eca 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1490393.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1490393.html @@ -38,7 +38,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // In this case we just want to make sure the scroll position moved from 0 // which indicates the thumb dragging worked properly. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html b/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html index a53cb3e4e2a1..73badf4bc771 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html @@ -57,7 +57,7 @@ await new Promise(resolve => { synthesizeNativeTouchDrag(target, 10, 10, 200, -10, resolve); }); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); apzFlushed = true; setTimeout(checkForTestEnd, 0); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1550510.html b/gfx/layers/apz/test/mochitest/helper_bug1550510.html index 4dac5fb94c86..2f3be5dd2c12 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1550510.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1550510.html @@ -37,7 +37,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // In this case we just want to make sure the scroll position moved from 0 // which indicates the thumb dragging worked properly. diff --git a/gfx/layers/apz/test/mochitest/helper_bug1662800.html b/gfx/layers/apz/test/mochitest/helper_bug1662800.html index 6e7231ebaead..eb804a40f6fb 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1662800.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1662800.html @@ -36,7 +36,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Ensure the scroll position ended up roughly where we wanted it (around // 50px, but definitely less than 1300px). diff --git a/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html b/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html index 6ce669de663f..96e72ce0fa29 100644 --- a/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html +++ b/gfx/layers/apz/test/mochitest/helper_checkerboard_apzforcedisabled.html @@ -58,7 +58,7 @@ async function test() { window.scrollBy({top: 500, left: 0, behavior: 'auto'}); is(window.scrollY, 500, "document got scrolled instantly"); - // Note that at this point we must NOT call promiseApzRepaintsFlushed, because + // Note that at this point we must NOT call promiseOnlyApzControllerFlushed, because // otherwise APZCCallbackHelper::NotifyFlushComplete will trigger a repaint // (for unrelated reasons), and the repaint will clear the checkerboard // state. We do, however, want to wait for a "steady state" here that diff --git a/gfx/layers/apz/test/mochitest/helper_click.html b/gfx/layers/apz/test/mochitest/helper_click.html index 40be3df82f8b..ee2d9d7c5770 100644 --- a/gfx/layers/apz/test/mochitest/helper_click.html +++ b/gfx/layers/apz/test/mochitest/helper_click.html @@ -18,7 +18,7 @@ async function clickButton() { // force a dispatch-to-content region on the document document.addEventListener("wheel", function() { /* no-op */ }, { passive: false }); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } synthesizeNativeMouseEventWithAPZ( diff --git a/gfx/layers/apz/test/mochitest/helper_click_interrupt_animation.html b/gfx/layers/apz/test/mochitest/helper_click_interrupt_animation.html index 5c9226128a25..5c0e031a6eda 100644 --- a/gfx/layers/apz/test/mochitest/helper_click_interrupt_animation.html +++ b/gfx/layers/apz/test/mochitest/helper_click_interrupt_animation.html @@ -52,7 +52,7 @@ async function test() { for (let i = 0; i < 5; i++) { utils.advanceTimeAndRefresh(16); } - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let curPos = scroller.scrollTop; ok(curPos > 0, @@ -69,7 +69,7 @@ async function test() { for (let i = 0; i < 1000; i++) { utils.advanceTimeAndRefresh(16); } - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Ensure the scroll position hasn't changed since the last time we checked, // which indicates the animation got interrupted. diff --git a/gfx/layers/apz/test/mochitest/helper_div_pan.html b/gfx/layers/apz/test/mochitest/helper_div_pan.html index 5bc99c92e8a4..d29d21dad690 100644 --- a/gfx/layers/apz/test/mochitest/helper_div_pan.html +++ b/gfx/layers/apz/test/mochitest/helper_div_pan.html @@ -18,7 +18,7 @@ async function test() { await transformEndPromise; dump("Transform complete; flushing repaints...\n"); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); var outerScroll = document.getElementById("outer").scrollTop; is(outerScroll, 50, "check that the div scrolled"); diff --git a/gfx/layers/apz/test/mochitest/helper_drag_root_scrollbar.html b/gfx/layers/apz/test/mochitest/helper_drag_root_scrollbar.html index 5e81151bc569..1665e168cb57 100644 --- a/gfx/layers/apz/test/mochitest/helper_drag_root_scrollbar.html +++ b/gfx/layers/apz/test/mochitest/helper_drag_root_scrollbar.html @@ -36,7 +36,7 @@ async function test() { await dragFinisher(); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // After dragging the scrollbar 20px on a 1000px-high viewport, we should // have scrolled approx 2% of the 5000px high content. There might have been diff --git a/gfx/layers/apz/test/mochitest/helper_fission_empty.html b/gfx/layers/apz/test/mochitest/helper_fission_empty.html index a19cd9df30ed..6a95f763393c 100644 --- a/gfx/layers/apz/test/mochitest/helper_fission_empty.html +++ b/gfx/layers/apz/test/mochitest/helper_fission_empty.html @@ -21,7 +21,7 @@ async function loaded() { window.dispatchEvent(new Event("FissionTestHelper:Init")); // Wait a couple of animation frames before sending the load, to ensure that // this OOPIF's layer tree has been sent to the compositor. We use this - // instead of things like promiseApzRepaintsFlushed and/or promiseAllPaintsDone because + // instead of things like promiseOnlyApzControllerFlushed and/or promiseAllPaintsDone because // this page is running without SpecialPowers and I couldn't figure out a good // way to get a hold of a things like Services.obs or DOMWindowUtils easily. await promiseFrame(); diff --git a/gfx/layers/apz/test/mochitest/helper_fission_event_region_override.html b/gfx/layers/apz/test/mochitest/helper_fission_event_region_override.html index 41bd88faa92d..d67337bfd485 100644 --- a/gfx/layers/apz/test/mochitest/helper_fission_event_region_override.html +++ b/gfx/layers/apz/test/mochitest/helper_fission_event_region_override.html @@ -70,7 +70,7 @@ async function test() { utils.advanceTimeAndRefresh(16); } utils.restoreNormalRefresh(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(!wheeled, "OOPIF correctly did not get wheel event"); ok(!scrolled, "OOPIF correctly did not scroll"); diff --git a/gfx/layers/apz/test/mochitest/helper_fission_scroll_oopif.html b/gfx/layers/apz/test/mochitest/helper_fission_scroll_oopif.html index d550b3c42acc..c70dc8857ffa 100644 --- a/gfx/layers/apz/test/mochitest/helper_fission_scroll_oopif.html +++ b/gfx/layers/apz/test/mochitest/helper_fission_scroll_oopif.html @@ -113,7 +113,7 @@ async function test() { } utils.restoreNormalRefresh(); // Let the repaint requests get processed - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); await promiseAllPaintsDone(); ok(window.scrollY > 5, "window has scrolled by " + window.scrollY + " pixels"); diff --git a/gfx/layers/apz/test/mochitest/helper_iframe_pan.html b/gfx/layers/apz/test/mochitest/helper_iframe_pan.html index 78fad4a8d1c4..4ab3f6be1c48 100644 --- a/gfx/layers/apz/test/mochitest/helper_iframe_pan.html +++ b/gfx/layers/apz/test/mochitest/helper_iframe_pan.html @@ -19,7 +19,7 @@ async function test() { await transformEndPromise; dump("Transform complete; flushing repaints...\n"); - await promiseApzRepaintsFlushed(outer.contentWindow); + await promiseOnlyApzControllerFlushed(outer.contentWindow); var outerScroll = outer.contentWindow.scrollY; if (getPlatform() == "windows") { diff --git a/gfx/layers/apz/test/mochitest/helper_long_tap.html b/gfx/layers/apz/test/mochitest/helper_long_tap.html index 3d9e014c32b1..ce482b3e83bd 100644 --- a/gfx/layers/apz/test/mochitest/helper_long_tap.html +++ b/gfx/layers/apz/test/mochitest/helper_long_tap.html @@ -58,7 +58,7 @@ function recordEvent(e) { if (eventsFired == 7) { removeMouseEventListeners(target); dump("Finished waiting for events, doing an APZ flush to see if any more unexpected events come through...\n"); - promiseApzRepaintsFlushed().then(function() { + promiseOnlyApzControllerFlushed().then(function() { dump("Done APZ flush, ending test...\n"); subtestDone(); }); @@ -82,7 +82,7 @@ function recordEvent(e) { removeMouseEventListeners(target); synthesizeNativeTouch(target, 5, 5, SpecialPowers.DOMWindowUtils.TOUCH_REMOVE, function() { dump("Finished synthesizing touch-end, doing an APZ flush to see if any more unexpected events come through...\n"); - promiseApzRepaintsFlushed().then(function() { + promiseOnlyApzControllerFlushed().then(function() { dump("Done APZ flush, ending test...\n"); subtestDone(); }); diff --git a/gfx/layers/apz/test/mochitest/helper_override_root.html b/gfx/layers/apz/test/mochitest/helper_override_root.html index 6cb64034ac84..0afaf72ea847 100644 --- a/gfx/layers/apz/test/mochitest/helper_override_root.html +++ b/gfx/layers/apz/test/mochitest/helper_override_root.html @@ -37,7 +37,7 @@ async function test() { dump("Finished native wheel, waiting for listener to run...\n"); await wheelEventPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(window.scrollY, 0, "check that the window didn't scroll"); } diff --git a/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html b/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html index e15f5972a667..5fbbc1437fcc 100644 --- a/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html +++ b/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html @@ -27,7 +27,7 @@ async function test() { ok(fpos.scrollTop > scrollPos, "scrollable item inside fixed-pos element scrolled"); // wait for it to layerize fully and then try again await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); scrollPos = fpos.scrollTop; await promiseMoveMouseAndScrollWheelOver(fpos, 50, 150); ok(fpos.scrollTop > scrollPos, "scrollable item inside fixed-pos element scrolled after layerization"); diff --git a/gfx/layers/apz/test/mochitest/helper_scrollbar_snap_bug1501062.html b/gfx/layers/apz/test/mochitest/helper_scrollbar_snap_bug1501062.html index a87421ae7613..ec18fd856d52 100644 --- a/gfx/layers/apz/test/mochitest/helper_scrollbar_snap_bug1501062.html +++ b/gfx/layers/apz/test/mochitest/helper_scrollbar_snap_bug1501062.html @@ -122,7 +122,7 @@ async function test() { type: "mouseup", }); // Flush everything just to be safe - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(scrollableDiv.scrollTop == savedScrollPos, "Final scroll position was " + scrollableDiv.scrollTop); } diff --git a/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam.html b/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam.html index c56b0d69571f..154ed3cafeed 100644 --- a/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam.html +++ b/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam.html @@ -25,12 +25,12 @@ async function test() { // in the scroll position not advancing at all. for (let i = 0; i < 100; i++) { document.scrollingElement.scrollBy({top:60, behavior: "smooth"}); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); utils.advanceTimeAndRefresh(16); } utils.restoreNormalRefresh(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let scrollPos = document.scrollingElement.scrollTop; ok(scrollPos > 60, `Scrolled ${scrollPos}px, should be more than 60`); diff --git a/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam_interleaved.html b/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam_interleaved.html index 0fad1d3672cb..003ae49ea537 100644 --- a/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam_interleaved.html +++ b/gfx/layers/apz/test/mochitest/helper_smoothscroll_spam_interleaved.html @@ -22,12 +22,12 @@ async function test() { for (let i = 0; i < 100; i++) { s1.scrollBy({top:60, behavior: "smooth"}); s2.scrollBy({top:60, behavior: "smooth"}); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); utils.advanceTimeAndRefresh(16); } utils.restoreNormalRefresh(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let s1pos = s1.scrollTop; let s2pos = s2.scrollTop; diff --git a/gfx/layers/apz/test/mochitest/helper_test_reset_scaling_zoom.html b/gfx/layers/apz/test/mochitest/helper_test_reset_scaling_zoom.html index e925a8ba7238..31779410da75 100644 --- a/gfx/layers/apz/test/mochitest/helper_test_reset_scaling_zoom.html +++ b/gfx/layers/apz/test/mochitest/helper_test_reset_scaling_zoom.html @@ -7,7 +7,7 @@ async function doZoomIn() { await waitUntilApzStable(); await pinchZoomInWithTouch(100, 100); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } // Silence SimpleTest warning about missing assertions by having it wait diff --git a/gfx/layers/apz/test/mochitest/helper_touch_action.html b/gfx/layers/apz/test/mochitest/helper_touch_action.html index 9385bf025c24..38d0e6ecc4d2 100644 --- a/gfx/layers/apz/test/mochitest/helper_touch_action.html +++ b/gfx/layers/apz/test/mochitest/helper_touch_action.html @@ -22,21 +22,21 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 10, 100, 0, -50), "Synthesized native vertical drag (1), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(0, 50, "After first vertical drag, with pan-y" ); // switch style to pan-x document.body.style.touchAction = "pan-x"; ok(true, "Waiting for pan-x to propagate..."); await promiseAllPaintsDone(null, true); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // drag the page up to scroll down by 50px, but it won't happen because pan-x touchEndPromise = promiseTouchEnd(document.body); ok(synthesizeNativeTouchDrag(target, 10, 100, 0, -50), "Synthesized native vertical drag (2), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(0, 50, "After second vertical drag, with pan-x"); // drag the page left to scroll right by 50px @@ -44,7 +44,7 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 100, 10, -50, 0), "Synthesized horizontal drag (1), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(50, 50, "After first horizontal drag, with pan-x"); // drag the page diagonally right/down to scroll up/left by 40px each axis; @@ -53,14 +53,14 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 10, 10, 40, 40), "Synthesized diagonal drag (1), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(10, 50, "After first diagonal drag, with pan-x"); // switch style back to pan-y document.body.style.touchAction = "pan-y"; ok(true, "Waiting for pan-y to propagate..."); await promiseAllPaintsDone(null, true); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // drag the page diagonally right/down to scroll up/left by 40px each axis; // only the y-axis will actually scroll because pan-y @@ -68,14 +68,14 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 10, 10, 40, 40), "Synthesized diagonal drag (2), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(10, 10, "After second diagonal drag, with pan-y"); // switch style to none document.body.style.touchAction = "none"; ok(true, "Waiting for none to propagate..."); await promiseAllPaintsDone(null, true); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // drag the page diagonally up/left to scroll down/right by 40px each axis; // neither will scroll because of touch-action @@ -83,13 +83,13 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 100, 100, -40, -40), "Synthesized diagonal drag (3), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(10, 10, "After third diagonal drag, with none"); document.body.style.touchAction = "manipulation"; ok(true, "Waiting for manipulation to propagate..."); await promiseAllPaintsDone(null, true); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // drag the page diagonally up/left to scroll down/right by 40px each axis; // both will scroll because of touch-action @@ -97,7 +97,7 @@ async function test() { ok(synthesizeNativeTouchDrag(target, 100, 100, -40, -40), "Synthesized diagonal drag (4), waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); checkScroll(50, 50, "After fourth diagonal drag, with manipulation"); } diff --git a/gfx/layers/apz/test/mochitest/helper_touch_action_complex.html b/gfx/layers/apz/test/mochitest/helper_touch_action_complex.html index cc6413027c05..7f88d53194aa 100644 --- a/gfx/layers/apz/test/mochitest/helper_touch_action_complex.html +++ b/gfx/layers/apz/test/mochitest/helper_touch_action_complex.html @@ -41,7 +41,7 @@ async function resetConfiguration(config) { s.scrollTop = 0; await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } async function test() { @@ -63,7 +63,7 @@ async function test() { "Synthesized drag of (" + dx + ", " + dy + ") on configuration " + configuration); await touchEndPromise; await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Check for expected scroll position checkScroll(scrollframe, ex, ey, "configuration " + configuration + " " + desc); } diff --git a/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_block.html b/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_block.html index 89685a0bd830..301154e53368 100644 --- a/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_block.html +++ b/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_block.html @@ -17,7 +17,7 @@ "Synthesized native vertical drag, waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(window.scrollX, 0, "X scroll offset didn't change"); is(window.scrollY, 50, "Y scroll offset changed"); diff --git a/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_zindex.html b/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_zindex.html index 3db538085475..dd2a22095386 100644 --- a/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_zindex.html +++ b/gfx/layers/apz/test/mochitest/helper_touch_action_ordering_zindex.html @@ -17,7 +17,7 @@ "Synthesized native vertical drag, waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(window.scrollX, 0, "X scroll offset didn't change"); is(window.scrollY, 50, "Y scroll offset changed"); diff --git a/gfx/layers/apz/test/mochitest/helper_touch_action_zero_opacity_bug1500864.html b/gfx/layers/apz/test/mochitest/helper_touch_action_zero_opacity_bug1500864.html index 99a79e697b02..585597229255 100644 --- a/gfx/layers/apz/test/mochitest/helper_touch_action_zero_opacity_bug1500864.html +++ b/gfx/layers/apz/test/mochitest/helper_touch_action_zero_opacity_bug1500864.html @@ -18,7 +18,7 @@ async function test() { "Synthesized native vertical drag, waiting for touch-end event..."); await touchEndPromise; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(window.scrollX, 0, "X scroll offset didn't change"); is(window.scrollY, 0, "Y scroll offset didn't change"); diff --git a/gfx/layers/apz/test/mochitest/helper_touchpad_doubletap_zoom.html b/gfx/layers/apz/test/mochitest/helper_touchpad_doubletap_zoom.html index 1be77eb2392c..6506adf39974 100644 --- a/gfx/layers/apz/test/mochitest/helper_touchpad_doubletap_zoom.html +++ b/gfx/layers/apz/test/mochitest/helper_touchpad_doubletap_zoom.html @@ -18,7 +18,7 @@ async function doubleTapOn(element, x, y) { await transformEndPromise; // Flush state so we can query an accurate resolution - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } async function test() { diff --git a/gfx/layers/apz/test/mochitest/helper_touchscreen_doubletap_zoom.html b/gfx/layers/apz/test/mochitest/helper_touchscreen_doubletap_zoom.html index 296c3c54ab5a..e1e55ba78ebc 100644 --- a/gfx/layers/apz/test/mochitest/helper_touchscreen_doubletap_zoom.html +++ b/gfx/layers/apz/test/mochitest/helper_touchscreen_doubletap_zoom.html @@ -19,7 +19,7 @@ async function doubleTapOn(element, x, y) { await transformEndPromise; // Flush state so we can query an accurate resolution - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); } async function test() { diff --git a/gfx/layers/apz/test/mochitest/helper_visual_scrollbars_pagescroll.html b/gfx/layers/apz/test/mochitest/helper_visual_scrollbars_pagescroll.html index 7aa9afc4c443..721a046221c9 100644 --- a/gfx/layers/apz/test/mochitest/helper_visual_scrollbars_pagescroll.html +++ b/gfx/layers/apz/test/mochitest/helper_visual_scrollbars_pagescroll.html @@ -53,7 +53,7 @@ async function test() { for (let i = 0; i < 1000; i++) { utils.advanceTimeAndRefresh(16); } - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let pageScrollAmount = scroller.scrollTop; ok(pageScrollAmount > scroller.clientHeight / 2, @@ -71,7 +71,7 @@ async function test() { for (let i = 0; i < 5; i++) { utils.advanceTimeAndRefresh(16); } - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let curPos = scroller.scrollTop; ok(curPos > pageScrollAmount, `Scroll offset has increased to ${curPos}`); ok(curPos < pageScrollAmount * 2, "Second page-scroll is not yet complete"); @@ -87,7 +87,7 @@ async function test() { for (let i = 0; i < 1000; i++) { utils.advanceTimeAndRefresh(16); } - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); curPos = scroller.scrollTop; ok(Math.abs(curPos - (pageScrollAmount * 3)) < 3, `Final scroll offset ${curPos} is close to 3x${pageScrollAmount}`); diff --git a/gfx/layers/apz/test/mochitest/test_bug1253683.html b/gfx/layers/apz/test/mochitest/test_bug1253683.html index 3f12ab1d1a88..f12455fb3a42 100644 --- a/gfx/layers/apz/test/mochitest/test_bug1253683.html +++ b/gfx/layers/apz/test/mochitest/test_bug1253683.html @@ -32,7 +32,7 @@ async function test() { // Scrolling over outer1 should layerize outer1, but not inner1. await promiseMoveMouseAndScrollWheelOver(no_layer, 10, 10, true); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(container.scrollTop > 0, "We should have scrolled the body"); ok(!isLayerized("no_layer"), "no_layer should still not be layerized"); diff --git a/gfx/layers/apz/test/mochitest/test_bug1277814.html b/gfx/layers/apz/test/mochitest/test_bug1277814.html index 34c00c7c3dfb..28c4619e4e5d 100644 --- a/gfx/layers/apz/test/mochitest/test_bug1277814.html +++ b/gfx/layers/apz/test/mochitest/test_bug1277814.html @@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1277814 // Wait for the layer tree with any updated dispatch-to-content region to // get pushed over to the APZ await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Trigger layerization of the subframe by scrolling the wheel over it await promiseMoveMouseAndScrollWheelOver(subframe, 10, 10); diff --git a/gfx/layers/apz/test/mochitest/test_bug1304689-2.html b/gfx/layers/apz/test/mochitest/test_bug1304689-2.html index 419905a10a1d..1c7b1255d925 100644 --- a/gfx/layers/apz/test/mochitest/test_bug1304689-2.html +++ b/gfx/layers/apz/test/mochitest/test_bug1304689-2.html @@ -37,7 +37,7 @@ async function test() { // Set margins on the element, to ensure it is layerized utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /* priority*/ 1); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Take control of the refresh driver utils.advanceTimeAndRefresh(0); @@ -62,7 +62,7 @@ async function test() { } utils.restoreNormalRefresh(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(elm.scrollTop, 100, "The scrollTop now should be y=100"); } diff --git a/gfx/layers/apz/test/mochitest/test_bug1304689.html b/gfx/layers/apz/test/mochitest/test_bug1304689.html index b36415068bdc..85ca3d5503cc 100644 --- a/gfx/layers/apz/test/mochitest/test_bug1304689.html +++ b/gfx/layers/apz/test/mochitest/test_bug1304689.html @@ -40,7 +40,7 @@ async function test() { // Set margins on the element, to ensure it is layerized utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, /* priority*/ 1); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Take control of the refresh driver utils.advanceTimeAndRefresh(0); @@ -66,7 +66,7 @@ async function test() { } utils.restoreNormalRefresh(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(elm.scrollTop, 100, "The scrollTop now should be y=100"); } diff --git a/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html b/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html index 427180357b37..1031701a3bdf 100644 --- a/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html +++ b/gfx/layers/apz/test/mochitest/test_frame_reconstruction.html @@ -157,7 +157,7 @@ async function test() { var elm = document.getElementsByClassName("inner")[0]; elm.scrollTop = 0; - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Take over control of the refresh driver and compositor var utils = SpecialPowers.DOMWindowUtils; @@ -170,7 +170,7 @@ async function test() { // Let's do a couple of frames of the animation, and make sure it's going utils.advanceTimeAndRefresh(16); utils.advanceTimeAndRefresh(16); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(elm.scrollTop > 0, "APZ animation in progress, scrollTop is now " + elm.scrollTop); ok(elm.scrollTop < 200, "APZ animation not yet completed, scrollTop is now " + elm.scrollTop); @@ -190,7 +190,7 @@ async function test() { // and the frame reconstruction utils.advanceTimeAndRefresh(16); utils.advanceTimeAndRefresh(16); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(elm.scrollTop < 200, "APZ animation not yet completed, scrollTop is now " + elm.scrollTop); ok(frameReconstructionTriggered > 0, "Frame reconstruction triggered, reconstruction triggered " + frameReconstructionTriggered + " times"); @@ -200,7 +200,7 @@ async function test() { } utils.restoreNormalRefresh(); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); is(elm.scrollTop, 200, "Element should have scrolled by 200px"); } diff --git a/gfx/layers/apz/test/mochitest/test_interrupted_reflow.html b/gfx/layers/apz/test/mochitest/test_interrupted_reflow.html index 2340da3d8052..96b3d64986a6 100644 --- a/gfx/layers/apz/test/mochitest/test_interrupted_reflow.html +++ b/gfx/layers/apz/test/mochitest/test_interrupted_reflow.html @@ -610,7 +610,7 @@ async function test() { var maxScroll = elm.scrollTopMax; elm.scrollTop = maxScroll; await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Take control of the refresh driver utils.advanceTimeAndRefresh(0); diff --git a/gfx/layers/apz/test/mochitest/test_layerization.html b/gfx/layers/apz/test/mochitest/test_layerization.html index 4dabda87c0ca..16b2ae5a83eb 100644 --- a/gfx/layers/apz/test/mochitest/test_layerization.html +++ b/gfx/layers/apz/test/mochitest/test_layerization.html @@ -139,7 +139,7 @@ async function test() { // Scrolling over outer1 should activate outer1 directly, but not inner1. await scrollWheelOver(document.getElementById("outer1")); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(checkDirectActivation("outer1"), "scrolling 'outer1' should activate it directly"); ok(checkInactive("inner1"), @@ -148,7 +148,7 @@ async function test() { // Scrolling over inner2 should activate inner2 directly, but outer2 only ancestrally. await scrollWheelOver(document.getElementById("inner2")); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(checkDirectActivation("inner2"), "scrolling 'inner2' should cause it to be directly activated"); ok(checkAncestorActivation("outer2"), @@ -160,7 +160,7 @@ async function test() { // Scrolling over outer3 should activate outer3 directly, but not inner3. await scrollWheelOver(outer3Doc.documentElement); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(checkDirectActivation("outer3"), "scrolling 'outer3' should cause it to be directly activated"); ok(checkInactive("inner3", outer3Doc), "scrolling 'outer3' should not cause 'inner3' to be activated"); @@ -168,7 +168,7 @@ async function test() { // Scrolling over inner4 should activate inner4 directly, but outer4 only ancestrally. await scrollWheelOver(outer4Doc.getElementById("inner4")); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); ok(checkDirectActivation("inner4", outer4Doc), "scrolling 'inner4' should cause it to be directly activated"); ok(checkAncestorActivation("outer4"), @@ -194,7 +194,7 @@ async function test() { // Expire displayport with scrolling on outer1 await scrollWheelOver(document.getElementById("outer1")); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); await SpecialPowers.promiseTimeout(DISPLAYPORT_EXPIRY); await promiseAllPaintsDone(); ok(checkInactive("outer1"), "outer1 is inactive after displayport expiry"); @@ -203,7 +203,7 @@ async function test() { // Expire displayport with scrolling on inner2 await scrollWheelOver(document.getElementById("inner2")); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Once the expiry elapses, it will trigger expiry on outer2, so we check // both, one at a time. await SpecialPowers.promiseTimeout(DISPLAYPORT_EXPIRY); @@ -239,7 +239,7 @@ async function test() { let inner3 = outer3Doc.getElementById("inner3"); await scrollWheelOver(inner3); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); let timerPromise = new Promise(resolve => { var timeoutTarget = function() { inner3.removeEventListener("scroll", timeoutResetter); @@ -272,7 +272,7 @@ async function test() { // inner4 is still layerized await scrollWheelOver(outer4Doc.documentElement); await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); // Wait for the expiry to elapse await SpecialPowers.promiseTimeout(DISPLAYPORT_EXPIRY); await promiseAllPaintsDone(); diff --git a/gfx/layers/apz/test/mochitest/test_touch_listeners_impacting_wheel.html b/gfx/layers/apz/test/mochitest/test_touch_listeners_impacting_wheel.html index b698a546d467..71147d5238b9 100644 --- a/gfx/layers/apz/test/mochitest/test_touch_listeners_impacting_wheel.html +++ b/gfx/layers/apz/test/mochitest/test_touch_listeners_impacting_wheel.html @@ -76,7 +76,7 @@ async function test() { // Let the event regions and layerization propagate to the APZ await promiseAllPaintsDone(); - await promiseApzRepaintsFlushed(); + await promiseOnlyApzControllerFlushed(); await promiseNativeMouseEventWithAPZAndWaitForEvent({ type: "mousemove",