Bug 1459260 - Don't use dom.meta-viewport.enabled in tests that don't need it. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 14 May 2019 02:15:09 +0000
changeset 473714 ab450513a15615bc3dd1ddf2db999424dc7531d6
parent 473713 db30d35f71305ef3440f98f1a4e6cb541cca314f
child 473715 9224b5e39c2e1e8132929a7be64a71c9531ddd2f
push id36012
push useraiakab@mozilla.com
push dateTue, 14 May 2019 09:42:36 +0000
treeherdermozilla-central@db99095ae0b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1459260
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1459260 - Don't use dom.meta-viewport.enabled in tests that don't need it. r=kats Many tests only had it enabled because it was required for zooming to work on desktop. This patch revises tests to only use it if they actually use a non- default meta viewport tag. The motivation is to bring test coverage closer to the platform defaults (so on desktop, tests will run with dom.meta-viewport.enabled=false, and on Android with dom.meta-viewport.enabled=true, matching the production scenarios). Depends on D30988 Differential Revision: https://phabricator.services.mozilla.com/D30989
gfx/layers/apz/test/mochitest/apz_test_utils.js
gfx/layers/apz/test/mochitest/test_group_minimum_scale_size.html
gfx/layers/apz/test/mochitest/test_group_touchevents-2.html
gfx/layers/apz/test/mochitest/test_group_touchevents-3.html
gfx/layers/apz/test/mochitest/test_group_touchevents-4.html
gfx/layers/apz/test/mochitest/test_group_touchevents.html
gfx/layers/apz/test/mochitest/test_group_zoom.html
--- a/gfx/layers/apz/test/mochitest/apz_test_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js
@@ -796,18 +796,16 @@ function getPrefs(ident) {
         // want those pans to turn into fling animations, so we increase the
         // fling min velocity requirement absurdly high.
         ["apz.fling_min_velocity_threshold", "10000"],
         // The helper_div_pan's div gets a displayport on scroll, but if the
         // test takes too long the displayport can expire before the new scroll
         // position is synced back to the main thread. So we disable displayport
         // expiry for these tests.
         ["apz.displayport_expiry_ms", 0],
-        // All of test cases should define viewport meta tag.
-        ["dom.meta-viewport.enabled", true],
       ];
     case "TOUCH_ACTION":
       return [
         ...getPrefs("TOUCH_EVENTS:PAN"),
         ["layout.css.touch_action.enabled", true],
         ["apz.test.fails_with_native_injection", getPlatform() == "windows"],
       ];
     default:
