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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE>
2 <canvas id="canvas2D" width="50" height="50" background-color="red"></canvas>
3 <script id="myWorker" type="text/worker">
4 self.onmessage = function(e) {
5 var transferredOffscreenCanvas = e.data.data;
6 var offscreen2d = transferredOffscreenCanvas.getContext("2d");
7 offscreen2d.commit();
8 self.postMessage("");
9 };
10 </script>
11 <script>
12 // Note: If someone see this test flaky in the future, please mark the test as
13 // flaky; the code itself is not the cause of such flakiness.
14 // TODO(xlai): Guarantee all OffscreenCanvas commit tests non-flaky under all ca ses.
15 // See crbug.com/645173.
16 if (window.testRunner) {
17 testRunner.dumpAsTextWithPixelResults();
18 testRunner.waitUntilDone();
19 }
20
21 function makeWorker(script) {
22 var blob = new Blob([script]);
23 return new Worker(URL.createObjectURL(blob));
24 }
25
26 var canvas2D = document.getElementById("canvas2D");
27 var offscreenCanvas = canvas2D.transferControlToOffscreen();
28 var worker = makeWorker(document.getElementById("myWorker").textContent);
29 worker.onmessage = function (e) {
30 if (window.testRunner) testRunner.notifyDone();
31 };
32 worker.postMessage({data: offscreenCanvas}, [offscreenCanvas]);
33
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698