b=612334; update in-tree webgl tests from svn; npotb
authorVladimir Vukicevic <vladimir@pobox.com>
Tue, 16 Nov 2010 20:33:04 -0800
changeset 57640 56876e7bd59006ba7a2d0a50ce608cf470b898aa
parent 57639 53999baefb65d1880b9d9e6f76ab27879edfb35e
child 57641 69844c0f4fd1401982a3fe60ee47395c4eb89ea8
push id17016
push uservladimir@mozilla.com
push dateWed, 17 Nov 2010 04:34:14 +0000
treeherdermozilla-central@69844c0f4fd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs612334
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
b=612334; update in-tree webgl tests from svn; npotb
content/canvas/test/webgl/README.mozilla
content/canvas/test/webgl/conformance/00_testFIXME_list.txt
content/canvas/test/webgl/conformance/00_test_list.txt
content/canvas/test/webgl/conformance/array-unit-tests.html
content/canvas/test/webgl/conformance/bad-arguments-test.html
content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
content/canvas/test/webgl/conformance/constants.html
content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
content/canvas/test/webgl/conformance/context-attributes.html
content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
content/canvas/test/webgl/conformance/gl-object-get-calls.html
content/canvas/test/webgl/conformance/gl-teximage.html
content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
content/canvas/test/webgl/conformance/glsl-conformance.html
content/canvas/test/webgl/conformance/is-object.html
content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
content/canvas/test/webgl/conformance/read-pixels-test.html
content/canvas/test/webgl/conformance/renderbuffer-initialization.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-array-buffer-view.html
content/canvas/test/webgl/conformance/tex-image-with-invalid-data.html
content/canvas/test/webgl/conformance/texture-transparent-pixels-initialized.html
content/canvas/test/webgl/conformance/type-conversion-test.html
content/canvas/test/webgl/conformance/uninitialized-test.html
content/canvas/test/webgl/conformance/webgl-specific.html
--- a/content/canvas/test/webgl/README.mozilla
+++ b/content/canvas/test/webgl/README.mozilla
@@ -1,11 +1,11 @@
 This is a local copy of the WebGL conformance suite.
 
-  SVN revision: 11955
+  SVN revision: 12905
 
 The canonical location for this testsuite is:
 
   https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/
 
 All files and directories in this directory, with the exceptions listed below, come from
 upstream and should not be modified without corresponding upstream fixes and/or a
 patch file in the "patches" directory. The exceptions (the Mozilla-specific files) are:
--- a/content/canvas/test/webgl/conformance/00_testFIXME_list.txt
+++ b/content/canvas/test/webgl/conformance/00_testFIXME_list.txt
@@ -2,31 +2,32 @@ array-buffer-crash.html
 array-buffer-view-crash.html
 array-unit-tests.html
 bad-arguments-test.html
 buffer-bind-test.html
 buffer-data-array-buffer.html
 canvas-test.html
 constants.html
 context-attributes-alpha-depth-stencil-antialias.html
-context-attributes.html
 context-type-test.html
 copy-tex-image-and-sub-image-2d.html
 draw-arrays-out-of-bounds.html
 draw-elements-out-of-bounds.html
 error-reporting.html
 framebuffer-object-attachment.html
 framebuffer-test.html
 get-active-test.html
 gl-bind-attrib-location-test.html
+gl-clear.html
 gl-drawelements.html
 gl-enable-enum-test.html
 gl-enable-vertex-attrib.html
 gl-enum-tests.html
 gl-get-active-attribute.html
+gl-get-active-uniform.html
 gl-get-calls.html
 gl-getstring.html
 gl-object-get-calls.html
 gl-pixelstorei.html
 gl-scissor-test.html
 gl-shader-test.html
 gl-teximage.html
 gl-uniform-arrays.html
@@ -40,20 +41,23 @@ glsl-conformance.html
 incorrect-context-object-behaviour.html
 index-validation-copies-indices.html
 index-validation-crash-with-buffer-sub-data.html
 index-validation-verifies-too-many-indices.html
 index-validation-with-resized-buffer.html
 index-validation.html
 invalid-UTF-16.html
 invalid-passed-params.html
+is-object.html
 methods.html
 more-than-65536-points.html
 null-object-behaviour.html
 null-uniform-location.html
+object-deletion-behaviour.html
+origin-clean-conformance.html
 point-size.html
 program-test.html
 read-pixels-pack-alignment.html
 read-pixels-test.html
 renderbuffer-initialization.html
 resource-sharing-test.html
 tex-image-and-sub-image-2d-with-array-buffer-view.html
 tex-image-and-sub-image-2d-with-image-data.html
@@ -67,12 +71,14 @@ tex-sub-image-2d.html
 texparameter-test.html
 texture-active-bind-2.html
 texture-active-bind.html
 texture-complete.html
 texture-formats-test.html
 texture-npot.html
 texture-transparent-pixels-initialized.html
 triangle.html
-#uniform-location.html
+type-conversion-test.html
+uniform-location.html
 uniform-samplers-test.html
 uninitialized-test.html
 viewport-unchanged-upon-resize.html
+webgl-specific.html
deleted file mode 100644
--- a/content/canvas/test/webgl/conformance/00_test_list.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-array-buffer-crash.html
-array-buffer-view-crash.html
-array-unit-tests.html
-bad-arguments-test.html
-buffer-bind-test.html
-buffer-data-array-buffer.html
-canvas-test.html
-constants.html
-context-attributes-alpha-depth-stencil-antialias.html
-context-attributes.html
-context-type-test.html
-copy-tex-image-and-sub-image-2d.html
-draw-arrays-out-of-bounds.html
-draw-elements-out-of-bounds.html
-error-reporting.html
-framebuffer-object-attachment.html
-framebuffer-test.html
-get-active-test.html
-gl-bind-attrib-location-test.html
-gl-clear.html
-gl-drawelements.html
-gl-enable-enum-test.html
-gl-enable-vertex-attrib.html
-gl-enum-tests.html
-gl-get-active-attribute.html
-gl-get-active-uniform.html
-gl-get-calls.html
-gl-getstring.html
-gl-object-get-calls.html
-gl-pixelstorei.html
-gl-scissor-test.html
-gl-shader-test.html
-gl-teximage.html
-gl-uniform-arrays.html
-gl-uniform-bool.html
-gl-uniformmatrix4fv.html
-gl-unknown-uniform.html
-gl-vertex-attrib.html
-gl-vertexattribpointer.html
-glsl-2types-of-textures-on-same-unit.html
-glsl-conformance.html
-incorrect-context-object-behaviour.html
-index-validation-copies-indices.html
-index-validation-crash-with-buffer-sub-data.html
-index-validation-verifies-too-many-indices.html
-index-validation-with-resized-buffer.html
-index-validation.html
-invalid-UTF-16.html
-invalid-passed-params.html
-methods.html
-more-than-65536-points.html
-null-object-behaviour.html
-null-uniform-location.html
-object-deletion-behaviour.html
-origin-clean-conformance.html
-point-size.html
-program-test.html
-read-pixels-pack-alignment.html
-read-pixels-test.html
-renderbuffer-initialization.html
-resource-sharing-test.html
-tex-image-and-sub-image-2d-with-array-buffer-view.html
-tex-image-and-sub-image-2d-with-image-data.html
-tex-image-and-sub-image-2d-with-image.html
-tex-image-and-sub-image-2d-with-video.html
-tex-image-and-uniform-binding-bugs.html
-tex-image-with-format-and-type.html
-tex-image-with-invalid-data.html
-tex-input-validation.html
-tex-sub-image-2d.html
-texparameter-test.html
-texture-active-bind-2.html
-texture-active-bind.html
-texture-complete.html
-texture-formats-test.html
-texture-npot.html
-texture-transparent-pixels-initialized.html
-triangle.html
-uniform-location.html
-uniform-samplers-test.html
-uninitialized-test.html
-viewport-unchanged-upon-resize.html
--- a/content/canvas/test/webgl/conformance/array-unit-tests.html
+++ b/content/canvas/test/webgl/conformance/array-unit-tests.html
@@ -433,16 +433,25 @@ function testConstructionWithUnalignedOf
     if (elementSizeInBytes > 1) {
         shouldThrowIndexSizeErr(function() {
             var buffer = new ArrayBuffer(32);
             var array = new type(buffer, 1, elementSizeInBytes);
         }, "Construction of " + name + " with unaligned offset");
     }
 }
 
+function testConstructionWithUnalignedLength(type, name, elementSizeInBytes) {
+    if (elementSizeInBytes > 1) {
+        shouldThrowIndexSizeErr(function() {
+            var buffer = new ArrayBuffer(elementSizeInBytes + 1);
+            var array = new type(buffer, 0);
+        }, "Construction of " + name + " with unaligned length");
+    }
+}
+
 function testConstructionOfHugeArray(type, name, sz) {
     if (sz == 1)
         return;
     try {
         // Construction of huge arrays must fail because byteLength is
         // an unsigned long
         array = new type(3000000000);
         testFailed("Construction of huge " + name + " should throw exception");
@@ -666,16 +675,17 @@ function runTests() {
                            testCase.low,
                            testCase.expectedLow,
                            testCase.high,
                            testCase.expectedHigh);
     testConstructionWithNullBuffer(type, name);
     testConstructionWithOutOfRangeValues(type, name);
     testConstructionWithNegativeOutOfRangeValues(type, name);
     testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes);
+    testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes);
     testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
     testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSizeInBytes);
     testSlicingWithOutOfRangeValues(type, name, testCase.elementSizeInBytes);
     testSlicingWithDefaultValues(type, name, testCase.elementSizeInBytes);
     testSettingFromArrayWithOutOfRangeOffset(type, name);
     testSettingFromFakeArrayWithOutOfRangeLength(type, name);
     testSettingFromTypedArrayWithOutOfRangeOffset(type, name);
     negativeTestGetAndSetMethods(type, name);
