Bug 1313541 - Fix test since TexSubImage is no longer nullable. draft
authorJeff Gilbert (:jgilbert) <jgilbert@mozilla.com>
Fri, 21 Oct 2016 17:26:22 -0700
changeset 431871 fdbcbc92c7e5fdf8256b853a328502c9ef6c1124
parent 431870 70324a90633dc5afdcf7f373b2a9f77743508e93
child 431872 456ce2ae8b85a88c6972000caed6cda5ed387419
push id34137
push userbmo:jgilbert@mozilla.com
push dateMon, 31 Oct 2016 21:58:43 +0000
bugs1313541
milestone52.0a1
Bug 1313541 - Fix test since TexSubImage is no longer nullable. 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");