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) { |