Bug 1503653 - Part 1. Implement WebP mochitests. r=tnikkel
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 31 Oct 2018 14:16:47 -0400
changeset 503014 0fff097ac71669d4f1a48b1d460892d5c5669aa0
parent 503012 fc68a2bccde267e01879e637f0ceec3168983039
child 503015 f8fefc9626c12c7e3f48bdd82baab9fc4edec345
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1503653
milestone65.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 1503653 - Part 1. Implement WebP mochitests. r=tnikkel Differential Revision: https://phabricator.services.mozilla.com/D8119
image/test/mochitest/clear.webp
image/test/mochitest/clear2.webp
image/test/mochitest/infinite.webp
image/test/mochitest/keep.webp
image/test/mochitest/mochitest.ini
image/test/mochitest/test_animation_operators.html
image/test/mochitest/test_discardAnimatedImage.html
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6db376d6e176f94b8d152f491a779370b3ea45bc
GIT binary patch
literal 202
zc$^FJbaOkzz`zjh>J$(bU=hIuWD5atG8j4fdHS*edH;cc5y<m((_w%Ch>8>j1}30B
zA7P+~e)0hc0d@gFK?b2i|NlC<{15H~>(Rs1!vNAF3f05FF7UViAA3W~hx+{j7ypMS
Hk!2GA*Dx&M
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e4a3e2efabe2c963cd186dcd064dd1fd139aa7ab
GIT binary patch
literal 228
zc$^FJbaT7Iz`zjh>J$(bU=hIuWD5atG6RDb1B0WVr!O0j_a6utfjnO~Jq8$nr~s;G
z0_yV-1&Zh=HwZDXU-;kgkG-Mg!~cCk7yoaO1naWGp-Ty>OMqYCv;1dy9@kuH!>9eL
z&Uhu<sc`*L&-B4d^KEB7$OH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y7!6n@Q
--- a/image/test/mochitest/mochitest.ini
+++ b/image/test/mochitest/mochitest.ini
@@ -41,34 +41,38 @@ support-files =
   bug1180105.sjs
   bug1180105-waiter.sjs
   bug1217571-iframe.html
   bug1217571.jpg
   bug1319025.png
   bug1319025-ref.png
   clear.gif
   clear.png
+  clear.webp
   clear2.gif
+  clear2.webp
   clear2-results.gif
   damon.jpg
   error-early.png
   filter-final.svg
   filter.svg
   first-frame-padding.gif
   green.png
   green-background.html
   grey.png
   ico-bmp-opaque.ico
   ico-bmp-transparent.ico
   iframe.html
   imgutils.js
+  infinite.webp
   infinite-apng.png
   invalid.jpg
   keep.gif
   keep.png
+  keep.webp
   lime100x100.svg
   lime-anim-100x100.svg
   lime-anim-100x100-2.svg
   lime-css-anim-100x100.svg
   opaque.bmp
   purple.gif
   rainbow.gif
   red.gif
@@ -87,16 +91,17 @@ support-files =
   webcam-simulacrum.sjs
   6M-pixels.png
   12M-pixels-1.png
   12M-pixels-2.png
 
 [test_animation.html]
 skip-if = os == 'android'
 [test_animation_operators.html]
+skip-if = os == 'android'
 [test_animation2.html]
 skip-if = os == 'android'
 [test_animSVGImage.html]
 skip-if = os == 'android' || os == 'win' # Bug 1370784
 [test_animSVGImage2.html]
 skip-if = os == 'android' || (webrender && os == 'win') #Bug 1354561
 [test_background_image_anim.html]
 skip-if = os == 'android'
--- a/image/test/mochitest/test_animation_operators.html
+++ b/image/test/mochitest/test_animation_operators.html
@@ -24,33 +24,36 @@ https://bugzilla.mozilla.org/show_bug.cg
 // (Note that we do _not_ poll the reference, so it must not be animated.)
 
 var gTests = [
   // IMPORTANT NOTE: For these tests, the test and reference are not
   // snapshotted in the same way.  The REFERENCE (second file) is
   // assumed to be complete when loaded, but we poll the TEST
   // (first file) until the test passes.
 
-  // Tests of the allowed disposal operators for both GIF and APNG: keep, clear,
+  // Tests of the allowed disposal operators for GIF, APNG and WebP: keep, clear,
   // and restore previous.
   "== green-background.html?clear.gif green.png",
   "== green-background.html?clear.png green.png",
+  "== green-background.html?clear.webp green.png",
   "== keep.gif green.png",
   "== keep.png green.png",
+  "== keep.webp green.png",
   "== restore-previous.gif green.png",
   "== restore-previous.png green.png",
 
   // Tests of the blending/compositing operators that only APNG supports.
   "== over.png grey.png",
   "!= source.png grey.png",
   "== bug900200.png bug900200-ref.png",
   "== bug1319025.png bug1319025-ref.png",
 
   // Test of subframe updates.
   "== clear2.gif clear2-results.gif",
+  "== clear2.webp clear2-results.gif",
 ];
 
 // Maintain a reference count of how many things we're waiting for until
 // we can say the tests are done.
 var gDelayCount = 0;
 function AddFinishDependency()
   { ++gDelayCount; }
 function RemoveFinishDependency()
@@ -140,20 +143,25 @@ function startTest(i)
     return iframe;
   }
 
   AddFinishDependency();
   var test = startIframe(testData.test);
   var reference = startIframe(testData.reference);
 }
 
+function runTests()
+{
+  // Run the tests.
+  for (var i = 0; i < gTests.length; ++i) {
+    startTest(i);
+  }
+}
+
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 
-// Run the tests.
-for (var i = 0; i < gTests.length; ++i) {
-  startTest(i);
-}
+SpecialPowers.pushPrefEnv({"set": [["image.webp.enabled", true]]}, runTests);
 
 </script>
 </pre>
 </body>
 </html>
--- a/image/test/mochitest/test_discardAnimatedImage.html
+++ b/image/test/mochitest/test_discardAnimatedImage.html
@@ -13,51 +13,55 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=686905">Mozilla Bug 686905</a>
 <p id="display"></p>
 <div id="content">
   <div id="container">
     <canvas id="canvas" width="100" height="100"></canvas>
     <img id="infinitepng" src="infinite-apng.png">
     <img id="infinitegif" src="animated1.gif">
+    <img id="infinitewebp" src="infinite.webp">
     <img id="finitepng" src="restore-previous.png">
     <img id="finitegif" src="animated-gif.gif">
+    <img id="finitewebp" src="keep.webp">
   </div>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 686905. **/
 SimpleTest.waitForExplicitFinish();
 
 var gFinished = false;
 
 var gNumDiscards = 0;
 
 window.onload = function() {
   // Enable discarding for the test.
   SpecialPowers.pushPrefEnv({
-    'set':[['image.mem.discardable',true]]
+    'set':[['image.mem.discardable',true],
+           ['image.webp.enabled',true]]
   }, runTest);
 }
 
-var gImgs = ['infinitepng', 'infinitegif', 'finitepng', 'finitegif'];
+var gImgs = ['infinitepng', 'infinitegif', 'infinitewebp',
+             'finitepng',   'finitegif',   'finitewebp'];
 // If we are currently counting frame updates.
 var gCountingFrameUpdates = false;
 // The number of frame update notifications for the images in gImgs that happen
 // after discarding. (The last two images are finite looping so we don't expect
 // them to get incremented but it's possible if they don't finish their
 // animation before we discard them.)
-var gNumFrameUpdates = [0, 0, 0, 0];
+var gNumFrameUpdates = [0, 0, 0, 0, 0, 0];
 // The last snapshot of the image. Used to check that the image actually changes.
-var gLastSnapShot = [null, null, null, null];
+var gLastSnapShot = [null, null, null, null, null, null];
 // Number of observed changes in the snapshot.
-var gNumSnapShotChanges = [0, 0, 0, 0];
+var gNumSnapShotChanges = [0, 0, 0, 0, 0, 0];
 // If we've removed the observer.
-var gRemovedObserver = [false, false, false, false];
+var gRemovedObserver = [false, false, false, false, false, false];
 
 // 2 would probably be a good enough test, we arbitrarily choose 4.
 var kNumFrameUpdatesToExpect = 4;
 
 function runTest() {
   var animatedDiscardable =
     SpecialPowers.getBoolPref('image.mem.animated.discardable');
   if (!animatedDiscardable) {