--- a/content/canvas/test/webgl/conformance/bad-arguments-test.html
+++ b/content/canvas/test/webgl/conformance/bad-arguments-test.html
@@ -74,17 +74,16 @@ for (var i = 0; i < arguments.length; ++
   } else {
     func = shouldBeUndefined;
     func2 = shouldBeNull;
     func3 = shouldBeEmptyString;
   }
   argument = arguments[i].value;
   func("context.compileShader(argument)");
   func("context.linkProgram(argument)");
-  func("context.attachShader(argument)");
   func("context.attachShader(program, argument)");
   func("context.attachShader(argument, shader)");
   func("context.detachShader(program, argument)");
   func("context.detachShader(argument, shader)");
   func("context.useProgram(argument)");
   func("context.shaderSource(argument, 'foo')");
   func("context.bindAttribLocation(argument, 0, 'foo')");
   func("context.bindBuffer(context.ARRAY_BUFFER, argument)");
--- a/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
+++ b/content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
@@ -28,22 +28,29 @@ var buf = gl.createBuffer();
 shouldBeNonNull(buf);
 
 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
 glErrorShouldBe(gl, gl.INVALID_OPERATION);
 
 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
 glErrorShouldBe(gl, gl.NO_ERROR);
 
+// This should not crash, but the selection of the overload is ambiguous per Web IDL.
+gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);
+gl.getError();
+
 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 array = new ArrayBuffer(64);
 
 gl.bufferSubData(gl.ARRAY_BUFFER, 10, array);
 glErrorShouldBe(gl, gl.NO_ERROR);
 
+gl.bufferSubData(gl.ARRAY_BUFFER, 10, null);
+glErrorShouldBe(gl, gl.NO_ERROR);
+
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/constants.html
+++ b/content/canvas/test/webgl/conformance/constants.html
@@ -370,20 +370,16 @@ SAMPLER_CUBE                   : 0x8B60,
 VERTEX_ATTRIB_ARRAY_ENABLED        : 0x8622,
 VERTEX_ATTRIB_ARRAY_SIZE           : 0x8623,
 VERTEX_ATTRIB_ARRAY_STRIDE         : 0x8624,
 VERTEX_ATTRIB_ARRAY_TYPE           : 0x8625,
 VERTEX_ATTRIB_ARRAY_NORMALIZED     : 0x886A,
 VERTEX_ATTRIB_ARRAY_POINTER        : 0x8645,
 VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : 0x889F,
     
-    /* Read Format */
-IMPLEMENTATION_COLOR_READ_TYPE   : 0x8B9A,
-IMPLEMENTATION_COLOR_READ_FORMAT : 0x8B9B,
-    
     /* Shader Source */
 COMPILE_STATUS                 : 0x8B81,
 INFO_LOG_LENGTH                : 0x8B84,
 SHADER_SOURCE_LENGTH           : 0x8B88,
 SHADER_COMPILER                : 0x8DFA,
     
     /* Shader Precision-Specified Types */
 LOW_FLOAT                      : 0x8DF0,
@@ -398,16 +394,17 @@ FRAMEBUFFER                    : 0x8D40,
 RENDERBUFFER                   : 0x8D41,
     
 RGBA4                          : 0x8056,
 RGB5_A1                        : 0x8057,
 RGB565                         : 0x8D62,
 DEPTH_COMPONENT16              : 0x81A5,
 STENCIL_INDEX                  : 0x1901,
 STENCIL_INDEX8                 : 0x8D48,
+DEPTH_STENCIL                  : 0x84F9,
     
 RENDERBUFFER_WIDTH             : 0x8D42,
 RENDERBUFFER_HEIGHT            : 0x8D43,
 RENDERBUFFER_INTERNAL_FORMAT   : 0x8D44,
 RENDERBUFFER_RED_SIZE          : 0x8D50,
 RENDERBUFFER_GREEN_SIZE        : 0x8D51,
 RENDERBUFFER_BLUE_SIZE         : 0x8D52,
 RENDERBUFFER_ALPHA_SIZE        : 0x8D53,
@@ -417,30 +414,38 @@ RENDERBUFFER_STENCIL_SIZE      : 0x8D55,
 FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           : 0x8CD0,
 FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           : 0x8CD1,
 FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         : 0x8CD2,
 FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : 0x8CD3,
     
 COLOR_ATTACHMENT0              : 0x8CE0,
 DEPTH_ATTACHMENT               : 0x8D00,
 STENCIL_ATTACHMENT             : 0x8D20,
+DEPTH_STENCIL_ATTACHMENT       : 0x821A,
     
 NONE                           : 0,
     
 FRAMEBUFFER_COMPLETE                      : 0x8CD5,
 FRAMEBUFFER_INCOMPLETE_ATTACHMENT         : 0x8CD6,
 FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : 0x8CD7,
 FRAMEBUFFER_INCOMPLETE_DIMENSIONS         : 0x8CD9,
 FRAMEBUFFER_UNSUPPORTED                   : 0x8CDD,
   
 FRAMEBUFFER_BINDING            : 0x8CA6,
 RENDERBUFFER_BINDING           : 0x8CA7,
 MAX_RENDERBUFFER_SIZE          : 0x84E8,
     
