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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-worker.html

Issue 2318383002: Submit CompositorFrame from worker (Closed)
Patch Set: Adding comments Created 4 years, 3 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/OffscreenCanvas-commit-worker.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-worker.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-worker.html
new file mode 100644
index 0000000000000000000000000000000000000000..429e2baefa04ec75f48c210064bd13f4ebe31cbf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-worker.html
@@ -0,0 +1,34 @@
+<!DOCTYPE>
+<canvas id="canvas2D" width="50" height="50" background-color="red"></canvas>
+<script id="myWorker" type="text/worker">
+self.onmessage = function(e) {
+ var transferredOffscreenCanvas = e.data.data;
+ var offscreen2d = transferredOffscreenCanvas.getContext("2d");
+ offscreen2d.commit();
+ self.postMessage("");
+};
+</script>
+<script>
+// Note: If someone see this test flaky in the future, please mark the test as
+// flaky; the code itself is not the cause of such flakiness.
+// TODO(xlai): Guarantee all OffscreenCanvas commit tests non-flaky under all cases.
+// See crbug.com/645173.
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
+
+function makeWorker(script) {
+ var blob = new Blob([script]);
+ return new Worker(URL.createObjectURL(blob));
+}
+
+var canvas2D = document.getElementById("canvas2D");
+var offscreenCanvas = canvas2D.transferControlToOffscreen();
+var worker = makeWorker(document.getElementById("myWorker").textContent);
+worker.onmessage = function (e) {
+ if (window.testRunner) testRunner.notifyDone();
+};
+worker.postMessage({data: offscreenCanvas}, [offscreenCanvas]);
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698