Bug 1301671 - Update affected tests to top-of-tree. a=gchang
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Wed, 16 Nov 2016 18:08:06 -0800
changeset 352946 57792070436ea7a032ca062a4deb326278287aa0
parent 352945 d4aeb0562cba37ec836a6da62b43fe9dfa262c46
child 352947 eb32710bb76a77aaf7951e8d6d3c990e4c92904b
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgchang
bugs1301671
milestone52.0a2
Bug 1301671 - Update affected tests to top-of-tree. a=gchang MozReview-Commit-ID: I2xwbEKLRSw
dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html
dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html
dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js
--- a/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html
@@ -34,17 +34,17 @@
 <script src="../../js/webgl-test-utils.js"></script>
 </head>
 <body>
 <div id="description"></div>
 <div id="console"></div>
 
 <script>
 "use strict";
-description("Tests deletion behavior for texture, renderbuffer, shader, and program");
+description("Tests deletion behavior for buffer, texture, renderbuffer, shader, and program");
 
 var wtu = WebGLTestUtils;
 var gl = wtu.create3DContext();
 var shouldGenerateGLError = wtu.shouldGenerateGLError;
 var contextVersion = wtu.getDefault3DContextVersion();
 
 debug("");
 debug("shader and program deletion");
@@ -98,35 +98,35 @@ shouldGenerateGLError(gl, gl.NO_ERROR, "
 shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
 if (contextVersion > 1) {
   shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 } else {
   shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 }
 shouldBeFalse("gl.isTexture(tex)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_2D, tex)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
 
 var texCubeMap = gl.createTexture();
 shouldBeNonNull("texCubeMap");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
 shouldBe("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)", "texCubeMap");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(texCubeMap)");
 shouldBeFalse("gl.isTexture(texCubeMap)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
 shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)");
 
 var t = gl.createTexture();
 shouldBeNonNull("t");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(t)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_2D, t)");
 shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)");
 
 var t2 = gl.createTexture();
 shouldBeNonNull("t2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.activeTexture(gl.TEXTURE0)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t2)");
 shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "t2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.activeTexture(gl.TEXTURE1)");
@@ -154,17 +154,17 @@ shouldGenerateGLError(gl, gl.NO_ERROR, "
 shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
 if (contextVersion > 1) {
   shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 } else {
   shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
 }
 shouldBeFalse("gl.isRenderbuffer(rbo)");
 shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
 shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo2)");
 shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo3)");
 shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo2");
 
 debug("");
 debug("using deleted renderbuffer");
@@ -347,46 +347,46 @@ debug("buffer deletion");
 
 var buffer = gl.createBuffer();
 shouldBeNonNull("buffer");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
 shouldBe("gl.getParameter(gl.ARRAY_BUFFER_BINDING)", "buffer");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(buffer)");
 shouldBeFalse("gl.isBuffer(buffer)");
 shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
 shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
 
 var buffer2 = gl.createBuffer();
 shouldBeNonNull("buffer2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)");
 shouldBe("gl.getParameter(gl.ARRAY_BUFFER_BINDING)", "buffer2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, null)");
 shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(buffer2)");
 shouldBeFalse("gl.isBuffer(buffer2)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)");
 shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
 
 var bufferElement = gl.createBuffer();
 shouldBeNonNull("bufferElement");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferElement)");
 shouldBe("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)", "bufferElement");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(bufferElement)");
 shouldBeFalse("gl.isBuffer(bufferElement)");
 shouldBeNull("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferElement)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferElement)");
 shouldBeNull("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)");
 
 var b = gl.createBuffer();
 shouldBeNonNull("b");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(b)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, b)");
 shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW)");
 
 var b1 = gl.createBuffer();
 shouldBeNonNull("b1");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b1);");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.enableVertexAttribArray(1);");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);");
 var b2 = gl.createBuffer();
@@ -409,17 +409,17 @@ shouldBeNull("gl.getVertexAttrib(1, gl.V
 debug("");
 debug("framebuffer deletion");
 
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
 shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fbo)");
 shouldBeFalse("gl.isFramebuffer(fbo)");
 shouldBeNull("gl.getParameter(gl.FRAMEBUFFER_BINDING)");
-shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
 shouldBeNull("gl.getParameter(gl.FRAMEBUFFER_BINDING)");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
 shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo2");
 shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fbo3)");
 shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo2");
 
 fbo = gl.createFramebuffer();
 rbo = gl.createRenderbuffer();
--- a/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html
+++ b/dom/canvas/test/webgl-conf/checkout/conformance2/buffers/uniform-buffers.html
@@ -165,18 +165,18 @@ function runBindingTest() {
 
     debug("Testing deleting uniform buffers");
     gl.deleteBuffer(b1);
     gl.deleteBuffer(b2);
     shouldBeNull("gl.getParameter(gl.UNIFORM_BUFFER_BINDING)");
 
     // Shouldn't be able to bind a deleted buffer.
     gl.bindBuffer(gl.UNIFORM_BUFFER, b2);
+    wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "binding a deleted buffer should generate INVALID_OPERATION");
     shouldBeNull("gl.getParameter(gl.UNIFORM_BUFFER_BINDING)");
-    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
 }
 
 function runDrawTest() {
     debug("");
     debug("Testing drawing with uniform buffers");
 
     wtu.setupUnitQuad(gl);
 
@@ -188,58 +188,78 @@ function runDrawTest() {
     }
 
     var program = wtu.setupProgram(gl, ['vshader', 'fshader']);
     if (!program) {
         testFailed("Could not compile shader with uniform blocks without error");
         return;
     }
 
-    var blockIndex = gl.getUniformBlockIndex(program, "UBOData");
-    var blockSize = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE);
-    var uniformIndices = gl.getUniformIndices(program, ["UBORed", "UBOGreen", "UBOBlue"]);
-    var uniformOffsets = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_OFFSET);
+    var blockIndex_1 = gl.getUniformBlockIndex(program, "UBOData");
+    var blockSize_1 = gl.getActiveUniformBlockParameter(program, blockIndex_1, gl.UNIFORM_BLOCK_DATA_SIZE);
+    var uniformIndices_1 = gl.getUniformIndices(program, ["UBORed", "UBOGreen", "UBOBlue"]);
+    var uniformOffsets_1 = gl.getActiveUniforms(program, uniformIndices_1, gl.UNIFORM_OFFSET);
+    var blockIndex_2 = gl.getUniformBlockIndex(program, "UBOD");
+    var blockSize_2 = gl.getActiveUniformBlockParameter(program, blockIndex_2, gl.UNIFORM_BLOCK_DATA_SIZE);
+    var uniformIndices_2 = gl.getUniformIndices(program, ["UBOR", "UBOG", "UBOB"]);
+    var uniformOffsets_2 = gl.getActiveUniforms(program, uniformIndices_2, gl.UNIFORM_OFFSET);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to query uniform block information without error");
 
-    if (uniformOffsets.length < 3) {
+    if (uniformOffsets_1.length < 3 || uniformOffsets_2.length < 3) {
         testFailed("Could not query uniform offsets");
         return;
     }
 
     // Verify that the uniform offsets are aligned on 4-byte boundries
     // While unaligned values are allowed by the ES3 spec it would be *really* weird for anyone to actually do that.
-    if (uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT) ||
-        uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT) ||
-        uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT)) {
+    if (uniformOffsets_1[0] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_1[0] / Float32Array.BYTES_PER_ELEMENT) ||
+        uniformOffsets_1[1] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_1[1] / Float32Array.BYTES_PER_ELEMENT) ||
+        uniformOffsets_1[2] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_1[2] / Float32Array.BYTES_PER_ELEMENT) ||
+        uniformOffsets_2[0] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_2[0] / Float32Array.BYTES_PER_ELEMENT) ||
+        uniformOffsets_2[1] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_2[1] / Float32Array.BYTES_PER_ELEMENT) ||
+        uniformOffsets_2[2] / Float32Array.BYTES_PER_ELEMENT != Math.floor(uniformOffsets_2[2] / Float32Array.BYTES_PER_ELEMENT)) {
         testFailed("Uniform offsets are not well aligned");
         return;
     }
 
