Bug 1313541 - Fix test since TexSubImage is no longer nullable. a=gchang
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Fri, 21 Oct 2016 17:26:22 -0700
changeset 439991 cb27254fc424a10e4b11d7499796c54b6d7ae940
parent 439990 8b56b957a05ba8fdfadd693ba19b641c8479c283
child 439992 ee066afe41e5b37080c65be60e9c7a6f9d87dde9
push id36143
push userjkingston@mozilla.com
push dateWed, 16 Nov 2016 22:20:38 +0000
reviewersgchang
bugs1313541
milestone51.0a2
Bug 1313541 - Fix test since TexSubImage is no longer nullable. a=gchang MozReview-Commit-ID: BVBsXkVTDCA
dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html
--- a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html
@@ -62,35 +62,24 @@ gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 0,
 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "x + width > texture width");
 gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative x");
 gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, c);
 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative y");
 gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative level");
 
-if (contextVersion >= 2) {
-    var text = "Should throw with no image data.";
-    try {
-        gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
-        testFailed(text);
-    } catch(e) {
-        testPassed(text);
-    }
-    wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no image data");
-} else {
+var text = "Should throw with no image data.";
+try {
     gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
-    wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "no image data");
+    testFailed(text);
+} catch(e) {
+    testPassed(text);
 }
-
-if (contextVersion < 2) {
-    // In WebGL2, null coerces to 0 for the PBO entrypoint.
-    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
-    wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "null pixels");
-}
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no image data");
 
 // GL_INVALID_VALUE may be generated if level is greater than log 2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.
 // GL_INVALID_OPERATION is generated if the texture array has not been defined by a previous  glTexImage2D or glCopyTexImage2D operation whose internalformat matches the format of glTexSubImage2D.
 gl.texSubImage2D(gl.TEXTURE_2D, maxTextureLevel + 1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
 wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "too high level");
 
 gl.texSubImage2D(gl.FLOAT, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
 wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "bad target");