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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-main.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script id="myWorker" type="text/worker">
5 self.onmessage = function(e) {
6 var offscreenCanvas = new OffscreenCanvas(50, 50);
7 var offscreen2d = offscreenCanvas.getContext("2d");
8 try {
9 offscreen2d.commit();
10 self.postMessage("NoError");
11 } catch (ex) {
12 self.postMessage(ex.name);
13 }
14 };
15 </script>
16 <script>
17 function makeWorker(script) {
18 var blob = new Blob([script]);
19 return new Worker(URL.createObjectURL(blob));
20 }
21
22
23 test(function() {
24 var offscreenCanvas = new OffscreenCanvas(50, 50);
25 var offscreen2d = offscreenCanvas.getContext("2d");
26 assert_throws("InvalidStateError", function () {
27 offscreen2d.commit();
28 });
29 }, "Calling OffscreenCanvas.commit() on main without transferControlToOffscreen throws exception.");
30
31 async_test(function() {
32 var worker = makeWorker(document.getElementById("myWorker").textContent);
33 worker.onmessage = this.step_func(function (e) {
34 assert_equals(e.data, "InvalidStateError", "Expected exception on worker but receives " + e.data);
35 this.done();
36 });
37 worker.postMessage("");
38 }, "Calling OffscreenCanvas.commit() on worker without transferControlToOffscree n throws exception.");
39
40
41
42 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698