From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- gfx/layers/apz/test/gtest/TestGestureDetector.cpp | 236 ++++++++++++++++++++- .../test/mochitest/apz_test_native_event_utils.js | 14 +- gfx/layers/apz/test/mochitest/apz_test_utils.js | 4 +- gfx/layers/apz/test/mochitest/browser.toml | 8 +- .../browser_test_autoscrolling_in_oop_frame.js | 2 +- .../browser_test_content_response_timeout.js | 1 + ...ser_test_scrolling_in_extension_popup_window.js | 2 +- .../apz/test/mochitest/helper_basic_scrollend.html | 2 +- .../test/mochitest/helper_browser_test_utils.js | 2 +- .../apz/test/mochitest/helper_bug1346632.html | 2 +- .../apz/test/mochitest/helper_bug1414336.html | 6 +- .../helper_bug1502010_unconsumed_pan.html | 2 +- ...per_bug1506497_touch_action_fixed_on_fixed.html | 4 +- .../apz/test/mochitest/helper_bug1695598.html | 2 +- .../mochitest/helper_content_response_timeout.html | 2 +- .../test/mochitest/helper_displayport_expiry.html | 2 +- .../helper_fission_event_region_override.html | 2 +- .../mochitest/helper_fission_scroll_oopif.html | 2 +- .../apz/test/mochitest/helper_fullscreen.html | 2 +- .../mochitest/helper_hittest_deep_scene_stack.html | 2 +- .../apz/test/mochitest/helper_hittest_fixed-2.html | 2 +- .../apz/test/mochitest/helper_hittest_fixed-3.html | 4 +- .../apz/test/mochitest/helper_hittest_fixed.html | 2 +- ...helper_hittest_hidden_inactive_scrollframe.html | 2 +- .../helper_hittest_iframe_perspective-2.html | 2 +- .../test/mochitest/helper_hittest_overscroll.html | 2 +- .../helper_hittest_overscroll_contextmenu.html | 4 +- .../helper_hittest_overscroll_subframe.html | 2 +- .../apz/test/mochitest/helper_key_scroll.html | 4 +- ...helper_main_thread_smooth_scroll_scrollend.html | 2 +- .../test/mochitest/helper_minimum_scale_1_0.html | 2 +- .../helper_no_scalable_with_initial_scale.html | 2 +- .../helper_programmatic_scroll_behavior.html | 2 +- .../mochitest/helper_touch_action_regions.html | 2 +- .../apz/test/mochitest/helper_zoomed_pan.html | 4 +- gfx/layers/apz/test/mochitest/test_smoothness.html | 2 +- .../test_touch_listeners_impacting_wheel.html | 4 +- gfx/layers/apz/test/reftest/reftest.list | 18 +- 38 files changed, 297 insertions(+), 64 deletions(-) (limited to 'gfx/layers/apz/test') diff --git a/gfx/layers/apz/test/gtest/TestGestureDetector.cpp b/gfx/layers/apz/test/gtest/TestGestureDetector.cpp index f244ca4dc7..8256667d6b 100644 --- a/gfx/layers/apz/test/gtest/TestGestureDetector.cpp +++ b/gfx/layers/apz/test/gtest/TestGestureDetector.cpp @@ -21,12 +21,12 @@ class APZCGestureDetectorTester : public APZCBasicTester { : APZCBasicTester(AsyncPanZoomController::USE_GESTURE_DETECTOR) {} protected: - FrameMetrics GetPinchableFrameMetrics() { + FrameMetrics GetPinchableFrameMetrics(float aZoom = 2.0f) { FrameMetrics fm; fm.SetCompositionBounds(ParentLayerRect(200, 200, 100, 200)); fm.SetScrollableRect(CSSRect(0, 0, 980, 1000)); fm.SetVisualScrollOffset(CSSPoint(300, 300)); - fm.SetZoom(CSSToParentLayerScale(2.0)); + fm.SetZoom(CSSToParentLayerScale(aZoom)); // APZC only allows zooming on the root scrollable frame. fm.SetIsRootContent(true); // the visible area of the document in CSS pixels is x=300 y=300 w=50 h=100 @@ -843,3 +843,235 @@ TEST_F(APZCGestureDetectorTester, LongPressWithInputQueueDelay3) { mcc->AdvanceByMillis(1); check.Call("post long-tap dispatch"); } + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureShort) { + // Take less than StaticPrefs::apz_max_tap_time() until second touch down, + // hold second touch down for a very short time, then move + // and expect a successful one touch pinch gesture + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", true); + + MakeApzcZoomable(); + apzc->SetFrameMetrics(GetPinchableFrameMetrics()); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(10); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + // We should be able to hold down the second touch as long as we like + // before beginning to move + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 50), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchUp(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_NE(newZoom, oldZoom); +} + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureLong) { + // Take less than StaticPrefs::apz_max_tap_time() until second touch down, + // hold second touch down for a long time, then move + // and expect a successful one touch pinch gesture + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", true); + + MakeApzcZoomable(); + apzc->SetFrameMetrics(GetPinchableFrameMetrics()); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() - 20); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + // We should be able to hold down the second touch as long as we like + // before beginning to move + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() + 100); + TouchMove(apzc, ScreenIntPoint(10, 50), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchUp(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_NE(newZoom, oldZoom); +} + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureNoMoveTriggersDoubleTap) { + // Take less than StaticPrefs::apz_max_tap_time() until second touch down, + // then wait longer than StaticPrefs::apz_max_tap_time(), lift finger up + // and expect a successful double tap. No zooming should be performed + // by the one-touch pinch codepath. + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", true); + + apzc->SetFrameMetrics(GetPinchableFrameMetrics()); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + + MakeApzcZoomable(); + + EXPECT_CALL(*mcc, HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _, _)) + .Times(0); + EXPECT_CALL(*mcc, + HandleTap(TapType::eDoubleTap, _, 0, apzc->GetGuid(), _, _)); + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() - 20); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + // We should be able to hold down the second touch as long as we like + // before lifting the finger + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() + 100); + TouchUp(apzc, ScreenIntPoint(10, 10), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_EQ(newZoom, oldZoom); +} + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureNonZoomablePage) { + // Use a non-zoomable page. Perform a tap and a touch-drag + // which on a zoomable page trigger a one touch pinch gesture, + // and expect a single tap followed by a touch-scroll + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", true); + + apzc->SetFrameMetrics(GetPinchableFrameMetrics(1.0f)); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + const auto oldScrollOffset = apzc->GetFrameMetrics().GetVisualScrollOffset(); + MakeApzcUnzoomable(); + + EXPECT_CALL(*mcc, HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _, _)) + .Times(1); + EXPECT_CALL(*mcc, HandleTap(TapType::eDoubleTap, _, 0, apzc->GetGuid(), _, _)) + .Times(0); + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() - 20); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + // We should be able to hold down the second touch as long as we like + // before beginning to move + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() + 100); + TouchMove(apzc, ScreenIntPoint(10, 50), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 100), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchUp(apzc, ScreenIntPoint(10, 100), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_EQ(newZoom, oldZoom); + + const auto newScrollOffset = apzc->GetFrameMetrics().GetVisualScrollOffset(); + EXPECT_NE(newScrollOffset, oldScrollOffset); +} + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureTimeout) { + // Take longer than StaticPrefs::apz_max_tap_time() until second touch down + // and expect no one touch pinch gesture being performed + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", true); + + MakeApzcZoomable(); + apzc->SetFrameMetrics(GetPinchableFrameMetrics()); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + + EXPECT_CALL(*mcc, HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _, _)) + .Times(1); + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time()); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 50), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchUp(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_EQ(newZoom, oldZoom); +} + +TEST_F(APZCGestureDetectorTester, OneTouchPinchGestureDisabled) { + // With apz.one_touch_pinch disabled, + // perform one touch pinch gesture within the time threshold, + // and expect no zooming. + SCOPED_GFX_PREF_BOOL("apz.one_touch_pinch.enabled", false); + + MakeApzcZoomable(); + apzc->SetFrameMetrics(GetPinchableFrameMetrics()); + const auto oldZoom = apzc->GetFrameMetrics().GetZoom().scale; + const auto oldScrollOffset = apzc->GetFrameMetrics().GetVisualScrollOffset(); + + // todo: enable following EXPECT_CALLs when fixing bug 1881794 + // EXPECT_CALL(*mcc, HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _, + // _)) + // .Times(1); + // EXPECT_CALL(*mcc, HandleTap(TapType::eDoubleTap, _, 0, apzc->GetGuid(), _, + // _)) + // .Times(0); + + const auto tapResult = + Tap(apzc, ScreenIntPoint(10, 10), TimeDuration::FromMilliseconds(10)); + apzc->SetAllowedTouchBehavior(tapResult.mInputBlockId, + {kDefaultTouchBehavior}); + + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() - 20); + const auto touchResult = TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time()); + apzc->SetAllowedTouchBehavior(touchResult.mInputBlockId, + {kDefaultTouchBehavior}); + + // We should be able to hold down the second touch as long as we like + // before beginning to move + mcc->AdvanceByMillis(StaticPrefs::apz_max_tap_time() + 100); + TouchMove(apzc, ScreenIntPoint(10, 50), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchMove(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + mcc->AdvanceByMillis(10); + TouchUp(apzc, ScreenIntPoint(10, 150), mcc->Time()); + + const auto newZoom = apzc->GetFrameMetrics().GetZoom().scale; + EXPECT_EQ(newZoom, oldZoom); + + const auto newScrollOffset = apzc->GetFrameMetrics().GetVisualScrollOffset(); + EXPECT_NE(newScrollOffset, oldScrollOffset); +} diff --git a/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js b/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js index c290965845..1642bc147a 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js @@ -498,7 +498,7 @@ async function promiseNativeTouchpadPanEventAndWaitForObserver( return new Promise(resolve => { var observer = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { if (aTopic == "touchpadpanevent") { resolve(); } @@ -557,7 +557,7 @@ function promiseNativePanGestureEventAndWaitForObserver( ) { return new Promise(resolve => { var observer = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { if (aTopic == "mousescrollevent") { resolve(); } @@ -588,7 +588,7 @@ function promiseNativeWheelAndWaitForObserver( ) { return new Promise(resolve => { var observer = { - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { if (aTopic == "mousescrollevent") { resolve(); } @@ -614,7 +614,7 @@ function promiseNativeWheelAndWaitForWheelEvent( var targetWindow = windowForTarget(aTarget); targetWindow.addEventListener( "wheel", - function (e) { + function () { setTimeout(resolve, 0); }, { once: true } @@ -1566,7 +1566,7 @@ function promiseScrollend(aTarget = window) { function promiseTouchEnd(element, count = 1) { return new Promise(resolve => { var eventCount = 0; - var counterFunction = function (e) { + var counterFunction = function () { eventCount++; if (eventCount == count) { element.removeEventListener("touchend", counterFunction, { @@ -1816,7 +1816,7 @@ async function panRightToLeftUpdate(aElement, aX, aY, aMultiplier) { ); } -async function panRightToLeftEnd(aElement, aX, aY, aMultiplier) { +async function panRightToLeftEnd(aElement, aX, aY) { await NativePanHandler.promiseNativePanEvent( aElement, aX, @@ -1869,7 +1869,7 @@ async function panLeftToRightUpdate(aElement, aX, aY, aMultiplier) { ); } -async function panLeftToRightEnd(aElement, aX, aY, aMultiplier) { +async function panLeftToRightEnd(aElement, aX, aY) { await NativePanHandler.promiseNativePanEvent( aElement, aX, diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js index 821c66103d..cdae7824b2 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -309,7 +309,7 @@ function promiseAfterPaint() { // occurred by the the returned promise resolves. If you want to wait // for those repaints, consider using promiseApzFlushedRepaints instead. function promiseOnlyApzControllerFlushedWithoutSetTimeout(aWindow = window) { - return new Promise(function (resolve, reject) { + return new Promise(function (resolve) { var repaintDone = function () { dump("PromiseApzRepaintsFlushed: APZ flush done\n"); SpecialPowers.Services.obs.removeObserver( @@ -518,7 +518,7 @@ function runSubtestsSeriallyInFreshWindows(aSubtests) { if (test.onload) { w.addEventListener( "load", - function (e) { + function () { test.onload(w); }, { once: true } diff --git a/gfx/layers/apz/test/mochitest/browser.toml b/gfx/layers/apz/test/mochitest/browser.toml index 5432aa0ae1..67428eee23 100644 --- a/gfx/layers/apz/test/mochitest/browser.toml +++ b/gfx/layers/apz/test/mochitest/browser.toml @@ -19,7 +19,7 @@ support-files = ["helper_test_autoscrolling_in_oop_frame.html"] support-files = ["helper_background_tab_load_scroll.html"] ["browser_test_background_tab_scroll.js"] -skip-if = ["toolkit == 'android'"] # wheel events not supported on mobile +skip-if = ["os == 'android'"] # wheel events not supported on mobile support-files = ["helper_background_tab_scroll.html"] ["browser_test_content_response_timeout.js"] @@ -28,7 +28,7 @@ support-files = ["helper_content_response_timeout.html"] ["browser_test_group_fission.js"] skip-if = [ "win11_2009 && bits == 32", # intermittent failures on on win11/32 - "os == 'linux' && bits == 64", # Bug 1773830 + "os == 'linux' && os_version == '18.04' && bits == 64", # Bug 1773830 ] support-files = [ "FissionTestHelperParent.sys.mjs", @@ -49,7 +49,7 @@ support-files = ["helper_scroll_thumb_dragging.html"] ["browser_test_scrollbar_in_extension_popup_window.js"] skip-if = [ "verify", - "os == 'linux'" # Bug 1713052 + "os == 'linux' && os_version == '18.04'" # Bug 1713052 ] ["browser_test_scrolling_in_extension_popup_window.js"] @@ -70,7 +70,7 @@ skip-if = ["os == 'win'"] # bug 1495580 support-files = ["helper_test_select_zoom.html"] ["browser_test_tab_drag_event_counts.js"] -skip-if = ["os == 'linux'"] # No native key event support on Linux at this time (bug 1770143) +skip-if = ["os == 'linux' && os_version == '18.04'"] # No native key event support on Linux at this time (bug 1770143) support-files = [ "helper_test_tab_drag_event_counts.html" ] diff --git a/gfx/layers/apz/test/mochitest/browser_test_autoscrolling_in_oop_frame.js b/gfx/layers/apz/test/mochitest/browser_test_autoscrolling_in_oop_frame.js index 26d0ff6109..f7f83575f2 100644 --- a/gfx/layers/apz/test/mochitest/browser_test_autoscrolling_in_oop_frame.js +++ b/gfx/layers/apz/test/mochitest/browser_test_autoscrolling_in_oop_frame.js @@ -74,7 +74,7 @@ async function doTest() { return new Promise(resolve => { content.addEventListener( "scroll", - event => { + () => { dump("Got a scroll event in the iframe\n"); resolve(); }, diff --git a/gfx/layers/apz/test/mochitest/browser_test_content_response_timeout.js b/gfx/layers/apz/test/mochitest/browser_test_content_response_timeout.js index a80fd77c17..98f6ea6c29 100644 --- a/gfx/layers/apz/test/mochitest/browser_test_content_response_timeout.js +++ b/gfx/layers/apz/test/mochitest/browser_test_content_response_timeout.js @@ -60,6 +60,7 @@ add_task(async () => { ); await new Promise(resolve => { + // eslint-disable-next-line mozilla/no-arbitrary-setTimeout setTimeout(resolve, 200); }); 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 6da3f3311b..9896e628e3 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 @@ -98,7 +98,7 @@ add_task(async () => { return new Promise(resolve => { content.window.addEventListener( "scroll", - event => { + () => { dump("Got a scroll event in the popup content document\n"); resolve(); }, diff --git a/gfx/layers/apz/test/mochitest/helper_basic_scrollend.html b/gfx/layers/apz/test/mochitest/helper_basic_scrollend.html index 9d71fe6251..6c31859690 100644 --- a/gfx/layers/apz/test/mochitest/helper_basic_scrollend.html +++ b/gfx/layers/apz/test/mochitest/helper_basic_scrollend.html @@ -19,7 +19,7 @@ const searchParams = new URLSearchParams(location.search); async function test() { var scrollendCount = 0; - function onScrollend(e) { + function onScrollend() { scrollendCount += 1; } diff --git a/gfx/layers/apz/test/mochitest/helper_browser_test_utils.js b/gfx/layers/apz/test/mochitest/helper_browser_test_utils.js index ac68c9b1d4..22a072e48d 100644 --- a/gfx/layers/apz/test/mochitest/helper_browser_test_utils.js +++ b/gfx/layers/apz/test/mochitest/helper_browser_test_utils.js @@ -4,7 +4,7 @@ Services.scriptloader.loadSubScript( this ); -function openSelectPopup(selector = "select", win = window) { +function openSelectPopup(selector, win = window) { let popupShownPromise = BrowserTestUtils.waitForSelectPopupShown(win); EventUtils.synthesizeKey("KEY_ArrowDown", { altKey: true }, win); return popupShownPromise; diff --git a/gfx/layers/apz/test/mochitest/helper_bug1346632.html b/gfx/layers/apz/test/mochitest/helper_bug1346632.html index f91f8159b5..c7f92c3810 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1346632.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1346632.html @@ -28,7 +28,7 @@ async function test() { var root = document.scrollingElement; var scrollPos = root.scrollTop; - var scrollPromise = new Promise((resolve, reject) => { + var scrollPromise = new Promise((resolve) => { document.addEventListener("scroll", () => { ok(root.scrollTop > scrollPos, "document scrolled after dragging scrollbar"); resolve(); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1414336.html b/gfx/layers/apz/test/mochitest/helper_bug1414336.html index 636328b7e4..c0d35db401 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1414336.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1414336.html @@ -62,14 +62,14 @@ waitUntilApzStable().then(async () => { let target0 = window.document.getElementById("target0"); let target0_events = ["pointerdown", "pointermove"]; - target0_events.forEach((elem, index, arr) => { + target0_events.forEach((elem) => { target0.addEventListener(elem, (event) => { is(event.type, target0_events[0], "receive " + event.type + " on target0"); target0_events.shift(); }, { once: true }); }); - target0.addEventListener("pointercancel", (event) => { + target0.addEventListener("pointercancel", () => { ok(false, "Shouldn't receive pointercancel when content prevents default on touchstart"); // Wait until the event is done processing before we end the subtest, // otherwise on Android the pointer events pref is flipped back to false @@ -81,7 +81,7 @@ waitUntilApzStable().then(async () => { event.preventDefault(); }, { once: true }); - target0.addEventListener("pointerup", (event) => { + target0.addEventListener("pointerup", () => { ok(!target0_events.length, " should receive " + target0_events + " on target0"); // Wait until the event is done processing before we end the subtest, // otherwise on Android the pointer events pref is flipped back to false 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 73badf4bc7..8534e8886b 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1502010_unconsumed_pan.html @@ -38,7 +38,7 @@ async function test() { var target = document.getElementById("carousel"); - target.addEventListener("pointercancel", (event) => { + target.addEventListener("pointercancel", () => { ok(false, "Received pointercancel, uh-oh!"); endEventReceived = true; setTimeout(checkForTestEnd, 0); diff --git a/gfx/layers/apz/test/mochitest/helper_bug1506497_touch_action_fixed_on_fixed.html b/gfx/layers/apz/test/mochitest/helper_bug1506497_touch_action_fixed_on_fixed.html index cc73fe99ea..b853bde04d 100644 --- a/gfx/layers/apz/test/mochitest/helper_bug1506497_touch_action_fixed_on_fixed.html +++ b/gfx/layers/apz/test/mochitest/helper_bug1506497_touch_action_fixed_on_fixed.html @@ -11,7 +11,7 @@