-INVALID_FRAMEBUFFER_OPERATION  : 0x0506
+INVALID_FRAMEBUFFER_OPERATION  : 0x0506,
+
+/* WebGL-specific enums */
+UNPACK_FLIP_Y_WEBGL                : 0x9240,
+UNPACK_PREMULTIPLY_ALPHA_WEBGL     : 0x9241,
+CONTEXT_LOST_WEBGL                 : 0x9242,
+UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243,
+BROWSER_DEFAULT_WEBGL              : 0x9244
 };
 
 function assertProperty(v, p) {
   if (v[p] == null) {
     testFailed("Property does not exist: " + p)
     return false;
   } else {
     return true;
--- a/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
+++ b/content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
@@ -49,75 +49,24 @@ function init()
 
     description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
 
     runTest();
 }
 
 function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStencil)
 {
-    var canvas = document.getElementById(canvasName);
-    var gl = canvas.getContext("experimental-webgl", contextAttribs);
-    if (!gl) {
-        alert("No WebGL context found");
-        return null;
+    var context = initWebGL(canvasName, "vshader", "fshader", ["pos", "colorIn"], clearColor, clearDepth, contextAttribs);
+    if (context) {
+        context.clearStencil(clearStencil);
+        context.enable(context.STENCIL_TEST);
+        context.disable(context.BLEND);
+        context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
     }
-
-    // Add a console
-    gl.console = ("console" in window) ? window.console : { log: function() { } };
-
-    // create our shaders
-    var vertexShader = loadShader(gl, "vshader");
-    var fragmentShader = loadShader(gl, "fshader");
-
-    if (!vertexShader || !fragmentShader)
-        return null;
-
-    // Create the program object
-    gl.program = gl.createProgram();
-
-    if (!gl.program)
-        return null;
-
-    // Attach our two shaders to the program
-    gl.attachShader(gl.program, vertexShader);
-    gl.attachShader(gl.program, fragmentShader);
-
-    // Bind attributes
-    var attribs = [ "pos", "colorIn" ];
-    for (var i in attribs)
-        gl.bindAttribLocation(gl.program, i, attribs[i]);
-
-    // Link the program
-    gl.linkProgram(gl.program);
-
-    // Check the link status
-    var linked = gl.getProgramParameter(gl.program, gl.LINK_STATUS);
-    if (!linked) {
-        // something went wrong with the link
-        var error = gl.getProgramInfoLog (gl.program);
-        gl.console.log("Error in program linking:"+error);
-
-        gl.deleteProgram(gl.program);
-        gl.deleteProgram(fragmentShader);
-        gl.deleteProgram(vertexShader);
-
-        return null;
-    }
-
-    gl.useProgram(gl.program);
-
-    gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
-    gl.clearDepth(clearDepth);
-    gl.clearStencil(clearStencil);
-    gl.enable(gl.DEPTH_TEST);
-    gl.enable(gl.STENCIL_TEST);
-    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
-
-    return gl;
+    return context;
 }
 
 function drawAndReadPixel(gl, vertices, colors, x, y)
 {
     var colorOffset = vertices.byteLength;
 
     var vbo = gl.createBuffer();
     gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
@@ -141,51 +90,34 @@ function testAlpha(alpha)
 {
     debug("Testing alpha = " + alpha);
     if (alpha)
         shouldBeNonNull("webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     else
         shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
 
-    shouldBe("'depth' in contextAttribs", "true");
-    shouldBe("'stencil' in contextAttribs", "true");
-    shouldBe("'alpha' in contextAttribs", "true");
-    shouldBe("'antialias' in contextAttribs", "true");
-    shouldBe("'premultipliedAlpha' in contextAttribs", "true");
-
-    shouldBe("contextAttribs.alpha", (alpha ? "true" : "false"));
-    shouldBe("contextAttribs.depth", "false");
-    shouldBe("contextAttribs.stencil", "false");
-    shouldBe("contextAttribs.antialias", "false");
-    shouldBe("contextAttribs.premultipliedAlpha", "true");
-
     var buf = new Uint8Array(1 * 1 * 4);
     webGL.readPixels(0, 0, 1, 1, webGL.RGBA, webGL.UNSIGNED_BYTE, buf);
     pixel[0] = buf[0];
     pixel[1] = buf[1];
     pixel[2] = buf[2];
     pixel[3] = buf[3];
-    correctColor = (alpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
+    correctColor = (contextAttribs.alpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testDepth(depth)
 {
     debug("Testing depth = " + depth);
     if (depth)
         shouldBeNonNull("webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
         shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBe("contextAttribs.depth", (depth ? "true" : "false"));
-    shouldBe("contextAttribs.alpha", "true");
-    shouldBe("contextAttribs.stencil", "false");
-    shouldBe("contextAttribs.antialias", "false");
-    shouldBe("contextAttribs.premultipliedAlpha", "true");
 
     webGL.depthFunc(webGL.NEVER);
 
     var vertices = new Float32Array([
          1.0,  1.0, 0.0,
         -1.0,  1.0, 0.0,
         -1.0, -1.0, 0.0,
          1.0,  1.0, 0.0,
@@ -199,33 +131,28 @@ function testDepth(depth)
         255, 0, 0, 255,
         255, 0, 0, 255]);
 
     var buf = drawAndReadPixel(webGL, vertices, colors, 0, 0);
     pixel[0] = buf[0];
     pixel[1] = buf[1];
     pixel[2] = buf[2];
     pixel[3] = buf[3];
-    correctColor = (depth ? [0, 0, 0, 255] : [255, 0, 0, 255]);
+    correctColor = (contextAttribs.depth ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testStencil(stencil)
 {
     debug("Testing stencil = " + stencil);
     if (stencil)
         shouldBeNonNull("webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     else
         shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    // If EXT_packed_depth_stencil is supported, both depth & stencil will be true; otherwise, both will be false.
-    shouldBe("contextAttribs.depth == contextAttribs.stencil", "true");
-    shouldBe("contextAttribs.alpha", "true");
-    shouldBe("contextAttribs.antialias", "false");
-    shouldBe("contextAttribs.premultipliedAlpha", "true");
 
     webGL.depthFunc(webGL.ALWAYS);
 
     webGL.stencilFunc(webGL.NEVER, 1, 1);
     webGL.stencilOp(webGL.KEEP, webGL.KEEP, webGL.KEEP);
 
     var vertices = new Float32Array([
          1.0, 1.0, 0.0,
@@ -242,51 +169,40 @@ function testStencil(stencil)
         255, 0, 0, 255,
         255, 0, 0, 255]);
 
     var buf = drawAndReadPixel(webGL, vertices, colors, 0, 0);
     pixel[0] = buf[0];
     pixel[1] = buf[1];
     pixel[2] = buf[2];
     pixel[3] = buf[3];
-    correctColor = (stencil ? [0, 0, 0, 255] : [255, 0, 0, 255]);
-    // If stencil is requested but not supported, we fake the effect.
-    if (stencil && !contextAttribs.stencil)
-        pixel[0] = 0;
+    correctColor = (contextAttribs.stencil ? [0, 0, 0, 255] : [255, 0, 0, 255]);
     shouldBe("pixel", "correctColor");
 }
 
 function testAntialias(antialias)
 {
     debug("Testing antialias = " + antialias);
     if (antialias)
         shouldBeNonNull("webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
     else
         shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBe("contextAttribs.depth", "false");
-    shouldBe("contextAttribs.stencil", "false");
-    shouldBe("contextAttribs.alpha", "false");
-    shouldBe("contextAttribs.antialias == true || contextAttribs.antialias == false", "true");
-    shouldBe("contextAttribs.premultipliedAlpha", "true");
 
     var vertices = new Float32Array([
          1.0, 1.0, 0.0,
         -1.0, 1.0, 0.0,
         -1.0, -1.0, 0.0]);
     var colors = new Uint8Array([
         255, 0, 0, 255,
         255, 0, 0, 255,
         255, 0, 0, 255]);
     var buf = drawAndReadPixel(webGL, vertices, colors, 0, 0);
     pixel[0] = buf[0];
-    // If antialias is requested but not supported, we fake the effect.
-    if (antialias && !contextAttribs.antialias)
-        pixel[0] = 127;
-    shouldBe("pixel[0] == 255 || pixel[0] == 0", (antialias ? "false" : "true"));
+    shouldBe("pixel[0] != 255 && pixel[0] != 0", "contextAttribs.antialias");
 }
 
 function runTest()
 {
 
     testAlpha(true);
     testAlpha(false);
     testDepth(true);
deleted file mode 100644
--- a/content/canvas/test/webgl/conformance/context-attributes.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!--
-Copyright (c) 2010 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.
- -->
-<html>
-<head>
-<link rel="stylesheet" href="../resources/js-test-style.css"/>
-<script src="../resources/js-test-pre.js"></script>
-<script src="resources/webgl-test.js"></script>
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-
-<script>
-description("Test passing down and fetching of WebGLContextAttributes");
-
-debug("Test default values");
-var context;
-var attribs;
-shouldBeNonNull("context = create3DContext(null)");
-shouldBeNonNull("attribs = context.getContextAttributes()");
-shouldBe("attribs.depth", "true");
-shouldBe("attribs.alpha", "true");
-shouldBe("attribs.stencil", "false");
-// Antialias is requested by default, but might or might not be supported.
-shouldBe("attribs.antialias == true || attribs.antialias == false", "true");
-shouldBe("attribs.premultipliedAlpha", "true");
-
-debug ("Test customized values");
-shouldBeNonNull("context = create3DContext(null, { stencil: false, antialias: false })");
-shouldBeNonNull("attribs = context.getContextAttributes()");
-shouldBe("attribs.depth", "true");
-shouldBe("attribs.alpha", "true");
-shouldBe("attribs.stencil", "false");
-shouldBe("attribs.antialias", "false");
-shouldBe("attribs.premultipliedAlpha", "true");
-
-debug("Test customized values");
-// (stencil == true && depth == false) is not supported.
-// Default depth to true if EXT_packed_depth_stencil is supported.
-// Otherwise, both depth and stencil should be false.
-shouldBeNonNull("context = create3DContext(null, { depth: false, stencil: true, antialias: false })");
-shouldBeNonNull("attribs = context.getContextAttributes()");
-shouldBe("attribs.depth == attribs.stencil", "true");
-shouldBe("attribs.alpha", "true");
-shouldBe("attribs.antialias", "false");
-shouldBe("attribs.premultipliedAlpha", "true");
-
-debug("Test customized values");
-// (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 || attribs.premultipliedAlpha == false", "true");
-
-successfullyParsed = true;
-</script>
-
-<script src="../resources/js-test-post.js"></script>
-</body>
-</html>
--- a/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
+++ b/content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
@@ -83,17 +83,17 @@ function runTestIteration(antialias)
                   texCoordOffset + texCoords.byteLength,
                   gl.STATIC_DRAW);
     gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);
     gl.bufferSubData(gl.ARRAY_BUFFER, texCoordOffset, texCoords);
 
     gl.enableVertexAttribArray(0);
     gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
     gl.enableVertexAttribArray(1);
-    gl.vertexAttribPointer(1, 2, gl.FLOAT, gl.FALSE, 0, texCoordOffset);
+    gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, texCoordOffset);
 
     gl.colorMask(1, 1, 1, 0);
     gl.disable(gl.BLEND);
     debug('Testing copyTexImage2D');
 
     // Red canvas
     gl.clearColor(1, 0, 0, 1);
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
--- a/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
@@ -45,36 +45,36 @@ context.enableVertexAttribArray(0);
 
 debug("Test empty buffer")
 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.NO_ERROR, "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.NO_ERROR, "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 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);
 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.NO_ERROR, "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;" +
--- a/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
+++ b/content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
@@ -69,17 +69,17 @@ shouldGenerateGLError(context, context.I
 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.NO_ERROR, "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)");
 
 shouldGenerateGLError(context, context.NO_ERROR, "context.bufferData(context.ELEMENT_ARRAY_BUFFER, (new Uint8Array([ 3, 0, 1, 2 ])).slice(1), context.STATIC_DRAW)");
 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0)");
 shouldGenerateGLError(context, context.NO_ERROR, "context.bufferSubData(context.ELEMENT_ARRAY_BUFFER, 0, new Uint8Array([ 3, 0, 1]))");
 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0)");
--- a/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
+++ b/content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
@@ -23,50 +23,77 @@ var depthStencilBuffer;
 var colorBuffer;
 var width = 2;
 var height = 2;
 
 function testAttachment(attachment, buffer, isConflicted)
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer);
-    glErrorShouldBe(gl, isConflicted ? gl.INVALID_OPERATION : gl.NO_ERROR);
+    glErrorShouldBe(gl, gl.NO_ERROR);
+    if (isConflicted) {
+        shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
+        gl.clear(gl.COLOR_BUFFER_BIT);
+        glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
+        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(width * height * 4));
+        glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
+    }
 }
 
 function testAttachments(attachment0, buffer0, attachment1, buffer1, isConflicted)
 {
     shouldBeNonNull("fbo = gl.createFramebuffer()");
     gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, buffer0);
     glErrorShouldBe(gl, gl.NO_ERROR);
     gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
-    glErrorShouldBe(gl, isConflicted ? gl.INVALID_OPERATION : gl.NO_ERROR);
-    if (isConflicted) {
-        // Detach buffer0 first using a null object, then attaching buffer1 should succeed.
-        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, null);
-        glErrorShouldBe(gl, gl.NO_ERROR);
-        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
-        glErrorShouldBe(gl, gl.NO_ERROR);
-    }
+    glErrorShouldBe(gl, gl.NO_ERROR);
+    if (isConflicted)
+        shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
 }
 
 function testColorRenderbuffer(internalformat)
 {
     shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
     gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
     gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height);
     glErrorShouldBe(gl, gl.NO_ERROR);
     testAttachment(gl.COLOR_ATTACHMENT0, colorBuffer, false);
 }
 
+function testDepthStencilRenderbuffer()
+{
+    shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+    gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+    glErrorShouldBe(gl, gl.NO_ERROR);
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0");
+    shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0");
+    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
+    shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+    glErrorShouldBe(gl, gl.NO_ERROR);
+    testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
+}
+
 description("Test framebuffer object attachment behaviors");
 
 debug("Create renderbuffers");
 shouldBeNonNull("gl = create3DContext()");
+shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
+glErrorShouldBe(gl, gl.NO_ERROR);
 shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
 gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
 gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
 glErrorShouldBe(gl, gl.NO_ERROR);
 shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
 gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
 gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
 glErrorShouldBe(gl, gl.NO_ERROR);
@@ -111,14 +138,17 @@ debug("Attach color renderbuffer with in
 testColorRenderbuffer(gl.RGBA4);
 
 debug("Attach color renderbuffer with internalformat == RGB5_A1");
 testColorRenderbuffer(gl.RGB5_A1);
 
 debug("Attach color renderbuffer with internalformat == RGB565");
 testColorRenderbuffer(gl.RGB565);
 
+debug("Create and attach depthStencil renderbuffer");
+testDepthStencilRenderbuffer();
+
 successfullyParsed = true;
 </script>
 
 <script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-object-get-calls.html
+++ b/content/canvas/test/webgl/conformance/gl-object-get-calls.html
@@ -59,17 +59,17 @@ var standardFrag = loadStandardFragmentS
 var standardProgram = gl.createProgram();
 gl.attachShader(standardProgram, standardVert);
 gl.attachShader(standardProgram, standardFrag);
 gl.linkProgram(standardProgram);
 var shaders = gl.getAttachedShaders(standardProgram);
 shouldBe('shaders.length', '2');
 shouldBeTrue('shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag');
 glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeUndefined('gl.getAttachedShaders(null)');
+shouldBeNull('gl.getAttachedShaders(null)');
 glErrorShouldBe(gl, gl.INVALID_VALUE);
 shouldThrow('gl.getAttachedShaders(standardVert)');
 glErrorShouldBe(gl, gl.NO_ERROR);
 
 // Test getBufferParameter
 var buffer = gl.createBuffer();
 gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
 gl.bufferData(gl.ARRAY_BUFFER, 16, gl.DYNAMIC_DRAW);
@@ -169,19 +169,19 @@ var bval3Loc = gl.getUniformLocation(boo
 var bval4Loc = gl.getUniformLocation(boolProgram, "bval4");
 gl.useProgram(boolProgram);
 gl.uniform1i(bvalLoc, 1);
 gl.uniform2i(bval2Loc, 1, 0);
 gl.uniform3i(bval3Loc, 1, 0, 1);
 gl.uniform4i(bval4Loc, 1, 0, 1, 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]');
-shouldBe('gl.getUniform(boolProgram, bval4Loc)', '[1, 0, 1, 0]');
+shouldBe('gl.getUniform(boolProgram, bval2Loc)', '[true, false]');
+shouldBe('gl.getUniform(boolProgram, bval3Loc)', '[true, false, true]');
+shouldBe('gl.getUniform(boolProgram, bval4Loc)', '[true, false, true, false]');
 // Integer uniform variables
 var intProgram = loadProgram(gl, "resources/intUniformShader.vert", "resources/noopUniformShader.frag");
 shouldBe('gl.getProgramParameter(intProgram, gl.LINK_STATUS)', 'true');
 var ivalLoc = gl.getUniformLocation(intProgram, "ival");
 var ival2Loc = gl.getUniformLocation(intProgram, "ival2");
 var ival3Loc = gl.getUniformLocation(intProgram, "ival3");
 var ival4Loc = gl.getUniformLocation(intProgram, "ival4");
 gl.useProgram(intProgram);
--- a/content/canvas/test/webgl/conformance/gl-teximage.html
+++ b/content/canvas/test/webgl/conformance/gl-teximage.html
@@ -33,17 +33,18 @@ var imgURLs = [
   'resources/gray-ramp-gamma0.1.png',
   'resources/gray-ramp-gamma1.0.png',
   'resources/gray-ramp-gamma2.0.png',
   'resources/gray-ramp-gamma4.0.png',
   'resources/gray-ramp-gamma9.0.png',
   'resources/gray-ramp.png',
   'resources/zero-alpha.png',
   'resources/3x3.png',
-  'resources/blue-1x1.jpg'];
+  'resources/blue-1x1.jpg',
+  'resources/green-2x2-16bit.png'];
 
 wtu.loadImagesAsync(imgURLs, runTests);
 
 function runTests(imgs) {
   var loc = gl.getUniformLocation(program, "tex");
   gl.uniform1i(loc, 0);
 
   gl.disable(gl.BLEND);
@@ -162,16 +163,17 @@ function runTests(imgs) {
                 "There should be " + info.counts[ii] +
                 " unique values in channel " + ii + ". Found " +
                 numUniqueValues[ii]);
     }
   }
 
   debug("");
   debug("Check that gamma settings don't effect 8bit pngs");
+  gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
   gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
                 imgs['resources/gray-ramp-default-gamma.png']);
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
   wtu.drawQuad(gl);
   var ref = new Uint8Array(width * height * 4);
   gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, ref);
 
   var gammaImages = [
@@ -285,16 +287,29 @@ function runTests(imgs) {
   wtu.drawQuad(gl);
   gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
 
   checkPixelRange(buf, middle, center, [   0,   0, 255, 255], 10);
 
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
 
   debug("");
+  debug("check uploading of 16-bit images");
+  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+                imgs['resources/green-2x2-16bit.png']);
+  glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+  wtu.drawQuad(gl);
+  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+  checkPixelRange(buf, middle, center, [   15, 121,   0, 255], 10);
+
+  glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+  debug("");
   successfullyParsed = true;
   shouldBeTrue("successfullyParsed");
   debug('<br /><span class="pass">TEST COMPLETE</span>');
   notifyFinishedToHarness();
 }
 </script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
+++ b/content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
@@ -14,33 +14,43 @@ found in the LICENSE file.
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 <canvas id="canvas" width="2" height="2"> </canvas>
 <script>
-description("This test ensures WebGL implementations vertexAttribPointer can not be set if no buffer is bound.");
+description("This test checks vertexAttribPointer behaviors in WebGL.");
 
 debug("");
 debug("Canvas.getContext");
 
 var gl = create3DContext(document.getElementById("canvas"));
 if (!gl) {
   testFailed("context does not exist");
 } else {
   testPassed("context exists");
 
   debug("");
   debug("Checking gl.vertexAttribPointer.");
 
   gl.vertexAttribPointer(0, 3, gl.FLOAT, 0, 0, 12);
   glErrorShouldBe(gl, gl.INVALID_OPERATION,
       "vertexAttribPointer should fail if no buffer is bound");
+
+  var vertexObject = gl.createBuffer();
+  gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(512), gl.STATIC_DRAW);
+  gl.vertexAttribPointer(0, 1, gl.FLOAT, 0, 256, 0);
+  glErrorShouldBe(gl, gl.INVALID_VALUE,
+      "WebGL API supports vertex attribute data strides up to 255 bytes");
+  gl.vertexAttribPointer(0, 1, gl.FLOAT, 0, 255, 0);
+  glErrorShouldBe(gl, gl.NO_ERROR,
+      "vertexAttribPointer with stride <= 255 should succeed");
 }
 
 debug("");
 successfullyParsed = true;
 
 </script>
 <script src="../resources/js-test-post.js"></script>
 
--- a/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
+++ b/content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
@@ -55,16 +55,17 @@ function init()
   debug("OpenGL ES 2.0.24 spec section 2.10.4, Samplers subsection.");
   debug("");
 
   var canvas2d = document.getElementById("canvas2d");
   var ctx2d = canvas2d.getContext("2d");
 
   gl = initWebGL("example", "vshader", "fshader", [ "vPosition", "texCoord0"],
                  [ 0, 0, 0, 1 ], 1);
+  gl = WebGLDebugUtils.makeDebugContext(gl);
 
   gl.disable(gl.DEPTH_TEST);
   gl.disable(gl.BLEND);
 
   var vertexObject = gl.createBuffer();
   gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
   gl.bufferData(
       gl.ARRAY_BUFFER,
@@ -119,17 +120,17 @@ function init()
   gl.clearColor(1,0,0,1);
   gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 
   for (var ii = 0; ii < 4; ++ii) {
     var x = ii % 2;
     var y = Math.floor(ii / 2);
     gl.drawArrays(gl.TRIANGLES, 0, 6);
     glErrorShouldBe(gl, gl.INVALID_OPERATION,
-                    "drawing with 2 different targets on the same texture unit should generate error");
+              "drawing with 2 different targets on the same texture unit should generate INVALID_VALUE");
   }
 }
 
 init();
 successfullyParsed = true;
 </script>
 </body>
 <script src="../resources/js-test-post.js"></script>
--- a/content/canvas/test/webgl/conformance/glsl-conformance.html
+++ b/content/canvas/test/webgl/conformance/glsl-conformance.html
@@ -218,16 +218,47 @@ void main()
 </script>
 <script id="vshaderWithLineDirective" type="text/something-not-javascript">
 #line 123
 foo
 </script>
 <script id="vshaderWith__FILE__" type="text/something-not-javascript">
 __FILE__
 </script>
+<script id="fshaderWithdFdx" type="text/something-not-javascript">
+#extension GL_OES_standard_derivatives:enable
+precision mediump float;
+void main()
+{
+    gl_FragColor = vec4(dFdx(0.5),0.0,0.0,1.0);
+}
+</script>
+<script id="fshaderWithdFdxNoExt" type="text/something-not-javascript">
+precision mediump float;
+void main()
+{
+    gl_FragColor = vec4(dFdx(0.5),0.0,0.0,1.0);
+}
+</script>
+<script id="fshaderWith256CharacterIdentifier" type="text/something-not-javascript">
+precision mediump float;
+uniform float a123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 = 2.0;
+void main()
+{
+  gl_FragColor = vec4(a123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345,0.0,0.0,1.0);
+}
+</script>
+<script id="fshaderWith257CharacterIdentifier" type="text/something-not-javascript">
+precision mediump float;
+uniform float a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 = 2.0;
+void main()
+{
+  gl_FragColor = vec4(a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456,0.0,0.0,1.0);
+}
+</script>
 <canvas id="canvas" width="2" height="2"> </canvas>
 <script>
 description("This test ensures WebGL implementations allow proper GLES2 shaders compile and improper ones fail.");
 
 debug("");
 debug("Canvas.getContext");
 
 var wtu = WebGLTestUtils;
