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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html

Issue 2468263002: Handle exception when user call canvas.transferControlToOffscreen() twice (Closed)
Patch Set: fix Created 4 years, 1 month 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/Source/modules/canvas/HTMLCanvasElementModule.cpp » ('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-transferControlToOffscreen.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
index e541808549b9485387e0a383c4e305a6bc0debf4..e961996b03fe8d9a6110723384fe7653b2c85500 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
@@ -28,13 +28,19 @@ test(function() {
}, "Tests whether transferControlToOffscreen can be run correctly.");
test(function() {
- var canvas2 = createCanvas(50, 50);
- var offscreenCanvas2;
- var ctx = canvas2.getContext("2d");
+ var canvas2a = createCanvas(50, 50);
+ var offscreenCanvas2a;
+ var ctx = canvas2a.getContext("2d");
assert_throws("InvalidStateError", function() {
- offscreenCanvas2 = canvas2.transferControlToOffscreen();
+ offscreenCanvas2a = canvas2a.transferControlToOffscreen();
assert_false("transferControlToOffscreen from a canvas with context didn't throw an exception.");
}, "transferControlToOffscreen from a canvas with context throws an exception");
+
+ var canvas2b = createCanvas(10, 10);
+ var offscreenCanvas2b = canvas2b.transferControlToOffscreen();
+ assert_throws("InvalidStateError", function() {
+ var anotherOffscreenCanvas = canvas2b.transferControlToOffscreen();
+ }, "canvas.transferControlToOffscreen() is not allowed to called more than once for the same canvas.");
}, "Tests whether transferControlToOffscreen throws exception correctly.");
test(function() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698