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
This commit is contained in:
Botond Ballo 2020-01-14 00:22:30 +00:00
Родитель 8ef8a5826a
Коммит 5d070f7e85
6 изменённых файлов: 15 добавлений и 10 удалений

Просмотреть файл

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; minimum-scale=1.0; initial-scale=8.0">
<meta name="viewport" content="width=device-width; minimum-scale=1.0">
<title>position:fixed display port sizing</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
@ -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);
</script>
</body>

Просмотреть файл

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=2.0">
<meta name="viewport" content="width=device-width">
<title>Hittest position:fixed zoomed scroll</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
@ -47,6 +47,7 @@
is(e.target, input, "got click");
subtestDone();
});
SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0);
waitUntilApzStable().then(runContinuation(test));
</script>
</body>

Просмотреть файл

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=2.0">
<meta name="viewport" content="width=device-width">
<title>Test for bug 1516056: "scroll into view" respects bounds on layout scroll position</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
@ -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);
</script>
</body>

Просмотреть файл

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=2.0">
<meta name="viewport" content="width=device-width">
<title>Test for bug 1562757: "scroll into view" in iframe respects bounds on layout scroll position</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
@ -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);
</script>
</body>

Просмотреть файл

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=2.0">
<meta name="viewport" content="width=device-width, minimum-scale=1.0">
<title>Tests that the (internal) visual smooth scrolling API is not restricted to the layout scroll range</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
@ -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);
</script>
</body>

Просмотреть файл

@ -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()) {