Add WebGL Conformance Tests programs folder.
authorgman@chromium.org <gman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 13:05:32 +0000 (13:05 +0000)
committergman@chromium.org <gman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 13:05:32 +0000 (13:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109120

Reviewed by Kenneth Russell.

* webgl/conformance/programs/get-active-test-expected.txt: Added.
* webgl/conformance/programs/get-active-test.html: Added.
* webgl/conformance/programs/gl-bind-attrib-location-test-expected.txt: Added.
* webgl/conformance/programs/gl-bind-attrib-location-test.html: Added.
* webgl/conformance/programs/gl-get-active-attribute-expected.txt: Added.
* webgl/conformance/programs/gl-get-active-attribute.html: Added.
* webgl/conformance/programs/gl-get-active-uniform-expected.txt: Added.
* webgl/conformance/programs/gl-get-active-uniform.html: Added.
* webgl/conformance/programs/gl-getshadersource-expected.txt: Added.
* webgl/conformance/programs/gl-getshadersource.html: Added.
* webgl/conformance/programs/gl-shader-test-expected.txt: Added.
* webgl/conformance/programs/gl-shader-test.html: Added.
* webgl/conformance/programs/invalid-UTF-16-expected.txt: Added.
* webgl/conformance/programs/invalid-UTF-16.html: Added.
* webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader-expected.txt: Added.
* webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/00_test_list.txt: Added.
* webgl/resources/webgl_test_files/conformance/programs/get-active-test.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/gl-getshadersource.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/gl-shader-test.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/invalid-UTF-16.html: Added.
* webgl/resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/webgl/conformance/programs/get-active-test-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/get-active-test.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-get-active-attribute-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-get-active-attribute.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-get-active-uniform-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-get-active-uniform.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-getshadersource-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-getshadersource.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-shader-test-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/gl-shader-test.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/invalid-UTF-16-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/invalid-UTF-16.html [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader-expected.txt [new file with mode: 0644]
LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/00_test_list.txt [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/get-active-test.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-getshadersource.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-shader-test.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/invalid-UTF-16.html [new file with mode: 0644]
LayoutTests/webgl/resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html [new file with mode: 0644]

index 1a8b03b..ccee80c 100644 (file)
@@ -1,5 +1,38 @@
 2013-02-07  Gregg Tavares  <gman@chromium.org>
 
+        Add WebGL Conformance Tests programs folder.
+        https://bugs.webkit.org/show_bug.cgi?id=109120
+
+        Reviewed by Kenneth Russell.
+
+        * webgl/conformance/programs/get-active-test-expected.txt: Added.
+        * webgl/conformance/programs/get-active-test.html: Added.
+        * webgl/conformance/programs/gl-bind-attrib-location-test-expected.txt: Added.
+        * webgl/conformance/programs/gl-bind-attrib-location-test.html: Added.
+        * webgl/conformance/programs/gl-get-active-attribute-expected.txt: Added.
+        * webgl/conformance/programs/gl-get-active-attribute.html: Added.
+        * webgl/conformance/programs/gl-get-active-uniform-expected.txt: Added.
+        * webgl/conformance/programs/gl-get-active-uniform.html: Added.
+        * webgl/conformance/programs/gl-getshadersource-expected.txt: Added.
+        * webgl/conformance/programs/gl-getshadersource.html: Added.
+        * webgl/conformance/programs/gl-shader-test-expected.txt: Added.
+        * webgl/conformance/programs/gl-shader-test.html: Added.
+        * webgl/conformance/programs/invalid-UTF-16-expected.txt: Added.
+        * webgl/conformance/programs/invalid-UTF-16.html: Added.
+        * webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader-expected.txt: Added.
+        * webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/00_test_list.txt: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/get-active-test.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/gl-getshadersource.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/gl-shader-test.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/invalid-UTF-16.html: Added.
+        * webgl/resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html: Added.
+
+2013-02-07  Gregg Tavares  <gman@chromium.org>
+
         Add WebGL Conformance Tests context folder.
         https://bugs.webkit.org/show_bug.cgi?id=109114
 
diff --git a/LayoutTests/webgl/conformance/programs/get-active-test-expected.txt b/LayoutTests/webgl/conformance/programs/get-active-test-expected.txt
new file mode 100644 (file)
index 0000000..e15b640
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/get-active-test.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/get-active-test.html b/LayoutTests/webgl/conformance/programs/get-active-test.html
new file mode 100644 (file)
index 0000000..84a4544
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for get-active-test.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/get-active-test.html">../../resources/webgl_test_files/conformance/programs/get-active-test.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/get-active-test.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test-expected.txt b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test-expected.txt
new file mode 100644 (file)
index 0000000..77dfd52
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test.html b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-test.html
new file mode 100644 (file)
index 0000000..16c6131
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for gl-bind-attrib-location-test.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html">../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/gl-get-active-attribute-expected.txt b/LayoutTests/webgl/conformance/programs/gl-get-active-attribute-expected.txt
new file mode 100644 (file)
index 0000000..1551786
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/gl-get-active-attribute.html b/LayoutTests/webgl/conformance/programs/gl-get-active-attribute.html
new file mode 100644 (file)
index 0000000..0d69aa7
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for gl-get-active-attribute.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html">../../resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/gl-get-active-uniform-expected.txt b/LayoutTests/webgl/conformance/programs/gl-get-active-uniform-expected.txt
new file mode 100644 (file)
index 0000000..c114aa9
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/gl-get-active-uniform.html b/LayoutTests/webgl/conformance/programs/gl-get-active-uniform.html
new file mode 100644 (file)
index 0000000..46cb590
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for gl-get-active-uniform.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html">../../resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/gl-getshadersource-expected.txt b/LayoutTests/webgl/conformance/programs/gl-getshadersource-expected.txt
new file mode 100644 (file)
index 0000000..75adec2
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/gl-getshadersource.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/gl-getshadersource.html b/LayoutTests/webgl/conformance/programs/gl-getshadersource.html
new file mode 100644 (file)
index 0000000..dc1d93d
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for gl-getshadersource.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-getshadersource.html">../../resources/webgl_test_files/conformance/programs/gl-getshadersource.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-getshadersource.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/gl-shader-test-expected.txt b/LayoutTests/webgl/conformance/programs/gl-shader-test-expected.txt
new file mode 100644 (file)
index 0000000..012fd9c
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/gl-shader-test.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/gl-shader-test.html b/LayoutTests/webgl/conformance/programs/gl-shader-test.html
new file mode 100644 (file)
index 0000000..a793b51
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for gl-shader-test.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-shader-test.html">../../resources/webgl_test_files/conformance/programs/gl-shader-test.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-shader-test.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/invalid-UTF-16-expected.txt b/LayoutTests/webgl/conformance/programs/invalid-UTF-16-expected.txt
new file mode 100644 (file)
index 0000000..1878d07
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/invalid-UTF-16.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/invalid-UTF-16.html b/LayoutTests/webgl/conformance/programs/invalid-UTF-16.html
new file mode 100644 (file)
index 0000000..fd94aa1
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for invalid-UTF-16.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/invalid-UTF-16.html">../../resources/webgl_test_files/conformance/programs/invalid-UTF-16.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/invalid-UTF-16.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader-expected.txt b/LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader-expected.txt
new file mode 100644 (file)
index 0000000..675acda
--- /dev/null
@@ -0,0 +1,5 @@
+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
+
+Test: ../../resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html
+PASS
+
diff --git a/LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html b/LayoutTests/webgl/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html
new file mode 100644 (file)
index 0000000..1f8359f
--- /dev/null
@@ -0,0 +1,18 @@
+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT -->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Test Wrapper for use-program-crash-with-discard-in-fragment-shader.html</title>
+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script>
+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script>
+</head>
+<body>
+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
+Test: <a href="../../resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html">../../resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html</a>
+<div id="result"></div>
+<div id="iframe">
+<iframe src="../../resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html" width="800" height="600"></iframe>
+</div>
+</body>
+</html>
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/00_test_list.txt b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/00_test_list.txt
new file mode 100644 (file)
index 0000000..fd5efc7
--- /dev/null
@@ -0,0 +1,10 @@
+get-active-test.html
+gl-bind-attrib-location-test.html
+--min-version 1.0.2 gl-bind-attrib-location-long-names-test.html
+gl-get-active-attribute.html
+gl-get-active-uniform.html
+gl-getshadersource.html
+gl-shader-test.html
+invalid-UTF-16.html
+program-test.html
+--min-version 1.0.2 use-program-crash-with-discard-in-fragment-shader.html
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/get-active-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/get-active-test.html
new file mode 100644 (file)
index 0000000..c087b66
--- /dev/null
@@ -0,0 +1,141 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!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>
+<script src="../resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test of getActiveAttrib and getActiveUniform");
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var context2 = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+var program2 = wtu.loadProgramFromFile(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) {
+  var 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);
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-test.html
new file mode 100644 (file)
index 0000000..e0e00af
--- /dev/null
@@ -0,0 +1,226 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL BindAttribLocation Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"></script>
+<script src="../resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas style="border: 1px solid black;" id="canvas" width="50" height="50"></canvas>
+<script id="vshader" type="text/something-not-javascript">
+attribute vec4 vPosition;
+attribute vec4 vColor;
+varying vec4 color;
+void main()
+{
+  gl_Position = vPosition;
+  color = vColor;
+}
+</script>
+<script id="fshader" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 color;
+void main()
+{
+  gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description("This test ensures WebGL implementations don't allow names that start with 'gl_' when calling bindAttribLocation.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+shouldBeNonNull("gl");
+
+function fail(x,y, buf, shouldBe)
+{
+  var i = (y*50+x) * 4;
+  var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
+  testFailed(reason);
+}
+
+function pass()
+{
+  testPassed("drawing is correct");
+}
+
+function loadShader(shaderType, shaderId) {
+  // Get the shader source.
+  var shaderSource = document.getElementById(shaderId).text;
+
+  // Create the shader object
+  var shader = gl.createShader(shaderType);
+  if (shader == null) {
+    debug("*** Error: unable to create shader '"+shaderId+"'");
+    return null;
+  }
+
+  // Load the shader source
+  gl.shaderSource(shader, shaderSource);
+
+  // Compile the shader
+  gl.compileShader(shader);
+
+  // Check the compile status
+  var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
+  if (!compiled) {
+    // Something went wrong during compilation; get the error
+    var error = gl.getShaderInfoLog(shader);
+    debug("*** Error compiling shader '"+shader+"':"+error);
+    gl.deleteShader(shader);
+    return null;
+  }
+  return shader;
+}
+
+debug("");
+debug("Checking gl.bindAttribLocation.");
+
+var program = gl.createProgram();
+gl.bindAttribLocation(program, 0, "gl_foo");
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'");
+gl.bindAttribLocation(program, 0, "gl_TexCoord0");
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'");
+
+var vs = loadShader(gl.VERTEX_SHADER, "vshader");
+var fs = loadShader(gl.FRAGMENT_SHADER, "fshader");
+gl.attachShader(program, vs);
+gl.attachShader(program, fs);
+
+var positions = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+
+var colors = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+    0,1,0,1,
+    0,1,0,1,
+    0,1,0,1]), gl.STATIC_DRAW);
+
+function setBindLocations(colorLocation, positionLocation) {
+  gl.bindAttribLocation(program, positionLocation, "vPosition");
+  gl.bindAttribLocation(program, colorLocation, "vColor");
+  gl.linkProgram(program);
+  gl.useProgram(program);
+  var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);
+  assertMsg(linked, "program linked successfully");
+
+  debug("vPosition:" + gl.getAttribLocation(program, "vPosition"))
+  debug("vColor   :" + gl.getAttribLocation(program, "vColor"))
+  assertMsg(gl.getAttribLocation(program, "vPosition") == positionLocation,
+            "location of vPosition should be " + positionLocation);
+  assertMsg(gl.getAttribLocation(program, "vColor") == colorLocation,
+            "location of vColor should be " + colorLocation);
+
+  var ploc = gl.getAttribLocation(program, "vPosition");
+  var cloc = gl.getAttribLocation(program, "vColor");
+  gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+  gl.enableVertexAttribArray(positionLocation);
+  gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+  gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+  gl.enableVertexAttribArray(colorLocation);
+  gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
+}
+
+function checkDraw(colorLocation, positionLocation, r, g, b, a) {
+  gl.clearColor(0, 0, 0, 1);
+  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+  gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+  var width = 50;
+  var height = 50;
+  var buf = new Uint8Array(width * height * 4);
+  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+  function checkPixel(x, y, r, g, b, a) {
+    var offset = (y * width + x) * 4;
+    if (buf[offset + 0] != r ||
+        buf[offset + 1] != g ||
+        buf[offset + 2] != b ||
+        buf[offset + 3] != a) {
+        fail(x, y, buf, "(" + r + "," + g + "," + b + "," + a + ")");
+        return false;
+    }
+    return true;
+  }
+
+  // Test several locations
+  // First line should be all black
+  var success = true;
+  for (var i = 0; i < 50; ++i)
+    success = success && checkPixel(i, 0, 0, 0, 0, 255);
+
+  // Line 15 should be red for at least 10 rgba pixels starting 20 pixels in
+  var offset = (15 * 50 + 20) * 4;
+  for (var i = 0; i < 10; ++i)
+    success = success && checkPixel(20 + i, 15, r, g, b, a);
+
+  // Last line should be all black
+  for (var i = 0; i < 50; ++i)
+    success = success && checkPixel(i, 49, 0, 0, 0, 255);
+
+  if (success)
+    pass();
+
+  gl.disableVertexAttribArray(positionLocation);
+  gl.disableVertexAttribArray(colorLocation);
+}
+
+setBindLocations(2, 3);
+checkDraw(2, 3, 0, 255, 0, 255);
+
+setBindLocations(0, 3);
+gl.disableVertexAttribArray(0);
+gl.vertexAttrib4f(0, 1, 0, 0, 1);
+checkDraw(0, 3, 255, 0, 0, 255);
+
+glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-attribute.html
new file mode 100644 (file)
index 0000000..f931437
--- /dev/null
@@ -0,0 +1,107 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getActiveAttrib conformance test.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"> </script>
+<script src="../resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute $type attr0;
+void main()
+{
+    gl_Position = vec4(0, 0, 0, attr0$access);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+    gl_FragColor = vec4(0,1,0,1);
+}
+</script>
+<script>
+"use strict";
+description("Tests getActiveAttrib for various types");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var tests = [
+{ glType: gl.FLOAT,      size: 1, type: 'float', access: ''},
+{ glType: gl.FLOAT_VEC2, size: 1, type: 'vec2',  access: '[1]'},
+{ glType: gl.FLOAT_VEC3, size: 1, type: 'vec3',  access: '[2]'},
+{ glType: gl.FLOAT_VEC4, size: 1, type: 'vec4',  access: '[3]'},
+{ glType: gl.FLOAT_MAT2, size: 1, type: 'mat2',  access: '[1][1]'},
+{ glType: gl.FLOAT_MAT3, size: 1, type: 'mat3',  access: '[2][2]'},
+{ glType: gl.FLOAT_MAT4, size: 1, type: 'mat4',  access: '[3][3]'},
+];
+
+var source = document.getElementById('vshader').text;
+var fs = wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER);
+for (var tt = 0; tt < tests.length; ++tt) {
+  var t = tests[tt];
+  var vs = wtu.loadShader(
+      gl,
+      source.replace('$type', t.type).replace('$access', t.access),
+      gl.VERTEX_SHADER);
+  var program = wtu.setupProgram(gl, [vs, fs]);
+  glErrorShouldBe(gl, gl.NO_ERROR, "no errors from setup");
+  var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
+  var found = false;
+  for (var ii = 0; ii < numAttribs; ++ii) {
+    var info = gl.getActiveAttrib(program, ii);
+    if (info.name == 'attr0') {
+      found = true;
+      assertMsg(info.type == t.glType,
+                "type must be " + wtu.glEnumToString(gl, t.glType) + " was " +
+                wtu.glEnumToString(gl, info.type));
+      assertMsg(info.size == t.size,
+                "size must be " + t.size + ' was ' + info.size);
+    }
+  }
+  if (!found) {
+    testFailed("attrib 'attr0' not found");
+  }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-get-active-uniform.html
new file mode 100644 (file)
index 0000000..a745fef
--- /dev/null
@@ -0,0 +1,166 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getActiveUniform conformance test.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"> </script>
+<script src="../resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main()
+{
+    gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform $type uniform0;
+void main()
+{
+    gl_FragColor = vec4(0,$access,0,1);
+}
+</script>
+<script id="fshaderA" type="x-shader/x-fragment">
+precision mediump float;
+uniform float uniform0;
+void main()
+{
+    gl_FragColor = vec4(0,uniform0,0,1);
+}
+</script>
+<script id="fshaderB" type="x-shader/x-fragment">
+precision mediump float;
+uniform float uniform0;
+uniform float uniform1;
+void main()
+{
+    gl_FragColor = vec4(0,uniform0,uniform1,1);
+}
+</script>
+<script>
+"use strict";
+description("Tests getActiveUniform for various types");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var tests = [
+{ glType: gl.FLOAT,      size: 1, type: 'float', access: 'uniform0'},
+{ glType: gl.FLOAT_VEC2, size: 1, type: 'vec2',  access: 'uniform0[1]'},
+{ glType: gl.FLOAT_VEC3, size: 1, type: 'vec3',  access: 'uniform0[2]'},
+{ glType: gl.FLOAT_VEC4, size: 1, type: 'vec4',  access: 'uniform0[3]'},
+{ glType: gl.FLOAT_MAT2, size: 1, type: 'mat2',  access: 'uniform0[1][1]'},
+{ glType: gl.FLOAT_MAT3, size: 1, type: 'mat3',  access: 'uniform0[2][2]'},
+{ glType: gl.FLOAT_MAT3, size: 1, type: 'mat3',  access: 'uniform0[2][2]'},
+{ glType: gl.FLOAT_MAT4, size: 1, type: 'mat4',  access: 'uniform0[3][3]'},
+{ glType: gl.INT,        size: 1, type: 'int',   access: 'float(uniform0)'},
+{ glType: gl.INT_VEC2,   size: 1, type: 'ivec2', access: 'float(uniform0[1])'},
+{ glType: gl.INT_VEC3,   size: 1, type: 'ivec3', access: 'float(uniform0[2])'},
+{ glType: gl.INT_VEC4,   size: 1, type: 'ivec4', access: 'float(uniform0[3])'},
+{ glType: gl.BOOL,       size: 1, type: 'bool',  access: 'float(uniform0)'},
+{ glType: gl.BOOL_VEC2,  size: 1, type: 'bvec2', access: 'float(uniform0[1])'},
+{ glType: gl.BOOL_VEC3,  size: 1, type: 'bvec3', access: 'float(uniform0[2])'},
+{ glType: gl.BOOL_VEC4,  size: 1, type: 'bvec4', access: 'float(uniform0[3])'},
+{ glType: gl.SAMPLER_2D,
+  size: 1,
+  type: 'sampler2D',
+  access: 'texture2D(uniform0, vec2(0,0)).x'
+},
+{ glType: gl.SAMPLER_CUBE,
+  size: 1,
+  type: 'samplerCube',
+  access: 'textureCube(uniform0, vec3(0,1,0)).x'
+}
+];
+
+var vs = wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER);
+var source = document.getElementById('fshader').text;
+
+function createProgram(type, access) {
+  var fs = wtu.loadShader(
+      gl,
+      source.replace('$type', type).replace('$access', access),
+      gl.FRAGMENT_SHADER);
+  var program = wtu.setupProgram(gl, [vs, fs]);
+  glErrorShouldBe(gl, gl.NO_ERROR, "no errors from setup");
+  return program;
+}
+
+for (var tt = 0; tt < tests.length; ++tt) {
+  var t = tests[tt];
+  var program = createProgram(t.type, t.access);
+  var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+  var found = false;
+  for (var ii = 0; ii < numUniforms; ++ii) {
+    var info = gl.getActiveUniform(program, ii);
+    if (info.name == 'uniform0') {
+      found = true;
+      assertMsg(info.type == t.glType,
+                "type must be " + wtu.glEnumToString(gl, t.glType) + " was " +
+                wtu.glEnumToString(gl, info.type));
+      assertMsg(info.size == t.size,
+                "size must be " + t.size + ' was ' + info.size);
+    }
+  }
+  if (!found) {
+    testFailed("uniform 'uniform0' not found");
+  }
+}
+
+var p1 = wtu.setupProgram(gl, [vs, 'fshaderA']);
+glErrorShouldBe(gl, gl.NO_ERROR, "no errors from program A");
+var p2 = wtu.setupProgram(gl, [vs, 'fshaderB']);
+glErrorShouldBe(gl, gl.NO_ERROR, "no errors from program B");
+var l1 = gl.getUniformLocation(p1, 'uniform0');
+glErrorShouldBe(gl, gl.NO_ERROR, "no errors getting location of uniform0 p1");
+var l2 = gl.getUniformLocation(p2, 'uniform0');
+glErrorShouldBe(gl, gl.NO_ERROR, "no errors getting location of uniform0 p2");
+
+gl.useProgram(p2);
+gl.uniform1f(l2, 1);
+glErrorShouldBe(gl, gl.NO_ERROR, "no errors setting uniform 0");
+gl.uniform1f(l1, 2);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+                "setting a uniform using a location from another program");
+
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-getshadersource.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-getshadersource.html
new file mode 100644 (file)
index 0000000..7fbe20e
--- /dev/null
@@ -0,0 +1,61 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+   <title>WebGL getShaderSource conformance test.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"> </script>
+<script src="../resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">abc//defNOTASCII</script>
+<script>
+"use strict";
+description("Tests that the source that goes into a shader is what comes out.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var original = document.getElementById("vshader").text;
+var shader = gl.createShader(gl.VERTEX_SHADER);
+gl.shaderSource(shader, original);
+var source = gl.getShaderSource(shader);
+shouldBe("source", "original");
+glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-shader-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-shader-test.html
new file mode 100644 (file)
index 0000000..742df95
--- /dev/null
@@ -0,0 +1,116 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ShaderL Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"></script>
+<script src="../resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<script id="vs" type="x-shader/x-fragment">
+attribute vec4 vPosition;
+varying vec2 texCoord;
+void main() {
+    gl_Position = vPosition;
+    texCoord = vPosition.xy * 0.5 + 0.5;
+}
+</script>
+<script id="fs-green" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+    gl_FragData[0] = vec4(0, 1, 0, 1);
+}
+</script>
+<script id="fs-red" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+    gl_FragData[0] = vec4(1, 0, 0, 1);
+}
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test checks a few things about WebGL Shaders.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+
+  debug("");
+  debug("Checking shaders.");
+
+  // Create the shader object
+  var shader = gl.createShader(desktopGL['GEOMETRY_SHADER_ARB']);
+  assertMsg(shader == null,
+            "should not be able to create GEOMETRY shader");
+
+  checkDeferredCompliation()
+}
+
+function checkDeferredCompliation() {
+  var vs = gl.createShader(gl.VERTEX_SHADER);
+  gl.shaderSource(vs, document.getElementById("vs").text);
+  gl.compileShader(vs);
+  var fs = gl.createShader(gl.FRAGMENT_SHADER);
+  // Compile the green shader
+  gl.shaderSource(fs, document.getElementById("fs-green").text);
+  gl.compileShader(fs);
+  // Load the red shader source but do NOT compile it
+  gl.shaderSource(fs, document.getElementById("fs-red").text);
+  var p = gl.createProgram();
+  gl.attachShader(p, vs);
+  gl.attachShader(p, fs);
+  gl.bindAttribLocation(p, 0, "vPosition");
+  gl.linkProgram(p);
+  gl.useProgram(p);
+  wtu.setupUnitQuad(gl, 0, 1);
+  wtu.drawQuad(gl);
+  wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/invalid-UTF-16.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/invalid-UTF-16.html
new file mode 100644 (file)
index 0000000..a2b4583
--- /dev/null
@@ -0,0 +1,70 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!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>
+<script src="../resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+"use strict";
+description('This test verifies that the internal conversion from UTF16 to UTF8 is robust to invalid inputs. Any DOM entry point which converts an incoming string to UTF8 could be used for this test.');
+
+var array = [];
+array.push(String.fromCharCode(0x48)); // H
+array.push(String.fromCharCode(0x69)); // i
+array.push(String.fromCharCode(0xd87e)); // Bogus
+var string = array.join('');
+
+// In order to make this test not depend on WebGL, the following were
+// attempted:
+//  - Send a string to console.log
+//  - Submit a mailto: form containing a text input with the bogus
+//    string
+// The first code path does not perform a utf8 conversion of the
+// incoming string unless Console::shouldPrintExceptions() returns
+// true. The second seems to sanitize the form's input before
+// converting it to a UTF8 string.
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var program = gl.createProgram();
+gl.bindAttribLocation(program, 0, string);
+testPassed("bindAttribLocation with invalid UTF-16 did not crash");
+
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html
new file mode 100644 (file)
index 0000000..f840908
--- /dev/null
@@ -0,0 +1,126 @@
+<!--
+
+/*
+** Copyright (c) 2012 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Program Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../../resources/js-test-pre.js"></script>
+<script src="../resources/webgl-test.js"></script>
+<script src="../resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script id="vertexShader" language="x-shader/x-vertex">
+attribute vec4 ATTR0;
+void main()
+{
+  gl_Position = ATTR0;
+}
+</script>
+<script id="fragmentShader" language="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+  float _Intensity = exp2(gl_FragCoord.w);
+  if (_Intensity < 0.5) {
+    discard;
+  }
+  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description('Regression test for crash in Mac OS AMD OpenGL driver related to use of discard in fragment shader.<br><br>More specifically, triggering the crash seems to require examination of gl_FragCoord.w, use of exp2, and a call to discard in the fragment shader. Thanks to Sheheryar Zakaria and Michael Braithwaite at Turbulenz for the original test case.<br><a href="https://bugs.webkit.org/show_bug.cgi?id=73932">WebKit bug 73932</a><br>');
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+  testFailed("context does not exist");
+} else {
+  testPassed("context exists");
+}
+
+debug("");
+
+var vertexShaderSource = document.getElementById("vertexShader").text;
+var fragmentShaderSource = document.getElementById("fragmentShader").text;
+var vertexShader = gl.createShader(gl.VERTEX_SHADER);
+gl.shaderSource(vertexShader, vertexShaderSource);
+gl.compileShader(vertexShader);
+var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
+gl.shaderSource(fragmentShader, fragmentShaderSource);
+gl.compileShader(fragmentShader);
+var program = gl.createProgram();
+gl.attachShader(program, vertexShader);
+gl.attachShader(program, fragmentShader);
+
+gl.bindAttribLocation(program, 0, "ATTR0");
+
+gl.linkProgram(program);
+
+var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
+if (linked) {
+  testPassed("Program linked successfully");
+} else {
+  testFailed("Program failed to link");
+}
+
+// Crash occurs here on affected machines
+gl.useProgram(program);
+
+// In some browsers, such as Chrome, the above crash only causes a
+// lost context event to be dispatched, and not synchronously. To verify
+// that everything worked, clear and read back the frame buffer.
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+var pixels = new Uint8Array(4);
+gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+if (pixels[0] == 255 &&
+    pixels[1] == 0 &&
+    pixels[2] == 0 &&
+    pixels[3] == 255) {
+  testPassed("useProgram, clear and readback executed successfully");
+} else {
+  testFailed("color was (" +
+           pixels[0] + ", " + pixels[1] + ", " + pixels[2] + ", " + pixels[3] +
+           "), should be (255, 0, 0, 255)");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../resources/js-test-post.js"></script>
+
+</body>
+</html>