[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
kbr at google.com
kbr at google.com
Wed Dec 22 11:14:13 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c41427b34726dbff42103883641f7b921a20c8cc
Author: kbr at google.com <kbr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jul 15 19:12:47 2010 +0000
2010-07-15 Kenneth Russell <kbr at google.com>
Reviewed by Nate Chapin.
Synchronize Khronos and WebKit WebGL tests
https://bugs.webkit.org/show_bug.cgi?id=42185
For the WebGL tests in the Khronos repository that originated in
the WebKit repository, synchronized the latest versions of these
tests using a script which will be checked in later. Copied
webgl-test-utils.js from Khronos repo and added needed entry
points to webgl-test.js. Rebaselined tests as necessary and
verified the rebaselining manually.
* fast/canvas/webgl/array-buffer-crash-expected.txt:
* fast/canvas/webgl/array-buffer-crash.html:
* fast/canvas/webgl/array-unit-tests.html:
* fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt:
* fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
* fast/canvas/webgl/context-attributes-expected.txt:
* fast/canvas/webgl/context-attributes.html:
* fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html:
* fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt:
* fast/canvas/webgl/draw-arrays-out-of-bounds.html:
* fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
* fast/canvas/webgl/draw-elements-out-of-bounds.html:
* fast/canvas/webgl/error-reporting-expected.txt:
* fast/canvas/webgl/error-reporting.html:
* fast/canvas/webgl/get-active-test-expected.txt:
* fast/canvas/webgl/get-active-test.html:
* fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt:
* fast/canvas/webgl/gl-bind-attrib-location-test.html:
* fast/canvas/webgl/gl-enable-enum-test.html:
* fast/canvas/webgl/gl-enum-tests-expected.txt:
* fast/canvas/webgl/gl-enum-tests.html:
* fast/canvas/webgl/gl-get-calls-expected.txt:
* fast/canvas/webgl/gl-get-calls.html:
* fast/canvas/webgl/gl-object-get-calls-expected.txt:
* fast/canvas/webgl/gl-object-get-calls.html:
* fast/canvas/webgl/gl-uniform-arrays.html:
* fast/canvas/webgl/gl-uniformmatrix4fv.html:
* fast/canvas/webgl/index-validation-copies-indices-expected.txt:
* fast/canvas/webgl/index-validation-copies-indices.html:
* fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt:
* fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html:
* fast/canvas/webgl/index-validation-expected.txt:
* fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt:
* fast/canvas/webgl/index-validation-verifies-too-many-indices.html:
* fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt:
* fast/canvas/webgl/index-validation-with-resized-buffer.html:
* fast/canvas/webgl/index-validation.html:
* fast/canvas/webgl/invalid-UTF-16.html:
* fast/canvas/webgl/null-object-behaviour-expected.txt:
* fast/canvas/webgl/null-object-behaviour.html:
* fast/canvas/webgl/null-uniform-location.html:
* fast/canvas/webgl/point-size-expected.txt:
* fast/canvas/webgl/point-size.html:
* fast/canvas/webgl/renderbuffer-initialization-expected.txt:
* fast/canvas/webgl/renderbuffer-initialization.html:
* fast/canvas/webgl/resources/webgl-test-utils.js: Added.
(WebGLTestUtils):
(WebGLTestUtils.):
* fast/canvas/webgl/resources/webgl-test.js:
(initNonKhronosFramework):
(nonKhronosFrameworkNotifyDone):
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt:
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html:
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt:
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html:
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt:
* fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html:
* fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt:
* fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html:
* fast/canvas/webgl/tex-image-with-format-and-type-expected.txt:
* fast/canvas/webgl/tex-image-with-format-and-type.html:
* fast/canvas/webgl/tex-sub-image-2d-expected.txt:
* fast/canvas/webgl/tex-sub-image-2d.html:
* fast/canvas/webgl/texture-active-bind.html:
* fast/canvas/webgl/texture-complete.html:
* fast/canvas/webgl/texture-npot-expected.txt:
* fast/canvas/webgl/texture-npot.html:
* fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt:
* fast/canvas/webgl/texture-transparent-pixels-initialized.html:
* fast/canvas/webgl/triangle-expected.txt:
* fast/canvas/webgl/triangle.html:
* fast/canvas/webgl/uniform-location-expected.txt:
* fast/canvas/webgl/uniform-location.html:
* fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt:
* fast/canvas/webgl/viewport-unchanged-upon-resize.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 245d944..c66f5a6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,93 @@
+2010-07-15 Kenneth Russell <kbr at google.com>
+
+ Reviewed by Nate Chapin.
+
+ Synchronize Khronos and WebKit WebGL tests
+ https://bugs.webkit.org/show_bug.cgi?id=42185
+
+ For the WebGL tests in the Khronos repository that originated in
+ the WebKit repository, synchronized the latest versions of these
+ tests using a script which will be checked in later. Copied
+ webgl-test-utils.js from Khronos repo and added needed entry
+ points to webgl-test.js. Rebaselined tests as necessary and
+ verified the rebaselining manually.
+
+ * fast/canvas/webgl/array-buffer-crash-expected.txt:
+ * fast/canvas/webgl/array-buffer-crash.html:
+ * fast/canvas/webgl/array-unit-tests.html:
+ * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt:
+ * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
+ * fast/canvas/webgl/context-attributes-expected.txt:
+ * fast/canvas/webgl/context-attributes.html:
+ * fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html:
+ * fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt:
+ * fast/canvas/webgl/draw-arrays-out-of-bounds.html:
+ * fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt:
+ * fast/canvas/webgl/draw-elements-out-of-bounds.html:
+ * fast/canvas/webgl/error-reporting-expected.txt:
+ * fast/canvas/webgl/error-reporting.html:
+ * fast/canvas/webgl/get-active-test-expected.txt:
+ * fast/canvas/webgl/get-active-test.html:
+ * fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt:
+ * fast/canvas/webgl/gl-bind-attrib-location-test.html:
+ * fast/canvas/webgl/gl-enable-enum-test.html:
+ * fast/canvas/webgl/gl-enum-tests-expected.txt:
+ * fast/canvas/webgl/gl-enum-tests.html:
+ * fast/canvas/webgl/gl-get-calls-expected.txt:
+ * fast/canvas/webgl/gl-get-calls.html:
+ * fast/canvas/webgl/gl-object-get-calls-expected.txt:
+ * fast/canvas/webgl/gl-object-get-calls.html:
+ * fast/canvas/webgl/gl-uniform-arrays.html:
+ * fast/canvas/webgl/gl-uniformmatrix4fv.html:
+ * fast/canvas/webgl/index-validation-copies-indices-expected.txt:
+ * fast/canvas/webgl/index-validation-copies-indices.html:
+ * fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt:
+ * fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html:
+ * fast/canvas/webgl/index-validation-expected.txt:
+ * fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt:
+ * fast/canvas/webgl/index-validation-verifies-too-many-indices.html:
+ * fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt:
+ * fast/canvas/webgl/index-validation-with-resized-buffer.html:
+ * fast/canvas/webgl/index-validation.html:
+ * fast/canvas/webgl/invalid-UTF-16.html:
+ * fast/canvas/webgl/null-object-behaviour-expected.txt:
+ * fast/canvas/webgl/null-object-behaviour.html:
+ * fast/canvas/webgl/null-uniform-location.html:
+ * fast/canvas/webgl/point-size-expected.txt:
+ * fast/canvas/webgl/point-size.html:
+ * fast/canvas/webgl/renderbuffer-initialization-expected.txt:
+ * fast/canvas/webgl/renderbuffer-initialization.html:
+ * fast/canvas/webgl/resources/webgl-test-utils.js: Added.
+ (WebGLTestUtils):
+ (WebGLTestUtils.):
+ * fast/canvas/webgl/resources/webgl-test.js:
+ (initNonKhronosFramework):
+ (nonKhronosFrameworkNotifyDone):
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt:
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html:
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt:
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html:
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt:
+ * fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html:
+ * fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt:
+ * fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html:
+ * fast/canvas/webgl/tex-image-with-format-and-type-expected.txt:
+ * fast/canvas/webgl/tex-image-with-format-and-type.html:
+ * fast/canvas/webgl/tex-sub-image-2d-expected.txt:
+ * fast/canvas/webgl/tex-sub-image-2d.html:
+ * fast/canvas/webgl/texture-active-bind.html:
+ * fast/canvas/webgl/texture-complete.html:
+ * fast/canvas/webgl/texture-npot-expected.txt:
+ * fast/canvas/webgl/texture-npot.html:
+ * fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt:
+ * fast/canvas/webgl/texture-transparent-pixels-initialized.html:
+ * fast/canvas/webgl/triangle-expected.txt:
+ * fast/canvas/webgl/triangle.html:
+ * fast/canvas/webgl/uniform-location-expected.txt:
+ * fast/canvas/webgl/uniform-location.html:
+ * fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt:
+ * fast/canvas/webgl/viewport-unchanged-upon-resize.html:
+
2010-07-15 Ojan Vafai <ojan at chromium.org>
Unreviewed.
diff --git a/LayoutTests/fast/canvas/webgl/array-buffer-crash-expected.txt b/LayoutTests/fast/canvas/webgl/array-buffer-crash-expected.txt
index 2255193..9d306c7 100644
--- a/LayoutTests/fast/canvas/webgl/array-buffer-crash-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/array-buffer-crash-expected.txt
@@ -1,8 +1,8 @@
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=31889 : [v8] WebCore::WebGLArrayBufferInternal::byteLengthAttrGetter NULL pointer
+Test ArrayBuffer.byteLength
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS new WebGLArrayBuffer().byteLength did not crash
+PASS new ArrayBuffer().byteLength did not crash
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/array-buffer-crash.html b/LayoutTests/fast/canvas/webgl/array-buffer-crash.html
index eba1de7..54e63b5 100644
--- a/LayoutTests/fast/canvas/webgl/array-buffer-crash.html
+++ b/LayoutTests/fast/canvas/webgl/array-buffer-crash.html
@@ -10,12 +10,12 @@
<script>
-description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=31889">https://bugs.webkit.org/show_bug.cgi?id=31889</a> : <code>[v8] WebCore::WebGLArrayBufferInternal::byteLengthAttrGetter NULL pointer</code>');
+description('Test ArrayBuffer.byteLength');
<!-- The following used to cause a crash in Chrome -->
-new WebGLArrayBuffer().byteLength;
+new ArrayBuffer().byteLength;
-testPassed("new WebGLArrayBuffer().byteLength did not crash");
+testPassed("new ArrayBuffer().byteLength did not crash");
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/array-unit-tests.html b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
index e34ad4e..784f896 100644
--- a/LayoutTests/fast/canvas/webgl/array-unit-tests.html
+++ b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
@@ -703,8 +703,5 @@ successfullyParsed = true;
</script>
<script src="../../js/resources/js-test-post.js"></script>
-<script>
-</script>
-
</body>
</html>
diff --git a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt
index 4fb2399..bdd5c8c 100644
--- a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt
@@ -3,7 +3,6 @@ Verify WebGLContextAttributes are working as specified, including alpha, depth,
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=33416 : Hook up WebGLContextAttributes to OpenGL context creation code
Testing alpha = true
PASS webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0) is non-null.
PASS contextAttribs = webGL.getContextAttributes() is non-null.
diff --git a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
index 8627698..b8edb5b 100644
--- a/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
+++ b/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
@@ -35,16 +35,12 @@ var correctColor = null;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
- debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=33416">https://bugs.webkit.org/show_bug.cgi?id=33416</a> : <code>Hook up WebGLContextAttributes to OpenGL context creation code</code>');
-
runTest();
}
@@ -57,7 +53,7 @@ function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStenc
return null;
}
var actualContextAttribs = gl.getContextAttributes();
-
+
// Add a console
gl.console = ("console" in window) ? window.console : { log: function() { } };
@@ -294,8 +290,8 @@ function runTest()
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/context-attributes-expected.txt b/LayoutTests/fast/canvas/webgl/context-attributes-expected.txt
index a1b1761..35e8b9d 100644
--- a/LayoutTests/fast/canvas/webgl/context-attributes-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/context-attributes-expected.txt
@@ -32,7 +32,7 @@ PASS attribs.depth is true
PASS attribs.alpha is true
PASS attribs.stencil == true || attribs.stencil == false is true
PASS attribs.antialias is false
-PASS attribs.premultipliedAlpha is true
+PASS attribs.premultipliedAlpha == true || attribs.premultipliedAlpha == false is true
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/context-attributes.html b/LayoutTests/fast/canvas/webgl/context-attributes.html
index 2e7917a..268d153 100644
--- a/LayoutTests/fast/canvas/webgl/context-attributes.html
+++ b/LayoutTests/fast/canvas/webgl/context-attributes.html
@@ -44,14 +44,14 @@ shouldBe("attribs.antialias", "false");
shouldBe("attribs.premultipliedAlpha", "true");
debug("Test customized values");
-// (premultipliedAlpha == false) is not supported, default to true
+// (premultipliedAlpha == false) is not supported by most implementations yet
shouldBeNonNull("context = create3DContext(null, { premultipliedAlpha: false, antialias: false })");
shouldBeNonNull("attribs = context.getContextAttributes()");
shouldBe("attribs.depth", "true");
shouldBe("attribs.alpha", "true");
shouldBe("attribs.stencil == true || attribs.stencil == false", "true");
shouldBe("attribs.antialias", "false");
-shouldBe("attribs.premultipliedAlpha", "true");
+shouldBe("attribs.premultipliedAlpha == true || attribs.premultipliedAlpha == false", "true");
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html b/LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
index 53cbc11..14233b1 100644
--- a/LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
+++ b/LayoutTests/fast/canvas/webgl/copy-tex-image-and-sub-image-2d.html
@@ -18,7 +18,12 @@ void main()
<script id="fshader" type="x-shader/x-fragment">
uniform sampler2D tex;
+// Workaround for non-compliant WebGL implementations (FIXME)
+#if defined(GL_ES)
+varying mediump vec2 texCoord;
+#else
varying vec2 texCoord;
+#endif
void main()
{
@@ -31,10 +36,8 @@ var successfullyParsed = false;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verify copyTexImage2D and copyTexSubImage2D');
@@ -97,7 +100,7 @@ function runTestIteration(antialias)
// Bind the texture to texture unit 0
gl.bindTexture(gl.TEXTURE_2D, texture);
// Set up texture
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
@@ -175,8 +178,8 @@ function runTest(antialias)
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt b/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt
index 092a128..036b77d 100644
--- a/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds-expected.txt
@@ -3,26 +3,40 @@ Test of drawArrays with out-of-bounds parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test empty buffer
+PASS context.drawArrays(context.TRIANGLES, 0, 1) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0, 10000) generated expected GL error: INVALID_OPERATION.
+PASS context.drawArrays(context.TRIANGLES, 0, 10000000000000) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0, -1) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, 1, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, -1, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, 0, 0) generated expected GL error: NO_ERROR.
PASS context.drawArrays(context.TRIANGLES, 100, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawArrays(context.TRIANGLES, 1, -1) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, -1, 1) generated expected GL error: INVALID_VALUE.
Test buffer with 3 float vectors
-PASS context.checkFramebufferStatus(context.FRAMEBUFFER) is context.FRAMEBUFFER_COMPLETE
-PASS context.drawArrays(context.TRIANGLES, 0, 3) is undefined
PASS context.drawArrays(context.TRIANGLES, 0, 3) generated expected GL error: NO_ERROR.
PASS context.drawArrays(0x0009, 0, 3) generated expected GL error: INVALID_ENUM.
PASS context.drawArrays(context.TRIANGLES, 3, 2) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0, 10000) generated expected GL error: INVALID_OPERATION.
+PASS context.drawArrays(context.TRIANGLES, 0, 10000000000000) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0, -1) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, -1, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, 0, 0) generated expected GL error: NO_ERROR.
PASS context.drawArrays(context.TRIANGLES, 100, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawArrays(context.TRIANGLES, 1, -1) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, -1, 1) generated expected GL error: INVALID_VALUE.
+
+Test buffer with interleaved (3+2) float vectors
+PASS context.drawArrays(context.TRIANGLES, 0, 9) generated expected GL error: NO_ERROR.
+PASS context.drawArrays(context.TRIANGLES, 0, -500) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, -200, 1) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, -200, -500) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, 0, 0xffffffff) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, 0xffffffff, 1) generated expected GL error: INVALID_VALUE.
PASS context.drawArrays(context.TRIANGLES, 0xffffffff, 0xffffffff) generated expected GL error: INVALID_VALUE.
+PASS context.drawArrays(context.TRIANGLES, 0, 200) generated expected GL error: INVALID_OPERATION.
+PASS context.drawArrays(context.TRIANGLES, 0, 0x7fffffff) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0x7fffffff, 1) generated expected GL error: INVALID_OPERATION.
PASS context.drawArrays(context.TRIANGLES, 0x7fffffff, 0x7fffffff) generated expected GL error: INVALID_OPERATION.
diff --git a/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html b/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html
index ab7878b..1c50739 100644
--- a/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html
+++ b/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html
@@ -20,28 +20,69 @@ context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
context.enableVertexAttribArray(0);
debug("Test empty buffer")
-context.bufferData(context.ARRAY_BUFFER, new WebGLFloatArray([ ]), context.STATIC_DRAW);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ ]), context.STATIC_DRAW);
context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 1)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 10000)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 10000000000000)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0, -1)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 1, 0)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -1, 0)");
shouldGenerateGLError(context, context.NO_ERROR, "context.drawArrays(context.TRIANGLES, 0, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 100, 0)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 1, -1)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -1, 1)");
debug("")
debug("Test buffer with 3 float vectors")
-context.bufferData(context.ARRAY_BUFFER, new WebGLFloatArray([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), context.STATIC_DRAW);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), context.STATIC_DRAW);
context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
-shouldBe("context.checkFramebufferStatus(context.FRAMEBUFFER)", "context.FRAMEBUFFER_COMPLETE");
-shouldBe("context.drawArrays(context.TRIANGLES, 0, 3)", "undefined");
shouldGenerateGLError(context, context.NO_ERROR, "context.drawArrays(context.TRIANGLES, 0, 3)");
shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawArrays(0x0009, 0, 3)"); // GL_POLYGON
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 3, 2)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 10000)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 10000000000000)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0, -1)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -1, 0)");
shouldGenerateGLError(context, context.NO_ERROR, "context.drawArrays(context.TRIANGLES, 0, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 100, 0)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 1, -1)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -1, 1)");
+
+debug("")
+debug("Test buffer with interleaved (3+2) float vectors")
+
+var program2 = createProgram(context,
+ "attribute vec3 aOne;" +
+ "attribute vec2 aTwo;" +
+ "void main() { gl_Position = vec4(aOne, 1.0) + vec4(aTwo, 0.0, 1.0); }",
+ "void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }",
+ [ "aOne", "aTwo" ]);
+if (!program2) {
+ testFailed("failed to create test program");
+}
+
+context.useProgram(program2);
+
+var vbo = context.createBuffer();
+context.bindBuffer(context.ARRAY_BUFFER, vbo);
+// enough for 9 vertices, so 3 triangles
+context.bufferData(context.ARRAY_BUFFER, new Float32Array(9*5), context.STATIC_DRAW);
+
+// bind first 3 elements, with a stride of 5 float elements
+context.vertexAttribPointer(0, 3, context.FLOAT, false, 5*4, 0);
+// bind 2 elements, starting after the first 3; same stride of 5 float elements
+context.vertexAttribPointer(1, 2, context.FLOAT, false, 5*4, 3*4);
+
+context.enableVertexAttribArray(0);
+context.enableVertexAttribArray(1);
+
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawArrays(context.TRIANGLES, 0, 9)");
+
+// negative values must generate INVALID_VALUE; they can never be valid
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0, -500)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -200, 1)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, -200, -500)");
// 0xffffffff needs to convert to a 'long' IDL argument as -1, as per
// WebIDL 4.1.7. JS ToInt32(0xffffffff) == -1, which is the first step
@@ -49,6 +90,11 @@ shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(co
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0, 0xffffffff)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0xffffffff, 1)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawArrays(context.TRIANGLES, 0xffffffff, 0xffffffff)");
+
+// values that could otherwise be valid but aren't due to bindings generate
+// INVALID_OPERATION
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 200)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0, 0x7fffffff)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0x7fffffff, 1)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawArrays(context.TRIANGLES, 0x7fffffff, 0x7fffffff)");
diff --git a/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt b/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt
index 4d341cb..6ff9c3b 100644
--- a/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds-expected.txt
@@ -5,27 +5,43 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Test empty index buffer
PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1) generated expected GL error: INVALID_VALUE.
+PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE.
Test buffer with 3 byte indexes
-PASS context.checkFramebufferStatus(context.FRAMEBUFFER) is context.FRAMEBUFFER_COMPLETE
-PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) is undefined
PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR.
PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_INT, 0) generated expected GL error: INVALID_ENUM.
PASS context.drawElements(0x0009, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_ENUM.
PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 2) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1) generated expected GL error: INVALID_VALUE.
+PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 4) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE.
PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0x7fffffff) generated expected GL error: INVALID_OPERATION.
+Test buffer with interleaved (3+2) float vectors
+PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR.
+PASS context.drawElements(context.TRIANGLES, 9, context.FLOAT, 0) generated expected GL error: INVALID_ENUM.
+PASS context.drawElements(context.TRIANGLES, 9, context.SHORT, 0) generated expected GL error: INVALID_ENUM.
+PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_INT, 0) generated expected GL error: INVALID_ENUM.
+PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 1000) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 12, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 15, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 18, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 2*15) generated expected GL error: INVALID_OPERATION.
+PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_VALUE.
+PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
+
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html b/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html
index 9ad8092..9f76c52 100644
--- a/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html
+++ b/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html
@@ -18,41 +18,99 @@ context.useProgram(program);
var vertexObject = context.createBuffer();
context.enableVertexAttribArray(0);
context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
-context.bufferData(context.ARRAY_BUFFER, new WebGLFloatArray([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), context.STATIC_DRAW);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), context.STATIC_DRAW);
context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
var indexObject = context.createBuffer();
debug("Test empty index buffer")
context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
-context.bufferData(context.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedByteArray([ ]), context.STATIC_DRAW);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint8Array([ ]), context.STATIC_DRAW);
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1)");
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 0)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1)");
debug("")
debug("Test buffer with 3 byte indexes")
context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
-context.bufferData(context.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedByteArray([ 0, 1, 2 ]), context.STATIC_DRAW);
-shouldBe("context.checkFramebufferStatus(context.FRAMEBUFFER)", "context.FRAMEBUFFER_COMPLETE");
-shouldBe("context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0)", "undefined");
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint8Array([ 0, 1, 2 ]), context.STATIC_DRAW);
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_INT, 0)");
shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawElements(0x0009, 3, context.UNSIGNED_BYTE, 0)"); // GL_POLYGON
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 2)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1)");
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 4)");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0x7fffffff)");
debug("")
+debug("Test buffer with interleaved (3+2) float vectors")
+
+var program2 = createProgram(context,
+ "attribute vec3 aOne;" +
+ "attribute vec2 aTwo;" +
+ "void main() { gl_Position = vec4(aOne, 1.0) + vec4(aTwo, 0.0, 1.0); }",
+ "void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }",
+ [ "aOne", "aTwo" ]);
+if (!program2) {
+ testFailed("failed to create test program");
+}
+
+context.useProgram(program2);
+
+var vbo = context.createBuffer();
+context.bindBuffer(context.ARRAY_BUFFER, vbo);
+// enough for 9 vertices, so 3 triangles
+context.bufferData(context.ARRAY_BUFFER, new Float32Array(9*5), context.STATIC_DRAW);
+
+// bind first 3 elements, with a stride of 5 float elements
+context.vertexAttribPointer(0, 3, context.FLOAT, false, 5*4, 0);
+// bind 2 elements, starting after the first 3; same stride of 5 float elements
+context.vertexAttribPointer(1, 2, context.FLOAT, false, 5*4, 3*4);
+
+context.enableVertexAttribArray(0);
+context.enableVertexAttribArray(1);
+
+var ebo = context.createBuffer();
+context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, ebo);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 0, 1, 2,
+ 1, 2, 0,
+ 2, 0, 1,
+ 200, 200, 200,
+ 0x7fff, 0x7fff, 0x7fff,
+ 0xffff, 0xffff, 0xffff ]),
+ context.STATIC_DRAW);
+
+shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 0)");
+
+// invalid type arguments
+shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawElements(context.TRIANGLES, 9, context.FLOAT, 0)");
+shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawElements(context.TRIANGLES, 9, context.SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_ENUM, "context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_INT, 0)");
+
+// invalid operation with indices that would be valid with correct bindings
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 1000)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 12, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 15, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 18, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 2*15)");
+
+shouldGenerateGLError(context, context.INVALID_VALUE, "context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_SHORT, 0)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_SHORT, 0)");
+
+debug("")
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/error-reporting-expected.txt b/LayoutTests/fast/canvas/webgl/error-reporting-expected.txt
index 910735d..108d8bb 100644
--- a/LayoutTests/fast/canvas/webgl/error-reporting-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/error-reporting-expected.txt
@@ -5,27 +5,27 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS context.getError() is 0
Testing getActiveAttrib
PASS context.getActiveAttrib(null, 2) is null
-PASS context.getError() is context.INVALID_VALUE
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_VALUE :
+PASS getError was expected value: NO_ERROR :
PASS context.getActiveAttrib(program, 2) is null
-PASS context.getError() is context.INVALID_VALUE
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_VALUE :
+PASS getError was expected value: NO_ERROR :
Testing getActiveUniform
PASS context.getActiveUniform(null, 0) is null
-PASS context.getError() is context.INVALID_VALUE
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_VALUE :
+PASS getError was expected value: NO_ERROR :
PASS context.getActiveUniform(program, 50) is null
-PASS context.getError() is context.INVALID_VALUE
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_VALUE :
+PASS getError was expected value: NO_ERROR :
Testing attempts to manipulate the default framebuffer
PASS context.bindFramebuffer(context.FRAMEBUFFER, 0) is undefined.
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: NO_ERROR :
PASS context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0) is undefined.
-PASS context.getError() is context.INVALID_OPERATION
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_OPERATION :
+PASS getError was expected value: NO_ERROR :
PASS context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0) is undefined.
-PASS context.getError() is context.INVALID_OPERATION
-PASS context.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_OPERATION :
+PASS getError was expected value: NO_ERROR :
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/error-reporting.html b/LayoutTests/fast/canvas/webgl/error-reporting.html
index bfb3f1f..b60b3b5 100644
--- a/LayoutTests/fast/canvas/webgl/error-reporting.html
+++ b/LayoutTests/fast/canvas/webgl/error-reporting.html
@@ -26,40 +26,40 @@ shouldBe("context.getError()", "0");
debug("Testing getActiveAttrib");
// Synthetic OpenGL error
shouldBeNull("context.getActiveAttrib(null, 2)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
// Real OpenGL error
shouldBeNull("context.getActiveAttrib(program, 2)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
debug("Testing getActiveUniform");
// Synthetic OpenGL error
shouldBeNull("context.getActiveUniform(null, 0)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
// Real OpenGL error
shouldBeNull("context.getActiveUniform(program, 50)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
debug("Testing attempts to manipulate the default framebuffer");
shouldBeUndefined("context.bindFramebuffer(context.FRAMEBUFFER, 0)");
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
shouldBeUndefined("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0)");
// Synthetic OpenGL error
-shouldBe("context.getError()", "context.INVALID_OPERATION");
+glErrorShouldBe(context, context.INVALID_OPERATION);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
shouldBeUndefined("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0)");
// Synthetic OpenGL error
-shouldBe("context.getError()", "context.INVALID_OPERATION");
+glErrorShouldBe(context, context.INVALID_OPERATION);
// Error state should be clear by this point
-shouldBe("context.getError()", "context.NO_ERROR");
+glErrorShouldBe(context, context.NO_ERROR);
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/get-active-test-expected.txt b/LayoutTests/fast/canvas/webgl/get-active-test-expected.txt
index 757040f..b2841d8 100644
--- a/LayoutTests/fast/canvas/webgl/get-active-test-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/get-active-test-expected.txt
@@ -2,21 +2,16 @@ Test of getActiveAttrib and getActiveUniform
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS context is non-null.
-PASS context2 is non-null.
-PASS program is non-null.
-PASS program2 is non-null.
-PASS context.getError() is context.NO_ERROR
-PASS context2.getError() is context2.NO_ERROR
+PASS getError was expected value: NO_ERROR :
PASS context.getActiveUniform(program, 0).name is 'u_modelViewProjMatrix'
PASS context.getActiveUniform(program, 0).type is context.FLOAT_MAT4
PASS context.getActiveUniform(program, 0).size is 1
PASS context.getActiveUniform(program, 1) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS context.getActiveUniform(program, -1) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS context.getActiveUniform(null, 0) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS info[ii] is non-null.
PASS info[ii] is non-null.
PASS info[ii].name is expected[ii].name
@@ -34,20 +29,22 @@ PASS info2[ii].name is expected2[ii].name
PASS info2[ii].type is expected2[ii].type
PASS info2[ii].size is expected2[ii].size
PASS context.getActiveAttrib(program, 2) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS context.getActiveAttrib(program, -1) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS context.getActiveAttrib(null, 0) is null
-PASS context.getError() is context.INVALID_VALUE
-PASS context2.getError() is context.NO_ERROR
+PASS getError was expected value: INVALID_VALUE :
+PASS getError was expected value: NO_ERROR :
+Check trying to get attribs from different context
PASS context2.getActiveAttrib(program, 0) is null
-PASS context2.getError() is context2.INVALID_OPERATION
+PASS getError was expected value: INVALID_OPERATION :
PASS context2.getActiveUniform(program, 0) is null
-PASS context2.getError() is context2.INVALID_OPERATION
+PASS getError was expected value: INVALID_OPERATION :
+Check trying to get attribs from deleted program
PASS context.getActiveUniform(program, 0) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS context.getActiveAttrib(program, 0) is null
-PASS context.getError() is context.INVALID_VALUE
+PASS getError was expected value: INVALID_VALUE :
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/get-active-test.html b/LayoutTests/fast/canvas/webgl/get-active-test.html
index ba8d785..4e728bd 100644
--- a/LayoutTests/fast/canvas/webgl/get-active-test.html
+++ b/LayoutTests/fast/canvas/webgl/get-active-test.html
@@ -1,3 +1,4 @@
+
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
@@ -12,51 +13,46 @@
description("Test of getActiveAttrib and getActiveUniform");
var context = create3DContext();
-shouldBeNonNull("context");
var context2 = create3DContext();
-shouldBeNonNull("context2");
var program = loadStandardProgram(context);
-shouldBeNonNull("program");
var program2 = loadProgram(context2,
"resources/intArrayUniformShader.vert",
"resources/noopUniformShader.frag");
-shouldBeNonNull("program2");
-shouldBe("context.getError()", "context.NO_ERROR");
-shouldBe("context2.getError()", "context2.NO_ERROR");
+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)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
shouldBeNull("context.getActiveUniform(program, -1)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
shouldBeNull("context.getActiveUniform(null, 0)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+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)
+ 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 }
+ { 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;
+ 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");
+ 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.
@@ -85,23 +81,26 @@ for (var ii = 0; ii < info2.length; ++ii) {
}
shouldBeNull("context.getActiveAttrib(program, 2)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
shouldBeNull("context.getActiveAttrib(program, -1)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
shouldBeNull("context.getActiveAttrib(null, 0)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
+
+glErrorShouldBe(context2, context.NO_ERROR);
-shouldBe("context2.getError()", "context.NO_ERROR");
+debug("Check trying to get attribs from different context");
shouldBeNull("context2.getActiveAttrib(program, 0)");
-shouldBe("context2.getError()", "context2.INVALID_OPERATION");
+glErrorShouldBe(context2, context2.INVALID_OPERATION);
shouldBeNull("context2.getActiveUniform(program, 0)");
-shouldBe("context2.getError()", "context2.INVALID_OPERATION");
+glErrorShouldBe(context2, context2.INVALID_OPERATION);
+debug("Check trying to get attribs from deleted program");
context.deleteProgram(program);
shouldBeNull("context.getActiveUniform(program, 0)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
shouldBeNull("context.getActiveAttrib(program, 0)");
-shouldBe("context.getError()", "context.INVALID_VALUE");
+glErrorShouldBe(context, context.INVALID_VALUE);
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt b/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt
index 3a75ab8..74b7f23 100644
--- a/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test-expected.txt
@@ -4,7 +4,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Canvas.getContext
-PASS [object HTMLCanvasElement] is non-null.
PASS [object WebGLRenderingContext] is non-null.
Checking gl.bindAttribLocation.
diff --git a/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test.html b/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test.html
index de697f3..ee8be57 100644
--- a/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test.html
+++ b/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test.html
@@ -18,15 +18,15 @@ attribute vec4 vColor;
varying vec4 color;
void main()
{
- gl_Position = vPosition;
- color = vColor;
+ gl_Position = vPosition;
+ color = vColor;
}
</script>
<script id="fshader" type="text/something-not-javascript">
varying vec4 color;
void main()
{
- gl_FragColor = color;
+ gl_FragColor = color;
}
</script>
<script>
@@ -35,21 +35,19 @@ description("This test ensures WebGL implementations don't allow names that star
debug("");
debug("Canvas.getContext");
-var canvas = document.getElementById("canvas");
-shouldBeNonNull(canvas);
-var gl = canvas.getContext("experimental-webgl");
+var gl = create3DContext(document.getElementById("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);
+ 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");
+ testPassed("drawing is correct");
}
function loadShader(shaderType, shaderId) {
@@ -59,8 +57,8 @@ function loadShader(shaderType, shaderId) {
// Create the shader object
var shader = gl.createShader(shaderType);
if (shader == null) {
- debug("*** Error: unable to create shader '"+shaderId+"'");
- return null;
+ debug("*** Error: unable to create shader '"+shaderId+"'");
+ return null;
}
// Load the shader source
@@ -72,11 +70,11 @@ function loadShader(shaderType, shaderId) {
// 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;
+ // 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;
}
@@ -104,9 +102,9 @@ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5
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);
+ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1]), gl.STATIC_DRAW);
function setBindLocations(colorLocation, positionLocation) {
gl.bindAttribLocation(program, positionLocation, "vPosition");
diff --git a/LayoutTests/fast/canvas/webgl/gl-enable-enum-test.html b/LayoutTests/fast/canvas/webgl/gl-enable-enum-test.html
index d5e509e..4e7da62 100644
--- a/LayoutTests/fast/canvas/webgl/gl-enable-enum-test.html
+++ b/LayoutTests/fast/canvas/webgl/gl-enable-enum-test.html
@@ -5,9 +5,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl.ENABLE enums Conformance Tests</title>
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
-<script src="resources/desktop-gl-constants.js"></script>
</head>
<body>
<div id="description"></div>
diff --git a/LayoutTests/fast/canvas/webgl/gl-enum-tests-expected.txt b/LayoutTests/fast/canvas/webgl/gl-enum-tests-expected.txt
index fb3b873..1fa633d 100644
--- a/LayoutTests/fast/canvas/webgl/gl-enum-tests-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-enum-tests-expected.txt
@@ -7,6 +7,7 @@ Canvas.getContext
PASS context exists
Checking gl enums.
+PASS gl.getError() is gl.NO_ERROR
PASS gl.bindTexture(desktopGL['TEXTURE_3D'], tex) should return INVALID_ENUM.
PASS gl.blendEquation(desktopGL['MIN']) should return INVALID_ENUM.
PASS gl.blendEquation(desktopGL['MAX']) should return INVALID_ENUM.
diff --git a/LayoutTests/fast/canvas/webgl/gl-enum-tests.html b/LayoutTests/fast/canvas/webgl/gl-enum-tests.html
index cf665d0..0b6018b 100644
--- a/LayoutTests/fast/canvas/webgl/gl-enum-tests.html
+++ b/LayoutTests/fast/canvas/webgl/gl-enum-tests.html
@@ -5,9 +5,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl enums Conformance Tests</title>
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
-<script src="resources/desktop-gl-constants.js"></script>
</head>
<body>
<div id="description"></div>
@@ -31,6 +31,8 @@ if (!gl) {
var buffer = new ArrayBuffer(1);
var buf = new Uint16Array(buffer);
var tex = gl.createTexture();
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+ shouldBe("gl.getError()", "gl.NO_ERROR");
var tests = [
"gl.bindTexture(desktopGL['TEXTURE_3D'], tex)",
"gl.blendEquation(desktopGL['MIN'])",
diff --git a/LayoutTests/fast/canvas/webgl/gl-get-calls-expected.txt b/LayoutTests/fast/canvas/webgl/gl-get-calls-expected.txt
index a5920bd..92cc038 100644
--- a/LayoutTests/fast/canvas/webgl/gl-get-calls-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-get-calls-expected.txt
@@ -70,6 +70,8 @@ PASS context.getParameter(context.VIEWPORT) is [0, 0, 2, 2]
PASS context.getParameter(context.MAX_FRAGMENT_UNIFORM_VECTORS) >= 16 is true
PASS context.getParameter(context.MAX_VERTEX_UNIFORM_VECTORS) >= 128 is true
PASS context.getParameter(context.MAX_VARYING_VECTORS) >= 8 is true
+FAIL context.getParameter(context.NUM_COMPRESSED_TEXTURE_FORMATS) should be 0. Was 4.
+FAIL context.getParameter(context.SHADER_COMPILER) should be true (of type boolean). Was null (of type object).
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/canvas/webgl/gl-get-calls.html b/LayoutTests/fast/canvas/webgl/gl-get-calls.html
index 409207d..ebff636 100644
--- a/LayoutTests/fast/canvas/webgl/gl-get-calls.html
+++ b/LayoutTests/fast/canvas/webgl/gl-get-calls.html
@@ -1,5 +1,8 @@
+
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL gl calls Conformance Tests</title>
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@@ -16,7 +19,7 @@ description("This test ensures basic functionality of the underlying graphics li
debug("");
debug("Canvas.getContext");
-var context = document.getElementById("canvas").getContext("experimental-webgl");
+var context = create3DContext(document.getElementById("canvas"));
if (!context)
testFailed("context does not exist");
else {
@@ -78,10 +81,12 @@ else {
shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getParameter(context.STENCIL_BACK_REF)', '0');
-
+
// FIXME: Current WebKit implementation returns the wrong value (https://bugs.webkit.org/show_bug.cgi?id=31842)
- //shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK)', '0xFFFFFFFF');
- //shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK)', '0xFFFFFFFF');
+ // Re-enable these tests as soon as that bug has been fixed.
+ // shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK)', '0xFFFFFFFF');
+ // shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK)', '0xFFFFFFFF');
+
// If EXT_packed_depth_stencil is supported, STENCIL_BITS > 0; otherwise, STENCIL_BITS == 0.
shouldBe('context.getParameter(context.STENCIL_BITS) >= 0', 'true');
shouldBe('context.getParameter(context.STENCIL_CLEAR_VALUE)', '0');
@@ -91,8 +96,12 @@ else {
shouldBe('context.getParameter(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getParameter(context.STENCIL_REF)', '0');
shouldBe('context.getParameter(context.STENCIL_TEST)', 'false');
- //shouldBe('context.getParameter(context.STENCIL_VALUE_MASK)', '0xFFFFFFFF');
- //shouldBe('context.getParameter(context.STENCIL_WRITEMASK)', '0xFFFFFFFF');
+
+ // FIXME: Current WebKit implementation returns the wrong value (https://bugs.webkit.org/show_bug.cgi?id=31842)
+ // Re-enable these tests as soon as that bug has been fixed.
+ // shouldBe('context.getParameter(context.STENCIL_VALUE_MASK)', '0xFFFFFFFF');
+ // shouldBe('context.getParameter(context.STENCIL_WRITEMASK)', '0xFFFFFFFF');
+
shouldBe('context.getParameter(context.TEXTURE_BINDING_2D)', 'null');
shouldBe('context.getParameter(context.TEXTURE_BINDING_CUBE_MAP)', 'null');
shouldBe('context.getParameter(context.UNPACK_ALIGNMENT)', '4');
@@ -102,6 +111,8 @@ else {
shouldBeTrue('context.getParameter(context.MAX_FRAGMENT_UNIFORM_VECTORS) >= 16');
shouldBeTrue('context.getParameter(context.MAX_VERTEX_UNIFORM_VECTORS) >= 128');
shouldBeTrue('context.getParameter(context.MAX_VARYING_VECTORS) >= 8');
+ shouldBe('context.getParameter(context.NUM_COMPRESSED_TEXTURE_FORMATS)', '0');
+ shouldBe('context.getParameter(context.SHADER_COMPILER)', 'true');
}
debug("");
diff --git a/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt b/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
index e64bf9a..81bdac4 100644
--- a/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-object-get-calls-expected.txt
@@ -2,11 +2,6 @@ Test of get calls against GL objects like getBufferParameter, etc.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS gl.getProgramInfoLog(standardProgram) is ""
-PASS gl.getShaderInfoLog(errorVert) is parseError
-PASS gl.getShaderInfoLog(errorFrag) is parseError
-PASS gl.getShaderSource(errorVert) is errorVertString
-PASS gl.getShaderSource(errorFrag) is errorFragString
PASS shaders.length is 2
PASS shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag is true
PASS gl.getError() is gl.NO_ERROR
@@ -16,9 +11,10 @@ PASS gl.getAttachedShaders(standardVert) is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE) is 16
PASS gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE) is gl.DYNAMIC_DRAW
-PASS gl.getError() is 0
-PASS gl.getError() is 0
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
+PASS getError was expected value: NO_ERROR :
+PASS getError was expected value: NO_ERROR :
+PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE) is gl.TEXTURE
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is texture
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL) is 0
@@ -38,8 +34,8 @@ PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT) is 2
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) is non-zero.
-PASS gl.getError() is 0
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
+PASS getError was expected value: NO_ERROR :
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE) is non-zero.
PASS gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE) is non-zero.
@@ -54,25 +50,25 @@ PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER) is gl.NEAREST
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S) is gl.CLAMP_TO_EDGE
PASS gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T) is gl.CLAMP_TO_EDGE
PASS gl.getProgramParameter(boolProgram, gl.LINK_STATUS) is true
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(boolProgram, bvalLoc) is true
PASS gl.getUniform(boolProgram, bval2Loc) is [1, 0]
PASS gl.getUniform(boolProgram, bval3Loc) is [1, 0, 1]
PASS gl.getUniform(boolProgram, bval4Loc) is [1, 0, 1, 0]
PASS gl.getProgramParameter(intProgram, gl.LINK_STATUS) is true
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(intProgram, ivalLoc) is 1
PASS gl.getUniform(intProgram, ival2Loc) is [2, 3]
PASS gl.getUniform(intProgram, ival3Loc) is [4, 5, 6]
PASS gl.getUniform(intProgram, ival4Loc) is [7, 8, 9, 10]
PASS gl.getProgramParameter(floatProgram, gl.LINK_STATUS) is true
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(floatProgram, fvalLoc) is 11
PASS gl.getUniform(floatProgram, fval2Loc) is [12, 13]
PASS gl.getUniform(floatProgram, fval3Loc) is [14, 15, 16]
PASS gl.getUniform(floatProgram, fval4Loc) is [17, 18, 19, 20]
PASS gl.getProgramParameter(matProgram, gl.LINK_STATUS) is true
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS gl.getUniform(matProgram, mval2Loc) is [1, 2, 3, 4]
PASS gl.getUniform(matProgram, mval3Loc) is [5, 6, 7, 8, 9, 10, 11, 12, 13]
PASS gl.getUniform(matProgram, mval4Loc) is [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
@@ -84,11 +80,11 @@ PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE) is gl.FLOAT
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) is false
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is false
PASS gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB) is [5, 6, 7, 8]
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is null
PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) is null
PASS gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is null
-PASS gl.getError() is 0
+PASS getError was expected value: NO_ERROR :
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html b/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
index ef0a1f5..934c1aa 100644
--- a/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
+++ b/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html
@@ -13,30 +13,12 @@ description("Test of get calls against GL objects like getBufferParameter, etc."
var gl = create3DContext();
-var errorVert = gl.createShader(gl.VERTEX_SHADER);
-gl.shaderSource(errorVert, "I am a bad vertex shader");
-gl.compileShader(errorVert);
-
-var errorFrag = gl.createShader(gl.FRAGMENT_SHADER);
-gl.shaderSource(errorFrag, "I am a bad fragment shader");
-gl.compileShader(errorFrag);
-
var standardVert = loadStandardVertexShader(gl);
var standardFrag = loadStandardFragmentShader(gl);
var standardProgram = gl.createProgram();
gl.attachShader(standardProgram, standardVert);
gl.attachShader(standardProgram, standardFrag);
gl.linkProgram(standardProgram);
-
-// Test program and shader gets
-var parseError = "ERROR: 0:1: 'I' : syntax error syntax error\nERROR: Parser found no code to compile in source strings.\n";
-var errorVertString = "I am a bad vertex shader\n";
-var errorFragString = "I am a bad fragment shader\n";
-shouldBe('gl.getProgramInfoLog(standardProgram)', '""');
-shouldBe('gl.getShaderInfoLog(errorVert)', 'parseError');
-shouldBe('gl.getShaderInfoLog(errorFrag)', 'parseError');
-shouldBe('gl.getShaderSource(errorVert)', 'errorVertString');
-shouldBe('gl.getShaderSource(errorFrag)', 'errorFragString');
var shaders = gl.getAttachedShaders(standardProgram);
shouldBe('shaders.length', '2');
shouldBeTrue('shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag');
@@ -57,10 +39,11 @@ shouldBe('gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE)', 'gl.DYNAMIC_
var texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE,
- new WebGLUnsignedByteArray([0, 0, 0, 255,
- 255, 255, 255, 255,
- 255, 255, 255, 255,
- 0, 0, 0, 255]));
+ new Uint8Array([
+ 0, 0, 0, 255,
+ 255, 255, 255, 255,
+ 255, 255, 255, 255,
+ 0, 0, 0, 255]));
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.bindTexture(gl.TEXTURE_2D, null);
@@ -68,18 +51,18 @@ var framebuffer = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
var renderbuffer = gl.createRenderbuffer();
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 2, 2);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);
// FIXME: on some machines (in particular the WebKit commit bots) the
// framebuffer status is FRAMEBUFFER_UNSUPPORTED; more investigation
// is needed why this is the case, because the FBO allocated
// internally by the WebKit implementation has almost identical
// parameters to this one. See https://bugs.webkit.org/show_bug.cgi?id=31843.
-//shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.TEXTURE');
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'texture');
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL)', '0');
@@ -107,9 +90,9 @@ shouldBe('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)',
shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)');
shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE)');
var colorbuffer = gl.createRenderbuffer();
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 2, 2);
shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)');
shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)');
@@ -148,7 +131,7 @@ gl.uniform1i(bvalLoc, 1);
gl.uniform2i(bval2Loc, 1, 0);
gl.uniform3i(bval3Loc, 1, 0, 1);
gl.uniform4i(bval4Loc, 1, 0, 1, 0);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe('gl.getUniform(boolProgram, bvalLoc)', 'true');
shouldBe('gl.getUniform(boolProgram, bval2Loc)', '[1, 0]');
shouldBe('gl.getUniform(boolProgram, bval3Loc)', '[1, 0, 1]');
@@ -165,7 +148,7 @@ gl.uniform1i(ivalLoc, 1);
gl.uniform2i(ival2Loc, 2, 3);
gl.uniform3i(ival3Loc, 4, 5, 6);
gl.uniform4i(ival4Loc, 7, 8, 9, 10);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe('gl.getUniform(intProgram, ivalLoc)', '1');
shouldBe('gl.getUniform(intProgram, ival2Loc)', '[2, 3]');
shouldBe('gl.getUniform(intProgram, ival3Loc)', '[4, 5, 6]');
@@ -182,7 +165,7 @@ gl.uniform1f(fvalLoc, 11);
gl.uniform2f(fval2Loc, 12, 13);
gl.uniform3f(fval3Loc, 14, 15, 16);
gl.uniform4f(fval4Loc, 17, 18, 19, 20);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe('gl.getUniform(floatProgram, fvalLoc)', '11');
shouldBe('gl.getUniform(floatProgram, fval2Loc)', '[12, 13]');
shouldBe('gl.getUniform(floatProgram, fval3Loc)', '[14, 15, 16]');
@@ -197,13 +180,13 @@ gl.useProgram(matProgram);
gl.uniformMatrix2fv(mval2Loc, false, [1, 2, 3, 4]);
gl.uniformMatrix3fv(mval3Loc, false, [5, 6, 7, 8, 9, 10, 11, 12, 13]);
gl.uniformMatrix4fv(mval4Loc, false, [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]);
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe('gl.getUniform(matProgram, mval2Loc)', '[1, 2, 3, 4]');
shouldBe('gl.getUniform(matProgram, mval3Loc)', '[5, 6, 7, 8, 9, 10, 11, 12, 13]');
shouldBe('gl.getUniform(matProgram, mval4Loc)', '[14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]');
// Test getVertexAttrib
-var array = new WebGLFloatArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+var array = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
gl.bufferData(gl.ARRAY_BUFFER, array, gl.DYNAMIC_DRAW);
// Vertex attribute 0 is special in that it has no current state, so
@@ -221,7 +204,7 @@ gl.disableVertexAttribArray(1);
shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'false');
gl.vertexAttrib4f(1, 5, 6, 7, 8);
shouldBe('gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB)', '[5, 6, 7, 8]');
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
// Test cases where name == 0
gl.deleteTexture(texture);
@@ -230,7 +213,7 @@ gl.deleteRenderbuffer(renderbuffer);
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
gl.deleteBuffer(buffer);
shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
-shouldBe('gl.getError()', '0');
+glErrorShouldBe(gl, gl.NO_ERROR);
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
index 73dc872..bff30fd 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
+++ b/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
@@ -21,7 +21,12 @@
</script>
<script id="fshader" type="x-shader/x-fragment">
+ // Workaround for non-compliant WebGL implementations (FIXME)
+ #if defined(GL_ES)
+ uniform mediump $type color[3];
+ #else
uniform $type color[3];
+ #endif
void main()
{
gl_FragColor = vec4(color[0]$elem, color[1]$elem, color[2]$elem, 1);
diff --git a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
index d51fd46..3eb7a24 100644
--- a/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
+++ b/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html
@@ -43,7 +43,7 @@ for (var ii = 2; ii <= 4; ++ii) {
var mat = [];
for (var jj = 0; jj < ii; ++jj) {
for (var ll = 0; ll < ii; ++ll) {
- if (jj == ii -1 && ll == ii - 1)
+ if (jj == ii - 1 && ll == ii - 1)
continue;
mat[jj * ii + ll] = (jj == ll) ? 1 : 0;
}
@@ -60,8 +60,8 @@ for (var ii = 2; ii <= 4; ++ii) {
debug("");
successfullyParsed = true;
-</script>
+</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-copies-indices-expected.txt b/LayoutTests/fast/canvas/webgl/index-validation-copies-indices-expected.txt
index 2785f86..3888302 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-copies-indices-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/index-validation-copies-indices-expected.txt
@@ -2,12 +2,9 @@ Test that client data is always copied during bufferData and bufferSubData calls
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=32748 : Index validation code must always copy client data
-PASS context.checkFramebufferStatus(context.FRAMEBUFFER) is context.FRAMEBUFFER_COMPLETE
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2) generated expected GL error: NO_ERROR.
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4) generated expected GL error: INVALID_OPERATION.
-PASS context.checkFramebufferStatus(context.FRAMEBUFFER) is context.FRAMEBUFFER_COMPLETE
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2) generated expected GL error: NO_ERROR.
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION.
PASS context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4) generated expected GL error: INVALID_OPERATION.
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.html b/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.html
index 66b2c84..8d7f999 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.html
@@ -11,8 +11,6 @@
<script>
description('Test that client data is always copied during bufferData and bufferSubData calls, because otherwise the data the GL uses to draw may differ from that checked by the index validation code.')
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32748">https://bugs.webkit.org/show_bug.cgi?id=32748</a> : <code>Index validation code must always copy client data</code>');
-
var context = create3DContext();
var program = loadStandardProgram(context);
@@ -21,21 +19,19 @@ var vertexObject = context.createBuffer();
context.enableVertexAttribArray(0);
context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
// 4 vertices -> 2 triangles
-context.bufferData(context.ARRAY_BUFFER, new WebGLFloatArray([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
var indexObject = context.createBuffer();
context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
-var indices = new WebGLUnsignedShortArray([ 10000, 0, 1, 2, 3, 10000 ]);
+var indices = new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]);
context.bufferData(context.ELEMENT_ARRAY_BUFFER, indices, context.STATIC_DRAW);
-shouldBe('context.checkFramebufferStatus(context.FRAMEBUFFER)', 'context.FRAMEBUFFER_COMPLETE');
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
indices[0] = 2;
indices[5] = 1;
-shouldBe("context.checkFramebufferStatus(context.FRAMEBUFFER)", "context.FRAMEBUFFER_COMPLETE");
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt b/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt
index 4d1391a..2d9b418 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data-expected.txt
@@ -2,7 +2,6 @@ Verifies that the index validation code which is within bufferSubData does not c
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=42004 : bufferSubData causes crash in WebGLBuffer::associateBufferSubData
PASS bufferSubData, when buffer object was initialized with null, did not crash
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html b/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html
index d4fd140..a985b12 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation-crash-with-buffer-sub-data.html
@@ -11,8 +11,6 @@
<script>
description('Verifies that the index validation code which is within bufferSubData does not crash.')
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=42004">https://bugs.webkit.org/show_bug.cgi?id=42004</a> : <code>bufferSubData causes crash in WebGLBuffer::associateBufferSubData</code>');
-
var gl = create3DContext();
var elementBuffer = gl.createBuffer();
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-expected.txt b/LayoutTests/fast/canvas/webgl/index-validation-expected.txt
index 362b6a2..ce7c67c 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/index-validation-expected.txt
@@ -1,4 +1,4 @@
-Test of validating indices for drawElements().
+Tests that index validation verifies the correct number of indices
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt b/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt
index 2c557ab..4d5c6e8 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices-expected.txt
@@ -1,4 +1,4 @@
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=32692 : Index validation for drawElements examines too many indices
+Tests that index validation for drawElements does not examine too many indices
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices.html b/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices.html
index 936c4c6..09f9c4f 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices.html
@@ -9,7 +9,7 @@
<div id="console"></div>
<script>
-description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32692">https://bugs.webkit.org/show_bug.cgi?id=32692</a> : <code>Index validation for drawElements examines too many indices</code>');
+description('Tests that index validation for drawElements does not examine too many indices');
var context = create3DContext();
var program = loadStandardProgram(context);
@@ -19,14 +19,14 @@ var vertexObject = context.createBuffer();
context.enableVertexAttribArray(0);
context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
// 4 vertices -> 2 triangles
-context.bufferData(context.ARRAY_BUFFER, new WebGLFloatArray([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
var indexObject = context.createBuffer();
debug("Test out of range indices")
context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
-context.bufferData(context.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt b/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt
index c8beda7..1bfa716 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer-expected.txt
@@ -2,7 +2,6 @@ Test that updating the size of a vertex buffer is properly noticed by the WebGL
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=41092 : Index validation caches buffer size information too aggressively
PASS getError was expected value: NO_ERROR : after initialization
PASS getError was expected value: NO_ERROR : after vertex setup
PASS getError was expected value: NO_ERROR : after texture coord setup
diff --git a/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer.html b/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer.html
index 6f8fde9..7b99017 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation-with-resized-buffer.html
@@ -30,8 +30,6 @@ void main() {
<script>
description('Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.')
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=41092">https://bugs.webkit.org/show_bug.cgi?id=41092</a> : <code>Index validation caches buffer size information too aggressively</code>');
-
var gl = initWebGL("example", "vs", "fs", ["vPosition", "vColor"], [0, 0, 0, 1], 1);
glErrorShouldBe(gl, gl.NO_ERROR, "after initialization");
diff --git a/LayoutTests/fast/canvas/webgl/index-validation.html b/LayoutTests/fast/canvas/webgl/index-validation.html
index db35acc..9486a1a 100644
--- a/LayoutTests/fast/canvas/webgl/index-validation.html
+++ b/LayoutTests/fast/canvas/webgl/index-validation.html
@@ -9,24 +9,24 @@
<div id="console"></div>
<script>
-description("Test of validating indices for drawElements().");
+description("Tests that index validation verifies the correct number of indices");
var gl = create3DContext();
var program = loadStandardProgram(gl);
// 3 vertices => 1 triangle, interleaved data
-var dataComplete = new WebGLFloatArray([0, 0, 0, 1,
- 0, 0, 1,
- 1, 0, 0, 1,
- 0, 0, 1,
- 1, 1, 1, 1,
- 0, 0, 1]);
-var dataIncomplete = new WebGLFloatArray([0, 0, 0, 1,
- 0, 0, 1,
- 1, 0, 0, 1,
- 0, 0, 1,
- 1, 1, 1, 1]);
-var indices = new WebGLUnsignedShortArray([0, 1, 2]);
+var dataComplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1,
+ 0, 0, 1]);
+var dataIncomplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1]);
+var indices = new Uint16Array([0, 1, 2]);
debug("Testing with valid indices");
diff --git a/LayoutTests/fast/canvas/webgl/invalid-UTF-16.html b/LayoutTests/fast/canvas/webgl/invalid-UTF-16.html
index e61fed5..67fa27f 100644
--- a/LayoutTests/fast/canvas/webgl/invalid-UTF-16.html
+++ b/LayoutTests/fast/canvas/webgl/invalid-UTF-16.html
@@ -8,8 +8,9 @@
<p id="description"></p>
<div id="console"></div>
<script>
- if (window.layoutTestController)
- layoutTestController.dumpAsText();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(false);
+ }
</script>
<script>
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.');
diff --git a/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt b/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
index 725dad7..b2f24c2 100644
--- a/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/null-object-behaviour-expected.txt
@@ -2,29 +2,31 @@ Tests calling WebGL APIs without providing the necessary objects
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS context.compileShader() generated expected GL error: INVALID_VALUE.
-PASS context.linkProgram() generated expected GL error: INVALID_VALUE.
-PASS context.attachShader() generated expected GL error: INVALID_VALUE.
-PASS context.attachShader(program, undefined) generated expected GL error: INVALID_VALUE.
-PASS context.attachShader(undefined, shader) generated expected GL error: INVALID_VALUE.
-PASS context.detachShader(program, undefined) generated expected GL error: INVALID_VALUE.
-PASS context.detachShader(undefined, shader) generated expected GL error: INVALID_VALUE.
-PASS context.shaderSource() generated expected GL error: INVALID_VALUE.
-PASS context.shaderSource(undefined, 'foo') generated expected GL error: INVALID_VALUE.
-PASS context.bindAttribLocation(undefined, 0, 'foo') generated expected GL error: INVALID_VALUE.
-PASS context.bindBuffer(context.ARRAY_BUFFER, 0) generated expected GL error: NO_ERROR.
-PASS context.bindFramebuffer(context.FRAMEBUFFER, 0) generated expected GL error: NO_ERROR.
-PASS context.bindRenderbuffer(context.RENDERBUFFER, 0) generated expected GL error: NO_ERROR.
-PASS context.bindTexture(context.TEXTURE_2D, 0) generated expected GL error: NO_ERROR.
-PASS context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0) generated expected GL error: INVALID_OPERATION.
-PASS context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0) generated expected GL error: INVALID_OPERATION.
-PASS context.getProgramParameter(undefined, 0) generated expected GL error: INVALID_VALUE.
-PASS context.getProgramInfoLog(undefined, 0) generated expected GL error: INVALID_VALUE.
-PASS context.getShaderParameter(undefined, 0) generated expected GL error: INVALID_VALUE.
-PASS context.getShaderInfoLog(undefined, 0) generated expected GL error: INVALID_VALUE.
-PASS context.getShaderSource(undefined) generated expected GL error: INVALID_VALUE.
-PASS context.getUniform(undefined, 0) generated expected GL error: INVALID_VALUE.
-PASS context.getUniformLocation(undefined, 'foo') generated expected GL error: INVALID_VALUE.
+PASS Program Compiled
+PASS Shader Compiled
+PASS context.compileShader() was expected value: INVALID_VALUE.
+PASS context.linkProgram() was expected value: INVALID_VALUE.
+PASS context.attachShader() was expected value: INVALID_VALUE.
+PASS context.attachShader(program, undefined) was expected value: INVALID_VALUE.
+PASS context.attachShader(undefined, shader) was expected value: INVALID_VALUE.
+PASS context.detachShader(program, undefined) was expected value: INVALID_VALUE.
+PASS context.detachShader(undefined, shader) was expected value: INVALID_VALUE.
+PASS context.shaderSource() was expected value: INVALID_VALUE.
+PASS context.shaderSource(undefined, 'foo') was expected value: INVALID_VALUE.
+PASS context.bindAttribLocation(undefined, 0, 'foo') was expected value: INVALID_VALUE.
+PASS context.bindBuffer(context.ARRAY_BUFFER, 0) was expected value: NO_ERROR.
+PASS context.bindFramebuffer(context.FRAMEBUFFER, 0) was expected value: NO_ERROR.
+PASS context.bindRenderbuffer(context.RENDERBUFFER, 0) was expected value: NO_ERROR.
+PASS context.bindTexture(context.TEXTURE_2D, 0) was expected value: NO_ERROR.
+PASS context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, 0) was expected value: INVALID_OPERATION.
+PASS context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, 0, 0) was expected value: INVALID_OPERATION.
+PASS context.getProgramParameter(undefined, 0) was expected value: INVALID_VALUE.
+PASS context.getProgramInfoLog(undefined, 0) was expected value: INVALID_VALUE.
+PASS context.getShaderParameter(undefined, 0) was expected value: INVALID_VALUE.
+PASS context.getShaderInfoLog(undefined, 0) was expected value: INVALID_VALUE.
+PASS context.getShaderSource(undefined) was expected value: INVALID_VALUE.
+PASS context.getUniform(undefined, 0) was expected value: INVALID_VALUE.
+PASS context.getUniformLocation(undefined, 'foo') was expected value: INVALID_VALUE.
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/null-object-behaviour.html b/LayoutTests/fast/canvas/webgl/null-object-behaviour.html
index 0c6d9fa..dc84278 100644
--- a/LayoutTests/fast/canvas/webgl/null-object-behaviour.html
+++ b/LayoutTests/fast/canvas/webgl/null-object-behaviour.html
@@ -3,18 +3,23 @@
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
<script src="../../js/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>
+var wtu = WebGLTestUtils;
description("Tests calling WebGL APIs without providing the necessary objects");
-var context = create3DContext();
-var program = loadStandardProgram(context);
-var shader = loadStandardVertexShader(context);
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+var shader = wtu.loadStandardVertexShader(context);
+var shouldGenerateGLError = wtu.shouldGenerateGLError;
+assertMsg(program != null, "Program Compiled");
+assertMsg(shader != null, "Shader Compiled");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.compileShader()");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.linkProgram()");
shouldGenerateGLError(context, context.INVALID_VALUE, "context.attachShader()");
diff --git a/LayoutTests/fast/canvas/webgl/null-uniform-location.html b/LayoutTests/fast/canvas/webgl/null-uniform-location.html
index 1ded25f..0be664f 100644
--- a/LayoutTests/fast/canvas/webgl/null-uniform-location.html
+++ b/LayoutTests/fast/canvas/webgl/null-uniform-location.html
@@ -20,34 +20,34 @@ var floatArray = new WebGLFloatArray([1, 2, 3, 4]);
var intArray = new WebGLIntArray([1, 2, 3, 4]);
function callUniformFunction(name) {
- var isArrayVariant = (name.charAt(name.length - 1) == 'v');
- var isMatrix = (name.indexOf("Matrix") != -1);
- var isFloat =
- (name.charAt(name.length - 1) == 'f' ||
- name.charAt(name.length - 2) == 'f');
- var sizeIndex = (isArrayVariant ? name.length - 3 : name.length - 2);
- var size = parseInt(name.substring(sizeIndex, sizeIndex + 1));
- // Initialize argument list with null uniform location
- var args = [ null ];
- if (isArrayVariant) {
- // Call variant which takes values as array
- if (isMatrix) {
- size = size * size;
- args.push(false);
- }
- var array = (isFloat ? new WebGLFloatArray(size) : new WebGLIntArray(size));
- for (var i = 0; i < size; i++) {
- array[i] = i;
- }
- args.push(array);
- } else {
- // Call variant which takes values as parameters
- for (var i = 0; i < size; i++) {
- args.push(i);
- }
+ var isArrayVariant = (name.charAt(name.length - 1) == 'v');
+ var isMatrix = (name.indexOf("Matrix") != -1);
+ var isFloat =
+ (name.charAt(name.length - 1) == 'f' ||
+ name.charAt(name.length - 2) == 'f');
+ var sizeIndex = (isArrayVariant ? name.length - 3 : name.length - 2);
+ var size = parseInt(name.substring(sizeIndex, sizeIndex + 1));
+ // Initialize argument list with null uniform location
+ var args = [ null ];
+ if (isArrayVariant) {
+ // Call variant which takes values as array
+ if (isMatrix) {
+ size = size * size;
+ args.push(false);
}
- var func = gl[name];
- return func.apply(gl, args);
+ var array = (isFloat ? new WebGLFloatArray(size) : new WebGLIntArray(size));
+ for (var i = 0; i < size; i++) {
+ array[i] = i;
+ }
+ args.push(array);
+ } else {
+ // Call variant which takes values as parameters
+ for (var i = 0; i < size; i++) {
+ args.push(i);
+ }
+ }
+ var func = gl[name];
+ return func.apply(gl, args);
}
var funcs = [ "uniform1f", "uniform1fv", "uniform1i", "uniform1iv",
@@ -56,9 +56,9 @@ var funcs = [ "uniform1f", "uniform1fv", "uniform1i", "uniform1iv",
"uniform4f", "uniform4fv", "uniform4i", "uniform4iv",
"uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv" ];
for (var i = 0; i < funcs.length; i++) {
- callString = "callUniformFunction('" + funcs[i] + "')";
- shouldBeUndefined(callString);
- shouldBe("gl.getError()", "gl.NO_ERROR");
+ callString = "callUniformFunction('" + funcs[i] + "')";
+ shouldBeUndefined(callString);
+ shouldBe("gl.getError()", "gl.NO_ERROR");
}
successfullyParsed = true;
diff --git a/LayoutTests/fast/canvas/webgl/point-size-expected.txt b/LayoutTests/fast/canvas/webgl/point-size-expected.txt
index ebcad67..a2a5d30 100644
--- a/LayoutTests/fast/canvas/webgl/point-size-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/point-size-expected.txt
@@ -2,8 +2,10 @@ Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled in WebGL
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=37178 : Must enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization
Draw a point of size 1 and verify it does not touch any other pixels.
Draw a point of size 2 and verify it fills the appropriate region.
PASS
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/point-size.html b/LayoutTests/fast/canvas/webgl/point-size.html
index 2bb2250..8e32286 100644
--- a/LayoutTests/fast/canvas/webgl/point-size.html
+++ b/LayoutTests/fast/canvas/webgl/point-size.html
@@ -113,10 +113,13 @@ function runTest()
<script>
description('Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled in WebGL');
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=37178">https://bugs.webkit.org/show_bug.cgi?id=37178</a> : <code>Must enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization</code>');
-
if (runTest())
testPassed("");
+
+successfullyParsed = true;
</script>
+
+<script src="../../js/resources/js-test-post.js"></script>
+
</body>
</html>
diff --git a/LayoutTests/fast/canvas/webgl/renderbuffer-initialization-expected.txt b/LayoutTests/fast/canvas/webgl/renderbuffer-initialization-expected.txt
index 3f03afd..af2fbb0 100644
--- a/LayoutTests/fast/canvas/webgl/renderbuffer-initialization-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/renderbuffer-initialization-expected.txt
@@ -2,7 +2,6 @@ Verify renderbuffers are initialized to 0 before being read in WebGL
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=36248 : Implement lazy clearing of renderbuffers
Test whether the WebGL internal buffers have been initialized to 0.
PASS Buffers have been initialized to 0.
Test whether user created buffers have been initialized to 0.
diff --git a/LayoutTests/fast/canvas/webgl/renderbuffer-initialization.html b/LayoutTests/fast/canvas/webgl/renderbuffer-initialization.html
index 03099f8..ab2d401 100644
--- a/LayoutTests/fast/canvas/webgl/renderbuffer-initialization.html
+++ b/LayoutTests/fast/canvas/webgl/renderbuffer-initialization.html
@@ -70,8 +70,6 @@ var successfullyParsed = false;
description('Verify renderbuffers are initialized to 0 before being read in WebGL');
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=36248">https://bugs.webkit.org/show_bug.cgi?id=36248</a> : <code>Implement lazy clearing of renderbuffers</code>');
-
runTest();
successfullyParsed = true;
diff --git a/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js b/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js
new file mode 100644
index 0000000..331af41
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js
@@ -0,0 +1,741 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+WebGLTestUtils = (function() {
+
+/**
+ * Wrapped logging function.
+ * @param {string} msg The message to log.
+ */
+var log = function(msg) {
+ if (window.console && window.console.log) {
+ window.console.log(msg);
+ }
+};
+
+var lastError = "";
+
+/**
+ * Returns the last compiler/linker error.
+ * @return {string} The last compiler/linker error.
+ */
+var getLastError = function() {
+ return lastError;
+};
+
+/**
+ * A vertex shader for a single texture.
+ * @type {string}
+ */
+var simpleTextureVertexShader = '' +
+ 'attribute vec4 vPosition;\n' +
+ 'attribute vec2 texCoord0;\n' +
+ 'varying vec2 texCoord;\n' +
+ 'void main() {\n' +
+ ' gl_Position = vPosition;\n' +
+ ' texCoord = texCoord0;\n' +
+ '}\n';
+
+/**
+ * A fragment shader for a single texture.
+ * @type {string}
+ */
+var simpleTextureFragmentShader = '' +
+ '#ifdef GL_ES\n' +
+ 'precision mediump float;\n' +
+ '#endif\n' +
+ 'uniform sampler2D tex;\n' +
+ 'varying vec2 texCoord;\n' +
+ 'void main() {\n' +
+ ' gl_FragColor = texture2D(tex, texCoord);\n' +
+ '}\n';
+
+/**
+ * Creates a simple texture vertex shader.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @return {!WebGLShader}
+ */
+var setupSimpleTextureVertexShader = function(gl) {
+ return loadShader(gl, simpleTextureVertexShader, gl.VERTEX_SHADER);
+};
+
+/**
+ * Creates a simple texture fragment shader.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @return {!WebGLShader}
+ */
+var setupSimpleTextureFragmentShader = function(gl) {
+ return loadShader(
+ gl, simpleTextureFragmentShader, gl.FRAGMENT_SHADER);
+};
+
+/**
+ * Creates a program, attaches shaders, binds attrib locations, links the
+ * program and calls useProgram.
+ * @param {!Array.<!WebGLShader>} shaders The shaders to attach .
+ * @param {!Array.<string>} attribs The attribs names.
+ * @param {!Array.<number>} opt_locations The locations for the attribs.
+ */
+var setupProgram = function(gl, shaders, attribs, opt_locations) {
+ var program = gl.createProgram();
+ for (var ii = 0; ii < shaders.length; ++ii) {
+ gl.attachShader(program, shaders[ii]);
+ }
+ for (var ii = 0; ii < attribs.length; ++ii) {
+ gl.bindAttribLocation(
+ program,
+ opt_locations ? opt_locations[ii] : ii,
+ attribs[ii]);
+ }
+ gl.linkProgram(program);
+
+ // Check the link status
+ var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
+ if (!linked) {
+ // something went wrong with the link
+ lastError = gl.getProgramInfoLog (program);
+ log("Error in program linking:" + lastError);
+
+ gl.deleteProgram(program);
+ return null;
+ }
+
+ gl.useProgram(program);
+ return program;
+};
+
+/**
+ * Creates a simple texture program.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} opt_positionLocation The attrib location for position.
+ * @param {number} opt_texcoordLocation The attrib location for texture coords.
+ * @return {WebGLProgram}
+ */
+var setupSimpleTextureProgram = function(
+ gl, opt_positionLocation, opt_texcoordLocation) {
+ opt_positionLocation = opt_positionLocation || 0;
+ opt_texcoordLocation = opt_texcoordLocation || 1;
+ var vs = setupSimpleTextureVertexShader(gl);
+ var fs = setupSimpleTextureFragmentShader(gl);
+ if (!vs || !fs) {
+ return null;
+ }
+ var program = setupProgram(
+ gl,
+ [vs, fs],
+ ['vPosition', 'texCoord0'],
+ [opt_positionLocation, opt_texcoordLocation]);
+ if (!program) {
+ gl.deleteShader(fs);
+ gl.deleteShader(vs);
+ }
+ return program;
+};
+
+/**
+ * Creates buffers for a textured unit quad and attaches them to vertex attribs.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} opt_positionLocation The attrib location for position.
+ * @param {number} opt_texcoordLocation The attrib location for texture coords.
+ * @return {!Array.<WebGLBuffer>} The buffer objects that were
+ * created.
+ */
+var setupUnitQuad = function(gl, opt_positionLocation, opt_texcoordLocation) {
+ opt_positionLocation = opt_positionLocation || 0;
+ opt_texcoordLocation = opt_texcoordLocation || 1;
+ var objects = [];
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [-1,1,0, 1,1,0, -1,-1,0,
+ -1,-1,0, 1,1,0, 1,-1,0]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(opt_positionLocation);
+ gl.vertexAttribPointer(opt_positionLocation, 3, gl.FLOAT, false, 0, 0);
+ objects.push(vertexObject);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [0,0, 1,0, 0,1,
+ 0,1, 1,0, 1,1]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(opt_texcoordLocation);
+ gl.vertexAttribPointer(opt_texcoordLocation, 2, gl.FLOAT, false, 0, 0);
+ objects.push(vertexObject);
+ return objects;
+};
+
+/**
+ * Creates a program and buffers for rendering a textured quad.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} opt_positionLocation The attrib location for position.
+ * @param {number} opt_texcoordLocation The attrib location for texture coords.
+ * @return {!WebGLProgram}
+ */
+var setupTexturedQuad = function(
+ gl, opt_positionLocation, opt_texcoordLocation) {
+ var program = setupSimpleTextureProgram(
+ gl, opt_positionLocation, opt_texcoordLocation);
+ setupUnitQuad(gl, opt_positionLocation, opt_texcoordLocation);
+ return program;
+};
+
+/**
+ * Fills the given texture with a solid color
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {!WebGLTexture} tex The texture to fill.
+ * @param {number} width The width of the texture to create.
+ * @param {number} height The height of the texture to create.
+ * @param {!Array.<number>} color The color to fill with. A 4 element array
+ * where each element is in the range 0 to 255.
+ * @param {number} opt_level The level of the texture to fill. Default = 0.
+ */
+var fillTexture = function(gl, tex, width, height, color, opt_level) {
+ opt_level = opt_level || 0;
+ var canvas = document.createElement('canvas');
+ canvas.width = width;
+ canvas.height = height;
+ var ctx2d = canvas.getContext('2d');
+ ctx2d.fillStyle = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ")";
+ ctx2d.fillRect(0, 0, width, height);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(
+ gl.TEXTURE_2D, opt_level, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+};
+
+/**
+ * Creates a textures and fills it with a solid color
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} width The width of the texture to create.
+ * @param {number} height The height of the texture to create.
+ * @param {!Array.<number>} color The color to fill with. A 4 element array
+ * where each element is in the range 0 to 255.
+ * @return {!WebGLTexture}
+ */
+var createColoredTexture = function(gl, width, height, color) {
+ var tex = gl.createTexture();
+ fillTexture(gl, text, width, height, color);
+ return tex;
+};
+
+/**
+ * Draws a previously setup quad.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {!Array.<number>} opt_color The color to fill clear with before
+ * drawing. A 4 element array where each element is in the range 0 to
+ * 255. Default [255, 255, 255, 255]
+ */
+var drawQuad = function(gl, opt_color) {
+ opt_color = opt_color || [255, 255, 255, 255];
+ gl.clearColor(
+ opt_color[0] / 255,
+ opt_color[1] / 255,
+ opt_color[2] / 255,
+ opt_color[3] / 255);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+};
+
+/**
+ * Checks that an entire canvas is 1 color.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {!Array.<number>} color The color to fill clear with before drawing. A
+ * 4 element array where each element is in the range 0 to 255.
+ * @param {string} msg Message to associate with success. Eg ("should be red").
+ */
+var checkCanvas = function(gl, color, msg) {
+ var width = gl.canvas.width;
+ var height = gl.canvas.height;
+ var buf = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ for (var i = 0; i < width * height; ++i) {
+ var offset = i * 4;
+ if (buf[offset + 0] != color[0] ||
+ buf[offset + 1] != color[1] ||
+ buf[offset + 2] != color[2] ||
+ buf[offset + 3] != color[3]) {
+ testFailed(msg);
+ debug('expected: ' +
+ color[0] + ', ' +
+ color[1] + ', ' +
+ color[2] + ', ' +
+ color[3] + ' was: ' +
+ buf[offset + 0] + ', ' +
+ buf[offset + 1] + ', ' +
+ buf[offset + 2] + ', ' +
+ buf[offset + 3]);
+ return;
+ }
+ }
+ testPassed(msg);
+};
+
+/**
+ * Creates a webgl context.
+ * @param {!Canvas} opt_canvas The canvas tag to get context from. If one is not
+ * passed in one will be created.
+ * @return {!WebGLContext} The created context.
+ */
+var create3DContext = function(opt_canvas) {
+ opt_canvas = opt_canvas || document.createElement("canvas");
+ var context = null;
+ try {
+ context = opt_canvas.getContext("experimental-webgl");
+ } catch(e) {}
+ if (!context) {
+ try {
+ context = opt_canvas.getContext("webkit-3d");
+ } catch(e) {}
+ }
+ if (!context) {
+ try {
+ context = opt_canvas.getContext("moz-webgl");
+ } catch(e) {}
+ }
+ if (!context) {
+ testFailed("Unable to fetch WebGL rendering context for Canvas");
+ }
+ return context;
+}
+
+/**
+ * Gets a GLError value as a string.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} err The webgl error as retrieved from gl.getError().
+ * @return {string} the error as a string.
+ */
+var getGLErrorAsString = function(gl, err) {
+ if (err === gl.NO_ERROR) {
+ return "NO_ERROR";
+ }
+ for (var name in gl) {
+ if (gl[name] === err) {
+ return name;
+ }
+ }
+ return err.toString();
+};
+
+/**
+ * Wraps a WebGL function with a function that throws an exception if there is
+ * an error.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {string} fname Name of function to wrap.
+ * @return {function} The wrapped function.
+ */
+var createGLErrorWrapper = function(context, fname) {
+ return function() {
+ var rv = context[fname].apply(context, arguments);
+ var err = context.getError();
+ if (err != 0)
+ throw "GL error " + getGLErrorAsString(err) + " in " + fname;
+ return rv;
+ };
+};
+
+/**
+ * Creates a WebGL context where all functions are wrapped to throw an exception
+ * if there is an error.
+ * @param {!Canvas} canvas The HTML canvas to get a context from.
+ * @return {!Object} The wrapped context.
+ */
+function create3DContextWithWrapperThatThrowsOnGLError(canvas) {
+ var context = create3DContext(canvas);
+ var wrap = {};
+ for (var i in context) {
+ try {
+ if (typeof context[i] == 'function') {
+ wrap[i] = createGLErrorWrapper(context, i);
+ } else {
+ wrap[i] = context[i];
+ }
+ } catch (e) {
+ log("createContextWrapperThatThrowsOnGLError: Error accessing " + i);
+ }
+ }
+ wrap.getError = function() {
+ return context.getError();
+ };
+ return wrap;
+};
+
+/**
+ * Tests that an evaluated expression generates a specific GL error.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} glError The expected gl error.
+ * @param {string} evalSTr The string to evaluate.
+ */
+var shouldGenerateGLError = function(gl, glError, evalStr) {
+ var exception;
+ try {
+ eval(evalStr);
+ } catch (e) {
+ exception = e;
+ }
+ if (exception) {
+ testFailed(evalStr + " threw exception " + exception);
+ } else {
+ var err = gl.getError();
+ if (err != glError) {
+ testFailed(evalStr + " expected: " + getGLErrorAsString(gl, glError) + ". Was " + getGLErrorAsString(gl, err) + ".");
+ } else {
+ testPassed(evalStr + " was expected value: " + getGLErrorAsString(gl, glError) + ".");
+ }
+ }
+};
+
+/**
+ * Tests that the first error GL returns is the specified error.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {number} glError The expected gl error.
+ * @param {string} opt_msg
+ */
+var glErrorShouldBe = function(gl, glError, opt_msg) {
+ opt_msg = opt_msg || "";
+ var err = gl.getError();
+ if (err != glError) {
+ testFailed("getError expected: " + getGLErrorAsString(gl, glError) +
+ ". Was " + getGLErrorAsString(gl, err) + " : " + opt_msg);
+ } else {
+ testPassed("getError was expected value: " +
+ getGLErrorAsString(gl, glError) + " : " + opt_msg);
+ }
+};
+
+/**
+ * Links a WebGL program, throws if there are errors.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {!WebGLProgram} program The WebGLProgram to link.
+ */
+var linkProgram = function(gl, program) {
+ // Link the program
+ gl.linkProgram(program);
+
+ // Check the link status
+ var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
+ if (!linked) {
+ // something went wrong with the link
+ var error = gl.getProgramInfoLog (program);
+
+ gl.deleteProgram(program);
+ gl.deleteProgram(fragmentShader);
+ gl.deleteProgram(vertexShader);
+
+ testFailed("Error in program linking:" + error);
+ }
+};
+
+/**
+ * Sets up WebGL with shaders.
+ * @param {string} canvasName The id of the canvas.
+ * @param {string} vshader The id of the script tag that contains the vertex
+ * shader source.
+ * @param {string} fshader The id of the script tag that contains the fragment
+ * shader source.
+ * @param {!Array.<string>} attribs An array of attrib names used to bind
+ * attribs to the ordinal of the name in this array.
+ * @param {!Array.<number>} opt_clearColor The color to cla
+ * @return {!WebGLContext} The created WebGLContext.
+ */
+var setupWebGLWithShaders = function(
+ canvasName, vshader, fshader, attribs) {
+ var canvas = document.getElementById(canvasName);
+ var gl = create3DContext(canvas);
+ if (!gl) {
+ testFailed("No WebGL context found");
+ }
+
+ // create our shaders
+ var vertexShader = loadShaderFromScript(gl, vshader);
+ var fragmentShader = loadShaderFromScript(gl, fshader);
+
+ if (!vertexShader || !fragmentShader) {
+ return null;
+ }
+
+ // Create the program object
+ program = gl.createProgram();
+
+ if (!program) {
+ return null;
+ }
+
+ // Attach our two shaders to the program
+ gl.attachShader (program, vertexShader);
+ gl.attachShader (program, fragmentShader);
+
+ // Bind attributes
+ for (var i in attribs) {
+ gl.bindAttribLocation (program, i, attribs[i]);
+ }
+
+ linkProgram(gl, program);
+
+ gl.useProgram(program);
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+
+ gl.program = program;
+ return gl;
+};
+
+/**
+ * Gets a file from a file/URL
+ * @param {string} file the URL of the file to get.
+ * @return {string} The contents of the file.
+ */
+var readFile = function(file) {
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", file, false);
+ xhr.send();
+ return xhr.responseText;
+};
+
+/**
+ * Gets a file from a URL and parses it for filenames. IF a file name ends
+ * in .txt recursively reads that file and adds it to the list.
+ */
+var readFileList = function(url) {
+ var files = [];
+ if (url.substr(url.length - 4) == '.txt') {
+ var lines = readFile(url).split('\n');
+ var prefix = '';
+ var lastSlash = url.lastIndexOf('/');
+ if (lastSlash >= 0) {
+ prefix = url.substr(0, lastSlash + 1);
+ }
+ for (var ii = 0; ii < lines.length; ++ii) {
+ var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+ if (str.length > 4 &&
+ str[0] != '#' &&
+ str[0] != ";" &&
+ str.substr(0, 2) != "//") {
+ new_url = prefix + str;
+ files = files.concat(readFileList(new_url));
+ }
+ }
+ } else {
+ files.push(url);
+ }
+ return files;
+};
+
+/**
+ * Loads a shader.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {string} shaderSource The shader source.
+ * @param {number} shaderType The type of shader.
+ * @return {!WebGLShader} The created shader.
+ */
+var loadShader = function(gl, shaderSource, shaderType) {
+ // Create the shader object
+ var shader = gl.createShader(shaderType);
+ if (shader == null) {
+ log("*** Error: unable to create shader '"+shaderSource+"'");
+ 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
+ lastError = gl.getShaderInfoLog(shader);
+ log("*** Error compiling shader '" + shader + "':" + lastError);
+ gl.deleteShader(shader);
+ return null;
+ }
+
+ return shader;
+}
+
+/**
+ * Loads a shader from a URL.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {file} file The URL of the shader source.
+ * @param {number} type The type of shader.
+ * @return {!WebGLShader} The created shader.
+ */
+var loadShaderFromFile = function(gl, file, type) {
+ var shaderSource = readFile(file);
+ return loadShader(gl, shaderSource, type);
+};
+
+/**
+ * Loads a shader from a script tag.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {string} scriptId The id of the script tag.
+ * @param {number} opt_shaderType The type of shader. If not passed in it will
+ * be derived from the type of the script tag.
+ * @return {!WebGLShader} The created shader.
+ */
+var loadShaderFromScript = function(gl, scriptId, opt_shaderType) {
+ var shaderSource = "";
+ var shaderType;
+ var shaderScript = document.getElementById(scriptId);
+ if (!shaderScript) {
+ throw("*** Error: unknown script element" + scriptId);
+ }
+ shaderSource = shaderScript.text;
+
+ if (!opt_shaderType) {
+ if (shaderScript.type == "x-shader/x-vertex") {
+ shaderType = gl.VERTEX_SHADER;
+ } else if (shaderScript.type == "x-shader/x-fragment") {
+ shaderType = gl.FRAGMENT_SHADER;
+ } else if (shaderType != gl.VERTEX_SHADER && shaderType != gl.FRAGMENT_SHADER) {
+ throw("*** Error: unknown shader type");
+ return null;
+ }
+ }
+
+ return loadShader(
+ gl, shaderSource, opt_shaderType ? opt_shaderType : shaderType);
+};
+
+var loadStandardProgram = function(gl) {
+ var program = gl.createProgram();
+ gl.attachShader(program, loadStandardVertexShader(gl));
+ gl.attachShader(program, loadStandardFragmentShader(gl));
+ linkProgram(gl, program);
+ return program;
+};
+
+/**
+ * Loads shaders from files, creates a program, attaches the shaders and links.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {string} vertexShaderPath The URL of the vertex shader.
+ * @param {string} fragmentShaderPath The URL of the fragment shader.
+ * @return {!WebGLProgram} The created program.
+ */
+var loadProgramFromFile = function(gl, vertexShaderPath, fragmentShaderPath) {
+ var program = gl.createProgram();
+ gl.attachShader(
+ program,
+ loadShaderFromFile(gl, vertexShaderPath, gl.VERTEX_SHADER));
+ gl.attachShader(
+ program,
+ loadShaderFromFile(gl, fragmentShaderPath, gl.FRAGMENT_SHADER));
+ linkProgram(gl, program);
+ return program;
+};
+
+/**
+ * Loads shaders from script tags, creates a program, attaches the shaders and
+ * links.
+ * @param {!WebGLContext} gl The WebGLContext to use.
+ * @param {string} vertexScriptId The id of the script tag that contains the
+ * vertex shader.
+ * @param {string} fragmentScriptId The id of the script tag that contains the
+ * fragment shader.
+ * @return {!WebGLProgram} The created program.
+ */
+var loadProgramFromScript = function loadProgramFromScript(
+ gl, vertexScriptId, fragmentScriptId) {
+ var program = gl.createProgram();
+ gl.attachShader(
+ program,
+ loadShaderFromScript(gl, vertexScriptId, gl.VERTEX_SHADER));
+ gl.attachShader(
+ program,
+ loadShaderFromScript(gl, fragmentScriptId, gl.FRAGMENT_SHADER));
+ linkProgram(gl, program);
+ return program;
+};
+
+var loadStandardVertexShader = function(gl) {
+ return loadShaderFromFile(
+ gl, "resources/vertexShader.vert", gl.VERTEX_SHADER);
+};
+
+var loadStandardFragmentShader = function(gl) {
+ return loadShaderFromFile(
+ gl, "resources/fragmentShader.frag", gl.FRAGMENT_SHADER);
+};
+
+/**
+ * Loads an image asynchronously.
+ * @param {string} url URL of image to load.
+ * @param {!function(!Element): void} callback Function to call
+ * with loaded image.
+ */
+var loadImageAsync = function(url, callback) {
+ var img = document.createElement('img');
+ img.onload = function() {
+ callback(img);
+ };
+ img.src = url;
+};
+
+/**
+ * Loads an array of images.
+ * @param {!Array.<string>} urls URLs of images to load.
+ * @param {!function(!{string, img}): void} callback. Callback
+ * that gets passed map of urls to img tags.
+ */
+var loadImagesAsync = function(urls, callback) {
+ var count = 1;
+ var images = { };
+ function countDown() {
+ --count;
+ if (count == 0) {
+ callback(images);
+ }
+ }
+ function imageLoaded(url) {
+ return function(img) {
+ images[url] = img;
+ countDown();
+ }
+ }
+ for (var ii = 0; ii < urls.length; ++ii) {
+ ++count;
+ loadImageAsync(urls[ii], imageLoaded(urls[ii]));
+ }
+ countDown();
+};
+
+return {
+ create3DContext: create3DContext,
+ create3DContextWithWrapperThatThrowsOnGLError:
+ create3DContextWithWrapperThatThrowsOnGLError,
+ checkCanvas: checkCanvas,
+ createColoredTexture: createColoredTexture,
+ drawQuad: drawQuad,
+ getLastError: getLastError,
+ glErrorShouldBe: glErrorShouldBe,
+ fillTexture: fillTexture,
+ loadImageAsync: loadImageAsync,
+ loadImagesAsync: loadImagesAsync,
+ loadProgramFromFile: loadProgramFromFile,
+ loadProgramFromScript: loadProgramFromScript,
+ loadShader: loadShader,
+ loadShaderFromFile: loadShaderFromFile,
+ loadShaderFromScript: loadShaderFromScript,
+ loadStandardProgram: loadStandardProgram,
+ loadStandardVertexShader: loadStandardVertexShader,
+ loadStandardFragmentShader: loadStandardFragmentShader,
+ setupProgram: setupProgram,
+ setupSimpleTextureFragmentShader: setupSimpleTextureFragmentShader,
+ setupSimpleTextureProgram: setupSimpleTextureProgram,
+ setupSimpleTextureVertexShader: setupSimpleTextureVertexShader,
+ setupTexturedQuad: setupTexturedQuad,
+ setupUnitQuad: setupUnitQuad,
+ shouldGenerateGLError: shouldGenerateGLError,
+ readFile: readFile,
+ readFileList: readFileList,
+
+ none: false
+};
+
+}());
+
+
diff --git a/LayoutTests/fast/canvas/webgl/resources/webgl-test.js b/LayoutTests/fast/canvas/webgl/resources/webgl-test.js
index 2221f1a..30fba41 100644
--- a/LayoutTests/fast/canvas/webgl/resources/webgl-test.js
+++ b/LayoutTests/fast/canvas/webgl/resources/webgl-test.js
@@ -11,6 +11,22 @@ function assertMsg(assertion, msg) {
}
}
+function initNonKhronosFramework(waitUntilDone) {
+ if (window.layoutTestController) {
+ layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
+ layoutTestController.dumpAsText();
+ if (waitUntilDone) {
+ layoutTestController.waitUntilDone();
+ }
+ }
+}
+
+function nonKhronosFrameworkNotifyDone() {
+ if (window.layoutTestController) {
+ layoutTestController.notifyDone();
+ }
+}
+
//
//----------------------------------------------------------------------
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt
index dd09ed2..b7d5028 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view-expected.txt
@@ -3,7 +3,6 @@ Verifies texImage2D and texSubImage2D code paths taking ArrayBufferView
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=40398 : Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D taking ArrayBufferView
Testing texImage2D with type=UNSIGNED_BYTE, unpackAlignment=1, flipY=true, premultiplyAlpha=false
Checking bottom pixel
PASS pixel is correctColor
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html
index a98e29b..d98d556 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html
@@ -34,16 +34,12 @@ var imageData = null;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verifies texImage2D and texSubImage2D code paths taking ArrayBufferView');
- debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=40398">https://bugs.webkit.org/show_bug.cgi?id=40398</a> : <code>Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D taking ArrayBufferView</code>');
-
var canvas2d = document.getElementById("texcanvas");
var context2d = canvas2d.getContext("2d");
imageData = context2d.createImageData(1, 2);
@@ -264,8 +260,8 @@ function runTest()
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt
index b47f36e..82d311c 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-expected.txt
@@ -3,7 +3,6 @@ Verify texImage2D and texSubImage2D code paths taking ImageData
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=34459 : Refactor texImage2D and texSubImage2D taking ImageData to use common code
Testing texImage2D with flipY=true and premultiplyAlpha=false
Checking bottom pixel
PASS pixel is correctColor
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html
index 9ff1b77..650beb4 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html
@@ -34,16 +34,12 @@ var imageData = null;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verify texImage2D and texSubImage2D code paths taking ImageData');
- debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34459">https://bugs.webkit.org/show_bug.cgi?id=34459</a> : <code>Refactor texImage2D and texSubImage2D taking ImageData to use common code</code>');
-
var canvas2d = document.getElementById("texcanvas");
var context2d = canvas2d.getContext("2d");
imageData = context2d.createImageData(1, 2);
@@ -187,8 +183,8 @@ function runTest()
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt
index 1492a8b..17831c5 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-expected.txt
@@ -2,7 +2,6 @@ Verify texImage2D and texSubImage2D code paths taking Images
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=34458 : Refactor texImage2D and texSubImage2D taking Image to use common code
Testing texImage2D with flipY=true
Checking lower left corner
PASS pixel is correctColor
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html
index 8b0c7ee..21ca596 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html
@@ -33,16 +33,12 @@ var successfullyParsed = false;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verify texImage2D and texSubImage2D code paths taking Images');
- debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34458">https://bugs.webkit.org/show_bug.cgi?id=34458</a> : <code>Refactor texImage2D and texSubImage2D taking Image to use common code</code>');
-
gl = initWebGL("example", "vshader", "fshader", [ "g_Position", "g_TexCoord0" ], [ 0, 0, 0, 1 ], 1);
textureLoc = gl.getUniformLocation(gl.program, "tex");
@@ -186,8 +182,8 @@ function runTest(image)
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt b/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt
index a415161..d1d92cd 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs-expected.txt
@@ -1,10 +1,10 @@
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=32364 : [Chromium] SporeViewer demo doesn't work in Chromium
+Tests passing a vec4 to a uniform and a canvas to texImage2D
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS gl.useProgram(floatProgram) is undefined.
PASS gl.getError() is gl.NO_ERROR
-PASS gl.uniform4fv(fval4Loc, new WebGLFloatArray([0.1, 0.2, 0.4, 1.0])); is undefined.
+PASS gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0])); is undefined.
PASS gl.bindTexture(gl.TEXTURE_2D, texture) is undefined.
PASS gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tmpcanvas) is undefined.
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html b/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html
index 7b16265..411576d 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html
+++ b/LayoutTests/fast/canvas/webgl/tex-image-and-uniform-binding-bugs.html
@@ -10,14 +10,14 @@
<script>
-description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32364">https://bugs.webkit.org/show_bug.cgi?id=32364</a> : <code>[Chromium] SporeViewer demo doesn\'t work in Chromium</code>');
+description('Tests passing a vec4 to a uniform and a canvas to texImage2D');
var gl = create3DContext();
var floatProgram = loadProgram(gl, "resources/floatUniformShader.vert", "resources/noopUniformShader.frag");
shouldBeUndefined("gl.useProgram(floatProgram)");
var fval4Loc = gl.getUniformLocation(floatProgram, "fval4");
shouldBe("gl.getError()", "gl.NO_ERROR");
-shouldBeUndefined("gl.uniform4fv(fval4Loc, new WebGLFloatArray([0.1, 0.2, 0.4, 1.0]));");
+shouldBeUndefined("gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0]));");
var tmpcanvas = document.createElement("canvas");
tmpcanvas.width = 2;
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type-expected.txt b/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type-expected.txt
index eb629bd..1fcc154 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type-expected.txt
@@ -2,9 +2,6 @@ Verify texImage2D and texSubImage2D code paths taking both HTML and user-specifi
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for:
-https://bugs.webkit.org/show_bug.cgi?id=40319 : Implement format conversions in texImage2D and texSubImage2D taking HTML data
-https://bugs.webkit.org/show_bug.cgi?id=40398 : Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D taking ArrayBufferView
Testing texImage2D with Image at 256x1
PASS RGBA/UNSIGNED_BYTE should maintain full precision of data
Testing texImage2D with Image at 256x1
diff --git a/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type.html b/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type.html
index 2e3ba75..7467c10 100644
--- a/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type.html
+++ b/LayoutTests/fast/canvas/webgl/tex-image-with-format-and-type.html
@@ -51,18 +51,12 @@ var DataMode = {
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
description('Verify texImage2D and texSubImage2D code paths taking both HTML and user-specified data with all format/type combinations');
- debug('Regression test for:');
- debug('<a href="https://bugs.webkit.org/show_bug.cgi?id=40319">https://bugs.webkit.org/show_bug.cgi?id=40319</a> : <code>Implement format conversions in texImage2D and texSubImage2D taking HTML data</code>');
- debug('<a href="https://bugs.webkit.org/show_bug.cgi?id=40398">https://bugs.webkit.org/show_bug.cgi?id=40398</a> : <code>Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D taking ArrayBufferView</code>');
-
gl = initWebGL("example", "vshader", "fshader", [ "g_Position", "g_TexCoord0" ], [ 0, 0, 0, 1 ], 1);
gl.disable(gl.BLEND);
@@ -480,8 +474,8 @@ function runOneTest(testCase)
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
diff --git a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt
index 174d95e..c20dda1 100644
--- a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-expected.txt
@@ -2,6 +2,8 @@ Tests texSubImage2D upload path from WebGLUnsignedByteArray
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=33932 : [Chromium] Implement texSubImage2D taking WebGLArray
PASS
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html
index c13820f..d877a5c 100644
--- a/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html
+++ b/LayoutTests/fast/canvas/webgl/tex-sub-image-2d.html
@@ -35,8 +35,6 @@ void main()
<script>
description('Tests texSubImage2D upload path from WebGLUnsignedByteArray');
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=33932">https://bugs.webkit.org/show_bug.cgi?id=33932</a> : <code>[Chromium] Implement texSubImage2D taking WebGLArray</code>');
-
var gl = initWebGL("example", "vshader", "fshader", [ "g_Position", "g_TexCoord0" ], [ 0, 0, 0, 1 ], 1);
var textureWidth = 256;
var textureHeight = 1;
@@ -118,6 +116,9 @@ for (var i = 0; i < textureWidth; i++) {
if (passed)
testPassed("");
+
+successfullyParsed = true;
</script>
+<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/fast/canvas/webgl/texture-active-bind.html b/LayoutTests/fast/canvas/webgl/texture-active-bind.html
index a7bb250..83224c8 100644
--- a/LayoutTests/fast/canvas/webgl/texture-active-bind.html
+++ b/LayoutTests/fast/canvas/webgl/texture-active-bind.html
@@ -1,11 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
-<head>
-<title>WebGL ActiveTexture BindTexture conformance test.</title>
-<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
-<script src="../../js/resources/js-test-pre.js"></script>
-<script src="resources/webgl-test.js"> </script>
+ <head>
+ <title>WebGL ActiveTexture BindTexture conformance test.</title>
+ <link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+ <script src="../../js/resources/js-test-pre.js"></script>
+ <script src="resources/webgl-test.js"> </script>
</head>
<body>
<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
@@ -36,9 +36,8 @@ void main()
<script>
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(false);
}
debug("Tests that glActiveTexture and glBindTexture work as expected");
@@ -131,8 +130,14 @@ function init()
gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
var msg = 'expected:' +
c[0] + ', ' + c[1] + ', ' + c[2] + ', ' + c[3] + ' found: ' +
- buf[0] + ', ' + buf[1] + ', ' + buf[2] + ', ' + buf[3];
- if (buf[0] != c[0] || buf[1] != c[1] || buf[2] != c[2] || buf[3] != c[3])
+ buf[0] + ', ' +
+ buf[1] + ', ' +
+ buf[2] + ', ' +
+ buf[3];
+ if (buf[0] != c[0] ||
+ buf[1] != c[1] ||
+ buf[2] != c[2] ||
+ buf[3] != c[3])
testFailed(msg);
else
testPassed(msg);
diff --git a/LayoutTests/fast/canvas/webgl/texture-complete.html b/LayoutTests/fast/canvas/webgl/texture-complete.html
index f445028..9c6ab36 100644
--- a/LayoutTests/fast/canvas/webgl/texture-complete.html
+++ b/LayoutTests/fast/canvas/webgl/texture-complete.html
@@ -35,9 +35,8 @@ void main()
<script>
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(false);
}
debug("Checks that a texture that is not -texture-complete- does not draw if"+
diff --git a/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt b/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
index 5ecf02d..b5a3822 100644
--- a/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/texture-npot-expected.txt
@@ -1,11 +1,12 @@
-
-WebGL NPOT texture conformance test
+ PASS Should be no errors from setup.
PASS gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE
PASS gl.texImage2D with NPOT texture at level 0 should succeed
PASS gl.generateMipmap with NPOT texture should return INVALID_OPERATION
PASS NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255
+PASS Should be no errors from setup.
PASS NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255
-PASS NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw with 0,192,128,255
+PASS Should be no errors from setup.
+PASS NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw.
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/texture-npot.html b/LayoutTests/fast/canvas/webgl/texture-npot.html
index 19245f5..630b5eb 100644
--- a/LayoutTests/fast/canvas/webgl/texture-npot.html
+++ b/LayoutTests/fast/canvas/webgl/texture-npot.html
@@ -1,156 +1,82 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
- <head>
- <title>WebGL Non-Power of 2 texture conformance test.</title>
- <link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
- <script src="../../js/resources/js-test-pre.js"></script>
- <script src="resources/webgl-test.js"> </script>
-</head>
-<body>
-<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
-<canvas id="canvas2d" width="5" height="3" style="width: 50px; height: 30px;"></canvas>
-<div id="description"></div>
-<div id="console"></div>
- <script id="vshader" type="x-shader/x-vertex">
- attribute vec4 vPosition;
- attribute vec2 texCoord0;
- varying vec2 texCoord;
- void main()
- {
- gl_Position = vPosition;
- texCoord = texCoord0;
- }
- </script>
-
- <script id="fshader" type="x-shader/x-fragment">
- uniform sampler2D tex;
- varying vec2 texCoord;
- void main()
- {
- gl_FragColor = texture2D(tex, texCoord);
- }
- </script>
-
- <script>
- function init()
- {
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- }
-
- debug("WebGL NPOT texture conformance test");
-
- var canvas2d = document.getElementById("canvas2d");
- var ctx2d = canvas2d.getContext("2d");
- ctx2d.fillStyle = "rgba(0,192,128,255)";
- ctx2d.fillRect(0, 0, 5, 3);
-
- gl = initWebGL("example", "vshader", "fshader", [ "vPosition", "texCoord0"], [ 0, 0, 0, 1 ], 1);
-
- gl.disable(gl.DEPTH_TEST);
- gl.disable(gl.BLEND);
-
- var vertexObject = gl.createBuffer();
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
- gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray([ -1,1,0, 1,1,0, -1,-1,0,
- -1,-1,0, 1,1,0, 1,-1,0
- ]), gl.STATIC_DRAW);
- gl.enableVertexAttribArray(0);
- gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
-
- var vertexObject = gl.createBuffer();
- gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
- gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray([ 0,0, 1,0, 0,1,
- 0,1, 1,0, 1,1
- ]), gl.STATIC_DRAW);
- gl.enableVertexAttribArray(1);
- gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
-
- var tex = gl.createTexture();
- gl.bindTexture(gl.TEXTURE_2D, tex);
-
- // Check that an NPOT texture not on level 0 generates INVALID_VALUE
- gl.texImage2D(gl.TEXTURE_2D,
- 1, // level
- gl.RGBA,
- gl.RGBA,
- gl.UNSIGNED_BYTE,
- canvas2d);
- assertMsg(gl.getError() == gl.INVALID_VALUE,
- "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
-
- // Check that an NPOT texture on level 0 succeeds
- gl.texImage2D(gl.TEXTURE_2D,
- 0, // level
- gl.RGBA,
- gl.RGBA,
- gl.UNSIGNED_BYTE,
- canvas2d);
- assertMsg(gl.getError() == gl.NO_ERROR,
- "gl.texImage2D with NPOT texture at level 0 should succeed");
-
- // Check that generateMipmap fails on NPOT
- gl.generateMipmap(gl.TEXTURE_2D);
- assertMsg(gl.getError() == gl.INVALID_OPERATION,
- "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
-
- var loc = gl.getUniformLocation(gl.program, "tex");
- gl.uniform1i(loc, 0);
-
- // FIXME: uncomment the three chechBuffer calls once we figure out why they fail on the Leopard bot.
- // https://bugs.webkit.org/show_bug.cgi?id=39128
-
- // Check that nothing is drawn if filtering is not correct for NPOT
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
-
- checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
-
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
-
- checkBuffer(0,0,0,255, "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
-
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
-
- checkBuffer(0,192,128,255, "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw with 0,192,128,255");
-
- function checkBuffer(r, g, b, a, msg) {
- gl.clearColor(1,1,1,1);
- gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
- gl.drawArrays(gl.TRIANGLES, 0, 6);
- gl.flush();
- var buf = new Uint8Array(4 * 4 * 4);
- gl.readPixels(0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, buf);
- for (var i = 0; i < 4 * 4; ++i) {
- var offset = i * 4;
- if (buf[offset + 0] != r ||
- buf[offset + 1] != g ||
- buf[offset + 2] != b ||
- buf[offset + 3] != a) {
- testFailed(msg + ', read back color is ' + buf[offset + 0] + ',' + buf[offset + 1]
- + ',' + buf[offset + 2] + ',' + buf[offset + 3]);
- return;
- }
- }
- testPassed(msg);
- }
- }
-
- init();
- successfullyParsed = true;
- </script>
-</body>
-<script src="../../js/resources/js-test-post.js"></script>
-
-<script>
-</script>
-
-</body>
-</html>
-
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>WebGL Non-Power of 2 texture conformance test.</title>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/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>
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+var program = wtu.setupTexturedQuad(gl);
+
+assertMsg(gl.getError() == gl.NO_ERROR, "Should be no errors from setup.");
+
+var tex = gl.createTexture();
+
+// Check that an NPOT texture not on level 0 generates INVALID_VALUE
+wtu.fillTexture(gl, tex, 5, 3, [0, 192, 128, 255], 1);
+assertMsg(gl.getError() == gl.INVALID_VALUE,
+ "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
+
+// Check that an NPOT texture on level 0 succeeds
+wtu.fillTexture(gl, tex, 5, 3, [0, 192, 128, 255]);
+assertMsg(gl.getError() == gl.NO_ERROR,
+ "gl.texImage2D with NPOT texture at level 0 should succeed");
+
+// Check that generateMipmap fails on NPOT
+gl.generateMipmap(gl.TEXTURE_2D);
+assertMsg(gl.getError() == gl.INVALID_OPERATION,
+ "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
+
+var loc = gl.getUniformLocation(program, "tex");
+gl.uniform1i(loc, 0);
+
+// Check that nothing is drawn if filtering is not correct for NPOT
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+wtu.drawQuad(gl);
+wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
+assertMsg(gl.getError() == gl.NO_ERROR, "Should be no errors from setup.");
+
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
+
+wtu.drawQuad(gl);
+wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
+assertMsg(gl.getError() == gl.NO_ERROR, "Should be no errors from setup.");
+
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+
+wtu.drawQuad(gl);
+wtu.checkCanvas(
+ gl, [0, 192, 128, 255],
+ "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw.");
+
+successfullyParsed = true;
+</script>
+</body>
+<script src="../../js/resources/js-test-post.js"></script>
+
+<script>
+</script>
+
+</body>
+</html>
+
diff --git a/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt b/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt
index 5f86d7d..aaba6a9 100644
--- a/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized-expected.txt
@@ -1,4 +1,4 @@
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=32888 : Garbage in transparent regions of images uploaded as textures
+Tests there is no garbage in transparent regions of images uploaded as textures
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized.html b/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized.html
index f6fe0f9..26eb02a 100644
--- a/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized.html
+++ b/LayoutTests/fast/canvas/webgl/texture-transparent-pixels-initialized.html
@@ -33,19 +33,17 @@ var successfullyParsed = false;
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
- layoutTestController.waitUntilDone();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(true);
}
- description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32888">https://bugs.webkit.org/show_bug.cgi?id=32888</a> : <code>Garbage in transparent regions of images uploaded as textures</code>');
+ description('Tests there is no garbage in transparent regions of images uploaded as textures');
gl = initWebGL("example", "vshader", "fshader", [ "g_Position", "g_TexCoord0" ], [ 0, 0, 0, 1 ], 1);
textureLoc = gl.getUniformLocation(gl.program, "tex");
- var vertices = new WebGLFloatArray([
+ var vertices = new Float32Array([
1.0, 1.0, 0.0,
-1.0, 1.0, 0.0,
-1.0, -1.0, 0.0,
@@ -54,7 +52,7 @@ function init()
1.0, -1.0, 0.0]);
// The input texture has 8 characters; take the leftmost one
var coeff = 1.0 / 8.0;
- var texCoords = new WebGLFloatArray([
+ var texCoords = new Float32Array([
coeff, 1.0,
0.0, 1.0,
0.0, 0.0,
@@ -147,8 +145,8 @@ function runTest()
}
function finish() {
- if (window.layoutTestController) {
- layoutTestController.notifyDone();
+ if (window.nonKhronosFrameworkNotifyDone) {
+ window.nonKhronosFrameworkNotifyDone();
}
}
</script>
diff --git a/LayoutTests/fast/canvas/webgl/triangle-expected.txt b/LayoutTests/fast/canvas/webgl/triangle-expected.txt
index 883063e..16a7fa6 100644
--- a/LayoutTests/fast/canvas/webgl/triangle-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/triangle-expected.txt
@@ -1 +1,5 @@
-Test PASSED
+ PASS drawing is correct
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/webgl/triangle.html b/LayoutTests/fast/canvas/webgl/triangle.html
index 46d9b78..ed635f6 100644
--- a/LayoutTests/fast/canvas/webgl/triangle.html
+++ b/LayoutTests/fast/canvas/webgl/triangle.html
@@ -1,8 +1,18 @@
+
<!DOCTYPE html>
<html>
<head>
- <title>Spinning Box</title>
+ <title>Rendering Test</title>
+ <link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+ <script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
<script id="vshader" type="x-shader/x-vertex">
attribute vec4 vPosition;
void main()
@@ -23,35 +33,34 @@
{
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;
- document.getElementById("results").innerHTML = "Test <span style='color:red'>FAILED</span> "+reason;
+ testFailed(reason);
}
-
+
function pass()
{
- document.getElementById("results").innerHTML = "Test <span style='color:green'>PASSED</span>";
+ testPassed("drawing is correct");
}
-
+
function init()
{
- if (window.layoutTestController) {
- layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
- layoutTestController.dumpAsText();
+ if (window.initNonKhronosFramework) {
+ window.initNonKhronosFramework(false);
}
-
+
gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
-
+
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
- gl.bufferData(gl.ARRAY_BUFFER, new WebGLFloatArray([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
-
+
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES, 0, 3);
-
+
var buf = new Uint8Array(50 * 50 * 4);
gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
-
+
// Test several locations
// First line should be all black
for (var i = 0; i < 50; ++i)
@@ -59,7 +68,7 @@
fail(i, 0, buf, "(0,0,0,255)");
return;
}
-
+
// Line 15 should be red for at least 10 red pixels starting 20 pixels in
var offset = (15*50+20) * 4;
for (var i = 0; i < 10; ++i)
@@ -74,15 +83,15 @@
fail(i, 49, buf, "(0,0,0,255)");
return;
}
-
+
pass();
}
+
+ init();
+ successfullyParsed = true;
</script>
- </head>
- <body onload="init()">
- <canvas id="example" width="50px" height="50px">
- There is supposed to be an example drawing here, but it's not important.
- </canvas>
- <div id="results">Test <span style="color:red">FAILED</span></div>
- </body>
+</body>
+<script src="../../js/resources/js-test-post.js"></script>
+
+</body>
</html>
diff --git a/LayoutTests/fast/canvas/webgl/uniform-location-expected.txt b/LayoutTests/fast/canvas/webgl/uniform-location-expected.txt
index 8a42614..8077f00 100644
--- a/LayoutTests/fast/canvas/webgl/uniform-location-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/uniform-location-expected.txt
@@ -1,4 +1,4 @@
-Tests WebGL APIs related to shader uniforms
+Tests the WebGLUniformLocation API
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -16,6 +16,8 @@ PASS contextA.useProgram(programV) generated expected GL error: NO_ERROR.
PASS contextA.uniform4fv(locationVec4, vec) generated expected GL error: NO_ERROR.
PASS contextA.getUniform(programV, locationVec4) is vec
PASS contextA.getUniformLocation(programV, "IDontExist") is null
+PASS contextA.linkProgram(programA1) generated expected GL error: NO_ERROR.
+PASS contextA.uniformMatrix4fv(locationA, false, mat) generated expected GL error: INVALID_OPERATION.
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/uniform-location.html b/LayoutTests/fast/canvas/webgl/uniform-location.html
index 06253a9..f055ad0 100644
--- a/LayoutTests/fast/canvas/webgl/uniform-location.html
+++ b/LayoutTests/fast/canvas/webgl/uniform-location.html
@@ -9,7 +9,7 @@
<div id="console"></div>
<script>
-description("Tests WebGL APIs related to shader uniforms");
+description("Tests the WebGLUniformLocation API");
var contextA = create3DContext();
var contextB = create3DContext();
@@ -45,6 +45,9 @@ shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform4fv(location
shouldBe("contextA.getUniform(programV, locationVec4)", "vec");
shouldBeNull("contextA.getUniformLocation(programV, \"IDontExist\")");
+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programA1)");
+// After linking all boxes are bad.
+shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationA, false, mat)");
successfullyParsed = true;
</script>
diff --git a/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt b/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt
index 41a4357..f3e912c 100644
--- a/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize-expected.txt
@@ -2,7 +2,6 @@ Verifies that GL viewport does not change when canvas is resized
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Regression test for https://bugs.webkit.org/show_bug.cgi?id=34766 : Remove automatic viewport resizing
PASS Viewport correctly did not change size during canvas resize
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize.html b/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize.html
index b24d537..6c096d6 100644
--- a/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize.html
+++ b/LayoutTests/fast/canvas/webgl/viewport-unchanged-upon-resize.html
@@ -27,8 +27,6 @@ void main()
<script>
description('Verifies that GL viewport does not change when canvas is resized');
-debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34766">https://bugs.webkit.org/show_bug.cgi?id=34766</a> : <code>Remove automatic viewport resizing</code>');
-
var gl = initWebGL("example", "vshader", "fshader", [ "g_Position" ], [ 0, 0, 1, 1 ], 1);
var vertices = new WebGLFloatArray([
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list