Title: [226512] trunk/LayoutTests
Revision
226512
Author
ms2...@igalia.com
Date
2018-01-08 07:55:14 -0800 (Mon, 08 Jan 2018)

Log Message

Update imagebitmap tests.
https://bugs.webkit.org/show_bug.cgi?id=181379

Unreviewed test gardening.


LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/common.js:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html:

LayoutTests:

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226511 => 226512)


--- trunk/LayoutTests/ChangeLog	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/ChangeLog	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,3 +1,15 @@
+2018-01-08  Ms2ger  <ms2...@igalia.com>
+
+        Update imagebitmap tests.
+        https://bugs.webkit.org/show_bug.cgi?id=181379
+
+        Unreviewed test gardening.
+
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
+
 2018-01-08  Youenn Fablet  <you...@apple.com>
 
         navigator.onLine does not work inside service workers

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,3 +1,16 @@
+2018-01-08  Ms2ger  <ms2...@igalia.com>
+
+        Update imagebitmap tests.
+        https://bugs.webkit.org/show_bug.cgi?id=181379
+
+        Unreviewed test gardening.
+
+        * web-platform-tests/2dcontext/imagebitmap/common.js:
+        * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
+        * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html:
+        * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
+        * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html:
+
 2018-01-07  Ms2ger  <ms2...@igalia.com>
 
         Implement createImageBitmap(ImageBitmap)

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/common.js (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/common.js	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/common.js	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,58 +1,107 @@
-function testCanvasDisplayingPattern(canvas)
-{
-    var tolerance = 5; // for creating ImageBitmap from a video, the tolerance needs to be high
-    _assertPixelApprox(canvas, 5,5, 255,0,0,255, "5,5", "255,0,0,255", tolerance);
-    _assertPixelApprox(canvas, 15,5, 0,255,0,255, "15,5", "0,255,0,255", tolerance);
-    _assertPixelApprox(canvas, 5,15, 0,0,255,255, "5,15", "0,0,255,255", tolerance);
-    _assertPixelApprox(canvas, 15,15, 0,0,0,255, "15,15", "0,0,0,255", tolerance);
+function makeCanvas() {
+    return new Promise(resolve => {
+        var testCanvas = document.createElement("canvas");
+        testCanvas.width = 20;
+        testCanvas.height = 20;
+        var testCtx = testCanvas.getContext("2d");
+        testCtx.fillStyle = "rgb(255, 0, 0)";
+        testCtx.fillRect(0, 0, 10, 10);
+        testCtx.fillStyle = "rgb(0, 255, 0)";
+        testCtx.fillRect(10, 0, 10, 10);
+        testCtx.fillStyle = "rgb(0, 0, 255)";
+        testCtx.fillRect(0, 10, 10, 10);
+        testCtx.fillStyle = "rgb(0, 0, 0)";
+        testCtx.fillRect(10, 10, 10, 10);
+        resolve(testCanvas);
+    });
 }
 
-function testDrawImageBitmap(source)
-{
-    var canvas = document.createElement("canvas");
-    canvas.width = 20;
-    canvas.height = 20;
-    var ctx = canvas.getContext("2d");
-    ctx.clearRect(0, 0, canvas.width, canvas.height);
-    return createImageBitmap(source).then(imageBitmap => {
-        ctx.drawImage(imageBitmap, 0, 0);
-        testCanvasDisplayingPattern(canvas);
+function makeOffscreenCanvas() {
+    return new Promise(resolve => {
+        let canvas = new OffscreenCanvas(20, 20);
+        var testCtx = canvas.getContext("2d");
+        testCtx.fillStyle = "rgb(255, 0, 0)";
+        testCtx.fillRect(0, 0, 10, 10);
+        testCtx.fillStyle = "rgb(0, 255, 0)";
+        testCtx.fillRect(10, 0, 10, 10);
+        testCtx.fillStyle = "rgb(0, 0, 255)";
+        testCtx.fillRect(0, 10, 10, 10);
+        testCtx.fillStyle = "rgb(0, 0, 0)";
+        testCtx.fillRect(10, 10, 10, 10);
+        resolve(canvas);
     });
 }
 
-function initializeTestCanvas(testCanvas)
-{
-    testCanvas.width = 20;
-    testCanvas.height = 20;
-    var testCtx = testCanvas.getContext("2d");
-    testCtx.fillStyle = "rgb(255, 0, 0)";
-    testCtx.fillRect(0, 0, 10, 10);
-    testCtx.fillStyle = "rgb(0, 255, 0)";
-    testCtx.fillRect(10, 0, 10, 10);
-    testCtx.fillStyle = "rgb(0, 0, 255)";
-    testCtx.fillRect(0, 10, 10, 10);
-    testCtx.fillStyle = "rgb(0, 0, 0)";
-    testCtx.fillRect(10, 10, 10, 10);
+function makeVideo() {
+    return new Promise(function(resolve, reject) {
+        var video = document.createElement("video");
+        video._oncanplaythrough_ = function() {
+            resolve(video);
+        };
+        video.src = ""
+    });
 }
 
-function initializeImageData(imgData, width, height)
-{
-    for (var i = 0; i < width * height * 4; i+=4) {
-        imgData.data[i] = 0;
-        imgData.data[i + 1] = 0;
-        imgData.data[i + 2] = 0;
-        imgData.data[i + 3] = 255; //alpha channel: 255
-    }
-    var halfWidth = width/2;
-    var halfHeight = height/2;
-    // initialize to R, G, B, Black, with each one 10*10 pixels
-    for (var i = 0; i < halfHeight; i++)
-        for (var j = 0; j < halfWidth; j++)
-            imgData.data[i * width * 4 + j * 4] = 255;
-    for (var i = 0; i < halfHeight; i++)
-        for (var j = halfWidth; j < width; j++)
-            imgData.data[i * width * 4 + j * 4 + 1] = 255;
-    for (var i = halfHeight; i < height; i++)
-        for (var j = 0; j < halfWidth; j++)
-            imgData.data[i * width * 4 + j * 4 + 2] = 255;
+function makeImage() {
+    return new Promise(resolve => {
+        var img = new Image();
+        img._onload_ = function() {
+            resolve(img);
+        };
+        img.src = ""
+    });
 }
+
+function makeImageData() {
+    return new Promise(function(resolve, reject) {
+        var width = 20, height = 20;
+        var imgData = new ImageData(width, height);
+        for (var i = 0; i < width * height * 4; i += 4) {
+            imgData.data[i] = 0;
+            imgData.data[i + 1] = 0;
+            imgData.data[i + 2] = 0;
+            imgData.data[i + 3] = 255; //alpha channel: 255
+        }
+        var halfWidth = width / 2;
+        var halfHeight = height / 2;
+        // initialize to R, G, B, Black, with each one 10*10 pixels
+        for (var i = 0; i < halfHeight; i++)
+            for (var j = 0; j < halfWidth; j++)
+                imgData.data[i * width * 4 + j * 4] = 255;
+        for (var i = 0; i < halfHeight; i++)
+            for (var j = halfWidth; j < width; j++)
+                imgData.data[i * width * 4 + j * 4 + 1] = 255;
+        for (var i = halfHeight; i < height; i++)
+            for (var j = 0; j < halfWidth; j++)
+                imgData.data[i * width * 4 + j * 4 + 2] = 255;
+        resolve(imgData);
+    });
+}
+
+function makeImageBitmap() {
+    return makeCanvas().then(canvas => {
+        return createImageBitmap(canvas);
+    });
+}
+
+function makeBlob() {
+    return new Promise(function(resolve, reject) {
+        var xhr = new XMLHttpRequest();
+        xhr.open("GET", '/images/pattern.png');
+        xhr.responseType = 'blob';
+        xhr.send();
+        xhr._onload_ = function() {
+            resolve(xhr.response);
+        };
+    });
+}
+
+var imageSourceTypes = [
+    { name: 'an HTMLCanvasElement', factory: makeCanvas },
+    { name: 'an HTMLVideoElement',  factory: makeVideo },
+    { name: 'an HTMLImageElement',  factory: makeImage },
+    { name: 'an OffscreenCanvas',   factory: makeOffscreenCanvas },
+    { name: 'an ImageData',         factory: makeImageData },
+    { name: 'an ImageBitmap',       factory: makeImageBitmap },
+    { name: 'a Blob',               factory: makeBlob },
+];

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,10 +1,18 @@
 
 Harness Error (TIMEOUT), message = null
 
-PASS createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap 
-FAIL createImageBitmap from a Blob, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented"
-PASS createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap 
-PASS createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
-FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
-TIMEOUT createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap Test timed out
+PASS createImageBitmap from an HTMLCanvasElement, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an HTMLCanvasElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+TIMEOUT createImageBitmap from an HTMLVideoElement, and drawImage on the created ImageBitmap Test timed out
+NOTRUN createImageBitmap from an HTMLVideoElement with negative sw/sh, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an HTMLImageElement, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an HTMLImageElement with negative sw/sh, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an ImageData, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an ImageData with negative sw/sh, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from a Blob, and drawImage on the created ImageBitmap 
+NOTRUN createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html	2018-01-08 15:55:14 UTC (rev 226512)
@@ -8,68 +8,41 @@
 <link rel="stylesheet" href=""
 <body>
 <script>
-(function() {
-    promise_test(function() {
-        return new Promise(function(resolve, reject) {
-            var img = new Image();
-            img._onload_ = function() { resolve(img); };
-            img.src = ""
-        }).then(function(img) {
-            return testDrawImageBitmap(img);
-        });
-    }, "createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap");
+function testCanvasDisplayingPattern(canvas)
+{
+    var tolerance = 5; // for creating ImageBitmap from a video, the tolerance needs to be high
+    _assertPixelApprox(canvas, 5,5, 255,0,0,255, "5,5", "255,0,0,255", tolerance);
+    _assertPixelApprox(canvas, 15,5, 0,255,0,255, "15,5", "0,255,0,255", tolerance);
+    _assertPixelApprox(canvas, 5,15, 0,0,255,255, "5,15", "0,0,255,255", tolerance);
+    _assertPixelApprox(canvas, 15,15, 0,0,0,255, "15,15", "0,0,0,255", tolerance);
+}
 
-    promise_test(function() {
-        return new Promise(function(resolve, reject) {
-            var xhr = new XMLHttpRequest();
-            xhr.open("GET", '/images/pattern.png');
-            xhr.responseType = 'blob';
-            xhr.send();
-            xhr._onload_ = function() {
-                blob = xhr.response;
-                resolve(blob);
-            };
-        }).then(function(blob) {
-            return testDrawImageBitmap(blob);
-        });
-    }, "createImageBitmap from a Blob, and drawImage on the created ImageBitmap");
+function testDrawImageBitmap(source, args = [])
+{
+    var canvas = document.createElement("canvas");
+    canvas.width = 20;
+    canvas.height = 20;
+    var ctx = canvas.getContext("2d");
+    ctx.clearRect(0, 0, canvas.width, canvas.height);
+    return createImageBitmap(source, ...args).then(imageBitmap => {
+        ctx.drawImage(imageBitmap, 0, 0);
+        testCanvasDisplayingPattern(canvas);
+    });
+}
 
+for (let { name, factory } of imageSourceTypes) {
     promise_test(function() {
-        var testCanvas = document.createElement("canvas");
-        initializeTestCanvas(testCanvas);
-        return testDrawImageBitmap(testCanvas);
-    }, "createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap");
-
-    promise_test(function() {
-        var testCanvas = document.createElement("canvas");
-        initializeTestCanvas(testCanvas);
-        return new Promise(function(resolve, reject) {
-            createImageBitmap(testCanvas).then(function(bitmap) {
-                resolve(bitmap);
-            });
-        }).then(function(bitmap) {
-            return testDrawImageBitmap(bitmap);
+        return factory().then(function(img) {
+            return testDrawImageBitmap(img);
         });
-    }, "createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap");
+    }, `createImageBitmap from ${name}, and drawImage on the created ImageBitmap`);
 
     promise_test(function() {
-        var imgData = new ImageData(20, 20);
-        initializeImageData(imgData, 20, 20);
-        return testDrawImageBitmap(imgData);
-    }, "createImageBitmap from an ImageData, and drawImage on the created ImageBitmap");
-
-    promise_test(function() {
-        return new Promise(function(resolve, reject) {
-            var video = document.createElement("video");
-            video._oncanplaythrough_ = function() {
-                resolve(video);
-            };
-            video.src = ""
-        }).then(function(video) {
-            return testDrawImageBitmap(video);
+        return factory().then(function(img) {
+            return testDrawImageBitmap(img, [20, 20, -20, -20]);
         });
-    }, "createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap");
-})();
+    }, `createImageBitmap from ${name} with negative sw/sh, and drawImage on the created ImageBitmap`);
+}
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,32 +1,35 @@
 
 Harness Error (TIMEOUT), message = null
 
-PASS createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLImageElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLImageElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-TIMEOUT createImageBitmap with a HTMLVideoElement source and sw set to 0 rejects with a RangeError. Test timed out
-NOTRUN createImageBitmap with a HTMLVideoElement source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a HTMLVideoElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with a HTMLCanvasElement source and sw set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a HTMLCanvasElement source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a HTMLCanvasElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with a OffscreenCanvas source and sw set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a OffscreenCanvas source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a OffscreenCanvas source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with a ImageData source and sw set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a ImageData source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a ImageData source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with a ImageBitmap source and sw set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a ImageBitmap source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a ImageBitmap source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with a Blob source and sw set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a Blob source and sh set to 0 rejects with a RangeError. 
-NOTRUN createImageBitmap with a Blob source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. 
-NOTRUN createImageBitmap with undefined image source rejects with a TypeError. 
-NOTRUN createImageBitmap with null image source rejects with a TypeError. 
-NOTRUN createImageBitmap with empty image source rejects with a InvalidStateError. 
-NOTRUN createImageBitmap with empty video source rejects with a InvalidStateError. 
-NOTRUN createImageBitmap with an oversized canvas source rejects with a RangeError. 
-NOTRUN createImageBitmap with an invalid OffscreenCanvas source rejects with a RangeError. 
-NOTRUN createImageBitmap with an undecodable blob source rejects with an InvalidStateError. 
+PASS createImageBitmap with a an HTMLCanvasElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLCanvasElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLCanvasElement source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+TIMEOUT createImageBitmap with a an HTMLVideoElement source and sw set to 0 Test timed out
+NOTRUN createImageBitmap with a an HTMLVideoElement source and sh set to 0 
+NOTRUN createImageBitmap with a an HTMLVideoElement source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with a an HTMLImageElement source and sw set to 0 
+NOTRUN createImageBitmap with a an HTMLImageElement source and sh set to 0 
+NOTRUN createImageBitmap with a an HTMLImageElement source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with a an OffscreenCanvas source and sw set to 0 
+NOTRUN createImageBitmap with a an OffscreenCanvas source and sh set to 0 
+NOTRUN createImageBitmap with a an OffscreenCanvas source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with a an ImageData source and sw set to 0 
+NOTRUN createImageBitmap with a an ImageData source and sh set to 0 
+NOTRUN createImageBitmap with a an ImageData source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with a an ImageBitmap source and sw set to 0 
+NOTRUN createImageBitmap with a an ImageBitmap source and sh set to 0 
+NOTRUN createImageBitmap with a an ImageBitmap source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with a a Blob source and sw set to 0 
+NOTRUN createImageBitmap with a a Blob source and sh set to 0 
+NOTRUN createImageBitmap with a a Blob source and oversized (unallocatable) crop region 
+NOTRUN createImageBitmap with undefined image source. 
+NOTRUN createImageBitmap with null image source. 
+NOTRUN createImageBitmap with empty image source. 
+NOTRUN createImageBitmap with empty video source. 
+NOTRUN createImageBitmap with an oversized canvas source. 
+NOTRUN createImageBitmap with an invalid OffscreenCanvas source. 
+NOTRUN createImageBitmap with an undecodable blob source. 
+NOTRUN createImageBitmap with a broken image source. 
+NOTRUN createImageBitmap with an available but undecodable image source. 
+NOTRUN createImageBitmap with a closed ImageBitmap. 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html (226511 => 226512)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,28 +1,9 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
+<!doctype html>
 <script src=""
 <script src=""
-</head>
-<body>
+<script src=""
 <script>
 
-function makeCanvas() {
-  return new Promise(resolve => {
-    let canvas = document.createElement('canvas');
-    canvas.setAttribute('width', '10');
-    canvas.setAttribute('height', '10');
-    resolve(canvas);
-  });
-}
-
-function makeOffscreenCanvas() {
-  return new Promise(resolve => {
-    let canvas = new OffscreenCanvas(10, 10);
-    resolve(canvas);
-  });
-}
-
 function makeOversizedCanvas() {
 
   return new Promise(resolve => {
@@ -40,66 +21,32 @@
   });
 }
 
-function makeVideo() {
+function makeInvalidBlob() {
   return new Promise(resolve => {
-    let video = document.createElement('video');
-    video.addEventListener('canplaythrough', resolve.bind(undefined, video), false);
-    video.src = '';
+    resolve(new Blob()); // Blob with no data cannot be decoded.
   });
 }
 
-function makeImage() {
-  return makeCanvas().then(canvas => {
-    let image = new Image();
-    image.src = ""
-    return new Promise(resolve => {
-      image._onload_ = resolve.bind(undefined, image);
-    });
+function makeBrokenImage() {
+  return new Promise(resolve => {
+    const image = new Image();
+    image.src = ""
+    image._onerror_ = () => resolve(image);
   });
 }
 
-function makeImageData() {
-  return makeCanvas().then(canvas => {
-    return new Promise(function(resolve, reject) {
-      resolve(canvas.getContext('2d').getImageData(0, 0, 10, 10));
-    });
+function makeAvailableButBrokenImage() {
+  return new Promise((resolve, reject) => {
+    const image = new Image();
+    image.src = ""
+    image._onload_ = () => resolve(image);
+    image._onerror_ = reject;
   });
 }
 
-function makeImageBitmap() {
-  return makeCanvas().then(canvas => {
-    return createImageBitmap(canvas);
-  });
-}
-
-function makeBlob() {
-  return makeCanvas().then(canvas => {
-    return new Promise(resolve => {
-      canvas.toBlob(resolve);
-    });
-  });
-}
-
-function makeInvalidBlob() {
-  return new Promise(resolve => {
-    resolve(new Blob()); // Blob with no data cannot be decoded.
-  });
-}
-
-imageSourceTypes = [
-  { name: 'HTMLImageElement',  factory: makeImage },
-  { name: 'HTMLVideoElement',  factory: makeVideo },
-  { name: 'HTMLCanvasElement', factory: makeCanvas },
-  { name: 'OffscreenCanvas',   factory: makeOffscreenCanvas },
-  { name: 'ImageData',         factory: makeImageData },
-  { name: 'ImageBitmap',       factory: makeImageBitmap },
-  { name: 'Blob',              factory: makeBlob },
-];
-
 testCases = [
   {
-    description: 'createImageBitmap with a <sourceType> source and sw set to ' +
-        '0 rejects with a RangeError.',
+    description: 'createImageBitmap with a <sourceType> source and sw set to 0',
     promiseTestFunction:
       (source, t) => {
         return promise_rejects(t, new RangeError(),
@@ -107,8 +54,7 @@
       }
   },
   {
-    description: 'createImageBitmap with a <sourceType> source and sh set to ' +
-        '0 rejects with a RangeError.',
+    description: 'createImageBitmap with a <sourceType> source and sh set to 0',
     promiseTestFunction:
       (source, t) => {
         return promise_rejects(t, new RangeError(),
@@ -118,10 +64,11 @@
   {
     // This case is not explicitly documented in the specification for
     // createImageBitmap, but it is expected that internal failures cause
+    // InvalidStateError.
     //
+    // Note: https://bugs.chromium.org/p/chromium/issues/detail?id=799025
     description: 'createImageBitmap with a <sourceType> source and oversized ' +
-        '(unallocatable) crop region rejects with an InvalidStateError ' +
-        'DOMException.',
+        '(unallocatable) crop region',
     promiseTestFunction:
       (source, t) => {
         return promise_rejects(t, new DOMException('', 'InvalidStateError'),
@@ -145,43 +92,61 @@
 
 promise_test( t => {
   return promise_rejects(t, new TypeError(), createImageBitmap(undefined));
-}, "createImageBitmap with undefined image source rejects with a TypeError.");
+}, "createImageBitmap with undefined image source.");
 
 promise_test( t => {
   return promise_rejects(t, new TypeError(), createImageBitmap(null));
-}, "createImageBitmap with null image source rejects with a TypeError.");
+}, "createImageBitmap with null image source.");
 
 promise_test( t => {
-  return promise_rejects(t, new DOMException('', 'InvalidStateError'),
+  return promise_rejects(t, "InvalidStateError",
     createImageBitmap(new Image()));
-}, "createImageBitmap with empty image source rejects with a InvalidStateError.");
+}, "createImageBitmap with empty image source.");
 
 promise_test( t => {
-  return promise_rejects(t, new DOMException('', 'InvalidStateError'),
+  return promise_rejects(t, "InvalidStateError",
     createImageBitmap(document.createElement('video')));
-}, "createImageBitmap with empty video source rejects with a InvalidStateError.");
+}, "createImageBitmap with empty video source.");
 
 promise_test( t => {
   return makeOversizedCanvas().then(canvas => {
-    return promise_rejects(t, new DOMException('', 'InvalidStateError'),
+    return promise_rejects(t, "InvalidStateError",
         createImageBitmap(canvas));
   });
-}, "createImageBitmap with an oversized canvas source rejects with a RangeError.");
+}, "createImageBitmap with an oversized canvas source.");
 
 promise_test( t => {
   return makeOversizedOffscreenCanvas().then(offscreenCanvas => {
-    return promise_rejects(t, new DOMException('', 'InvalidStateError'),
+    return promise_rejects(t, "InvalidStateError",
         createImageBitmap(offscreenCanvas));
   });
-}, "createImageBitmap with an invalid OffscreenCanvas source rejects with a RangeError.");
+}, "createImageBitmap with an invalid OffscreenCanvas source.");
 
 promise_test( t => {
   return makeInvalidBlob().then(blob => {
-    return promise_rejects(t, new DOMException('', 'InvalidStateError'),
+    return promise_rejects(t, "InvalidStateError",
         createImageBitmap(blob));
   });
-}, "createImageBitmap with an undecodable blob source rejects with an InvalidStateError.");
+}, "createImageBitmap with an undecodable blob source.");
 
+promise_test( t => {
+  return makeBrokenImage().then(image => {
+    return promise_rejects(t, "InvalidStateError",
+        createImageBitmap(image));
+  });
+}, "createImageBitmap with a broken image source.");
+
+promise_test( t => {
+  return makeAvailableButBrokenImage().then(image => {
+    return promise_rejects(t, "InvalidStateError",
+        createImageBitmap(image));
+  });
+}, "createImageBitmap with an available but undecodable image source.");
+
+promise_test( t => {
+  return makeImageBitmap().then(bitmap => {
+    bitmap.close()
+    return promise_rejects(t, "InvalidStateError", createImageBitmap(bitmap));
+  });
+}, "createImageBitmap with a closed ImageBitmap.");
 </script>
-</body>
-</html>

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt (226511 => 226512)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,8 +1,16 @@
 
-PASS createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an HTMLCanvasElement, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an HTMLCanvasElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+FAIL createImageBitmap from an HTMLVideoElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with HTMLVideoElement is not implemented"
+FAIL createImageBitmap from an HTMLVideoElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+PASS createImageBitmap from an HTMLImageElement, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an HTMLImageElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+FAIL createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
+FAIL createImageBitmap from an ImageData with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+PASS createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
 FAIL createImageBitmap from a Blob, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented"
-PASS createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap 
-PASS createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
-FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
-FAIL createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with HTMLVideoElement is not implemented"
+FAIL createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
 

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt (226511 => 226512)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,31 +1,34 @@
-CONSOLE MESSAGE: line 167: Canvas area exceeds the maximum limit (width * height > 268435456).
+CONSOLE MESSAGE: line 114: Canvas area exceeds the maximum limit (width * height > 268435456).
 
-PASS createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLImageElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLImageElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS createImageBitmap with a HTMLVideoElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLVideoElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLVideoElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a HTMLCanvasElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLCanvasElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLCanvasElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL createImageBitmap with a OffscreenCanvas source and sw set to 0 rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
-FAIL createImageBitmap with a OffscreenCanvas source and sh set to 0 rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
-FAIL createImageBitmap with a OffscreenCanvas source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a ImageData source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a ImageData source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a ImageData source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a ImageBitmap source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a ImageBitmap source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a ImageBitmap source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS createImageBitmap with a Blob source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a Blob source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a Blob source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with undefined image source rejects with a TypeError. 
-PASS createImageBitmap with null image source rejects with a TypeError. 
-PASS createImageBitmap with empty image source rejects with a InvalidStateError. 
-FAIL createImageBitmap with empty video source rejects with a InvalidStateError. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with an oversized canvas source rejects with a RangeError. 
-FAIL createImageBitmap with an invalid OffscreenCanvas source rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-FAIL createImageBitmap with an undecodable blob source rejects with an InvalidStateError. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an HTMLCanvasElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLCanvasElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLCanvasElement source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS createImageBitmap with a an HTMLVideoElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLVideoElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLVideoElement source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an HTMLImageElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLImageElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLImageElement source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+FAIL createImageBitmap with a an OffscreenCanvas source and sw set to 0 promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap with a an OffscreenCanvas source and sh set to 0 promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap with a an OffscreenCanvas source and oversized (unallocatable) crop region promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+PASS createImageBitmap with a an ImageData source and sw set to 0 
+PASS createImageBitmap with a an ImageData source and sh set to 0 
+FAIL createImageBitmap with a an ImageData source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an ImageBitmap source and sw set to 0 
+PASS createImageBitmap with a an ImageBitmap source and sh set to 0 
+FAIL createImageBitmap with a an ImageBitmap source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS createImageBitmap with a a Blob source and sw set to 0 
+PASS createImageBitmap with a a Blob source and sh set to 0 
+FAIL createImageBitmap with a a Blob source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with undefined image source. 
+PASS createImageBitmap with null image source. 
+PASS createImageBitmap with empty image source. 
+FAIL createImageBitmap with empty video source. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+PASS createImageBitmap with an oversized canvas source. 
+FAIL createImageBitmap with an invalid OffscreenCanvas source. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL createImageBitmap with an undecodable blob source. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+PASS createImageBitmap with a broken image source. 
+FAIL createImageBitmap with an available but undecodable image source. promise_test: Unhandled rejection with value: object "[object Event]"
+PASS createImageBitmap with a closed ImageBitmap. 
 

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt (226511 => 226512)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,8 +1,16 @@
 
-PASS createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an HTMLCanvasElement, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an HTMLCanvasElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+FAIL createImageBitmap from an HTMLVideoElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with HTMLVideoElement is not implemented"
+FAIL createImageBitmap from an HTMLVideoElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+PASS createImageBitmap from an HTMLImageElement, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an HTMLImageElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+FAIL createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
+FAIL createImageBitmap from an ImageData with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
+PASS createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
 FAIL createImageBitmap from a Blob, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented"
-PASS createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap 
-PASS createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap 
-FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
-FAIL createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with HTMLVideoElement is not implemented"
+FAIL createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "RangeError: Cannot create ImageBitmap with a negative width or height"
 

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt (226511 => 226512)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:00:38 UTC (rev 226511)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2018-01-08 15:55:14 UTC (rev 226512)
@@ -1,31 +1,34 @@
-CONSOLE MESSAGE: line 167: Canvas area exceeds the maximum limit (width * height > 268435456).
+CONSOLE MESSAGE: line 114: Canvas area exceeds the maximum limit (width * height > 268435456).
 
-PASS createImageBitmap with a HTMLImageElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLImageElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLImageElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS createImageBitmap with a HTMLVideoElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLVideoElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLVideoElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a HTMLCanvasElement source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a HTMLCanvasElement source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a HTMLCanvasElement source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-FAIL createImageBitmap with a OffscreenCanvas source and sw set to 0 rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
-FAIL createImageBitmap with a OffscreenCanvas source and sh set to 0 rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "RangeError" ("RangeError")
-FAIL createImageBitmap with a OffscreenCanvas source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a ImageData source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a ImageData source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a ImageData source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with a ImageBitmap source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a ImageBitmap source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a ImageBitmap source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_unreached: Should have rejected: undefined Reached unreachable code
-PASS createImageBitmap with a Blob source and sw set to 0 rejects with a RangeError. 
-PASS createImageBitmap with a Blob source and sh set to 0 rejects with a RangeError. 
-FAIL createImageBitmap with a Blob source and oversized (unallocatable) crop region rejects with an InvalidStateError DOMException. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with undefined image source rejects with a TypeError. 
-PASS createImageBitmap with null image source rejects with a TypeError. 
-PASS createImageBitmap with empty image source rejects with a InvalidStateError. 
-FAIL createImageBitmap with empty video source rejects with a InvalidStateError. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-PASS createImageBitmap with an oversized canvas source rejects with a RangeError. 
-FAIL createImageBitmap with an invalid OffscreenCanvas source rejects with a RangeError. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
-FAIL createImageBitmap with an undecodable blob source rejects with an InvalidStateError. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an HTMLCanvasElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLCanvasElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLCanvasElement source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS createImageBitmap with a an HTMLVideoElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLVideoElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLVideoElement source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an HTMLImageElement source and sw set to 0 
+PASS createImageBitmap with a an HTMLImageElement source and sh set to 0 
+FAIL createImageBitmap with a an HTMLImageElement source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+FAIL createImageBitmap with a an OffscreenCanvas source and sw set to 0 promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap with a an OffscreenCanvas source and sh set to 0 promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+FAIL createImageBitmap with a an OffscreenCanvas source and oversized (unallocatable) crop region promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'testCtx.fillStyle = "rgb(255, 0, 0)"')"
+PASS createImageBitmap with a an ImageData source and sw set to 0 
+PASS createImageBitmap with a an ImageData source and sh set to 0 
+FAIL createImageBitmap with a an ImageData source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with a an ImageBitmap source and sw set to 0 
+PASS createImageBitmap with a an ImageBitmap source and sh set to 0 
+FAIL createImageBitmap with a an ImageBitmap source and oversized (unallocatable) crop region assert_unreached: Should have rejected: undefined Reached unreachable code
+PASS createImageBitmap with a a Blob source and sw set to 0 
+PASS createImageBitmap with a a Blob source and sh set to 0 
+FAIL createImageBitmap with a a Blob source and oversized (unallocatable) crop region assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" ("TypeError") expected object "InvalidStateError" ("InvalidStateError")
+PASS createImageBitmap with undefined image source. 
+PASS createImageBitmap with null image source. 
+PASS createImageBitmap with empty image source. 
+FAIL createImageBitmap with empty video source. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with HTMLVideoElement is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+PASS createImageBitmap with an oversized canvas source. 
+FAIL createImageBitmap with an invalid OffscreenCanvas source. assert_throws: function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL createImageBitmap with an undecodable blob source. assert_throws: function "function () { throw e }" threw object "TypeError: createImageBitmap with ArrayBuffer or Blob is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+PASS createImageBitmap with a broken image source. 
+FAIL createImageBitmap with an available but undecodable image source. promise_test: Unhandled rejection with value: object "[object Event]"
+PASS createImageBitmap with a closed ImageBitmap. 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to