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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..8cc9d6d9170d79b0ade6670871cd3b1b8c833834
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-commit-invalid-call.html
@@ -0,0 +1,42 @@
+<!DOCTYPE>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script id="myWorker" type="text/worker">
+self.onmessage = function(e) {
+ var offscreenCanvas = new OffscreenCanvas(50, 50);
+ var offscreen2d = offscreenCanvas.getContext("2d");
+ try {
+ offscreen2d.commit();
+ self.postMessage("NoError");
+ } catch (ex) {
+ self.postMessage(ex.name);
+ }
+};
+</script>
+<script>
+function makeWorker(script) {
+ var blob = new Blob([script]);
+ return new Worker(URL.createObjectURL(blob));
+}
+
+
+test(function() {
+ var offscreenCanvas = new OffscreenCanvas(50, 50);
+ var offscreen2d = offscreenCanvas.getContext("2d");
+ assert_throws("InvalidStateError", function () {
+ offscreen2d.commit();
+ });
+}, "Calling OffscreenCanvas.commit() on main without transferControlToOffscreen throws exception.");
+
+async_test(function() {
+ var worker = makeWorker(document.getElementById("myWorker").textContent);
+ worker.onmessage = this.step_func(function (e) {
+ assert_equals(e.data, "InvalidStateError", "Expected exception on worker but receives " + e.data);
+ this.done();
+ });
+ worker.postMessage("");
+}, "Calling OffscreenCanvas.commit() on worker without transferControlToOffscreen throws exception.");
+
+
+
+</script>
« 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