@@ -305,16 +336,30 @@ if (!gl) {
     },
     { vShaderId: 'vshader',
       vShaderSuccess: true,
       fShaderId: 'fshaderWithFragDepth',
       fShaderSuccess: false,
       linkSuccess: false,
       passMsg: 'fragment shader that uses gl_FragDepth should fail',
     },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithdFdx',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: 'fragment shader that uses dFdx should fail',
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWithdFdxNoExt',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: 'fragment shader that uses dFdx without #extension should fail',
+    },
     { vShaderId: 'vshaderWithClipVertex',
       vShaderSuccess: false,
       fShaderId: 'fshader',
       fShaderSuccess: true,
       linkSuccess: false,
       passMsg: 'vertex shader that uses gl_ClipVertex should fail',
     },
     //{ vShaderId: 'vshader',
@@ -410,17 +455,31 @@ if (!gl) {
     },
     { vShaderId: 'vshaderWithLineDirective',
       vShaderSuccess: false,
       vShaderTest: (function() { return wtu.getLastError().indexOf("124") >= 0; }),
       fShaderId: 'fshader',
       fShaderSuccess: true,
       linkSuccess: false,
       passMsg: 'vertex shader uses #line directive should report correct line',
-    }
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith256CharacterIdentifier',
+      fShaderSuccess: true,
+      linkSuccess: true,
+      passMsg: 'shared that uses 256 character identifier should succeed',
+    },
+    { vShaderId: 'vshader',
+      vShaderSuccess: true,
+      fShaderId: 'fshaderWith257CharacterIdentifier',
+      fShaderSuccess: false,
+      linkSuccess: false,
+      passMsg: 'shared that uses 257 character identifier should fail',
+    },
   ];
 
   // Read in all the shader source.
   for (var ii = 0; ii < shaderInfo.length; ++ii) {
     var si = shaderInfo[ii];
     si.vShaderSource = document.getElementById(si.vShaderId).text;
     si.fShaderSource = document.getElementById(si.fShaderId).text;
   }
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/is-object.html
@@ -0,0 +1,72 @@
+<html>
+<head>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas">
+<script>
+var wtu;
+var canvas;
+var gl;
+var shouldGenerateGLError;
+
+var buffer;
+var framebuffer;
+var program;
+var renderbuffer;
+var shader;
+var texture;
+
+description("Tests 'is' calls against non-bound and deleted objects");
+
+wtu = WebGLTestUtils;
+canvas = document.getElementById("canvas");
+gl = wtu.create3DContext(canvas);
+shouldGenerateGLError = wtu.shouldGenerateGLError;
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "buffer = gl.createBuffer()");
+shouldBeFalse("gl.isBuffer(buffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
+shouldBeTrue("gl.isBuffer(buffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "framebuffer = gl.createFramebuffer()");
+shouldBeFalse("gl.isFramebuffer(framebuffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)");
+shouldBeTrue("gl.isFramebuffer(framebuffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "renderbuffer = gl.createRenderbuffer()");
+shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)");
+shouldBeTrue("gl.isRenderbuffer(renderbuffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "texture = gl.createTexture()");
+shouldBeFalse("gl.isTexture(texture)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, texture)");
+shouldBeTrue("gl.isTexture(texture)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "program = gl.createProgram()");
+shouldBeTrue("gl.isProgram(program)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteProgram(program)");
+shouldBeFalse("gl.isProgram(program)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "shader = gl.createShader(gl.VERTEX_SHADER)");
+shouldBeTrue("gl.isShader(shader)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteShader(shader)");
+shouldBeFalse("gl.isShader(shader)");
+debug("");
+
+successfullyParsed = true;
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
--- a/content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
+++ b/content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
@@ -39,18 +39,16 @@ void main()
 <script>
 var successfullyParsed = false;
 
 // The below declarations need to be global for "shouldBe" to see them
 var gl = null;
 var array = null;
 var pixel = [ 0, 0, 0, 0 ];
 var expectedColor = [ 0, 0, 0, 0 ];
-var pixelFormat = 0;
-var pixelType = 0;
 
 function calculatePixelBytes(format, type)
 {
     var size = 0;
     switch (format) {
     case gl.ALPHA:
         size = 1;
         break;
@@ -163,123 +161,80 @@ function runTestIteration(format, type, 
     debug("Testing PACK_ALIGNMENT = " + packAlignment + ", width = " + width + ", height = " + height);
     gl.clearColor(1, 0.4, 0, 1);
     gl.clear(gl.COLOR_BUFFER_BIT);
     gl.pixelStorei(gl.PACK_ALIGNMENT, packAlignment);
     glErrorShouldBe(gl, gl.NO_ERROR);
     var bytesPerPixel = calculatePixelBytes(format, type);
     var padding = calculatePaddingBytes(bytesPerPixel, packAlignment, width);
     var size = bytesPerPixel * width * height + padding * (height - 1);
-    var isShort = false;
-    switch (type) {
-    case gl.UNSIGNED_SHORT_5_6_5:
-    case gl.UNSIGNED_SHORT_4_4_4_4:
-    case gl.UNSIGNED_SHORT_5_5_5_1:
-        isShort = true;
+    if (type != gl.UNSIGNED_BYTE) {
+        throw "test error: only UNSIGNED_BYTE is valid to ReadPixels";
     }
-    if (isShort)
-        size /= 2;
     if (size < 0)
         size = 0;
-    if (type == gl.UNSIGNED_BYTE)
-        array = new Uint8Array(size);
-    else
-        array = new Uint16Array(size);
+    array = new Uint8Array(size);
     gl.readPixels(0, 0, width, height, format, type, array);
     if (width < 0 || height < 0) {
         glErrorShouldBe(gl, gl.INVALID_VALUE);
         return;
-    } else {
-        glErrorShouldBe(gl, gl.NO_ERROR);
-        if (!array.length)
-            return;
     }
+
+    glErrorShouldBe(gl, gl.NO_ERROR);
+    if (!array.length)
+        return;
+
     // Check the last pixel of the last row.
     var bytesPerRow = width * bytesPerPixel + padding;
     var pos = bytesPerRow * (height - 1) + (width - 1) * bytesPerPixel;
     var numComponents = bytesPerPixel;
-    if (isShort) {
-        pos /= 2;
-        numComponents /= 2;
-    }
     for (var i = 0; i < numComponents; ++i)
         pixel[i] = array[pos + i];
     for (var i = numComponents; i < 4; ++i)
         pixel[i] = 0;
     expectedColor = packColor(format, type, 255, 102, 0, 255);
     shouldBeNonNull(expectedColor);
     shouldBe("pixel", "expectedColor");
 }
 
-function checkSupportedPixelFormatAndType()
-{
-    debug("Check supported pixel format/type besides RGBA/UNSIGNED_BYTE");
-    glErrorShouldBe(gl, gl.NO_ERROR);
-    pixelFormat = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
-    pixelType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
-    glErrorShouldBe(gl, gl.NO_ERROR);
-    shouldBeFalse("pixelFormat == gl.RGBA && pixelType == gl.UNSIGNED_BYTE");
-}
-
 description('Verify readPixels() works fine with various PACK_ALIGNMENT values.');
 
 shouldBeNonNull("gl = initWebGL('example', 'vshader', 'fshader', [ 'pos', 'colorIn' ], [ 0, 0, 0, 1 ], 1)");
 gl.disable(gl.BLEND);
 
-checkSupportedPixelFormatAndType();
+var formats = [ gl.RGBA ];
+var formatNames = [ "RGBA" ];
+
+for (var i = 0; i < formats.length; ++i) {
+    var format = formats[i];
 
-debug("Testing format = RGBA and type = UNSIGNED_BYTE");
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 1, 1, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 2, 1, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 1, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 1, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 2, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 2, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 3, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 3, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 4, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 4, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 5, 1);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 5, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 5, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 6, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 7, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 8, 2);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 1, 0, 0);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 2, 0, 0);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 0, 0);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, 0, 0);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 1, -1, 1);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 2, 1, -1);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 4, 0, -1);
-runTestIteration(gl.RGBA, gl.UNSIGNED_BYTE, 8, -1, -1);
-
-debug("Testing the other supported format/type combination");
-runTestIteration(pixelFormat, pixelType, 1, 1, 2);
-runTestIteration(pixelFormat, pixelType, 2, 1, 2);
-runTestIteration(pixelFormat, pixelType, 4, 1, 2);
-runTestIteration(pixelFormat, pixelType, 8, 1, 2);
-runTestIteration(pixelFormat, pixelType, 4, 2, 2);
-runTestIteration(pixelFormat, pixelType, 8, 2, 2);
-runTestIteration(pixelFormat, pixelType, 4, 3, 2);
-runTestIteration(pixelFormat, pixelType, 8, 3, 2);
-runTestIteration(pixelFormat, pixelType, 4, 4, 2);
-runTestIteration(pixelFormat, pixelType, 8, 4, 2);
-runTestIteration(pixelFormat, pixelType, 8, 5, 1);
-runTestIteration(pixelFormat, pixelType, 4, 5, 2);
-runTestIteration(pixelFormat, pixelType, 8, 5, 2);
-runTestIteration(pixelFormat, pixelType, 8, 6, 2);
-runTestIteration(pixelFormat, pixelType, 8, 7, 2);
-runTestIteration(pixelFormat, pixelType, 8, 8, 2);
-runTestIteration(pixelFormat, pixelType, 1, 0, 0);
-runTestIteration(pixelFormat, pixelType, 2, 0, 0);
-runTestIteration(pixelFormat, pixelType, 4, 0, 0);
-runTestIteration(pixelFormat, pixelType, 8, 0, 0);
-runTestIteration(pixelFormat, pixelType, 1, -1, 1);
-runTestIteration(pixelFormat, pixelType, 2, 1, -1);
-runTestIteration(pixelFormat, pixelType, 4, 0, -1);
-runTestIteration(pixelFormat, pixelType, 8, -1, -1);
-
+    debug("Testing format = " + formatNames[i] + " and type = UNSIGNED_BYTE");
+    runTestIteration(format, gl.UNSIGNED_BYTE, 1, 1, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 2, 1, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 1, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 1, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 2, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 2, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 3, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 3, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 4, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 4, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 5, 1);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 5, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 5, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 6, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 7, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 8, 2);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 1, 0, 0);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 2, 0, 0);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 0, 0);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, 0, 0);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 1, -1, 1);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 2, 1, -1);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 4, 0, -1);
+    runTestIteration(format, gl.UNSIGNED_BYTE, 8, -1, -1);
+}
+    
 successfullyParsed = true;
 </script>
 <script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/read-pixels-test.html
