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

Side by Side Diff: conformance/gl-geterror.html

Issue 8344024: Remove older revision of webgl conformance tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « conformance/gl-get-calls.html ('k') | conformance/gl-getshadersource.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
7 "http://www.w3.org/TR/html4/loose.dtd">
8 <html>
9 <head>
10 <title>WebGL get error conformance test.</title>
11 <link rel="stylesheet" href="../resources/js-test-style.css"/>
12 <script src="../resources/desktop-gl-constants.js" type="text/javascript"></scri pt>
13 <script src="../resources/js-test-pre.js"></script>
14 <script src="resources/webgl-test.js"> </script>
15 <script src="resources/webgl-test-utils.js"> </script>
16 </head>
17 <body>
18 <canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></ canvas>
19 <div id="description"></div><div id="console"></div>
20 <script>
21 description("Test getError.");
22 var wtu = WebGLTestUtils;
23 var canvas = document.getElementById("example");
24 var gl = wtu.create3DContext(canvas);
25 var tex = gl.createTexture();
26 gl.bindTexture(gl.TEXTURE_2D, tex);
27
28 gl.enable(desktopGL.ALPHA_TEST);
29 glErrorShouldBe(gl, gl.INVALID_ENUM, "should generate INVALID_ENUM");
30 gl.viewport(-1, -1, -1, -1);
31 glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE");
32 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null );
33 glErrorShouldBe(gl, gl.INVALID_OPERATION, "should generate INVALID_OPERATION");
34
35 // Generate errors of each type.
36 // Generate 2 of each type to make sure the implementation is using a flag
37 // per type and not a list of errors.
38 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null );
39 gl.viewport(-1, -1, -1, -1);
40 gl.enable(desktopGL.ALPHA_TEST);
41 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null );
42 gl.viewport(-1, -1, -1, -1);
43 // Note: This error is specifically last because we know it will be synthasized
44 // by WebGL at least when implemented on top of Desktop OpenGL
45 gl.enable(desktopGL.ALPHA_TEST);
46
47 debug("There should be 3 errors, one of each type");
48 var err1 = gl.getError();
49 var err2 = gl.getError();
50 var err3 = gl.getError();
51
52 shouldBeTrue('err1 != err2 && err1 != err3 && err2 != err3');
53 shouldBeTrue('err1 == gl.INVALID_ENUM || err1 == gl.INVALID_VALUE || err1 == gl. INVALID_OPERATION');
54 shouldBeTrue('err2 == gl.INVALID_ENUM || err2 == gl.INVALID_VALUE || err2 == gl. INVALID_OPERATION');
55 shouldBeTrue('err3 == gl.INVALID_ENUM || err3 == gl.INVALID_VALUE || err3 == gl. INVALID_OPERATION');
56 shouldBeTrue('gl.getError() == gl.NO_ERROR');
57
58 debug("");
59 successfullyParsed = true;
60 </script>
61 <script src="../resources/js-test-post.js"></script>
62 </body>
63 </html>
64
OLDNEW
« no previous file with comments | « conformance/gl-get-calls.html ('k') | conformance/gl-getshadersource.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698