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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html

Issue 2328463004: Implement WebGL's commit on the main thread (Closed)
Patch Set: address junov@'s 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
1 <!DOCTYPE> 1 <!DOCTYPE>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script id="myWorker" type="text/worker"> 4 <script id="myWorker" type="text/worker">
5 self.onmessage = function(e) { 5 self.onmessage = function(e) {
6 var offscreenCanvas = new OffscreenCanvas(50, 50); 6 var offscreenCanvas = new OffscreenCanvas(50, 50);
7 var offscreen2d = offscreenCanvas.getContext("2d"); 7 var offscreen2d = offscreenCanvas.getContext("2d");
8 try { 8 try {
9 offscreen2d.commit(); 9 offscreen2d.commit();
10 self.postMessage("NoError"); 10 self.postMessage("NoError");
(...skipping 10 matching lines...) Expand all
21 21
22 22
23 test(function() { 23 test(function() {
24 var offscreenCanvas = new OffscreenCanvas(50, 50); 24 var offscreenCanvas = new OffscreenCanvas(50, 50);
25 var offscreen2d = offscreenCanvas.getContext("2d"); 25 var offscreen2d = offscreenCanvas.getContext("2d");
26 assert_throws("InvalidStateError", function () { 26 assert_throws("InvalidStateError", function () {
27 offscreen2d.commit(); 27 offscreen2d.commit();
28 }); 28 });
29 }, "Calling OffscreenCanvas.commit() on main without transferControlToOffscreen throws exception."); 29 }, "Calling OffscreenCanvas.commit() on main without transferControlToOffscreen throws exception.");
30 30
31 test(function() {
32 var offscreenCanvas = new OffscreenCanvas(50, 50);
33 var gl = offscreenCanvas.getContext("webgl");
34 gl.clearColor(1.0, 0.0, 0.0, 1.0);
35 gl.clear(gl.COLOR_BUFFER_BIT);
36 assert_throws("InvalidStateError", function() {
37 gl.commit();
38 });
39 }, "Calling WebGL's commit() on main without transferControlToOffscreen throws e xception.");
40
31 async_test(function() { 41 async_test(function() {
32 var worker = makeWorker(document.getElementById("myWorker").textContent); 42 var worker = makeWorker(document.getElementById("myWorker").textContent);
33 worker.onmessage = this.step_func(function (e) { 43 worker.onmessage = this.step_func(function (e) {
34 assert_equals(e.data, "InvalidStateError", "Expected exception on worker but receives " + e.data); 44 assert_equals(e.data, "InvalidStateError", "Expected exception on worker but receives " + e.data);
35 this.done(); 45 this.done();
36 }); 46 });
37 worker.postMessage(""); 47 worker.postMessage("");
38 }, "Calling OffscreenCanvas.commit() on worker without transferControlToOffscree n throws exception."); 48 }, "Calling OffscreenCanvas.commit() on worker without transferControlToOffscree n throws exception.");
39 49
40 50
41 51
42 </script> 52 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698