+++ b/content/canvas/test/webgl/conformance/read-pixels-test.html
@@ -6,24 +6,26 @@ found in the LICENSE file.
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
     <title>WebGL ReadPixels conformance test.</title>
     <link rel="stylesheet" href="../resources/js-test-style.css"/>
     <script src="../resources/js-test-pre.js"></script>
     <script src="resources/webgl-test.js"> </script>
+    <script src="resources/webgl-test-utils.js"> </script>
 </head>
 <body>
 <canvas id="example" width="200" height="200"></canvas>
 <div id="description"></div>
 <div id="console"></div>
 <script>
 description("Checks that ReadPixels works as expected.");
 
+var wtu = WebGLTestUtils;
 var canvas = document.getElementById("example");
 var gl = create3DContext(canvas);
 
 if (window.initNonKhronosFramework) {
    window.initNonKhronosFramework(false);
 }
 
 var width = 2;
@@ -85,16 +87,66 @@ function checkBuffer(checkColor, x, y, o
         assertMsg(diff < 3,
                   "color pixel at " + xx + ", " + yy + " should be about " +
                   expectedColor + " was " + color);
       }
     }
   }
 }
 
+var badFormats = [
+  {
+    format: gl.RGB,
+    type: gl.UNSIGNED_BYTE,
+    dest: new Uint8Array(3)
+  },
+  {
+    format: gl.RGB,
+    type: gl.UNSIGNED_SHORT_5_6_5,
+    dest: new Uint8Array(3)
+  },
+  {
+    format: gl.RGBA,
+    type: gl.UNSIGNED_SHORT_5_5_5_1,
+    dest: new Uint16Array(1)
+  },
+  {
+    format: gl.RGBA,
+    type: gl.UNSIGNED_SHORT_4_4_4_4,
+    dest: new Uint16Array(1)
+  },
+  {
+    format: gl.ALPHA,
+    type: gl.UNSIGNED_BYTE,
+    dest: new Uint8Array(1)
+  },
+  {
+    format: gl.LUMINANCE,
+    type: gl.UNSIGNED_BYTE,
+    dest: new Uint8Array(1) },
+  {
+    format: gl.LUMINANCE_ALPHA,
+    type: gl.UNSIGNED_BYTE,
+    dest: new Uint8Array(2)
+  }
+];
+for (var tt = 0; tt < badFormats.length; ++ tt) {
+  var info = badFormats[tt]
+  var format = info.format;
+  var type = info.type;
+  var dest = info.dest;
+  gl.readPixels(0, 0, 1, 1, format, type, dest);
+  // note that the GL error is INVALID_OPERATION if both format and type are invalid, but
+  // INVALID_ENUM if only one is.
+  glErrorShouldBe(
+      gl, (format == gl.RGBA || type == gl.UNSIGNED_BYTE) ? gl.INVALID_ENUM : gl.INVALID_OPERATION,
+      "Should not be able to read as " + wtu.glEnumToString(gl, format) +
+      " / " + wtu.glEnumToString(gl, type));
+}
+
 debug("");
 successfullyParsed = true;
 </script>
 </body>
 <script src="../resources/js-test-post.js"></script>
 
 <script>
 </script>
--- a/content/canvas/test/webgl/conformance/renderbuffer-initialization.html
+++ b/content/canvas/test/webgl/conformance/renderbuffer-initialization.html
@@ -7,17 +7,17 @@ found in the LICENSE file.
 <head>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script>
 function runTest()
 {
     var canvas = document.getElementById("testbed");
-    var gl = canvas.getContext("experimental-webgl");
+    var gl = create3DContext(canvas);
     if (!gl) {
         testFailed('canvas.getContext() failed');
         return false;
     }
 
     debug('Test whether the WebGL internal buffers have been initialized to 0.');
     var buf = new Uint8Array(500 * 500 * 4);
     gl.readPixels(0, 0, 500, 500, gl.RGBA, gl.UNSIGNED_BYTE, buf);
--- a/content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-array-buffer-view.html
+++ b/content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-array-buffer-view.html
@@ -4,56 +4,28 @@ Use of this source code is governed by a
 found in the LICENSE file.
  -->
 <html>
 <head>
 <link rel="stylesheet" href="../resources/js-test-style.css"/>
 <script src="../resources/js-test-pre.js"></script>
 <script src="resources/webgl-test.js"></script>
 <script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="1px" height="2px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
 <script>
+description('Verifies texImage2D and texSubImage2D code paths taking ArrayBufferView');
+
 var wtu = WebGLTestUtils;
 var gl = null;
 var textureLoc = null;
 var successfullyParsed = false;
-var imageData = null;
-
-function init()
-{
-    if (window.initNonKhronosFramework) {
-        window.initNonKhronosFramework(true);
-    }
-
-    description('Verifies texImage2D and texSubImage2D code paths taking ArrayBufferView');
-
-    var canvas2d = document.getElementById("texcanvas");
-    var context2d = canvas2d.getContext("2d");
-    imageData = context2d.createImageData(1, 2);
-    var data = imageData.data;
-    data[0] = 255;
-    data[1] = 0;
-    data[2] = 0;
-    data[3] = 255;
-    data[4] = 0;
-    data[5] = 255;
-    data[6] = 0;
-    data[7] = 0;
-
-    var canvas = document.getElementById("example");
-    gl = wtu.create3DContext(canvas);
-    var program = wtu.setupTexturedQuad(gl);
-    gl.disable(gl.BLEND);
-
-    gl.clearColor(0,0,0,1);
-    gl.clearDepth(1);
-
-    textureLoc = gl.getUniformLocation(program, "tex");
-
-    runTest();
-}
 
 // These two declarations need to be global for "shouldBe" to see them
 var buf = null;
 var idx = 0;
 var pixel = [0, 0, 0, 1];
 var correctColor = null;
 
 function generateRGBAData(type, unpackAlignment)
@@ -194,29 +166,26 @@ function runTest()
                             green, red);
             runOneIteration(true, type, unpackAlignment, true, true,
                             redPremultiplyAlpha, greenPremultiplyAlpha);
             runOneIteration(true, type, unpackAlignment, false, true,
                             greenPremultiplyAlpha, redPremultiplyAlpha);
         }
     }
 
-    successfullyParsed = true;
-    var epilogue = document.createElement("script");
-    epilogue.onload = finish;
-    epilogue.src = "../resources/js-test-post.js";
-    document.body.appendChild(epilogue);
 }
 
-function finish() {
-    if (window.nonKhronosFrameworkNotifyDone) {
-        window.nonKhronosFrameworkNotifyDone();
-    }
-}
+var canvas = document.getElementById("example");
+gl = wtu.create3DContext(canvas);
+var program = wtu.setupTexturedQuad(gl);
+gl.disable(gl.BLEND);
+
+gl.clearColor(0,0,0,1);
+gl.clearDepth(1);
+
+textureLoc = gl.getUniformLocation(program, "tex");
+
+runTest();
+successfullyParsed = true;
 </script>
-</head>
-<body onload="init()">
-<canvas id="texcanvas" width="1px" height="2px"></canvas>
-<canvas id="example" width="1px" height="2px"></canvas>
-<div id="description"></div>
-<div id="console"></div>
+<script src="../resources/js-test-post.js"></script>
 </body>
 </html>
--- a/content/canvas/test/webgl/conformance/tex-image-with-invalid-data.html
+++ b/content/canvas/test/webgl/conformance/tex-image-with-invalid-data.html
@@ -1,88 +1,103 @@
 <!doctype html>
 <html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>texImage2D and texSubImage2D tests with invalid data</title>
   <link rel="stylesheet" href="../resources/js-test-style.css"/>
   <script src="../resources/js-test-pre.js"></script>
   <script src="resources/webgl-test.js"></script>
-  <script src="resources/testrunner.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 <canvas id="canvas" width="2" height="2"> </canvas>
-<script><!--
+<script type="text/javascript">
 description("texImage2D and texSubImage2D tests with invalid data");
 
 var canvas = document.getElementById("canvas");
 var gl = create3DContext(canvas);
 if (!gl)
   testFailed("Context created.");
 else
   testPassed("Context created.");
 
+var tex;
 
-/* object containing all tests in this testsuite */
-var bug32619_tests = {
-  setup: function () {
-    bug32619_tests.tex = gl.createTexture();
+function setup() {
+    tex = gl.createTexture();
     gl.bindTexture(gl.TEXTURE_2D, bug32619_tests.tex);
     gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
-  },
-  teardown: function () {
-    gl.deleteTexture(bug32619_tests.tex);
-  },
+}
+
+function teardown() {
+    gl.deleteTexture(tex);
+}
+
+function test(desc, func, expected) {
+    debug(desc);
 
-  "Passing a buffer not large enough to texImage2D should generate an INVALID_OPERATION" : function () {
-    this.setup = function () {
-      var tooSmall = new Uint8Array(64);
-      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
-    };
-    this.expects = gl.INVALID_OPERATION;
-  },
-  "Passing texImage2D parameter data of Number type should throw a TypeError" : function () {
-    this.setup = function () {
-      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42);
-    };
-    this.expects = "TypeError";
-  },
-  "Passing texImage2D parameter data of String type should throw a TypeError" : function () {
-    this.setup = function () {
-      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
-    };
-    this.expects = "TypeError";
-  },
-  "Passing a buffer not large enough to texSubImage2D should generate an INVALID_OPERATION" : function () {
-    this.setup = function () {
-      var tooSmall = new Uint8Array(64);
-      gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
-    };
-    this.expects = gl.INVALID_OPERATION;
-  },
-  "Passing texSubImage2D parameter data of Number type should throw a TypeError" : function () {
-    this.setup = function () {
-      gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42);
-    };
-    this.expects = "TypeError";
-  },
-  "Passing texSubImage2D parameter data of String type should throw a TypeError" : function () {
-    this.setup = function () {
-      gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
-    };
-    this.expects = "TypeError";
-  },
+    var exc = null;
+    try {
+	func();
+    } catch (x) {
+	exc = x;
+    }
+
+    if (expected == gl.INVALID_OPERATION) {
+	glErrorShouldBe(gl, expected);
+    } else if (expected == "exception") {
+        if (exc) {
+	    testPassed("threw exception");
+	} else {
+	    testFailed("did not throw exception");
+	}
+    }
 }
 
-runTestsuite(bug32619_tests);
+test("Passing a buffer not large enough to texImage2D should generate an INVALID_OPERATION",
+     function () {
+	 var tooSmall = new Uint8Array(64);
+	 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
+     },
+     gl.INVALID_OPERATION);
+
+test("Passing texImage2D parameter data of Number type should throw an exception",
+     function () {
+      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+     },
+     "exception");
+
+test("Passing texImage2D parameter data of String type should throw a TypeError",
+     function () {
+      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+     },
+     "exception");
+test("Passing a buffer not large enough to texSubImage2D should generate an INVALID_OPERATION",
+     function () {
+	 var tooSmall = new Uint8Array(64);
+	 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
+     },
+     gl.INVALID_OPERATION);
+
+test("Passing texSubImage2D parameter data of Number type should throw a TypeError",
+     function () {
+	 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+     },
+     "exception");
+
+test("Passing texSubImage2D parameter data of String type should throw a TypeError",
+     function () {
+      gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+     },
+     "exception");
 
 debug("");
 successfullyParsed = true;
---></script>
+</script>
 <script src="../resources/js-test-post.js"></script>
 <script>
 </script>
 
 </body>
 </html>
 
--- a/content/canvas/test/webgl/conformance/texture-transparent-pixels-initialized.html
+++ b/content/canvas/test/webgl/conformance/texture-transparent-pixels-initialized.html
@@ -46,17 +46,17 @@ function init()
     }
 
     description('Tests there is no garbage in transparent regions of images uploaded as textures');
 
     wtu = WebGLTestUtils;
     var canvas = document.getElementById("example");
     gl = wtu.create3DContext(canvas);
     var program = wtu.setupTexturedQuad(gl);
-    gl.clearColor(0,0,0,1);
+    gl.clearColor(0.5,0.5,0.5,1);
     gl.clearDepth(1);
 
     textureLoc = gl.getUniformLocation(program, "tex");
 
     // The input texture has 8 characters; take the leftmost one
     var coeff = 1.0 / 8.0;
     var texCoords = new Float32Array([
         coeff, 1.0,
@@ -65,38 +65,40 @@ function init()
         coeff, 1.0,
         0.0, 0.0,
         coeff, 0.0]);
 
     var vbo = gl.createBuffer();
     gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
     gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW);
     gl.enableVertexAttribArray(1);
-    gl.vertexAttribPointer(1, 2, gl.FLOAT, gl.FALSE, 0, 0);
+    gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
 
     texture = wtu.loadTexture(gl, "resources/bug-32888-texture.png", runTest);
 }
 
 // These two declarations need to be global for "shouldBe" to see them
 var buf = null;
 var idx = 0;
 
 function runTest()
 {
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+    gl.enable(gl.BLEND);
+    gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
     // Bind the texture to texture unit 0
     gl.bindTexture(gl.TEXTURE_2D, texture);
     // Point the uniform sampler to texture unit 0
     gl.uniform1i(textureLoc, 0);
     // Draw the triangles
-    wtu.drawQuad(gl, [100, 100, 100, 255]);
+    wtu.drawQuad(gl, [0, 0, 0, 255]);
 
     // Spot check a couple of 2x2 regions in the upper and lower left
     // corners; they should be the rgb values in the texture.
-    color = [255, 255, 255]
+    color = [0, 0, 0];
     debug("Checking lower left corner");
     wtu.checkCanvasRect(gl, 1, gl.canvas.height - 3, 2, 2, color,
                         "shouldBe " + color);
     debug("Checking upper left corner");
     wtu.checkCanvasRect(gl, 1, 1, 2, 2, color,
                         "shouldBe " + color);
 
     successfullyParsed = true;
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/type-conversion-test.html
@@ -0,0 +1,168 @@
+<!--
+Copyright (C) 2009 Apple Computer, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html>
+<head>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+var wtu = WebGLTestUtils;
+description("Tests calling WebGL APIs with various types");
+
+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");
+
+var loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
+assertMsg(loc != null, "getUniformLocation succeeded");
+
+var buffer = context.createBuffer();
+context.bindBuffer(context.ARRAY_BUFFER, buffer);
+var texture = context.createTexture();
+context.bindTexture(context.TEXTURE_2D, texture);
+context.useProgram(program);
+
+var args = [
+  { type: "number", value: 0 },
+  { type: "number", value: 2 },
+  { type: "string that is NaN", value: "foo", },
+  { type: "string that is number", value: "2", },
+  { type: "null", value: null },
+  { type: "Empty Array", value: [] },
+  { type: "Object", value: {} },
+  { type: "Array of Number", value: [2] },
+  { type: "Array of String", value: ["foo"] },
+  { type: "Array of String that is number", value: ["0"] },
+  { type: "Array of String that is number", value: ["2"] },
+  { type: "TypedArray", value: new Float32Array(1) }
+];
+
+var argument;
+
+for (var i = 0; i < args.length; ++i) {
+  argument = args[i].value;
+  var func1 = shouldBeUndefined;
+  var func2 = shouldBeNonNull;
+  if (argument == 2) {
+    func2 = shouldBeNull;
+  }
+  func3 = shouldBeNull;
+  debug("");
+  debug("testing type of " + args[i].type + " : value = " + argument);
+  func1("context.bindAttribLocation(program, argument, 'foo')");
+  func1("context.blendColor(argument, argument, argument, argument)");
+  func1("context.bufferData(context.ARRAY_BUFFER, argument, context.STATIC_DRAW)");
+  func1("context.bufferData(context.ARRAY_BUFFER, new Float32Array(10), context.STATIC_DRAW)");
+  func1("context.bufferSubData(context.ARRAY_BUFFER, argument, new Float32Array(2))");
+  func1("context.clear(argument)")
+  func1("context.clearColor(argument, 0, 0, 0)");
+  func1("context.clearColor(0, argument, 0, 0)");
+  func1("context.clearColor(0, 0, argument, 0)");
+  func1("context.clearColor(0, 0, 0, argument)");
+  func1("context.clearDepth(argument)");
+  func1("context.clearStencil(argument)");
+  func1("context.copyTexImage2D(context.TEXTURE_2D, argument, context.RGBA, 0, 0, 1, 1, 0)");
+  func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, argument, 0, 1, 1, 0)");
+  func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, argument, 1, 1, 0)");
+  func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, argument, 1, 0)");
+  func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, 0, argument, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, argument, 0, 0, 0, 0, 0, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, argument, 0, 0, 0, 0, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, argument, 0, 0, 0, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, argument, 0, 0, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, argument, 0, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, argument, 0)");
+  func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, 0, argument)");
+  func1("context.depthMask(argument)");
+  func1("context.depthRange(argument, 1)");
+  func1("context.depthRange(0, argument)");
+  func1("context.drawArrays(context.POINTS, argument, 1)");
+  func1("context.drawArrays(context.POINTS, 0, argument)");
+  //func1("context.drawElements(...)");
+  func1("context.enableVertexAttribArray(argument)");
+  func1("context.disableVertexAttribArray(argument)");
+  func2("context.getActiveAttrib(program, argument)");
+  func2("context.getActiveUniform(program, argument)");
+  func3("context.getParameter(argument)");
+  func1("context.lineWidth(argument)");
+  func1("context.polygonOffset(argument, 0)");
+  func1("context.polygonOffset(0, argument)");
+  //func1("context.readPixels(...)");
+  //func1("context.renderbufferStorage(...)");
+  func1("context.sampleCoverage(argument, 0)");
+  func1("context.sampleCoverage(0, argument)");
+  func1("context.scissor(argument, 0, 10, 10)");
+  func1("context.scissor(0, argument, 10, 10)");
+  func1("context.scissor(0, 0, argument, 10)");
+  func1("context.scissor(0, 0, 10, argument)");
+  func1("context.shaderSource(shader, argument)");
+  func1("context.stencilFunc(context.NEVER, argument, 255)");
+  func1("context.stencilFunc(context.NEVER, 0, argument)");
+  //func1("context.stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)");
+  func1("context.stencilMask(argument)");
+  //func1("context.stencilMaskSeparate(context.FRONT, argument);
+  //func1("context.texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView pixels)");
+  //func1("context.texParameterf(GLenum target, GLenum pname, GLfloat param)");
+  //func1("context.texParameteri(GLenum target, GLenum pname, GLint param)");
+  //func1("context.texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,GLsizei width, GLsizei height,GLenum format, GLenum type, ArrayBufferView pixels)");
+  func1("context.uniform1i(loc, argument)");
+  func1("context.uniform2i(loc, argument, 0)");
+  func1("context.uniform2i(loc, 0, argument)");
+  func1("context.uniform3i(loc, argument, 0, 0)");
+  func1("context.uniform3i(loc, 0, argument, 0)");
+  func1("context.uniform3i(loc, 0, 0, argument)");
+  func1("context.uniform4i(loc, argument, 0, 0, 0)");
+  func1("context.uniform4i(loc, 0, argument, 0, 0)");
+  func1("context.uniform4i(loc, 0, 0, argument, 0)");
+  func1("context.uniform4i(loc, 0, 0, 0, argument)");
+  func1("context.uniform1f(loc, argument)");
+  func1("context.uniform2f(loc, argument, 0)");
+  func1("context.uniform2f(loc, 0, argument)");
+  func1("context.uniform3f(loc, argument, 0, 0)");
+  func1("context.uniform3f(loc, 0, argument, 0)");
+  func1("context.uniform3f(loc, 0, 0, argument)");
+  func1("context.uniform4f(loc, argument, 0, 0, 0)");
+  func1("context.uniform4f(loc, 0, argument, 0, 0)");
+  func1("context.uniform4f(loc, 0, 0, argument, 0)");
+  func1("context.uniform4f(loc, 0, 0, 0, argument)");
+}
+
+successfullyParsed = true;
+</script>
+
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
--- a/content/canvas/test/webgl/conformance/uninitialized-test.html
+++ b/content/canvas/test/webgl/conformance/uninitialized-test.html
@@ -1,92 +1,96 @@
 <!doctype html>
 <html>
 <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 	<title>WebGL Uninitialized GL Resources Tests</title>
 	<link rel="stylesheet" href="../resources/js-test-style.css"/>
 	<script src="../resources/js-test-pre.js"></script>
 	<script src="resources/webgl-test.js"></script>
