Bug 1504659 Part 4: Update tests to distinguish between layout and visual viewports. r=botond
☠☠ backed out by 73cd4b7b53ba ☠ ☠
authorBrad Werth <bwerth@mozilla.com>
Mon, 14 Jan 2019 20:08:43 +0000
changeset 510982 783f7ccbd7972fce5def1b7a416a9234fa8ef434
parent 510981 231b16b0091e96e1aa15cd34c2a9367df8f4d1b8
child 510983 749c9dcbbd7f7d8146a71d8cb2a1acb07db1b8c7
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [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]