Bug 1504659 Part 4: Update tests to distinguish between layout and visual viewports. r=botond
authorBrad Werth <bwerth@mozilla.com>
Wed, 16 Jan 2019 21:57:52 +0000
changeset 514156 ddc9999232d6692a0bd58d10e9a5b3dad77562c0
parent 514155 c017d1d148203aefcd7dd45aac08068c8005f17d
child 514157 d3d3222460fce87fc3dc53bdfd9794059b447c06
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1504659
milestone66.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 1504659 Part 4: Update tests to distinguish between layout and visual viewports. r=botond Testing the initial value of innerWidth and innerHeight is not really viable when the visual viewport has been set by the opener, but constrained by the device. The returned value differs between the desktop and mobile browsers because of the device constraints. The simplest thing to do is to test the CSS viewport and ensure that the innerWidth values can be set. Differential Revision: https://phabricator.services.mozilla.com/D15996
dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
dom/tests/mochitest/dom-level0/mochitest.ini
--- a/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
+++ b/dom/tests/mochitest/dom-level0/innerWidthHeight_script.html
@@ -1,29 +1,30 @@
 <!DOCTYPE html>
 <html>
 <head>
   <meta name="viewport" content="width=320,height=320" />
-  <title>Bug 602580 - Test getting and setting innerWidth and Height after using setCSSViewport</title>
+  <title>Bug 602580 - Test layout viewport and visual viewport sizes with meta tags and changed innerWidth</title>
   <script class="testbody" type="text/javascript">
   function runSubTest()
   {
+    /* CSS viewport is set the by the meta tag in this document. */
+    window.opener.is(document.documentElement.clientWidth, 320, "CSS viewport width is meta viewport width");
+    window.opener.is(document.documentElement.clientHeight, 320, "CSS viewport height is meta viewport height");
+
+    /* Visual viewport values can be changed by setting window.innerWidth and innerHeight. */
     var oldWidth = window.innerWidth;
     var oldHeight = window.innerHeight;
 
-    /* Test that return values are now from viewport */
-    window.opener.is(window.innerWidth, 320, "innerWidth is css viewport width");
-    window.opener.is(window.innerHeight, 320, "innerHeight is css viewport height");
-
     window.innerWidth = 300;
-    window.opener.is(window.innerWidth, 300, "innerWidth returns value that was set");
+    window.opener.is(window.innerWidth, 300, "visual viewport width returns set value");
     window.innerWidth = oldWidth;
 
     window.innerHeight = 300;
-    window.opener.is(window.innerHeight, 300, "innerHeight returns value that was set");
+    window.opener.is(window.innerHeight, 300, "visual viewport height returns set value");
     window.innerHeight = oldHeight;
 
     window.opener.finish();
   }
   </script>
 </head>
 <body onload="runSubTest()">
 </body>
--- a/dom/tests/mochitest/dom-level0/mochitest.ini
+++ b/dom/tests/mochitest/dom-level0/mochitest.ini
@@ -7,16 +7,15 @@ support-files =
   idn_child.html
   innerWidthHeight_script.html
   iframe1_location_setters.html
   iframe2_location_setters.html
   iframe3_location_setters.html
 
 [test_crossdomainprops.html]
 [test_innerWidthHeight_script.html]
-skip-if = toolkit == 'android' # Bug 1075071 - Permafail on Android
 [test_location.html]
 [test_location_framed.html]
 [test_location_getters.html]
 [test_location_sandboxed.html]
 [test_location_setters.html]
 [test_setting_document.domain_idn.html]
 [test_setting_document.domain_to_shortened_ipaddr.html]