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

Unified 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: fix compile error on win_dbg 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-invalid-call.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html
index 8cc9d6d9170d79b0ade6670871cd3b1b8c833834..1a1ad6d8604b2f009dc8b36eebdb62b6f789d7bd 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html
@@ -19,7 +19,6 @@ function makeWorker(script) {
return new Worker(URL.createObjectURL(blob));
}
-
test(function() {
var offscreenCanvas = new OffscreenCanvas(50, 50);
var offscreen2d = offscreenCanvas.getContext("2d");
@@ -28,6 +27,28 @@ test(function() {
});
}, "Calling OffscreenCanvas.commit() on main without transferControlToOffscreen throws exception.");
+test(function() {
+ var offscreenCanvas = new OffscreenCanvas(50, 50);
+ var gl = offscreenCanvas.getContext("webgl");
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ assert_throws("InvalidStateError", function() {
+ gl.commit();
+ });
+}, "Calling WebGL's commit() on main without transferControlToOffscreen throws exception.");
+
+test(function() {
+ var canvas = document.createElement('canvas');
+ canvas.width = 50;
+ canvas.height = 50;
+ var gl = canvas.getContext("webgl");
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ assert_throws("InvalidStateError", function() {
+ gl.commit();
+ });
+}, "Calling WebGL's commit() on main without a OffscreenCanvas throws exception.");
+
async_test(function() {
var worker = makeWorker(document.getElementById("myWorker").textContent);
worker.onmessage = this.step_func(function (e) {

Powered by Google App Engine
This is Rietveld 408576698