Modified: trunk/LayoutTests/ChangeLog (161793 => 161794)
--- trunk/LayoutTests/ChangeLog 2014-01-12 03:23:25 UTC (rev 161793)
+++ trunk/LayoutTests/ChangeLog 2014-01-12 03:53:39 UTC (rev 161794)
@@ -1,3 +1,16 @@
+2014-01-11 Brent Fulgham <[email protected]>
+
+ [WebGL] Correct uniform input validation for texture sampler uniforms
+ https://bugs.webkit.org/show_bug.cgi?id=126775
+
+ Reviewed by Anders Carlsson.
+
+ * fast/canvas/webgl/uniform-samplers-test-expected.txt: Added.
+ * fast/canvas/webgl/uniform-samplers-test.html: Corrected resource
+ includes when moving from khronos suite to our fast suite.
+ * resources/js-test-pre.js:
+ (expectTrue): Added.
+
2014-01-11 Dean Jackson <[email protected]>
[JSC] Revise typed array implementations to match ECMAScript and WebGL Specification
Added: trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test-expected.txt (0 => 161794)
--- trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test-expected.txt 2014-01-12 03:53:39 UTC (rev 161794)
@@ -0,0 +1,17 @@
+Tests that only Uniform1i and Uniform1iv can be used to setsampler uniforms.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS getError was expected value: NO_ERROR : uniform1i can set a sampler uniform
+PASS getError was expected value: NO_ERROR : uniform1iv can set a sampler uniform
+PASS getError was expected value: NO_ERROR : uniform1iv can set a sampler uniform
+PASS getError was expected value: INVALID_OPERATION : uniform1f returns INVALID_OPERATION if attempting to set a sampler uniform
+PASS getError was expected value: INVALID_OPERATION : uniform1fv returns INVALID_OPERATION if attempting to set a sampler uniform
+PASS uniform1i works for any valid texture unit
+PASS uniform1iv works for any valid texture unit
+PASS uniform1i generates INVALID_VALUE for invalid texture units
+PASS uniform1iv generates INVALID_VALUE for invalid texture units
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test.html (161793 => 161794)
--- trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test.html 2014-01-12 03:23:25 UTC (rev 161793)
+++ trunk/LayoutTests/fast/canvas/webgl/uniform-samplers-test.html 2014-01-12 03:53:39 UTC (rev 161794)
@@ -1,39 +1,10 @@
-<!--
-
-/*
-** 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 sampler uniforms conformance test.</title>
- <link rel="stylesheet" href=""
- <script src=""
- <script src="" </script>
- <script src=""
+ <script src=""
+ <script src="" </script>
+ <script src=""
</head>
<body>
<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -48,6 +19,9 @@
"Tests that only Uniform1i and Uniform1iv can be used to set" +
"sampler uniforms.");
+ if (window.internals)
+ window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
+
var canvas2d = document.getElementById("canvas2d");
var wtu = WebGLTestUtils;
@@ -55,7 +29,7 @@
var program = wtu.setupTexturedQuad(gl);
var textureLoc = gl.getUniformLocation(program, "tex");
- var testInt32Array = new Int32Array(4);
+ var testInt32Array = new Int32Array(1);
gl.uniform1i(textureLoc, 1);
glErrorShouldBe(gl, gl.NO_ERROR,
@@ -108,7 +82,7 @@
init();
var successfullyParsed = true;
</script>
-<script src=""
+<script src=""
</body>
</html>
Modified: trunk/LayoutTests/resources/js-test-pre.js (161793 => 161794)
--- trunk/LayoutTests/resources/js-test-pre.js 2014-01-12 03:23:25 UTC (rev 161793)
+++ trunk/LayoutTests/resources/js-test-pre.js 2014-01-12 03:53:39 UTC (rev 161794)
@@ -564,6 +564,14 @@
testPassed(_a + " is >= " + _b);
}
+function expectTrue(v, msg) {
+ if (v) {
+ testPassed(msg);
+ } else {
+ testFailed(msg);
+ }
+}
+
function shouldNotThrow(_a) {
try {
eval(_a);