From 73dd945ce013c6c7550285f640cf8c9169182b1e Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 19 Jan 2023 21:07:44 +0000 Subject: [PATCH] Bug 1810819 - Add NativePanHandlerForHeadless. r=botond Differential Revision: https://phabricator.services.mozilla.com/D167111 --- .../test/mochitest/apz_test_native_event_utils.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 1a7ef7f34591..785a4f3b9b59 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 @@ -1815,7 +1815,19 @@ const NativePanHandlerForMac = { delta: -50, }; +const NativePanHandlerForHeadless = { + beginPhase: SpecialPowers.DOMWindowUtils.PHASE_BEGIN, + updatePhase: SpecialPowers.DOMWindowUtils.PHASE_UPDATE, + endPhase: SpecialPowers.DOMWindowUtils.PHASE_END, + promiseNativePanEvent: promiseNativeTouchpadPanEventAndWaitForObserver, + delta: 50, +}; + function getPanHandler() { + if (SpecialPowers.isHeadless) { + return NativePanHandlerForHeadless; + } + switch (getPlatform()) { case "linux": return NativePanHandlerForLinux;