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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImage.js

Issue 291563004: Overload resolution: ignore extra arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 description("Test the behavior of CanvasRenderingContext2D.drawImage() when call ed with different numbers of arguments."); 1 description("Test the behavior of CanvasRenderingContext2D.drawImage() when call ed with different numbers of arguments.");
2 2
3 var ctx = document.createElement('canvas').getContext('2d'); 3 var ctx = document.createElement('canvas').getContext('2d');
4 4
5 var imageElement = document.createElement("img"); 5 var imageElement = document.createElement("img");
6 shouldThrow("ctx.drawImage()"); 6 shouldThrow("ctx.drawImage()");
7 shouldThrow("ctx.drawImage(imageElement)"); 7 shouldThrow("ctx.drawImage(imageElement)");
8 shouldThrow("ctx.drawImage(imageElement, 0)"); 8 shouldThrow("ctx.drawImage(imageElement, 0)");
9 shouldBe("ctx.drawImage(imageElement, 0, 0)", "undefined"); 9 shouldBe("ctx.drawImage(imageElement, 0, 0)", "undefined");
10 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0)"); 10 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0)");
11 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0)", "undefined"); 11 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0)", "undefined");
12 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0)"); 12 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0)");
13 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0)"); 13 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0)");
14 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0)"); 14 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0)");
15 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); 15 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
16 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); 16 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
17 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); 17 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined ");
18 18
19 var canvasElement = document.createElement("canvas"); 19 var canvasElement = document.createElement("canvas");
20 shouldThrow("ctx.drawImage(canvasElement)"); 20 shouldThrow("ctx.drawImage(canvasElement)");
21 shouldThrow("ctx.drawImage(canvasElement, 0)"); 21 shouldThrow("ctx.drawImage(canvasElement, 0)");
22 shouldBe("ctx.drawImage(canvasElement, 0, 0)", "undefined"); 22 shouldBe("ctx.drawImage(canvasElement, 0, 0)", "undefined");
23 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0)"); 23 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0)");
24 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0)", "undefined"); 24 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0)", "undefined");
25 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0)"); 25 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0)");
26 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0)"); 26 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0)");
27 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0)"); 27 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0)");
28 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); 28 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
29 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); 29 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined") ;
30 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); 30 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefine d");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698