Bug 1431601 - Run meta viewport tests on Desktop. r=botond
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 15 Oct 2018 23:53:43 +0000
changeset 489749 02de107cdac4bcd2dc17d26bb2a70fc2662d4707
parent 489748 d455d8d93e2c6a24761dc7392b965d24aa42b1b5
child 489750 2e7851b166cebcab9f5df591f33bc8d234f1ff7c
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbotond
bugs1431601
milestone64.0a1
Bug 1431601 - Run meta viewport tests on Desktop. r=botond Depends on D8319 Differential Revision: https://phabricator.services.mozilla.com/D8320
dom/base/test/mochitest.ini
dom/base/test/test_meta_viewport5.html
dom/base/test/viewport_helpers.js
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -680,31 +680,23 @@ skip-if = (verify && (os == 'win' || os 
 [test_integer_attr_with_leading_zero.html]
 [test_intersectionobservers.html]
 [test_link_prefetch.html]
 skip-if = !e10s # Track Bug 1281415
 [test_link_preload.html]
 [test_link_stylesheet.html]
 [test_messagemanager_targetchain.html]
 [test_meta_viewport0.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport1.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport2.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport3.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport4.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport5.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport6.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_meta_viewport7.html]
-skip-if = (os != 'android')    # meta-viewport tag support is mobile-only
 [test_mozbrowser_apis_blocked.html]
 [test_mozMatchesSelector.html]
 [test_mutationobserver_anonymous.html]
 [test_mutationobservers.html]
 [test_named_frames.html]
 [test_navigator_hardwareConcurrency.html]
 [test_navigator_language.html]
 [test_navigatorPrefOverride.html]
--- a/dom/base/test/test_meta_viewport5.html
+++ b/dom/base/test/test_meta_viewport5.html
@@ -9,15 +9,17 @@
   <meta name="viewport" content="user-scalable=NO">
   <script src="viewport_helpers.js"></script>
 </head>
 <body>
   <p>user-scalable=NO</p>
   <script type="application/javascript">
     "use strict";
 
-    add_task(function test1() {
+    add_task(async function test1() {
+      await SpecialPowers.pushPrefEnv(scaleRatio(1.0));
+
       let info = getViewportInfo(800, 480);
       is(info.allowZoom, true, "user-scalable values are case-sensitive; 'NO' is not valid");
     });
   </script>
 </body>
 </html>
--- a/dom/base/test/viewport_helpers.js
+++ b/dom/base/test/viewport_helpers.js
@@ -1,10 +1,16 @@
 function scaleRatio(scale) {
-  return {"set": [["layout.css.devPixelsPerPx", "" + scale]]};
+  return {
+    "set": [
+      [ "layout.css.devPixelsPerPx", "" + scale ],
+      [ "apz.allow_zooming", true ],
+      [ "dom.meta-viewport.enabled", true ],
+    ]
+  };
 }
 
 function getViewportInfo(aDisplayWidth, aDisplayHeight) {
   let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {},
       width = {}, height = {}, autoSize = {};
 
   let cwu = SpecialPowers.getDOMWindowUtils(window);
   cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom,