Changeset 264459 in webkit
- Timestamp:
- Jul 16, 2020, 9:26:57 AM (6 years ago)
- Location:
- trunk/LayoutTests/imported/w3c
- Files:
-
- 11 added
- 7 edited
- 2 copied
-
ChangeLog (modified) (1 diff)
-
web-platform-tests/imagebitmap-renderingcontext/META.yml (added)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha.html (copied) (copied from trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html ) (5 diffs)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen.html (added)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt (modified) (1 diff)
-
web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html (modified) (5 diffs)
-
web-platform-tests/imagebitmap-renderingcontext/context-preserves-canvas.html (modified) (2 diffs)
-
web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub.html (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen.html (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen.html (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen-expected.txt (added)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen.html (copied) (copied from trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html ) (2 diffs)
-
web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html (modified) (2 diffs)
-
web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached.html (modified) (1 diff)
-
web-platform-tests/imagebitmap-renderingcontext/w3c-import.log (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r264458 r264459 1 2020-07-16 Chris Dumez <cdumez@apple.com> 2 3 Resync web-platform-tests/imagebitmap-renderingcontext from upstream 4 https://bugs.webkit.org/show_bug.cgi?id=214376 5 6 Reviewed by Carlos Alberto Lopez Perez. 7 8 Resync web-platform-tests/imagebitmap-renderingcontext from upstream b2a666d93581a71e9338b2. 9 10 * web-platform-tests/imagebitmap-renderingcontext/META.yml: Added. 11 * web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-expected.txt: Added. 12 * web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha-expected.txt: Added. 13 * web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha.html: Copied from LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html. 14 * web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen.html: Added. 15 * web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt: 16 * web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html: 17 * web-platform-tests/imagebitmap-renderingcontext/context-preserves-canvas.html: 18 * web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub-expected.txt: Added. 19 * web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub.html: Added. 20 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen-expected.txt: Added. 21 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen.html: Added. 22 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen-expected.txt: Added. 23 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen.html: Added. 24 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen-expected.txt: Added. 25 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen.html: Copied from LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html. 26 * web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html: 27 * web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached.html: 28 * web-platform-tests/imagebitmap-renderingcontext/w3c-import.log: 29 1 30 2020-07-16 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha.html
r264458 r264459 9 9 var height = 10; 10 10 11 function test Canvas(ctx, r, g, b, a)11 function testImageBitmap(image, opts, expectedR, expectedG, expectedB, expectedA) 12 12 { 13 var color = ctx.getImageData(5, 5, 1, 1).data; 14 assert_array_equals(color, [r, g, b, a]); 15 } 16 17 function consumeImageBitmap(image, alphaVal, expectedR, expectedG, expectedB, expectedA) 18 { 19 var dstCanvas = document.createElement('canvas'); 20 dstCanvas.width = width; 21 dstCanvas.height = height; 22 var dstCtx; 23 if (alphaVal == 'true') 24 dstCtx = dstCanvas.getContext('bitmaprenderer', { alpha: true }); 25 else if (alphaVal == 'false') 26 dstCtx = dstCanvas.getContext('bitmaprenderer', { alpha: false }); 27 else 28 dstCtx = dstCanvas.getContext('bitmaprenderer'); 13 var dstCanvas = new OffscreenCanvas(width,height); 14 var dstCtx = dstCanvas.getContext('bitmaprenderer', opts); 29 15 dstCtx.transferFromImageBitmap(image); 30 16 … … 34 20 var myCtx = myCanvas.getContext('2d'); 35 21 myCtx.drawImage(dstCanvas, 0, 0); 36 testCanvas(myCtx, expectedR, expectedG, expectedB, expectedA); 22 var color = myCtx.getImageData(5, 5, 1, 1).data; 23 assert_array_approx_equals(color, [expectedR, expectedG, expectedB, expectedA],1); 37 24 } 38 25 … … 45 32 ctx.fillRect(0, 0, width, height); 46 33 return createImageBitmap(srcCanvas).then(function(image) { 47 consumeImageBitmap(image, 'false', 0, 127, 0, 255);34 testImageBitmap(image, {alpha: false}, 0, 255, 0, 128); 48 35 }); 49 36 }, "Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque"); … … 57 44 ctx.fillRect(0, 0, width, height); 58 45 return createImageBitmap(srcCanvas).then(function(image) { 59 consumeImageBitmap(image, 'true', 0, 255, 0, 127);46 testImageBitmap(image, {alpha: true}, 0, 255, 0, 128); 60 47 }); 61 48 }, "Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha"); … … 69 56 ctx.fillRect(0, 0, width, height); 70 57 return createImageBitmap(srcCanvas).then(function(image) { 71 consumeImageBitmap(image, '', 0, 255, 0, 127);58 testImageBitmap(image, {}, 0, 255, 0, 128); 72 59 }); 73 60 }, "Test that the 'alpha' context creation attribute is true by default"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha-expected.txt
r262254 r264459 1 1 2 FAIL Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque assert_array_equals: expected property 1 to be 127 but got 255 (expected array [0, 127, 0, 255] got object "0,255,0,128") 3 FAIL Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha assert_array_equals: expected property 3 to be 127 but got 128 (expected array [0, 255, 0, 127] got object "0,255,0,128") 4 FAIL Test that the 'alpha' context creation attribute is true by default assert_array_equals: expected property 3 to be 127 but got 128 (expected array [0, 255, 0, 127] got object "0,255,0,128") 2 PASS Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque 3 PASS Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha 4 PASS Test that the 'alpha' context creation attribute is true by default 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html
r223060 r264459 9 9 var height = 10; 10 10 11 function testCanvas(ctx, r, g, b, a) 12 { 13 var color = ctx.getImageData(5, 5, 1, 1).data; 14 assert_array_equals(color, [r, g, b, a]); 15 } 16 17 function consumeImageBitmap(image, alphaVal, expectedR, expectedG, expectedB, expectedA) 11 function testImageBitmap(image, opts, expectedR, expectedG, expectedB, expectedA) 18 12 { 19 13 var dstCanvas = document.createElement('canvas'); 20 14 dstCanvas.width = width; 21 15 dstCanvas.height = height; 22 var dstCtx; 23 if (alphaVal == 'true') 24 dstCtx = dstCanvas.getContext('bitmaprenderer', { alpha: true }); 25 else if (alphaVal == 'false') 26 dstCtx = dstCanvas.getContext('bitmaprenderer', { alpha: false }); 27 else 28 dstCtx = dstCanvas.getContext('bitmaprenderer'); 16 var dstCtx = dstCanvas.getContext('bitmaprenderer', opts); 29 17 dstCtx.transferFromImageBitmap(image); 30 18 … … 34 22 var myCtx = myCanvas.getContext('2d'); 35 23 myCtx.drawImage(dstCanvas, 0, 0); 36 testCanvas(myCtx, expectedR, expectedG, expectedB, expectedA); 24 var color = myCtx.getImageData(5, 5, 1, 1).data; 25 assert_array_approx_equals(color, [expectedR, expectedG, expectedB, expectedA],1); 37 26 } 38 27 … … 45 34 ctx.fillRect(0, 0, width, height); 46 35 return createImageBitmap(srcCanvas).then(function(image) { 47 consumeImageBitmap(image, 'false', 0, 127, 0, 255);36 testImageBitmap(image, {alpha: false}, 0, 255, 0, 128); 48 37 }); 49 38 }, "Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque"); … … 57 46 ctx.fillRect(0, 0, width, height); 58 47 return createImageBitmap(srcCanvas).then(function(image) { 59 consumeImageBitmap(image, 'true', 0, 255, 0, 127);48 testImageBitmap(image, {alpha: true}, 0, 255, 0, 128); 60 49 }); 61 50 }, "Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha"); … … 69 58 ctx.fillRect(0, 0, width, height); 70 59 return createImageBitmap(srcCanvas).then(function(image) { 71 consumeImageBitmap(image, '', 0, 255, 0, 127);60 testImageBitmap(image, {}, 0, 255, 0, 128); 72 61 }); 73 62 }, "Test that the 'alpha' context creation attribute is true by default"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-preserves-canvas.html
r223060 r264459 4 4 <script src="/resources/testharness.js"></script> 5 5 <script src="/resources/testharnessreport.js"></script> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/ scripting.html#the-imagebitmap-rendering-context">6 <link rel="help" href="https://html.spec.whatwg.org/multipage/canvas.html#the-imagebitmap-rendering-context"> 7 7 <script> 8 var width = 10;9 var height = 10;10 11 8 test(function() { 9 var width = 10; 10 var height = 10; 12 11 var canvas = document.createElement("canvas"); 13 12 canvas.width = width; … … 15 14 var ctx = canvas.getContext('bitmaprenderer'); 16 15 var dstCanvas = ctx.canvas; 16 assert_true("canvas" in ctx); 17 assert_equals(dstCanvas, ctx.canvas); 18 assert_equals(canvas, ctx.canvas); 17 19 assert_equals(dstCanvas.width, width); 18 20 assert_equals(dstCanvas.height, height); 19 21 }, "Test that ctx.canvas on a ImageBitmapRenderingContext returns the original canvas"); 20 21 22 </script> -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen.html
r264458 r264459 9 9 var height = 10; 10 10 11 function testCanvas( ctx, r, g, b, a)11 function testCanvas(bitmapCanvas, r, g, b, a) 12 12 { 13 var color = ctx.getImageData(5, 5, 1, 1).data; 13 var myCanvas = document.createElement('canvas'); 14 myCanvas.width = width; 15 myCanvas.height = height; 16 var myCtx = myCanvas.getContext('2d'); 17 myCtx.drawImage(bitmapCanvas, 0, 0); 18 var color = myCtx.getImageData(5, 5, 1, 1).data; 14 19 assert_array_equals(color, [r, g, b, a]); 15 20 } … … 17 22 promise_test(function() { 18 23 function testTransferFromImageBitmapNullability(greenImage, redImage) { 19 var bitmapCanvas = document.createElement('canvas'); 20 bitmapCanvas.width = width; 21 bitmapCanvas.height = height; 24 var bitmapCanvas = new OffscreenCanvas(width,height); 22 25 var bitmapCtx = bitmapCanvas.getContext('bitmaprenderer'); 23 26 bitmapCtx.transferFromImageBitmap(greenImage); 24 27 25 28 // Make sure the bitmap renderer canvas is filled correctly. 26 var myCanvas = document.createElement('canvas'); 27 myCanvas.width = width; 28 myCanvas.height = height; 29 var myCtx = myCanvas.getContext('2d'); 30 myCtx.drawImage(bitmapCanvas, 0, 0); 31 testCanvas(myCtx, 0, 255, 0, 255); 29 testCanvas(bitmapCanvas, 0, 255, 0, 255); 32 30 33 31 // Test if passing null resets the bitmap renderer canvas. 34 32 // Drawing the resetted canvas cannot change the destination canvas. 35 33 bitmapCtx.transferFromImageBitmap(null); 36 var myCanvas2 = document.createElement('canvas'); 37 myCanvas2.width = width; 38 myCanvas2.height = height; 39 var myCtx2 = myCanvas2.getContext('2d'); 40 myCtx2.drawImage(bitmapCanvas, 0, 0); 41 testCanvas(myCtx2, 0, 0, 0, 0); 34 testCanvas(bitmapCanvas, 0, 0, 0, 0); 42 35 43 36 // Test if we can redraw the bitmap canvas correctly after reset. 44 37 bitmapCtx.transferFromImageBitmap(redImage); 45 var myCanvas3 = document.createElement('canvas'); 46 myCanvas3.width = width; 47 myCanvas3.height = height; 48 var myCtx3 = myCanvas3.getContext('2d'); 49 myCtx3.drawImage(bitmapCanvas, 0, 0); 50 testCanvas(myCtx3, 255, 0, 0, 255); 38 testCanvas(bitmapCanvas, 255, 0, 0, 255); 51 39 } 52 40 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html
r223060 r264459 9 9 var height = 10; 10 10 11 function testCanvas( ctx, r, g, b, a)11 function testCanvas(bitmapCanvas, r, g, b, a) 12 12 { 13 var color = ctx.getImageData(5, 5, 1, 1).data; 13 var myCanvas = document.createElement('canvas'); 14 myCanvas.width = width; 15 myCanvas.height = height; 16 var myCtx = myCanvas.getContext('2d'); 17 myCtx.drawImage(bitmapCanvas, 0, 0); 18 var color = myCtx.getImageData(5, 5, 1, 1).data; 14 19 assert_array_equals(color, [r, g, b, a]); 15 20 } … … 24 29 25 30 // Make sure the bitmap renderer canvas is filled correctly. 26 var myCanvas = document.createElement('canvas'); 27 myCanvas.width = width; 28 myCanvas.height = height; 29 var myCtx = myCanvas.getContext('2d'); 30 myCtx.drawImage(bitmapCanvas, 0, 0); 31 testCanvas(myCtx, 0, 255, 0, 255); 31 testCanvas(bitmapCanvas, 0, 255, 0, 255); 32 32 33 33 // Test if passing null resets the bitmap renderer canvas. 34 34 // Drawing the resetted canvas cannot change the destination canvas. 35 35 bitmapCtx.transferFromImageBitmap(null); 36 var myCanvas2 = document.createElement('canvas'); 37 myCanvas2.width = width; 38 myCanvas2.height = height; 39 var myCtx2 = myCanvas2.getContext('2d'); 40 myCtx2.drawImage(bitmapCanvas, 0, 0); 41 testCanvas(myCtx2, 0, 0, 0, 0); 36 testCanvas(bitmapCanvas, 0, 0, 0, 0); 42 37 43 38 // Test if we can redraw the bitmap canvas correctly after reset. 44 39 bitmapCtx.transferFromImageBitmap(redImage); 45 var myCanvas3 = document.createElement('canvas'); 46 myCanvas3.width = width; 47 myCanvas3.height = height; 48 var myCtx3 = myCanvas3.getContext('2d'); 49 myCtx3.drawImage(bitmapCanvas, 0, 0); 50 testCanvas(myCtx3, 255, 0, 0, 255); 40 testCanvas(bitmapCanvas, 255, 0, 0, 255); 51 41 } 52 42 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached.html
r223060 r264459 20 20 assert_equals(image.width, 0); 21 21 assert_equals(image.height, 0); 22 assert_throws ("InvalidStateError", function() { dstCtx.transferFromImageBitmap(image); });22 assert_throws_dom("InvalidStateError", function() { dstCtx.transferFromImageBitmap(image); }); 23 23 } 24 24 -
trunk/LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/w3c-import.log
r223060 r264459 2 2 Do NOT modify these tests directly in WebKit. 3 3 Instead, create a pull request on the WPT github: 4 https://github.com/w 3c/web-platform-tests4 https://github.com/web-platform-tests/wpt 5 5 6 6 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport … … 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/META.yml 17 18 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html 19 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha.html 20 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen.html 18 21 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-with-alpha.html 19 22 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation.html 20 23 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-preserves-canvas.html 24 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub.html 25 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen.html 26 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen.html 27 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen.html 21 28 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null.html 22 29 /LayoutTests/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/transferFromImageBitmap-detached.html
Note:
See TracChangeset
for help on using the changeset viewer.