Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-transferToImageBitmap-invalid-mailbox.html

Issue 2139353003: Return a transparent black ImageBitmap when mailbox is invalid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-transferToImageBitmap-invalid-mailbox.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-transferToImageBitmap-invalid-mailbox.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-transferToImageBitmap-invalid-mailbox.html
new file mode 100644
index 0000000000000000000000000000000000000000..79ecaae6525d0d4a1d843e8805d12cd2b06dcc41
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-transferToImageBitmap-invalid-mailbox.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<canvas id='output1' width = '100' height = '100'></canvas>
+<canvas id='output2' width = '100' height = '100'></canvas>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+}
+
+var width = 100;
+var height = 100;
+var aCanvas = new OffscreenCanvas(width, height);
+var gl = aCanvas.getContext('webgl');
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+var image1 = aCanvas.transferToImageBitmap();
+var image2 = aCanvas.transferToImageBitmap();
+
+var canvas1 = document.getElementById("output1");
+var ctx1 = canvas1.getContext('bitmaprenderer');
+ctx1.transferFromImageBitmap(image1);
+
+var canvas2 = document.getElementById('output2');
+var ctx2 = canvas2.getContext('bitmaprenderer');
+ctx2.transferFromImageBitmap(image2);
+
+if (window.testRunner) {
+ testRunner.notifyDone();
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698