-    var uboArray = new ArrayBuffer(blockSize);
-    var uboFloatView = new Float32Array(uboArray);
-    uboFloatView[uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBORed
-    uboFloatView[uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOGreen
-    uboFloatView[uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOBlue
+    var uboArray_1 = new ArrayBuffer(blockSize_1);
+    var uboFloatView_1 = new Float32Array(uboArray_1);
+    uboFloatView_1[uniformOffsets_1[0] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBORed
+    uboFloatView_1[uniformOffsets_1[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOGreen
+    uboFloatView_1[uniformOffsets_1[2] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOBlue
+    var uboArray_2 = new ArrayBuffer(blockSize_2);
+    var uboFloatView_2 = new Float32Array(uboArray_2);
+    uboFloatView_2[uniformOffsets_2[0] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBOR
+    uboFloatView_2[uniformOffsets_2[1] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBOG
+    uboFloatView_2[uniformOffsets_2[2] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBOB
 
-    b1 = gl.createBuffer();
-    gl.bindBuffer(gl.UNIFORM_BUFFER, b1);
-    gl.bufferData(gl.UNIFORM_BUFFER, uboArray, gl.DYNAMIC_DRAW);
+    var b_1 = gl.createBuffer();
+    gl.bindBuffer(gl.UNIFORM_BUFFER, b_1);
+    gl.bufferData(gl.UNIFORM_BUFFER, uboFloatView_1, gl.DYNAMIC_DRAW);
+    var b_2 = gl.createBuffer();
+    gl.bindBuffer(gl.UNIFORM_BUFFER, b_2);
+    gl.bufferData(gl.UNIFORM_BUFFER, uboFloatView_2, gl.DYNAMIC_DRAW);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to set UBO data with no errors");
 
-    gl.bindBufferBase(gl.UNIFORM_BUFFER, blockIndex, b1);
+    var bindings = [1, 2];
+    gl.uniformBlockBinding(program, blockIndex_1, bindings[0]);
+    gl.bindBufferBase(gl.UNIFORM_BUFFER, bindings[0], b_1);
+    gl.uniformBlockBinding(program, blockIndex_2, bindings[1]);
+    gl.bindBufferBase(gl.UNIFORM_BUFFER, bindings[1], b_2);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferBase without errors");
 
     wtu.clearAndDrawUnitQuad(gl);
     wtu.checkCanvas(gl, [255, 0, 0, 255], "draw call should set canvas to red", 2);
 
     debug("Changing the data in the uniform buffer should automatically update the uniforms exposed to the draw call");
-    uboFloatView[uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBORed
-    uboFloatView[uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOGreen
-    uboFloatView[uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBOBlue
-    gl.bufferData(gl.UNIFORM_BUFFER, uboArray, gl.DYNAMIC_DRAW);
+    uboFloatView_1[uniformOffsets_1[0] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBORed
+    uboFloatView_1[uniformOffsets_1[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // UBOGreen
+    uboFloatView_1[uniformOffsets_1[2] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // UBOBlue
+    gl.bindBuffer(gl.UNIFORM_BUFFER, b_1);
+    gl.bufferData(gl.UNIFORM_BUFFER, uboFloatView_1, gl.DYNAMIC_DRAW);
 
     wtu.clearAndDrawUnitQuad(gl);
     wtu.checkCanvas(gl, [0, 0, 255, 255], "draw call should set canvas to blue", 2);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
 }
 
 function runNamedDrawTest() {
     debug("");
@@ -278,17 +298,19 @@ function runNamedDrawTest() {
     uboFloatView[uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // Green
     uboFloatView[uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // Blue
 
     b1 = gl.createBuffer();
     gl.bindBuffer(gl.UNIFORM_BUFFER, b1);
     gl.bufferData(gl.UNIFORM_BUFFER, uboArray, gl.DYNAMIC_DRAW);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to set UBO data with no errors");
 
-    gl.bindBufferBase(gl.UNIFORM_BUFFER, blockIndex, b1);
+    var binding = 3;
+    gl.uniformBlockBinding(program, blockIndex, binding);
+    gl.bindBufferBase(gl.UNIFORM_BUFFER, binding, b1);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferBase without errors");
 
     wtu.clearAndDrawUnitQuad(gl);
     wtu.checkCanvas(gl, [255, 0, 0, 255], "draw call should set canvas to red", 2);
 
     debug("Changing the data in the uniform buffer should automatically update the uniforms exposed to the draw call");
     uboFloatView[uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // Red
     uboFloatView[uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // Green
@@ -364,23 +386,23 @@ function runNamedArrayDrawTest() {
     uboFloatView[offset / Float32Array.BYTES_PER_ELEMENT +
                  uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // Blue
 
     b1 = gl.createBuffer();
     gl.bindBuffer(gl.UNIFORM_BUFFER, b1);
     gl.bufferData(gl.UNIFORM_BUFFER, uboArray, gl.DYNAMIC_DRAW);
     wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to set UBO data with no errors");
 
-    var binding = [2, 3];
-    gl.uniformBlockBinding(program, blockIndex[0], binding[0]);
-    gl.bindBufferRange(gl.UNIFORM_BUFFER, binding[0], b1, 0, blockSize[0]);
-    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferBase without errors");
-    gl.uniformBlockBinding(program, blockIndex[1], binding[1]);
-    gl.bindBufferRange(gl.UNIFORM_BUFFER, binding[1], b1, offset, blockSize[1]);
-    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferBase without errors");
+    var bindings = [4, 5];
+    gl.uniformBlockBinding(program, blockIndex[0], bindings[0]);
+    gl.bindBufferRange(gl.UNIFORM_BUFFER, bindings[0], b1, 0, blockSize[0]);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferRange without errors");
+    gl.uniformBlockBinding(program, blockIndex[1], bindings[1]);
+    gl.bindBufferRange(gl.UNIFORM_BUFFER, bindings[1], b1, offset, blockSize[1]);
+    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call bindBufferRange without errors");
 
     wtu.clearAndDrawUnitQuad(gl);
     wtu.checkCanvas(gl, [127, 0, 127, 255], "draw call should set canvas to (0.5, 0, 0.5)", 2);
 
     debug("Changing the data in the uniform buffer should automatically update the uniforms exposed to the draw call");
     uboFloatView[uniformOffsets[0] / Float32Array.BYTES_PER_ELEMENT] = 0.0; // Red
     uboFloatView[uniformOffsets[1] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // Green
     uboFloatView[uniformOffsets[2] / Float32Array.BYTES_PER_ELEMENT] = 1.0; // Blue
--- a/dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js
+++ b/dom/canvas/test/webgl-conf/checkout/js/tests/gl-object-get-calls.js
@@ -310,18 +310,18 @@ var standardFrag = wtu.loadStandardFragm
 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');
 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
-shouldBeNull('gl.getAttachedShaders(null)');
-wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+shouldThrow('gl.getAttachedShaders(null)');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
 shouldThrow('gl.getAttachedShaders(standardVert)');
 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
 
 debug("");
 debug("Test getProgramParameter");
 shouldBe('gl.getProgramParameter(standardProgram, gl.DELETE_STATUS)', 'false');
 shouldBe('gl.getProgramParameter(standardProgram, gl.LINK_STATUS)', 'true');
 shouldBe('typeof gl.getProgramParameter(standardProgram, gl.VALIDATE_STATUS)', '"boolean"');
@@ -724,27 +724,27 @@ testInvalidArgument(
 var numVertexAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
 wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, 'gl.getVertexAttrib(' + numVertexAttribs + ', gl.CURRENT_VERTEX_ATTRIB)');
 
 debug("");
 debug("Test cases where name == 0");
 gl.deleteTexture(texture);
 shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteRenderbuffer(renderbuffer);
+gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
 shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
 gl.deleteBuffer(buffer);
 shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
 
 if (contextVersion > 1) {
     debug("");
     debug("Test getInternalformatParameter")
 
-    gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
-    wtu.glErrorShouldBe(gl, gl.NO_ERROR);
     shouldBeNonNull('gl.getInternalformatParameter(gl.RENDERBUFFER, gl.R32I, gl.SAMPLES)');
     wtu.glErrorShouldBe(gl, gl.NO_ERROR);
 
     testInvalidArgument(
         "getInternalformatParameter",
         "target",
         [ gl.RENDERBUFFER ],
         function(target) {
@@ -854,17 +854,17 @@ if (contextVersion > 1) {
         gl.TEXTURE_WRAP_S,
         gl.TEXTURE_WRAP_T
     );
     testInvalidArgument(
         "getSamplerParameter",
         "pname",
         validArrayForSamplerParameter,
         function(pname) {
-	    return gl.getSamplerParameter(sampler, pname);
+            return gl.getSamplerParameter(sampler, pname);
     });
 
     debug("");
     debug("Test getSyncParameter");
     var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
     shouldBe('gl.getSyncParameter(sync, gl.OBJECT_TYPE)', 'gl.SYNC_FENCE');
     var sync_status = gl.getSyncParameter(sync, gl.SYNC_STATUS);
     switch (sync_status) {
@@ -899,26 +899,26 @@ if (contextVersion > 1) {
     debug("Test getQueryParameter");
     var query = gl.createQuery();
     gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, query);
     gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
     shouldBe('gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE)', 'false');
     // Queries' results are tested elsewhere in the conformance suite. It's complicated
     // to wait for this query's result to become available and verify it.
     var validArrayForPname = new Array(
-	gl.QUERY_RESULT,
-	gl.QUERY_RESULT_AVAILABLE
+        gl.QUERY_RESULT,
+        gl.QUERY_RESULT_AVAILABLE
     );
     testInvalidArgument(
-	"getQueryParameter",
-	"pname",
-	validArrayForPname,
-	function(pname) {
-	    return gl.getQueryParameter(query, pname);
-	}
+        "getQueryParameter",
+        "pname",
+        validArrayForPname,
+        function(pname) {
+            return gl.getQueryParameter(query, pname);
+        }
     );
 
     debug("");
     debug("Test getFragDataLocation");
     var baseVertShader = '' +
     '#version 300 es\n' +
     'uniform mat4 modelViewMatrix;\n' +
     'uniform mat4 projectionMatrix;\n' +
@@ -998,21 +998,21 @@ if (contextVersion > 1) {
         gl.UNIFORM_SIZE,
         gl.UNIFORM_BLOCK_INDEX,
         gl.UNIFORM_OFFSET,
         gl.UNIFORM_ARRAY_STRIDE,
         gl.UNIFORM_MATRIX_STRIDE,
         gl.UNIFORM_IS_ROW_MAJOR
     );
     testInvalidArgument(
-	"getActiveUniforms",
-	"pname",
-	validArrayForPname,
-	function(pname) {
-	    return gl.getActiveUniforms(program, uniformIndices, pname);
+        "getActiveUniforms",
+        "pname",
+        validArrayForPname,
+        function(pname) {
+            return gl.getActiveUniforms(program, uniformIndices, pname);
         }
     );
 
     debug("");
     debug("Test getUniformBlockIndex");
     var program = wtu.loadUniformBlockProgram(gl);
     gl.linkProgram(program);
     shouldBeTrue('gl.getProgramParameter(program, gl.LINK_STATUS)');
@@ -1065,28 +1065,28 @@ if (contextVersion > 1) {
     shouldBeTrue('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER)');
     shouldBeFalse('gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER)');
     var indices = gl.getActiveUniformBlockParameter(program, 0, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES);
     for (var i = 0; i < 3; i++) {
       if (indices[i] < 0)
         testFailed("expected value >= 0" + " actual value for UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES for uniform index[" + i + "]:" + indices[i]);
     }
     var validArrayForPname = new Array(
-	gl.UNIFORM_BLOCK_BINDING,
-	gl.UNIFORM_BLOCK_DATA_SIZE,
-	gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS,
-	gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
-	gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER,
-	gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
+        gl.UNIFORM_BLOCK_BINDING,
+        gl.UNIFORM_BLOCK_DATA_SIZE,
+        gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS,
+        gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
+        gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER,
+        gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
     );
     testInvalidArgument(
-	"getActiveUniformBlockParameter",
-	"pname",
-	validArrayForPname,
-	function(pname) {
-	    return gl.getActiveUniformBlockParameter(program, 0, pname);
-	}
+        "getActiveUniformBlockParameter",
+        "pname",
+        validArrayForPname,
+        function(pname) {
+            return gl.getActiveUniformBlockParameter(program, 0, pname);
+        }
     );
 }
 
 wtu.glErrorShouldBe(gl, gl.NO_ERROR);
 
 var successfullyParsed = true;