Bug 1633935 - P7 refactor bitmap test, r=jgilbert draft
authorJunior Hsu <juhsu@mozilla.com>
Wed, 27 May 2020 18:27:41 -0700
changeset 2927603 733f2ed3ebfc0ae2d7e079867b53abd448b32d77
parent 2927602 cf826c60e479b11da31242ed817ddfda3ed6a00c
child 2927604 e4d60accd539dc4569e9e14a8213f0a385d764cf
child 2953968 47704ba0396a0909eb989cb1c5739c6f309cf318
push id546254
push userjuhsu@mozilla.com
push dateSat, 30 May 2020 02:58:05 +0000
treeherdertry@6a275586f4e5 [default view] [failures only]
reviewersjgilbert
bugs1633935
milestone78.0a1
Bug 1633935 - P7 refactor bitmap test, r=jgilbert
dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js
--- a/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js
+++ b/dom/canvas/test/webgl-conf/checkout/js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js
@@ -381,30 +381,20 @@ function runImageBitmapTestInternal(bitm
             runTestOnBindingTargetImageBitmap(gl.TEXTURE_CUBE_MAP, program, cases, optionsVal,
                 internalFormat, pixelFormat, pixelType, gl, tiu, wtu);
         }
     }
 }
 
 function runImageBitmapTest(source, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D)
 {
-    var p1 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "premultiply"})
-                .then(cur => { cur.flipY = false; cur.premultiply = true; return cur; });
-    var p2 = createImageBitmap(source, {imageOrientation: "none", premultiplyAlpha: "none"})
-                .then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });
-    var p3 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "premultiply"})
-                .then(cur => { cur.flipY = true; cur.premultiply = true; return cur; });
-    var p4 = createImageBitmap(source, {imageOrientation: "flipY", premultiplyAlpha: "none"})
-                .then(cur => { cur.flipY = true; cur.premultiply = false; return cur; });
-    return Promise.all([p1, p2, p3, p4])
-        .catch( () => {
-            testPassed("createImageBitmap with options may be rejected if it is not supported. Retrying without options.");
-            var p = createImageBitmap(source)
-                .then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });
-            return Promise.all([p]);
-        }).then( bitmaps => {
+    var p = createImageBitmap(source)
+        .then(cur => { cur.flipY = false; cur.premultiply = false; return cur; });
+
+    return Promise.all([p])
+        .then( bitmaps => {
             bufferedLogToConsole("All createImageBitmap promises are resolved");
             runImageBitmapTestInternal(bitmaps, alphaVal, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, is3D);
         }, (e) => {
             // This will fail here when running from file:// instead of https://.
             testFailed("createImageBitmap(source) failed: \"" + e.message + "\"");
         });
 }