--- a/gfx/layers/apz/test/mochitest/test_group_minimum_scale_size.html
+++ b/gfx/layers/apz/test/mochitest/test_group_minimum_scale_size.html
@@ -22,18 +22,18 @@ const prefs = [
   // out of the test. So we disable displayport expiry for these tests.
   ["apz.displayport_expiry_ms", 0],
   // Prevent the dynamic toolbar from interfering with main-thread scroll
   // offset values.
   ["browser.chrome.dynamictoolbar", false],
   // Explicitly enable pinch-zooming, so this test can run on desktop
   // even though zooming isn't enabled by default on desktop yet.
   ["apz.allow_zooming", true],
-  // Pinch-zooming currently requires meta viewport support (this requirement
-  // will eventually be removed).
+  // Similarly, explicitly enable support for meta viewport tags (which the
+  // test cases use) so they're processed even on desktop.
   ["dom.meta-viewport.enabled", true],
   // We use the Visual Viewport API to tell the visual viewport offset.
   ["dom.visualviewport.enabled", true],
 ];
 
 const subtests = [
   { file: "helper_minimum_scale_1_0.html", prefs },
   { file: "helper_no_scalable_with_initial_scale.html", prefs },
--- a/gfx/layers/apz/test/mochitest/test_group_touchevents-2.html
+++ b/gfx/layers/apz/test/mochitest/test_group_touchevents-2.html
@@ -8,17 +8,16 @@
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
 var isWindows = getPlatform() == "windows";
 
 const shared_prefs = [
   ["apz.test.fails_with_native_injection", isWindows],
-  ["dom.meta-viewport.enabled", true],
   ["dom.w3c_touch_events.legacy_apis.enabled", true],
 ];
 
 var subtests = [
   // Taps on media elements to make sure the touchend event is delivered
   // properly. We increase the long-tap timeout to ensure it doesn't get trip
   // during the tap.
   // Also this test (on Windows) cannot satisfy the OS requirement of providing
--- a/gfx/layers/apz/test/mochitest/test_group_touchevents-3.html
+++ b/gfx/layers/apz/test/mochitest/test_group_touchevents-3.html
@@ -5,20 +5,21 @@
   <title>Various touch tests that spawn in new windows (3)</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
 var touch_action_prefs = getPrefs("TOUCH_ACTION");
+var with_meta_viewport = [...touch_action_prefs, ["dom.meta-viewport.enabled", true]];
 
 var subtests = [
   // Simple test to exercise touch-action CSS property
-  {"file": "helper_touch_action.html", "prefs": touch_action_prefs},
+  {"file": "helper_touch_action.html", "prefs": with_meta_viewport},
   // More complex touch-action tests, with overlapping regions and such
   {"file": "helper_touch_action_complex.html", "prefs": touch_action_prefs},
   // Tests that touch-action CSS properties are handled in APZ without waiting
   // on the main-thread, when possible
   {"file": "helper_touch_action_regions.html", "prefs": touch_action_prefs},
   // Tests that touch-action inside zero-opacity items are respected
   {"file": "helper_touch_action_zero_opacity_bug1500864.html", "prefs": touch_action_prefs},
 
--- a/gfx/layers/apz/test/mochitest/test_group_touchevents-4.html
+++ b/gfx/layers/apz/test/mochitest/test_group_touchevents-4.html
@@ -4,24 +4,24 @@
   <meta charset="utf-8">
   <title>Various touch tests that spawn in new windows (4)</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
-var basic_pan_prefs = getPrefs("TOUCH_EVENTS:PAN");
 var touch_action_prefs = getPrefs("TOUCH_ACTION");
 
 var subtests = [
   // clicking on element with :active::after CSS property
-  {"file": "helper_bug1473108.html", "prefs": [["dom.meta-viewport.enabled", true]]},
+  {"file": "helper_bug1473108.html"},
   // Resetting isFirstPaint shouldn't clobber the visual viewport
-  {"file": "helper_bug1509575.html", "prefs": basic_pan_prefs},
+  {"file": "helper_bug1509575.html", "prefs": [["dom.meta-viewport.enabled", true],
+                                               ...getPrefs("TOUCH_EVENTS:PAN")]},
   // Exercise one of the main-thread touch-action determination codepaths.
   {"file": "helper_bug1506497_touch_action_fixed_on_fixed.html", "prefs": touch_action_prefs},
   // Add new subtests here. If this starts timing out because it's taking too
   // long, create a test_group_touchevents-5.html file. Refer to 1423011#c57
   // for more details.
 ];
 
 if (isApzEnabled()) {
--- a/gfx/layers/apz/test/mochitest/test_group_touchevents.html
+++ b/gfx/layers/apz/test/mochitest/test_group_touchevents.html
@@ -13,29 +13,27 @@ var basic_pan_prefs = getPrefs("TOUCH_EV
 
 var subtests = [
   // Simple tests to exercise basic panning behaviour
   {"file": "helper_basic_pan.html", "prefs": basic_pan_prefs},
   {"file": "helper_div_pan.html", "prefs": basic_pan_prefs},
   {"file": "helper_iframe_pan.html", "prefs": basic_pan_prefs},
 
   // Simple test to exercise touch-tapping behaviour
-  {"file": "helper_tap.html", "prefs": [["dom.meta-viewport.enabled", true]]},
+  {"file": "helper_tap.html"},
   // Tapping, but with a full-zoom applied
-  {"file": "helper_tap_fullzoom.html", "prefs": [["dom.meta-viewport.enabled", true]]},
+  {"file": "helper_tap_fullzoom.html"},
 
   // For the following two tests, disable displayport suppression to make sure it
   // doesn't interfere with the test by scheduling paints non-deterministically.
   {"file": "helper_scrollto_tap.html?true",
-   "prefs": [["apz.paint_skipping.enabled", true],
-             ["dom.meta-viewport.enabled", true]],
+   "prefs": [["apz.paint_skipping.enabled", true]],
    "dp_suppression": false},
   {"file": "helper_scrollto_tap.html?false",
-   "prefs": [["apz.paint_skipping.enabled", false],
-             ["dom.meta-viewport.enabled", true]],
+   "prefs": [["apz.paint_skipping.enabled", false]],
    "dp_suppression": false},
 
   // Add new subtests to test_group_touch_events-4.html, not this file.
 ];
 
 if (isApzEnabled()) {
   ok(window.TouchEvent, "Check if TouchEvent is supported (it should be, the test harness forces it on everywhere)");
   if (getPlatform() == "android") {
--- a/gfx/layers/apz/test/mochitest/test_group_zoom.html
+++ b/gfx/layers/apz/test/mochitest/test_group_zoom.html
@@ -24,18 +24,18 @@ var prefs = [
   // out of the test. So we disable displayport expiry for these tests.
   ["apz.displayport_expiry_ms", 0],
   // Prevent the dynamic toolbar from interfering with main-thread scroll
   // offset values.
   ["browser.chrome.dynamictoolbar", false],
   // Explicitly enable pinch-zooming, so this test can run on desktop
   // even though zooming isn't enabled by default on desktop yet.
   ["apz.allow_zooming", true],
-  // Pinch-zooming currently requires meta viewport support (this requirement
-  // will eventually be removed).
+  // Similarly, explicitly enable support for meta viewport tags (which the
+  // test cases use) so they're processed even on desktop.
   ["dom.meta-viewport.enabled", true],
   // Increase the content response timeout because some tests do preventDefault
   // and we want to make sure APZ actually waits for them.
   ["apz.content_response_timeout", 60000],
 ];
 
 // Increase the tap timeouts so the double-tap is still detected in case of
 // random delays during testing.