From 5d070f7e85464cb8eb5c8a11e3ec1c05050c48d6 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Tue, 14 Jan 2020 00:22:30 +0000 Subject: [PATCH] Bug 1608506 - Use nsIDOMWindowUtils.setResolutionAndScaleTo() rather than initial-scale to zoom in most APZ mochitests. r=hiro The exception is the tests in test_group_minimum_scale_size.html, which are specifically testing mobile viewport sizing behaviour. Differential Revision: https://phabricator.services.mozilla.com/D59587 --HG-- extra : moz-landing-system : lando --- .../test/mochitest/helper_fixed_pos_displayport.html | 3 ++- .../helper_fixed_position_scroll_hittest.html | 3 ++- .../mochitest/helper_scroll_into_view_bug1516056.html | 3 ++- .../mochitest/helper_scroll_into_view_bug1562757.html | 3 ++- .../test/mochitest/helper_visual_smooth_scroll.html | 3 ++- gfx/layers/apz/test/mochitest/test_group_zoom.html | 10 +++++----- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gfx/layers/apz/test/mochitest/helper_fixed_pos_displayport.html b/gfx/layers/apz/test/mochitest/helper_fixed_pos_displayport.html index b63c3c95a0a0..46572c33d6f4 100644 --- a/gfx/layers/apz/test/mochitest/helper_fixed_pos_displayport.html +++ b/gfx/layers/apz/test/mochitest/helper_fixed_pos_displayport.html @@ -2,7 +2,7 @@ - + position:fixed display port sizing @@ -93,6 +93,7 @@ yield* scrollToVisual(vv.width * 3, vv.height * 30, testDriver); checkFixedPosDisplayport(); } + SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(8.0); waitUntilApzStable().then(runContinuation(test)).then(subtestDone); diff --git a/gfx/layers/apz/test/mochitest/helper_fixed_position_scroll_hittest.html b/gfx/layers/apz/test/mochitest/helper_fixed_position_scroll_hittest.html index b2de5348d743..c152783d708a 100644 --- a/gfx/layers/apz/test/mochitest/helper_fixed_position_scroll_hittest.html +++ b/gfx/layers/apz/test/mochitest/helper_fixed_position_scroll_hittest.html @@ -2,7 +2,7 @@ - + Hittest position:fixed zoomed scroll @@ -47,6 +47,7 @@ is(e.target, input, "got click"); subtestDone(); }); + SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0); waitUntilApzStable().then(runContinuation(test)); diff --git a/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1516056.html b/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1516056.html index 926c657edbf2..05069a34b77b 100644 --- a/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1516056.html +++ b/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1516056.html @@ -2,7 +2,7 @@ - + Test for bug 1516056: "scroll into view" respects bounds on layout scroll position @@ -61,6 +61,7 @@ targetBounds.h = targetBounds.height; assertRectContainment(vvRect, "visual viewport", targetBounds, "target element bounding rect"); } + SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0); waitUntilApzStable().then(runContinuation(test)).then(subtestDone); diff --git a/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1562757.html b/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1562757.html index dd101a8bec4f..bd2f720feded 100644 --- a/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1562757.html +++ b/gfx/layers/apz/test/mochitest/helper_scroll_into_view_bug1562757.html @@ -2,7 +2,7 @@ - + Test for bug 1562757: "scroll into view" in iframe respects bounds on layout scroll position @@ -63,6 +63,7 @@ targetBounds.h = targetBounds.height; assertRectContainment(vvRect, "visual viewport", targetBounds, "iframe having the target element bounding rect"); } + SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0); waitUntilApzStable().then(runContinuation(test)).then(subtestDone); diff --git a/gfx/layers/apz/test/mochitest/helper_visual_smooth_scroll.html b/gfx/layers/apz/test/mochitest/helper_visual_smooth_scroll.html index 686327be654e..953db6e3c572 100644 --- a/gfx/layers/apz/test/mochitest/helper_visual_smooth_scroll.html +++ b/gfx/layers/apz/test/mochitest/helper_visual_smooth_scroll.html @@ -2,7 +2,7 @@ - + Tests that the (internal) visual smooth scrolling API is not restricted to the layout scroll range @@ -43,6 +43,7 @@ "The visual viewport should have scrolled past the layout scroll range"); } + SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0); waitUntilApzStable().then(runContinuation(test)).then(subtestDone); diff --git a/gfx/layers/apz/test/mochitest/test_group_zoom.html b/gfx/layers/apz/test/mochitest/test_group_zoom.html index 7cbed1c7f117..1a569d4789f6 100644 --- a/gfx/layers/apz/test/mochitest/test_group_zoom.html +++ b/gfx/layers/apz/test/mochitest/test_group_zoom.html @@ -63,13 +63,13 @@ var subtests = [ {"file": "helper_basic_onetouchpinch.html", "prefs": onetouchpinch_prefs}, {"file": "helper_zoom_prevented.html", "prefs": prefs}, {"file": "helper_zoomed_pan.html", "prefs": prefs}, - {"file": "helper_fixed_position_scroll_hittest.html", "prefs": meta_viewport_prefs}, + {"file": "helper_fixed_position_scroll_hittest.html", "prefs": prefs}, {"file": "helper_basic_doubletap_zoom.html", "prefs": doubletap_prefs}, {"file": "helper_onetouchpinch_nested.html", "prefs": onetouchpinch_prefs}, - {"file": "helper_visual_smooth_scroll.html", "prefs": meta_viewport_prefs}, - {"file": "helper_scroll_into_view_bug1516056.html", "prefs": meta_viewport_prefs}, - {"file": "helper_scroll_into_view_bug1562757.html", "prefs": meta_viewport_prefs}, - {"file": "helper_fixed_pos_displayport.html", "prefs": meta_viewport_prefs}, + {"file": "helper_visual_smooth_scroll.html", "prefs": prefs}, + {"file": "helper_scroll_into_view_bug1516056.html", "prefs": prefs}, + {"file": "helper_scroll_into_view_bug1562757.html", "prefs": prefs}, + {"file": "helper_fixed_pos_displayport.html", "prefs": prefs}, ]; if (isApzEnabled()) {