Bug 1518999 - Trick contentful detection in some geckoview tests r=snorp,geckoview-reviewers,agi
authorSean Feng <sefeng@mozilla.com>
Tue, 27 Oct 2020 16:13:23 +0000
changeset 554732 0af7c44c8e72d3fea3793a83752c282dae2d43f7
parent 554731 b61d813af80df491c27dc3a84392b278342657ef
child 554733 412e728191535556e5514614ce1d01a226ac89b9
push id37898
push userabutkovits@mozilla.com
push dateWed, 28 Oct 2020 09:24:21 +0000
treeherdermozilla-central@83bf4fd3b1fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, geckoview-reviewers, agi
bugs1518999
milestone84.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 1518999 - Trick contentful detection in some geckoview tests r=snorp,geckoview-reviewers,agi Some geckoview tests require gradient usage. Since background images are async, these tests would wait for a contentful paint to make sure the images are decoded before running the assertions. This causes an issue because gradient-only backgrounds aren't contentful anymore according to the latest spec. We fix the tests by adding a transparent gif to the background image list to trick the contentful detection. Differential Revision: https://phabricator.services.mozilla.com/D88230
mobile/android/geckoview/src/androidTest/assets/www/colors.html
mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html
mobile/android/geckoview/src/androidTest/assets/www/scroll.html
mobile/android/geckoview/src/androidTest/assets/www/touch.html
mobile/android/geckoview/src/androidTest/assets/www/transparent.gif
--- a/mobile/android/geckoview/src/androidTest/assets/www/colors.html
+++ b/mobile/android/geckoview/src/androidTest/assets/www/colors.html
@@ -1,8 +1,14 @@
 <html>
     <head>
         <meta charset="utf-8">
         <title>Colours</title>
     </head>
-    <body style="overflow:hidden; height:100%; width:100%; margin: 0px; padding: 0px; background: linear-gradient(135deg, red, white);">
+    <!-- background contains one extra transparent.gif because we want trick the
+      contentful paint detection; We want to make sure the background is loaded
+      before the test starts so we always wait for the contentful paint timestamp
+      to exist, however, gradient isn't considered as contentful per spec, so Gecko
+      wouldn't generate a timestamp for it. Hence, we added a transparent gif
+      to the image list to trick the detection. !-->
+    <body style="overflow:hidden; height:100%; width:100%; margin: 0px; padding: 0px; background: url('/assets/www/transparent.gif'), linear-gradient(135deg, red, white);">
     </body>
 </html>
--- a/mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html
+++ b/mobile/android/geckoview/src/androidTest/assets/www/fixedbottom.html
@@ -1,10 +1,16 @@
 <html>
     <head>
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <title>Fixed bottom element</title>
     </head>
-    <body style="overflow:hidden; height:100%; width:100%; margin: 0px; padding: 0px; background: linear-gradient(135deg, blue, blue);">
+    <!-- background contains one extra transparent.gif because we want trick the
+      contentful paint detection; We want to make sure the background is loaded
+      before the test starts so we always wait for the contentful paint timestamp
+      to exist, however, gradient isn't considered as contentful per spec, so Gecko
+      wouldn't generate a timestamp for it. Hence, we added a transparent gif
+      to the image list to trick the detection. !-->
+    <body style="overflow:hidden; height:100%; width:100%; margin: 0px; padding: 0px; background: url('/assets/www/transparent.gif'), linear-gradient(135deg, blue, blue);">
         <div id="bottom-banner" style="width:100%;position:fixed;bottom:0;left:0;background-color:lime;height:10%;"></div>
     </body>
 </html>
--- a/mobile/android/geckoview/src/androidTest/assets/www/scroll.html
+++ b/mobile/android/geckoview/src/androidTest/assets/www/scroll.html
@@ -1,16 +1,22 @@
 <html>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=0.5">
     <style type="text/css">
 body {
    margin: 0;
-   background: linear-gradient(135deg, red, white);
+   /* background contains one extra transparent.gif because we want trick the
+      contentful paint detection; We want to make sure the background is loaded
+      before the test starts so we always wait for the contentful paint timestamp
+      to exist, however, gradient isn't considered as contentful per spec, so Gecko
+      wouldn't generate a timestamp for it. Hence, we added a transparent gif
+      to the image list to trick the detection. */
+   background: url('/assets/www/transparent.gif'), linear-gradient(135deg, red, white);
 }
 
 #one {
    background-color: red;
    width: 200vw;
    height: 100vh;
 }
 
--- a/mobile/android/geckoview/src/androidTest/assets/www/touch.html
+++ b/mobile/android/geckoview/src/androidTest/assets/www/touch.html
@@ -3,17 +3,23 @@
     <meta charset="utf-8">
     <meta name="viewport" content="height=device-height,width=device-width,initial-scale=1.0">
     <style type="text/css">
 body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0px;
-   background: linear-gradient(135deg, red, white);
+   /* background contains one extra transparent.gif because we want trick the
+      contentful paint detection; We want to make sure the background is loaded
+      before the test starts so we always wait for the contentful paint timestamp
+      to exist, however, gradient isn't considered as contentful per spec, so Gecko
+      wouldn't generate a timestamp for it. Hence, we added a transparent gif
+      to the image list to trick the detection. */
+   background: url('/assets/www/transparent.gif'), linear-gradient(135deg, red, white);
 }
 
 #one {
    background-color: red;
    width: 100%;
    height: 33vh;
 }
 
new file mode 100644
index 0000000000000000000000000000000000000000..e565824aafafe632011b281cba976baf8b3ba89a
GIT binary patch
literal 43
qc${<hbhEHbWMp7uXkcLY4+e@qSs1y10y+#p0Fq%~V)9{Rum%7ZWeN!Z