| Index: conformance/get-active-test.html
|
| ===================================================================
|
| --- conformance/get-active-test.html (revision 106149)
|
| +++ conformance/get-active-test.html (working copy)
|
| @@ -1,135 +0,0 @@
|
| -<!--
|
| -Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
|
| -
|
| -Redistribution and use in source and binary forms, with or without
|
| -modification, are permitted provided that the following conditions
|
| -are met:
|
| -1. Redistributions of source code must retain the above copyright
|
| - notice, this list of conditions and the following disclaimer.
|
| -2. Redistributions in binary form must reproduce the above copyright
|
| - notice, this list of conditions and the following disclaimer in the
|
| - documentation and/or other materials provided with the distribution.
|
| -
|
| -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
| -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
| -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
| -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
| -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
| -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| --->
|
| -<!DOCTYPE html>
|
| -<html>
|
| -<head>
|
| -<meta charset="utf-8">
|
| -<link rel="stylesheet" href="../resources/js-test-style.css"/>
|
| -<script src="../resources/js-test-pre.js"></script>
|
| -<script src="resources/webgl-test.js"></script>
|
| -</head>
|
| -<body>
|
| -<div id="description"></div>
|
| -<div id="console"></div>
|
| -
|
| -<script>
|
| -description("Test of getActiveAttrib and getActiveUniform");
|
| -
|
| -var context = create3DContext();
|
| -var context2 = create3DContext();
|
| -var program = loadStandardProgram(context);
|
| -var program2 = loadProgram(context2,
|
| - "resources/intArrayUniformShader.vert",
|
| - "resources/noopUniformShader.frag");
|
| -
|
| -glErrorShouldBe(context, context.NO_ERROR);
|
| -shouldBe("context.getActiveUniform(program, 0).name", "'u_modelViewProjMatrix'");
|
| -shouldBe("context.getActiveUniform(program, 0).type", "context.FLOAT_MAT4");
|
| -shouldBe("context.getActiveUniform(program, 0).size", "1");
|
| -shouldBeNull("context.getActiveUniform(program, 1)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -shouldBeNull("context.getActiveUniform(program, -1)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -shouldBeNull("context.getActiveUniform(null, 0)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -
|
| -// we don't know the order the attribs will appear.
|
| -var info = [
|
| - context.getActiveAttrib(program, 0),
|
| - context.getActiveAttrib(program, 1)
|
| -];
|
| -for (var ii = 0; ii < info.length; ++ii)
|
| - shouldBeNonNull("info[ii]");
|
| -
|
| -var expected = [
|
| - { name: 'a_normal', type: context.FLOAT_VEC3, size: 1 },
|
| - { name: 'a_vertex', type: context.FLOAT_VEC4, size: 1 }
|
| -];
|
| -
|
| -if (info[0].name != expected[0].name) {
|
| - t = info[0];
|
| - info[0] = info[1];
|
| - info[1] = t;
|
| -}
|
| -
|
| -for (var ii = 0; ii < info.length; ++ii) {
|
| - shouldBe("info[ii].name", "expected[ii].name");
|
| - shouldBe("info[ii].type", "expected[ii].type");
|
| - shouldBe("info[ii].size", "expected[ii].size");
|
| -}
|
| -
|
| -// we don't know the order the uniforms will appear.
|
| -var info2 = [
|
| - context2.getActiveUniform(program2, 0),
|
| - context2.getActiveUniform(program2, 1)
|
| -];
|
| -for (var ii = 0; ii < info2.length; ++ii)
|
| - shouldBeNonNull("info2[ii]");
|
| -
|
| -var expected2 = [
|
| - { name: 'ival', type: context2.INT, size: 1 },
|
| - { name: 'ival2[0]', type: context2.INT, size: 2 }
|
| -];
|
| -
|
| -if (info2[0].name != expected2[0].name) {
|
| - t = info2[0];
|
| - info2[0] = info2[1];
|
| - info2[1] = t;
|
| -}
|
| -
|
| -for (var ii = 0; ii < info2.length; ++ii) {
|
| - shouldBe("info2[ii].name", "expected2[ii].name");
|
| - shouldBe("info2[ii].type", "expected2[ii].type");
|
| - shouldBe("info2[ii].size", "expected2[ii].size");
|
| -}
|
| -
|
| -shouldBeNull("context.getActiveAttrib(program, 2)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -shouldBeNull("context.getActiveAttrib(program, -1)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -shouldBeNull("context.getActiveAttrib(null, 0)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -
|
| -glErrorShouldBe(context2, context.NO_ERROR);
|
| -
|
| -debug("Check trying to get attribs from different context");
|
| -shouldBeNull("context2.getActiveAttrib(program, 0)");
|
| -glErrorShouldBe(context2, context2.INVALID_OPERATION);
|
| -shouldBeNull("context2.getActiveUniform(program, 0)");
|
| -glErrorShouldBe(context2, context2.INVALID_OPERATION);
|
| -
|
| -debug("Check trying to get attribs from deleted program");
|
| -context.deleteProgram(program);
|
| -shouldBeNull("context.getActiveUniform(program, 0)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -shouldBeNull("context.getActiveAttrib(program, 0)");
|
| -glErrorShouldBe(context, context.INVALID_VALUE);
|
| -
|
| -successfullyParsed = true;
|
| -</script>
|
| -
|
| -<script src="../resources/js-test-post.js"></script>
|
| -</body>
|
| -</html>
|
|
|