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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/textures/tex-sub-image-2d-bad-args.html

Issue 10399113: Roll webgl conformance tests to r17874: part 2, adding r17874 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2
3 /*
4 ** Copyright (c) 2012 The Khronos Group Inc.
5 **
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
16 **
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
24 */
25
26 -->
27 <!DOCTYPE html>
28 <html>
29 <head>
30 <meta charset="utf-8">
31 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
32 <script src="../../resources/js-test-pre.js"></script>
33 <script src="../resources/webgl-test.js"></script>
34 <script src="../resources/webgl-test-utils.js"></script>
35 </head>
36 <body>
37 <canvas id="testbed" width="16" height="16"></canvas>
38 <canvas id="c" width="16" height="16"></canvas>
39 <div id="description"></div>
40 <div id="console"></div>
41 <script>
42 description('Tests texSubImage2D with bad arguments');
43
44 var wtu = WebGLTestUtils;
45 var c = document.getElementById("c");
46
47 var gl = wtu.create3DContext("testbed");
48 var tex = gl.createTexture();
49 gl.bindTexture(gl.TEXTURE_2D, tex);
50 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
51 glErrorShouldBe(gl, gl.NO_ERROR, "Setup should succeed");
52
53 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, c);
54 glErrorShouldBe(gl, gl.INVALID_VALUE, "y + height > texture height");
55 gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
56 glErrorShouldBe(gl, gl.INVALID_VALUE, "x + width > texture width");
57 gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
58 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative x");
59 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, c);
60 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative y");
61 gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
62 glErrorShouldBe(gl, gl.INVALID_VALUE, "negative level");
63 gl.texSubImage2D(gl.FLOAT, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
64 glErrorShouldBe(gl, gl.INVALID_ENUM, "bad target");
65 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
66 glErrorShouldBe(gl, gl.NO_ERROR, "good args");
67 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
68 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
69 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
70 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
71 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, c);
72 glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGB");
73 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
74 glErrorShouldBe(gl, gl.NO_ERROR, "format same as original RGB");
75 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
76 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original RGB");
77 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_SHORT_5_6_5, c);
78 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original RGB");
79 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
80 glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGBA 4_4_4_4");
81 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
82 glErrorShouldBe(gl, gl.NO_ERROR, "format same as original RGBA 4_4_4_4");
83 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c);
84 glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original RGBA 4_4_ 4_4");
85 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);
86 glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original RGBA 4_4_4_ 4");
87
88 successfullyParsed = true;
89 </script>
90 <script src="../../resources/js-test-post.js"></script>
91 </body>
92 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698