diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 1336c4d0b56..24e6a3b312f 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -53,7 +53,7 @@ FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c",
"*.yml"]
# File patterns that are ignored for all tidy and lint checks.
-FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc", "fake-ld.sh"]
+FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc", "fake-ld.sh", "*.ogv", "*.webm"]
SPEC_BASE_PATH = "components/script/dom/"
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/attribs/gl-bindAttribLocation-aliasing.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/attribs/gl-bindAttribLocation-aliasing.html
index 86fd74af8f3..62d341c60b9 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/attribs/gl-bindAttribLocation-aliasing.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/attribs/gl-bindAttribLocation-aliasing.html
@@ -1,92 +1,92 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-bindAttribLocation with aliasing
-
-
-
-
-
-
-
-
-
+
+
+bindAttribLocation with aliasing
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/buffer-data-array-buffer.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/buffer-data-array-buffer.html
index d0fcf406556..6c989addb2b 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/buffer-data-array-buffer.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/buffer-data-array-buffer.html
@@ -85,8 +85,7 @@ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
gl.bufferSubData(gl.ARRAY_BUFFER, 10, array);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
-gl.bufferSubData(gl.ARRAY_BUFFER, 10, null);
-wtu.glErrorShouldBe(gl, [gl.NO_ERROR, gl.INVALID_VALUE]);
+wtu.shouldThrowOrGenerateGLError(gl, [gl.NO_ERROR, gl.INVALID_VALUE], "gl.bufferSubData(gl.ARRAY_BUFFER, 10, null)");
var successfullyParsed = true;
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-copies-indices.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-copies-indices.html
index 55bbb970507..f5589f6e32f 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-copies-indices.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-copies-indices.html
@@ -58,13 +58,15 @@ context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
var indices = new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]);
context.bufferData(context.ELEMENT_ARRAY_BUFFER, indices, context.STATIC_DRAW);
wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+var indexValidationError = wtu.shouldGenerateGLError(context,
+ [context.INVALID_OPERATION, context.NO_ERROR],
+ "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
indices[0] = 2;
indices[5] = 1;
wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
debug("")
var successfullyParsed = true;
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-verifies-too-many-indices.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-verifies-too-many-indices.html
index 1fba7e461a7..95088070521 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-verifies-too-many-indices.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation-verifies-too-many-indices.html
@@ -60,9 +60,9 @@ var indexObject = context.createBuffer();
debug("Test out of range indices")
context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
+var indexValidationError = wtu.shouldGenerateGLError(context, [context.INVALID_OPERATION, context.NO_ERROR], "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
-wtu.shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
debug("")
var successfullyParsed = true;
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation.html
index 8ffcbc79bd2..1572381dc9b 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/buffers/index-validation.html
@@ -112,7 +112,7 @@ gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT),
gl.enableVertexAttribArray(normalLoc);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
-wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+wtu.glErrorShouldBe(gl, [gl.INVALID_OPERATION, gl.NO_ERROR]);
debug("Test with enabled attribute that does not belong to current program");
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/constants-and-properties.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/constants-and-properties.html
index df818c45ed5..e373387866e 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/constants-and-properties.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/constants-and-properties.html
@@ -48,7 +48,7 @@ var constants = {
DEPTH_BUFFER_BIT : 0x00000100,
STENCIL_BUFFER_BIT : 0x00000400,
COLOR_BUFFER_BIT : 0x00004000,
-
+
/* BeginMode */
POINTS : 0x0000,
LINES : 0x0001,
@@ -57,7 +57,7 @@ LINE_STRIP : 0x0003,
TRIANGLES : 0x0004,
TRIANGLE_STRIP : 0x0005,
TRIANGLE_FAN : 0x0006,
-
+
/* AlphaFunction (not supported in ES20) */
/* NEVER */
/* LESS */
@@ -67,7 +67,7 @@ TRIANGLE_FAN : 0x0006,
/* NOTEQUAL */
/* GEQUAL */
/* ALWAYS */
-
+
/* BlendingFactorDest */
ZERO : 0,
ONE : 1,
@@ -77,7 +77,7 @@ SRC_ALPHA : 0x0302,
ONE_MINUS_SRC_ALPHA : 0x0303,
DST_ALPHA : 0x0304,
ONE_MINUS_DST_ALPHA : 0x0305,
-
+
/* BlendingFactorSrc */
/* ZERO */
/* ONE */
@@ -88,17 +88,17 @@ SRC_ALPHA_SATURATE : 0x0308,
/* ONE_MINUS_SRC_ALPHA */
/* DST_ALPHA */
/* ONE_MINUS_DST_ALPHA */
-
+
/* BlendEquationSeparate */
FUNC_ADD : 0x8006,
BLEND_EQUATION : 0x8009,
BLEND_EQUATION_RGB : 0x8009, /* same as BLEND_EQUATION */
BLEND_EQUATION_ALPHA : 0x883D,
-
+
/* BlendSubtract */
FUNC_SUBTRACT : 0x800A,
FUNC_REVERSE_SUBTRACT : 0x800B,
-
+
/* Separate Blend Functions */
BLEND_DST_RGB : 0x80C8,
BLEND_SRC_RGB : 0x80C9,
@@ -109,27 +109,27 @@ ONE_MINUS_CONSTANT_COLOR : 0x8002,
CONSTANT_ALPHA : 0x8003,
ONE_MINUS_CONSTANT_ALPHA : 0x8004,
BLEND_COLOR : 0x8005,
-
+
/* Buffer Objects */
ARRAY_BUFFER : 0x8892,
ELEMENT_ARRAY_BUFFER : 0x8893,
ARRAY_BUFFER_BINDING : 0x8894,
ELEMENT_ARRAY_BUFFER_BINDING : 0x8895,
-
+
STREAM_DRAW : 0x88E0,
STATIC_DRAW : 0x88E4,
DYNAMIC_DRAW : 0x88E8,
-
+
BUFFER_SIZE : 0x8764,
BUFFER_USAGE : 0x8765,
-
+
CURRENT_VERTEX_ATTRIB : 0x8626,
-
+
/* CullFaceMode */
FRONT : 0x0404,
BACK : 0x0405,
FRONT_AND_BACK : 0x0408,
-
+
/* DepthFunction */
/* NEVER */
/* LESS */
@@ -139,7 +139,7 @@ FRONT_AND_BACK : 0x0408,
/* NOTEQUAL */
/* GEQUAL */
/* ALWAYS */
-
+
/* EnableCap */
/* TEXTURE_2D */
CULL_FACE : 0x0B44,
@@ -151,18 +151,18 @@ SCISSOR_TEST : 0x0C11,
POLYGON_OFFSET_FILL : 0x8037,
SAMPLE_ALPHA_TO_COVERAGE : 0x809E,
SAMPLE_COVERAGE : 0x80A0,
-
+
/* ErrorCode */
NO_ERROR : 0,
INVALID_ENUM : 0x0500,
INVALID_VALUE : 0x0501,
INVALID_OPERATION : 0x0502,
OUT_OF_MEMORY : 0x0505,
-
+
/* FrontFaceDirection */
CW : 0x0900,
CCW : 0x0901,
-
+
/* GetPName */
LINE_WIDTH : 0x0B21,
ALIASED_POINT_SIZE_RANGE : 0x846D,
@@ -212,23 +212,23 @@ SAMPLE_BUFFERS : 0x80A8,
SAMPLES : 0x80A9,
SAMPLE_COVERAGE_VALUE : 0x80AA,
SAMPLE_COVERAGE_INVERT : 0x80AB,
-
+
/* GetTextureParameter */
/* TEXTURE_MAG_FILTER */
/* TEXTURE_MIN_FILTER */
/* TEXTURE_WRAP_S */
/* TEXTURE_WRAP_T */
-
+
COMPRESSED_TEXTURE_FORMATS : 0x86A3,
-
+
/* HintMode */
DONT_CARE : 0x1100,
FASTEST : 0x1101,
NICEST : 0x1102,
-
+
/* HintTarget */
GENERATE_MIPMAP_HINT : 0x8192,
-
+
/* DataType */
BYTE : 0x1400,
UNSIGNED_BYTE : 0x1401,
@@ -237,7 +237,7 @@ UNSIGNED_SHORT : 0x1403,
INT : 0x1404,
UNSIGNED_INT : 0x1405,
FLOAT : 0x1406,
-
+
/* PixelFormat */
DEPTH_COMPONENT : 0x1902,
ALPHA : 0x1906,
@@ -245,13 +245,13 @@ RGB : 0x1907,
RGBA : 0x1908,
LUMINANCE : 0x1909,
LUMINANCE_ALPHA : 0x190A,
-
+
/* PixelType */
/* UNSIGNED_BYTE */
UNSIGNED_SHORT_4_4_4_4 : 0x8033,
UNSIGNED_SHORT_5_5_5_1 : 0x8034,
UNSIGNED_SHORT_5_6_5 : 0x8363,
-
+
/* Shaders */
FRAGMENT_SHADER : 0x8B30,
VERTEX_SHADER : 0x8B31,
@@ -271,7 +271,7 @@ ACTIVE_UNIFORMS : 0x8B86,
ACTIVE_ATTRIBUTES : 0x8B89,
SHADING_LANGUAGE_VERSION : 0x8B8C,
CURRENT_PROGRAM : 0x8B8D,
-
+
/* StencilFunction */
NEVER : 0x0200,
LESS : 0x0201,
@@ -281,7 +281,7 @@ GREATER : 0x0204,
NOTEQUAL : 0x0205,
GEQUAL : 0x0206,
ALWAYS : 0x0207,
-
+
/* StencilOp */
/* ZERO */
KEEP : 0x1E00,
@@ -291,16 +291,16 @@ DECR : 0x1E03,
INVERT : 0x150A,
INCR_WRAP : 0x8507,
DECR_WRAP : 0x8508,
-
+
/* StringName */
VENDOR : 0x1F00,
RENDERER : 0x1F01,
VERSION : 0x1F02,
-
+
/* TextureMagFilter */
NEAREST : 0x2600,
LINEAR : 0x2601,
-
+
/* TextureMinFilter */
/* NEAREST */
/* LINEAR */
@@ -308,17 +308,17 @@ NEAREST_MIPMAP_NEAREST : 0x2700,
LINEAR_MIPMAP_NEAREST : 0x2701,
NEAREST_MIPMAP_LINEAR : 0x2702,
LINEAR_MIPMAP_LINEAR : 0x2703,
-
+
/* TextureParameterName */
TEXTURE_MAG_FILTER : 0x2800,
TEXTURE_MIN_FILTER : 0x2801,
TEXTURE_WRAP_S : 0x2802,
TEXTURE_WRAP_T : 0x2803,
-
+
/* TextureTarget */
TEXTURE_2D : 0x0DE1,
TEXTURE : 0x1702,
-
+
TEXTURE_CUBE_MAP : 0x8513,
TEXTURE_BINDING_CUBE_MAP : 0x8514,
TEXTURE_CUBE_MAP_POSITIVE_X : 0x8515,
@@ -328,7 +328,7 @@ TEXTURE_CUBE_MAP_NEGATIVE_Y : 0x8518,
TEXTURE_CUBE_MAP_POSITIVE_Z : 0x8519,
TEXTURE_CUBE_MAP_NEGATIVE_Z : 0x851A,
MAX_CUBE_MAP_TEXTURE_SIZE : 0x851C,
-
+
/* TextureUnit */
TEXTURE0 : 0x84C0,
TEXTURE1 : 0x84C1,
@@ -363,12 +363,12 @@ TEXTURE29 : 0x84DD,
TEXTURE30 : 0x84DE,
TEXTURE31 : 0x84DF,
ACTIVE_TEXTURE : 0x84E0,
-
+
/* TextureWrapMode */
REPEAT : 0x2901,
CLAMP_TO_EDGE : 0x812F,
MIRRORED_REPEAT : 0x8370,
-
+
/* Uniform Types */
FLOAT_VEC2 : 0x8B50,
FLOAT_VEC3 : 0x8B51,
@@ -385,7 +385,7 @@ FLOAT_MAT3 : 0x8B5B,
FLOAT_MAT4 : 0x8B5C,
SAMPLER_2D : 0x8B5E,
SAMPLER_CUBE : 0x8B60,
-
+
/* Vertex Arrays */
VERTEX_ATTRIB_ARRAY_ENABLED : 0x8622,
VERTEX_ATTRIB_ARRAY_SIZE : 0x8623,
@@ -394,14 +394,14 @@ 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,
-
+
/* Shader Precision-Specified Types */
LOW_FLOAT : 0x8DF0,
MEDIUM_FLOAT : 0x8DF1,
@@ -409,19 +409,18 @@ HIGH_FLOAT : 0x8DF2,
LOW_INT : 0x8DF3,
MEDIUM_INT : 0x8DF4,
HIGH_INT : 0x8DF5,
-
+
/* Framebuffer Object. */
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,
@@ -431,29 +430,29 @@ RENDERBUFFER_BLUE_SIZE : 0x8D52,
RENDERBUFFER_ALPHA_SIZE : 0x8D53,
RENDERBUFFER_DEPTH_SIZE : 0x8D54,
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,
/* WebGL-specific enums */
@@ -475,6 +474,7 @@ canvas : "implementation-dependent"
// added in versions of the spec that are backward-compatible with
// this version
var ignoredProperties = [
+ 'STENCIL_INDEX',
];
// Constants removed from the WebGL spec compared to ES 2.0
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-attributes-alpha-depth-stencil-antialias.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
index f86b6f1b3c0..f0f21c4e109 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
@@ -64,8 +64,7 @@ void main()
var wtu = WebGLTestUtils;
var gl;
var contextAttribs = null;
-var pixel_1 = [0, 0, 0, 1];
-var pixel_2 = [0, 0, 0, 1];
+var redChannels = [0, 0, 0];
var correctColor = null;
var framebuffer;
var fbHasColor;
@@ -304,10 +303,13 @@ function testStencilAndDepth(stencil, depth)
function testAntialias(antialias)
{
debug("Testing antialias = " + antialias);
+ // Both the width and height of canvas are N.
+ // Note that "N = 2" doesn't work for some post processing AA per the discussion at https://github.com/KhronosGroup/WebGL/pull/1977.
+ var N = 3;
if (antialias)
- shouldBeNonNull("gl = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
+ shouldBeNonNull("gl = getWebGL(" + N + ", " + N + ", { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
else
- shouldBeNonNull("gl = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+ shouldBeNonNull("gl = getWebGL(" + N + ", " + N + ", { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
var vertices = new Float32Array([
@@ -319,17 +321,13 @@ function testAntialias(antialias)
255, 0, 0, 255,
255, 0, 0, 255]);
drawAndReadPixel(gl, vertices, colors, 0, 0);
- var buf_1 = new Uint8Array(1 * 1 * 4);
- var buf_2 = new Uint8Array(1 * 1 * 4);
- gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf_1);
- gl.readPixels(0, 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf_2);
- pixel_1[0] = buf_1[0];
- pixel_2[0] = buf_2[0];
- // For some anti-alias algorithms, effects may be not on diagonal line pixels, so that either:
- // - The red channel of the pixel at (0, 0) is not 0 and not 255, or,
- // - If it is 0, expect that the red channel of the pixel at (0, 1) is not 0 and not 255.
- shouldBe("pixel_1[0] != 255 && pixel_1[0] != 0 || pixel_1[0] == 0 && pixel_2[0] != 255 && pixel_2[0] != 0",
- "contextAttribs.antialias");
+ var buf = new Uint8Array(N * N * 4);
+ gl.readPixels(0, 0, N, N, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ redChannels[0] = buf[4 * (N + 1)]; // (1, 1)
+ redChannels[1] = buf[4 * N * (N - 1)]; // left top
+ redChannels[2] = buf[4 * (N - 1)]; // right bottom
+ shouldBeTrue("redChannels[1] == 255 && redChannels[2] == 0");
+ shouldBe("redChannels[0] != 255 && redChannels[0] != 0", "contextAttribs.antialias");
}
function runTest()
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost-restored.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost-restored.html
index dc83e16e6de..4781f6baa25 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost-restored.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost-restored.html
@@ -159,7 +159,7 @@ function testLosingAndRestoringContext()
// restore the context after this event has exited.
setTimeout(function() {
shouldGenerateGLError(gl, gl.NO_ERROR, "WEBGL_lose_context.restoreContext()");
- // The context should still be lost. It will not get restored until the
+ // The context should still be lost. It will not get restored until the
// webglrestorecontext event is fired.
shouldBeTrue("gl.isContextLost()");
shouldBe("gl.getError()", "gl.NO_ERROR");
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost.html
index 62daf2e9bec..ed94a0f89bb 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/context/context-lost.html
@@ -87,6 +87,9 @@ function init()
canvas.addEventListener("webglcontextlost", testLostContext, false);
+ // We need to initialize |uniformLocation| before losing context.
+ // Otherwise gl.getUniform() when context is lost will throw.
+ uniformLocation = gl.getUniformLocation(program, "tex");
loseContext();
}
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/angle-instanced-arrays.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/angle-instanced-arrays.html
index 908e612a47f..ee58314179f 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/angle-instanced-arrays.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/angle-instanced-arrays.html
@@ -125,7 +125,7 @@ function runSupportedTest(extensionEnabled) {
function runDivisorTestDisabled() {
debug("Testing VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE with extension disabled");
-
+
var VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
gl.getVertexAttrib(0, VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
@@ -385,7 +385,7 @@ function runANGLECorruptionTest()
ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, instanceCount);
- // Make sure each color was drawn correctly
+ // Make sure each color was drawn correctly
var i;
var passed = true;
for (i = 0; i < instanceCount; ++i) {
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-frag-depth.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-frag-depth.html
index 7885484152f..4599690dc35 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-frag-depth.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-frag-depth.html
@@ -202,7 +202,7 @@ function runOutputTests() {
canvas.width = 50; canvas.height = 50;
gl.viewport(0, 0, canvas.width, canvas.height);
-
+
// Enable depth testing with a clearDepth of 0.5
// This makes it so that fragments are only rendered when
// gl_fragDepthEXT is < 0.5
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-sRGB.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-sRGB.html
index a1da0ffd71e..e61c81035d9 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-sRGB.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-sRGB.html
@@ -326,7 +326,7 @@ function runFramebufferTextureConversionTest(format) {
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)', 'ext.SRGB_EXT');
-
+
if (validFormat) {
shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-texture-filter-anisotropic.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-texture-filter-anisotropic.html
index 81cde8f0ecf..ea6ff9c8679 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-texture-filter-anisotropic.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/ext-texture-filter-anisotropic.html
@@ -93,22 +93,22 @@ function runSupportedTest(extensionEnabled) {
function runHintTestDisabled() {
debug("Testing MAX_TEXTURE_MAX_ANISOTROPY_EXT with extension disabled");
-
+
var MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
gl.getParameter(MAX_TEXTURE_MAX_ANISOTROPY_EXT);
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "MAX_TEXTURE_MAX_ANISOTROPY_EXT should not be queryable if extension is disabled");
-
+
debug("Testing TEXTURE_MAX_ANISOTROPY_EXT with extension disabled");
var TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
var texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
-
+
gl.getTexParameter(gl.TEXTURE_2D, TEXTURE_MAX_ANISOTROPY_EXT);
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "TEXTURE_MAX_ANISOTROPY_EXT should not be queryable if extension is disabled");
gl.texParameterf(gl.TEXTURE_2D, TEXTURE_MAX_ANISOTROPY_EXT, 1);
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "TEXTURE_MAX_ANISOTROPY_EXT should not be settable if extension is disabled");
-
+
gl.texParameteri(gl.TEXTURE_2D, TEXTURE_MAX_ANISOTROPY_EXT, 1);
wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "TEXTURE_MAX_ANISOTROPY_EXT should not be settable if extension is disabled");
@@ -129,7 +129,7 @@ function runHintTestEnabled() {
else{
testFailed("Minimum value of MAX_TEXTURE_MAX_ANISOTROPY_EXT is 2.0, returned values was: " + max_anisotropy);
}
-
+
// TODO make a texture and verify initial value == 1 and setting to less than 1 is invalid value
debug("Testing TEXTURE_MAX_ANISOTROPY_EXT with extension disabled");
@@ -137,7 +137,7 @@ function runHintTestEnabled() {
var texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
-
+
var queried_value = gl.getTexParameter(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "TEXTURE_MAX_ANISOTROPY_EXT query should succeed if extension is enabled");
@@ -150,13 +150,13 @@ function runHintTestEnabled() {
gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, 0);
wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "texParameterf TEXTURE_MAX_ANISOTROPY_EXT set to < 1 should be an invalid value");
-
+
gl.texParameteri(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, 0);
wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "texParameteri TEXTURE_MAX_ANISOTROPY_EXT set to < 1 should be an invalid value");
-
+
gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texParameterf TEXTURE_MAX_ANISOTROPY_EXT set to >= 2 should succeed");
-
+
gl.texParameteri(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texParameteri TEXTURE_MAX_ANISOTROPY_EXT set to >= 2 should succeed");
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-element-index-uint.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-element-index-uint.html
index b5a0806d271..add8bdd603f 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-element-index-uint.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-element-index-uint.html
@@ -81,7 +81,7 @@ for (var ii = 0; ii < 2; ++ii) {
testFailed("WebGL context does not exist");
} else {
testPassed("WebGL context exists");
-
+
var drawType = (ii == 0) ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;
debug("Testing " + ((ii == 0) ? "STATIC_DRAW" : "DYNAMIC_DRAW"));
@@ -131,17 +131,17 @@ function runSupportedTest(extensionEnabled) {
function runDrawTests(drawType) {
debug("Test that draws with unsigned integer indices produce the expected results");
-
+
canvas.width = 50; canvas.height = 50;
gl.viewport(0, 0, canvas.width, canvas.height);
-
+
var program = wtu.setupNoTexCoordTextureProgram(gl);
function setupDraw(s) {
// Create a vertex buffer that cannot be fully indexed via shorts
var quadArrayLen = 65537 * 3;
var quadArray = new Float32Array(quadArrayLen);
-
+
// Leave all but the last 4 values zero-ed out
var idx = quadArrayLen - 12;
@@ -290,8 +290,8 @@ function runIndexValidationTests(drawType) {
gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
gl.enableVertexAttribArray(normalLoc);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
- shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
- wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ 'gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
debug("Test with enabled attribute that does not belong to current program");
@@ -331,13 +331,14 @@ function runCopiesIndicesTests(drawType) {
var indices = new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, drawType);
wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+ var indexValidationError = wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
indices[0] = 2;
indices[5] = 1;
wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
}
function runResizedBufferTests(drawType) {
@@ -423,8 +424,9 @@ function runVerifiesTooManyIndicesTests(drawType) {
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]), drawType);
wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
- wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+ var indexValidationError = wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
}
function runCrashWithBufferSubDataTests(drawType) {
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-float.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-float.html
index 9a20f3f25e0..4c00492fe25 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-float.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-float.html
@@ -183,10 +183,10 @@ function arrayToString(arr, size) {
mySize = size;
var out = "[";
for (var ii = 0; ii < mySize; ++ii) {
- if (ii > 0) {
- out += ", ";
- }
- out += arr[ii];
+ if (ii > 0) {
+ out += ", ";
+ }
+ out += arr[ii];
}
return out + "]";
}
@@ -252,25 +252,25 @@ function runRenderTargetAndReadbackTest(testProgram, format, numberOfChannels, s
var implType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "getParameter of IMPLEMENTATION_COLOR_READ_{FORMAT|TYPE} should succeed");
if ((implFormat == gl.RGBA || implFormat == gl.RGB) && implType == gl.FLOAT) {
- debug("Checking readback of floating-point values");
- var arraySize = (implFormat == gl.RGBA) ? 4 : 3
- var buf = new Float32Array(arraySize);
- gl.readPixels(0, 0, 1, 1, implFormat, implType , buf);
- wtu.glErrorShouldBe(gl, gl.NO_ERROR, "readPixels from floating-point renderbuffer should succeed");
- var ok = true;
- var tolerance = 8.0; // TODO: factor this out from both this test and the subtractor shader above.
- for (var ii = 0; ii < buf.length; ++ii) {
- if (Math.abs(buf[ii] - subtractor[ii]) > tolerance) {
- ok = false;
- break;
- }
- }
- if (ok) {
- testPassed("readPixels of float-type data from floating-point renderbuffer succeeded");
- } else {
- testFailed("readPixels of float-type data from floating-point renderbuffer failed: expected "
- + arrayToString(subtractor, arraySize) + ", got " + arrayToString(buf));
- }
+ debug("Checking readback of floating-point values");
+ var arraySize = (implFormat == gl.RGBA) ? 4 : 3
+ var buf = new Float32Array(arraySize);
+ gl.readPixels(0, 0, 1, 1, implFormat, implType , buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "readPixels from floating-point renderbuffer should succeed");
+ var ok = true;
+ var tolerance = 8.0; // TODO: factor this out from both this test and the subtractor shader above.
+ for (var ii = 0; ii < buf.length; ++ii) {
+ if (Math.abs(buf[ii] - subtractor[ii]) > tolerance) {
+ ok = false;
+ break;
+ }
+ }
+ if (ok) {
+ testPassed("readPixels of float-type data from floating-point renderbuffer succeeded");
+ } else {
+ testFailed("readPixels of float-type data from floating-point renderbuffer failed: expected "
+ + arrayToString(subtractor, arraySize) + ", got " + arrayToString(buf));
+ }
}
}
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-half-float.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-half-float.html
index fd47e55a8a2..792da43e263 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-half-float.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-texture-half-float.html
@@ -117,13 +117,13 @@ if (!gl) {
formats.forEach(function(f) {
runTextureCreationTest(true, f.format, null, f.expected);
});
-
+
// Texture creation should fail when passed with non-null, non-Uint16 ArrayBufferView
formats.forEach(function(f) {
var width = 2;
var height = 2;
var format = f.format;
-
+
// Float32Array
var float32Data = new Float32Array(width * height * getNumberOfChannels(format));
for (var ii = 0; ii < float32Data.length; ii++) {
@@ -140,7 +140,7 @@ if (!gl) {
});
// Test that Uint16 encoded half float values can be used as texture data.
-
+
// First test that values in the 0-1 range can be written and read.
var halfFloatOneThird = 0x3555; // Half float 1/3
var uint16Formats = [
@@ -234,12 +234,12 @@ function runTextureCreationTest(extensionEnabled, opt_format, opt_data, opt_expe
var format = opt_format || gl.RGBA;
var data = opt_data || null;
var expectSuccess = true;
-
+
if (!extensionEnabled || !opt_expected)
expectSuccess = false;
debug("Testing texture creation with extension " + (extensionEnabled ? "enabled" : "disabled") +
", format " + getFormatName(format) + ", and data " + (data ? "non-null" : "null") +
- ". Expect " + (expectSuccess ? "Success" : "Failure"));
+ ". Expect " + (expectSuccess ? "Success" : "Failure"));
var texture = allocateTexture();
var width = 2;
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-vertex-array-object-bufferData.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-vertex-array-object-bufferData.html
index 7d2acf9dd36..ee8db23bf36 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-vertex-array-object-bufferData.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/oes-vertex-array-object-bufferData.html
@@ -101,7 +101,7 @@ if (!gl) {
* namely the Nexus 5, and Nexus 7 (in 2014/01) when using bufferData before binding the VAO.
* The tested OS was Android KitKat 4.4.2, the effects were the same in all tested browsers
* (Chrome, Chrome Beta, Firefox, Firefox Beta), so it is likely a driver bug.
- * These devices have the similar Adreno 320 and Adreno 330 GPUs respectively.
+ * These devices have the similar Adreno 320 and Adreno 330 GPUs respectively.
*
* The issuse resulted from this sequence of actions in a requestAnimationFrame loop:
* 1. upload some vertex buffers with gl.bufferData (eg. colors)
@@ -109,12 +109,12 @@ if (!gl) {
* 3. clear the canvas
* 4. draw (some triangles) to the canvas
* 5. unbind the VAO
- *
+ *
* This caused the drawn triangles to be drawn with black (0) for most of the frames, with some
* rare frames presenting the correct render results. Interestingly on both devices exactly every
- * 64th frame passed (starting with the very first one), the others failed.
+ * 64th frame passed (starting with the very first one), the others failed.
* (Because of this, we test multiple frames.)
- * When positions were uploaded, seemingly nothing was drawn, that's likely because the
+ * When positions were uploaded, seemingly nothing was drawn, that's likely because the
* position buffer was also all 0s.
*
* The issue did not occur:
@@ -123,61 +123,61 @@ if (!gl) {
*/
function runBufferDataTest() {
debug("Testing draws with bufferData");
-
+
canvas.width = 50; canvas.height = 50;
gl.viewport(0, 0, canvas.width, canvas.height);
-
+
var testColor = [0, 255, 0, 255];
var clearColor = [255, 0, 0, 255];
-
+
// Where the issue occures, this is the sequence of success/failure every time:
// result: success fail fail fail fail ... success fail fail ...
// currentTestCount: 0 1 2 3 4 ... 64 65 66 ...
// So with just 1 test it passes, but 2 tests are enough. Here we use 3.
- var numberOfTests = 3;
+ var numberOfTests = 3;
var currentTestCount = 0;
-
+
var positionLoc = 0;
var colorLoc = 1;
var gridRes = 1;
-
+
var program = wtu.setupSimpleVertexColorProgram(gl, positionLoc, colorLoc);
-
+
var vao0 = ext.createVertexArrayOES();
ext.bindVertexArrayOES(vao0);
-
+
var buffers = wtu.setupIndexedQuadWithOptions(gl,
{ gridRes: gridRes,
positionLocation: positionLoc
});
-
+
var colorTypedArray = createColorTypedArray();
-
+
var colorBuffer = gl.createBuffer(gl.ARRAY_BUFFER);
gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
gl.enableVertexAttribArray(colorLoc);
- gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
-
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+
ext.bindVertexArrayOES(null);
-
+
testDrawing();
-
+
function testDrawing() {
// this order works fine:
// ext.bindVertexArrayOES(vao0);
// uploadColor();
-
+
// this order doesn't:
uploadColor();
ext.bindVertexArrayOES(vao0);
-
+
wtu.clearAndDrawIndexedQuad(gl, 1, clearColor);
-
+
ext.bindVertexArrayOES(null);
//debug(""+currentTestCount+" sharedArrayBufferSize && bufferSizeNeeded <= 4294967295) {
+ // ArrayBuffers can be at most 4GB (minus 1 byte), but any allocations larger than 1 GB are unreliable in practice. So limit allocations to 1 GB.
+ // Textures that are wide in just one dimension can still be used to test max TEXTURE_2D size limit even if we don't allocate space for huge square textures.
+ if (bufferSizeNeeded > sharedArrayBufferSize && bufferSizeNeeded <= Math.pow(2, 30)) {
sharedArrayBufferSize = bufferSizeNeeded;
}
}
@@ -195,7 +196,7 @@ function testFormatType(t, test) {
for (var j = 0; j < t.targets.length; ++j) {
var target = t.targets[j];
debug("");
- debug(wtu.glEnumToString(gl, target));
+ debug(wtu.glEnumToString(gl, target) + " " + wtu.glEnumToString(ext, test.format));
// positive test
var size = positiveTestSize;
@@ -219,11 +220,25 @@ function testFormatType(t, test) {
var dataSize = test.func(t.maxSize + test.sizeStep, t.maxSize + test.sizeStep);
// this check assumes that each element is 1 byte
if (dataSize > sharedArrayBuffer.byteLength) {
- testPassed("Unable to test texture larger than maximum size due to ArrayBuffer size limitations -- this is legal");
+ if (t.target == gl.TEXTURE_CUBE_MAP) {
+ testPassed("Unable to test texture larger than maximum size due to ArrayBuffer size limitations -- this is legal");
+ } else {
+ var wideAndShortDataSize = test.func(t.maxSize + test.sizeStep, test.sizeStep);
+ var pixelsNegativeTest1 = new test.dataType(sharedArrayBuffer, 0, wideAndShortDataSize);
+ gl.compressedTexImage2D(target, 0, test.format, t.maxSize + test.sizeStep, test.sizeStep, 0, pixelsNegativeTest1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width out of bounds: should generate INVALID_VALUE."
+ + " level is 0, size is " + (t.maxSize + test.sizeStep) + "x" + (test.sizeStep));
+
+ var narrowAndTallDataSize = test.func(test.sizeStep, t.maxSize + test.sizeStep);
+ var pixelsNegativeTest1 = new test.dataType(sharedArrayBuffer, 0, narrowAndTallDataSize);
+ gl.compressedTexImage2D(target, 0, test.format, test.sizeStep, t.maxSize + test.sizeStep, 0, pixelsNegativeTest1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "height out of bounds: should generate INVALID_VALUE."
+ + " level is 0, size is " + (test.sizeStep) + "x" + (t.maxSize + test.sizeStep));
+ }
} else {
var pixelsNegativeTest1 = new test.dataType(sharedArrayBuffer, 0, dataSize);
gl.compressedTexImage2D(target, 0, test.format, t.maxSize + test.sizeStep, t.maxSize + test.sizeStep, 0, pixelsNegativeTest1);
- wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE."
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width and height out of bounds: should generate INVALID_VALUE."
+ " level is 0, size is " + (t.maxSize + test.sizeStep) + "x" + (t.maxSize + test.sizeStep));
}
// level out of bounds
diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/webgl-draw-buffers.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/webgl-draw-buffers.html
index 7c963616c45..a4912717b29 100644
--- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/webgl-draw-buffers.html
+++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/extensions/webgl-draw-buffers.html
@@ -62,6 +62,13 @@ void main() {
gl_FragColor = vec4(1,0,0,1);
}
+