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

Side by Side Diff: LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly 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 of texImage2d and texSubImage2d"); 1 description("Test of texImage2d and texSubImage2d");
2 2
3 if (window.internals) 3 if (window.internals)
4 window.internals.settings.setWebGLErrorsToConsoleEnabled(false); 4 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
5 5
6 var context = create3DContext(); 6 var context = create3DContext();
7 var image = document.createElement("img"); 7 var image = document.createElement("img");
8 var video = document.createElement("video"); 8 var video = document.createElement("video");
9 var canvas2d = document.createElement("canvas"); 9 var canvas2d = document.createElement("canvas");
10 var context2d = canvas2d.getContext("2d"); 10 var context2d = canvas2d.getContext("2d");
11 var imageData = context2d.createImageData(64, 64); 11 var imageData = context2d.createImageData(64, 64);
12 var array = new Uint8Array([ 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 25 5, 0, 0, 0, 255 ]); 12 var array = new Uint8Array([ 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 25 5, 0, 0, 0, 255 ]);
13 13
14 shouldThrow("context.texImage2D(context.TEXTURE_2D)"); 14 shouldThrow("context.texImage2D(context.TEXTURE_2D)");
15 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 6 4, 0, context.RGBA, context.UNSIGNED_BYTE, null)"); 15 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 6 4, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
16 shouldThrow("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context. RGBA, context.UNSIGNED_BYTE, 0)"); 16 shouldThrow("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context. RGBA, context.UNSIGNED_BYTE, 0)");
17 shouldThrow("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context. RGBA, context.UNSIGNED_BYTE, 0, 0)");
17 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2, 0, context.RGBA, context.UNSIGNED_BYTE, array)"); 18 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2, 0, context.RGBA, context.UNSIGNED_BYTE, array)");
18 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); 19 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)");
19 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, imageData)"); 20 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, imageData)");
20 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); 21 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)");
21 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, image)"); 22 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, image)");
22 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, canvas2d)"); 23 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, canvas2d)");
23 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); 24 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)");
24 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, video)"); 25 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte xt.RGBA, context.UNSIGNED_BYTE, video)");
25 26
26 shouldThrow("context.texSubImage2D(context.TEXTURE_2D)"); 27 shouldThrow("context.texSubImage2D(context.TEXTURE_2D)");
27 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, co ntext.RGBA, context.UNSIGNED_BYTE, null)"); 28 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, co ntext.RGBA, context.UNSIGNED_BYTE, null)");
28 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context. RGBA, context.UNSIGNED_BYTE, 0)"); 29 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context. RGBA, context.UNSIGNED_BYTE, 0)");
29 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNS IGNED_BYTE, 0)"); 30 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNS IGNED_BYTE, 0)");
30 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); 31 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)");
31 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, imageData)"); 32 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, imageData)");
32 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, image)"); 33 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, image)");
33 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); 34 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)");
34 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, canvas2d)"); 35 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, canvas2d)");
35 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); 36 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)");
36 shouldBeUndefined("context.pixelStorei(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t rue)"); 37 shouldBeUndefined("context.pixelStorei(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t rue)");
37 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, video)"); 38 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context. RGBA, context.UNSIGNED_BYTE, video)");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698