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

Side by Side Diff: third_party/webgl/conformance-suites/1.0.0/conformance/tex-sub-image-2d-bad-args.html

Issue 9360034: Remove everthing except conformance tests in the deps/third_party/webgl (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 10 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
(Empty)
1 <html>
2 <head>
3 <link rel="stylesheet" href="../resources/js-test-style.css"/>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="resources/webgl-test.js"></script>
6 <script src="resources/webgl-test-utils.js"></script>
7 </head>
8 <body>
9 <canvas id="testbed" width="16" height="16"></canvas>
10 <canvas id="c" width="16" height="16"></canvas>
11 <div id="description"></div>
12 <div id="console"></div>
13 <script>
14 description('Tests texSubImage2D with bad arguments');
15
16 var wtu = WebGLTestUtils;
17 var canvas = document.getElementById("testbed");
18 var c = document.getElementById("c");
19
20 var gl = wtu.create3DContext(canvas);
21 var tex = gl.createTexture();
22 gl.bindTexture(gl.TEXTURE_2D, tex);
23 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
24 glErrorShouldBe(gl, gl.NO_ERROR, "Setup should succeed");
25
26 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, c);
27 glErrorShouldBe(gl, gl.INVALID_VALUE, "y + height > texture height");
28 gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
29 glErrorShouldBe(gl, gl.INVALID_VALUE, "x + width > texture width");
30 gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
31 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative x");
32 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, c);
33 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative y");
34 gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
35 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative level");
36 gl.texSubImage2D(gl.FLOAT, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
37 glErrorShouldBe(gl, gl.INVALID_ENUM, "bad target");
38 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
39 glErrorShouldBe(gl, gl.NO_ERROR, "good args");
40 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
41 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
42 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
43 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
44 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, c);
45 glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGB");
46 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
47 glErrorShouldBe(gl, gl.NO_ERROR, "format same as original RGB");
48 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
49 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original RGB");
50 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_SHORT_5_6_5, c);
51 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original RGB");
52 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
53 glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGBA 4_4_4_4");
54 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
55 glErrorShouldBe(gl, gl.NO_ERROR, "format same as original RGBA 4_4_4_4");
56 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
57 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original RGBA 4_4_ 4_4");
58 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
59 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original RGBA 4_4_4_ 4");
60
61 successfullyParsed = true;
62 </script>
63 <script src="../resources/js-test-post.js"></script>
64 </body>
65 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698