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

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

Issue 2335903003: Revert of Disallow users modify canvas after it transfers control to offscreen (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 function createCanvas(width, height) { 9 function createCanvas(width, height) {
10 var canvas = document.createElement("canvas"); 10 var canvas = document.createElement("canvas");
(...skipping 28 matching lines...) Expand all
39 39
40 test(function() { 40 test(function() {
41 var canvas3 = createCanvas(10, 10); 41 var canvas3 = createCanvas(10, 10);
42 var offscreenCanvas3 = canvas3.transferControlToOffscreen(); 42 var offscreenCanvas3 = canvas3.transferControlToOffscreen();
43 assert_equals(offscreenCanvas3.width, 10); 43 assert_equals(offscreenCanvas3.width, 10);
44 assert_equals(offscreenCanvas3.height, 10); 44 assert_equals(offscreenCanvas3.height, 10);
45 assert_throws("InvalidStateError", function() { offscreenCanvas3.width = 20; }); 45 assert_throws("InvalidStateError", function() { offscreenCanvas3.width = 20; });
46 assert_throws("InvalidStateError", function() { offscreenCanvas3.height = 20 ; }); 46 assert_throws("InvalidStateError", function() { offscreenCanvas3.height = 20 ; });
47 }, "Test if resizing on offscreencanvas transferred from html canvas has thrown exceptions."); 47 }, "Test if resizing on offscreencanvas transferred from html canvas has thrown exceptions.");
48 48
49 test(function() {
50 var canvas4 = createCanvas(10, 10);
51 var offscreenCanvas4 = canvas4.transferControlToOffscreen();
52 assert_throws("InvalidStateError", function() {
53 canvas4.getContext("2d");
54 }, "canvas.getContext() is not allowed after transferring control to offscre en.");
55 assert_throws("InvalidStateError", function() {
56 canvas4.height = 20;
57 }, "canvas resizing height is not allowed after transferring control to offs creen.");
58 assert_throws("InvalidStateError", function() {
59 canvas4.width = 20;
60 }, "canvas resizing width is not allowed after transferring control to offsc reen.");
61 assert_throws("InvalidStateError", function() {
62 canvas4.toBlob(function() {});
63 }, "canvas.toBlob is not allowed after transferring control to offscreen.");
64 assert_throws("InvalidStateError", function() {
65 canvas4.toDataURL();
66 }, "canvas.toDataURL is not allowed after transferring control to offscreen. ");
67 }, "Test if modifying canvas after it transfers controls to offscreen throw exce ptions");
68
69 </script> 49 </script>
70 </body> 50 </body>
71 </html> 51 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698