-	<script src="resources/testrunner.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 <canvas id="canvas" width="2" height="2"> </canvas>
-<script><!--
+<script>
 description("Tests to check user code cannot access uninitialized data from GL resources.");
 
 var canvas = document.getElementById("canvas");
 var gl = create3DContext(canvas);
 if (!gl)
   testFailed("Context created.");
 else
   testPassed("Context created.");
 
 
-/* object containing all tests in this testsuite */
-var uninitializedTests = {
-	"Reading an uninitialized texture should succeed with all bytes set to 0." : function () {
-		this._width = 512;
-		this._height = 512;
-		this._bpp = 4;
-		this._expectedDataLength = this._width*this._height*this._bpp;
+debug("Reading an uninitialized texture should succeed with all bytes set to 0.");
 
-		this.setup = function () {
-			var tex = gl.createTexture();
-			gl.bindTexture(gl.TEXTURE_2D, tex);
-			gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this._width, this._height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+var width = 512;
+var height = 512;
+var bpp = 4;
+var expectedDataLength = width*height*bpp;
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
 
-			// this can be quite undeterministic so to improve odds of seeing uninitialized data write bits
-			// into tex then delete texture then re-create one with same characteristics (driver will likely reuse mem)
-			// with this trick on r59046 WebKit/OSX I get FAIL 100% of the time instead of ~15% of the time.
-			var badData = new Uint8Array(this._expectedDataLength);
-			for (var i = 0; i < badData.length; ++i) badData[i] = i % 255;
-			gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this._width, this._height, gl.RGBA, gl.UNSIGNED_BYTE, badData);
-			gl.finish(); // make sure it has been uploaded
-			gl.deleteTexture(tex);
-			gl.finish(); // make sure it has been deleted
+// this can be quite undeterministic so to improve odds of seeing uninitialized data write bits
+// into tex then delete texture then re-create one with same characteristics (driver will likely reuse mem)
+// with this trick on r59046 WebKit/OSX I get FAIL 100% of the time instead of ~15% of the time.
 
-			var tex = gl.createTexture();
-			gl.bindTexture(gl.TEXTURE_2D, tex);
-			gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this._width, this._height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+var badData = new Uint8Array(expectedDataLength);
+for (var i = 0; i < badData.length; ++i)
+    badData[i] = i % 255;
+
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, badData);
+gl.finish(); // make sure it has been uploaded
+
+gl.deleteTexture(tex);
+gl.finish(); // make sure it has been deleted
 
-			var fb = gl.createFramebuffer();
-			gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
-			gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
 
-      this.data = new Uint8Array(this._width * this._height * 4);
-			gl.readPixels(0, 0, this._width, this._height, gl.RGBA, gl.UNSIGNED_BYTE, this.data);
-		};
+var fb = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+
+data = new Uint8Array(width * height * 4);
+gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data);
 
-		this.expects = function () {
-			if (this.data.length !== this._expectedDataLength) {
-				debug("expected data length " + this._expectedDataLength + " but got " + this.data.length + " instead.");
-				return false;
-			}
-			for (var i = 0; i < this.data.length; ++i)
-				if (0 !== this.data[i]) {
-					debug("byte at offset " + i + " has value " + this.data[i]);
-					return false;
-				}
-			return true;
-		};
+if (data.length != expectedDataLength) {
+    testFailed("expected data length " + expectedDataLength + " but got " + data.length + " instead.");
+} else {
+    var k = 0;
+    for (var i = 0; i < data.length; ++i) {
+	if (data[i] != 0) {
+	    k++;
 	}
-	//TODO: uninitialized vertex array buffer
-	//TODO: uninitialized vertex elements buffer
-	//TODO: uninitialized framebuffer? (implementations would need to do a GL clear at first binding?)
-	//TODO: uninitialized renderbuffer? (implementations would need to do a GL clear at first binding?)
-	//TODO: uninitialized uniform arrays?
+    }
+
+    if (k) {
+	testFailed("Found " + k + " non-zero bytes");
+    } else {
+	testPassed("All data initialized");
+    }
 }
 
-runTestsuite(uninitializedTests);
+glErrorShouldBe(gl, gl.NO_ERROR);
+
+//TODO: uninitialized vertex array buffer
+//TODO: uninitialized vertex elements buffer
+//TODO: uninitialized framebuffer? (implementations would need to do a GL clear at first binding?)
+//TODO: uninitialized renderbuffer? (implementations would need to do a GL clear at first binding?)
+//TODO: uninitialized uniform arrays?
+
 
 debug("");
 successfullyParsed = true;
---></script>
+</script>
 <script src="../resources/js-test-post.js"></script>
 <script>
 </script>
 
 </body>
 </html>
 
new file mode 100644
--- /dev/null
+++ b/content/canvas/test/webgl/conformance/webgl-specific.html
@@ -0,0 +1,120 @@
+<!--
+Copyright (c) 2010 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.
+ -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+  "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>WebGL GLES2 difference test.</title>
+<link rel="stylesheet" href="../resources/js-test-style.css"/>
+<script src="../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+var wtu = WebGLTestUtils;
+description("Tests the a few differences between WebGL and GLES2");
+
+var gl = wtu.create3DContext();
+
+gl.blendFunc(gl.CONSTANT_COLOR, gl.CONSTANT_ALPHA);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.CONSTANT_ALPHA, gl.CONSTANT_COLOR);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.ONE_MINUS_CONSTANT_ALPHA, gl.CONSTANT_COLOR);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFunc(gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+
+gl.blendFuncSeparate(gl.CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.CONSTANT_ALPHA, gl.CONSTANT_COLOR, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_ALPHA, gl.CONSTANT_COLOR, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE, gl.ZERO);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+
+gl.depthRange(20, 10);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "depthRange should generate INVALID_OPERATION if zNear is greater than zFar");
+
+gl.stencilMask(255);
+glErrorShouldBe(gl, gl.NO_ERROR,
+    "stencilMask should generate no error");
+gl.stencilMaskSeparate(gl.FRONT, 1);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different mask value for front and back facing is illegal");
+gl.stencilMaskSeparate(gl.BACK, 1);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different mask value for front and back facing is illegal");
+
+gl.stencilFunc(gl.ALWAYS, 0, 255);
+glErrorShouldBe(gl, gl.NO_ERROR,
+    "stencilFunc should generate no error");
+gl.stencilFuncSeparate(gl.FRONT, gl.ALWAYS, 1, 255);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different reference value for front and back facing is illegal");
+gl.stencilFuncSeparate(gl.BACK, gl.ALWAYS, 1, 255);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different reference value for front and back facing is illegal");
+gl.stencilFuncSeparate(gl.FRONT, gl.ALWAYS, 0, 1);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different mask value for front and back facing is illegal");
+gl.stencilFuncSeparate(gl.BACK, gl.ALWAYS, 0, 1);
+glErrorShouldBe(gl, gl.INVALID_OPERATION,
+    "a different mask value for front and back facing is illegal");
+
+shouldBeUndefined(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
+shouldBeUndefined(gl.IMPLEMENTATION_COLOR_READ_TYPE);
+
+shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.BROWSER_DEFAULT_WEBGL");
+gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.NONE");
+glErrorShouldBe(gl, gl.NO_ERROR,
+    "set/get UNPACK_COLORSPACE_CONVERSION_WEBGL should generate no error");
+
+successfullyParsed = true;
+</script>
+
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>