From 6d91cadcdff02869e978fbadc651d73b8fc9d5ec Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 9 Jul 2018 13:55:13 +0200 Subject: [PATCH] Update the Khronos test suites --- tests/wpt/mozilla/meta/MANIFEST.json | 28 ++++----- .../drawingbuffer-static-canvas-test.html.ini | 1 - .../canvas/drawingbuffer-test.html.ini | 1 - .../textures/tex-input-validation.html.ini | 1 - .../more/functions/texSubImage2DBadArgs.html | 4 +- .../textures/tex-input-validation.html | 4 +- .../textures/texture-size-limit.html | 63 ++++++++++++------- .../resources/js-test-pre.js | 5 -- .../resources/webgl-test-harness.js | 2 +- .../more/functions/texSubImage2DBadArgs.html | 4 +- .../textures/misc/texture-size-limit.html | 63 ++++++++++++------- .../buffers/buffer-type-restrictions.html | 10 --- .../misc/copy-texture-image-luma-format.html | 2 +- .../webgl/conformance-2.0.0/js/js-test-pre.js | 5 -- ...ub-image-2d-with-image-bitmap-from-blob.js | 4 +- ...ub-image-3d-with-image-bitmap-from-blob.js | 4 +- .../js/tests/tex-input-validation.js | 4 +- .../js/webgl-test-harness.js | 2 +- 18 files changed, 109 insertions(+), 98 deletions(-) diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 57cddd34edc..0beecc52b8f 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -72910,7 +72910,7 @@ "testharness" ], "webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DBadArgs.html": [ - "925cff1fe7e1a27f9a1d809a06cb0b3b0fd2e409", + "d8f835e310803c6f2c83a010cf325973a870877e", "testharness" ], "webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DHTML.html": [ @@ -80266,7 +80266,7 @@ "testharness" ], "webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html": [ - "1b579c2798c69585cf8959c09fdc5845aa92526e", + "5c6cf39bcf8c2a5e71e894c7453de7359095b2b1", "testharness" ], "webgl/conformance-1.0.3/conformance/textures/tex-sub-image-2d-bad-args.html": [ @@ -80338,7 +80338,7 @@ "testharness" ], "webgl/conformance-1.0.3/conformance/textures/texture-size-limit.html": [ - "df9d9db523e8fc9e672b9478d4ed7539b0afb8bb", + "e58263e358ab36319fb894e0a5cdfaf635a800d0", "testharness" ], "webgl/conformance-1.0.3/conformance/textures/texture-size.html": [ @@ -80470,7 +80470,7 @@ "support" ], "webgl/conformance-1.0.3/resources/js-test-pre.js": [ - "c908f204f89f448526ad40357f7169cf5803e67d", + "e477a3121fd6086aa97343e395e8d8622c01d844", "support" ], "webgl/conformance-1.0.3/resources/js-test-style.css": [ @@ -80486,7 +80486,7 @@ "support" ], "webgl/conformance-1.0.3/resources/webgl-test-harness.js": [ - "1cb2adb8fb53fa658bbb73ef61c08bcb587b2c0a", + "98e8e7e62030796bf34285f5bcbac3bd8b77ddb3", "support" ], "webgl/conformance-1.0.3/test-guidelines.md": [ @@ -82470,7 +82470,7 @@ "testharness" ], "webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DBadArgs.html": [ - "e0b233b82376bae960bc435ea2f390a3c892fb78", + "880919800fd7b68bfe97bcd8148fde5e41c1af5f", "testharness" ], "webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DHTML.html": [ @@ -89858,7 +89858,7 @@ "testharness" ], "webgl/conformance-2.0.0/conformance/textures/misc/texture-size-limit.html": [ - "e2ddd9863e70ef2c74ba38007235d6f5332c3690", + "188327cf75f77ba75096e17a32e6182bd8d7966c", "testharness" ], "webgl/conformance-2.0.0/conformance/textures/misc/texture-size.html": [ @@ -90078,7 +90078,7 @@ "testharness" ], "webgl/conformance-2.0.0/conformance2/buffers/buffer-type-restrictions.html": [ - "0220d823c0e8190475b7f704e9f81b0f02c5fd01", + "5fc1eeb29286971424220ecd122e9b2b605ff06d", "testharness" ], "webgl/conformance-2.0.0/conformance2/buffers/get-buffer-sub-data.html": [ @@ -93218,7 +93218,7 @@ "testharness" ], "webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html": [ - "e95ff06a4d3f1a77011a7c306dd4e0afd38a1552", + "b6f306193a82e55a53dc436949d76776632960b9", "testharness" ], "webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-webgl-specific.html": [ @@ -98622,7 +98622,7 @@ "support" ], "webgl/conformance-2.0.0/js/js-test-pre.js": [ - "440f5f81367b9a376423601ab45960a5319b1b0b", + "8f199ed7f5cea4fa0750de009149ac48a27d5a10", "support" ], "webgl/conformance-2.0.0/js/pnglib.js": [ @@ -98682,7 +98682,7 @@ "support" ], "webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js": [ - "8505a329d65a627cfab08dcef9e384f499bd2fd7", + "699897b0a2ceea03ec7bc113fd9350e26805dd70", "support" ], "webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js": [ @@ -98734,7 +98734,7 @@ "support" ], "webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js": [ - "34685e9545ac0f9fbb9665b9788b52a6ea656544", + "3691acb33bda464b05c21e6c0aea18d83a32ee7e", "support" ], "webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-canvas.js": [ @@ -98786,7 +98786,7 @@ "support" ], "webgl/conformance-2.0.0/js/tests/tex-input-validation.js": [ - "89befe095ced5482aa9788e1a4362cbc2771c462", + "d8b584d6ccc1d76239f412eca8360007c4a016c7", "support" ], "webgl/conformance-2.0.0/js/tests/typed-array-test-cases.js": [ @@ -98798,7 +98798,7 @@ "support" ], "webgl/conformance-2.0.0/js/webgl-test-harness.js": [ - "fd8879f1c8300d3ab3a3d9c15e49aa2b5fe25aca", + "c2c0b7c5660f9309682091150ef7e64e171a823d", "support" ], "webgl/conformance-2.0.0/js/webgl-test-utils.js": [ diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-static-canvas-test.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-static-canvas-test.html.ini index 461534c9e19..64c90bdf140 100644 --- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-static-canvas-test.html.ini +++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-static-canvas-test.html.ini @@ -1,4 +1,3 @@ [drawingbuffer-static-canvas-test.html] type: testharness expected: CRASH - diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-test.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-test.html.ini index f6cf3ae8bee..6570acb25a4 100644 --- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-test.html.ini +++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/canvas/drawingbuffer-test.html.ini @@ -1,4 +1,3 @@ [drawingbuffer-test.html] type: testharness expected: CRASH - diff --git a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini index 4d390acaba6..f91c50e108b 100644 --- a/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini +++ b/tests/wpt/mozilla/meta/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html.ini @@ -1,5 +1,4 @@ [tex-input-validation.html] - type: testharness [WebGL test #34: getError expected: INVALID_OPERATION. Was NO_ERROR : colorBufferFormat: RGB565 internalFormat: RGBA target: TEXTURE_2D border: 0] expected: FAIL diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DBadArgs.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DBadArgs.html index b435e15e98b..875f4c49597 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DBadArgs.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/more/functions/texSubImage2DBadArgs.html @@ -84,10 +84,10 @@ Tests.testTexImage2D = function(gl) { assertGLError(gl, gl.INVALID_VALUE, "negative y", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0,1,-1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); }); - assertGLError(gl, gl.INVALID_ENUM, "bad format", function(){ + assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad format", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.FLOAT,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); }); - assertGLError(gl, gl.INVALID_ENUM, "bad type", function(){ + assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad type", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.TEXTURE_2D, new Uint8Array([0,0,0,0])); }); assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html index 4d7a5489253..d6904d648f7 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/tex-input-validation.html @@ -245,11 +245,11 @@ testCases = [ {target: gl.TEXTURE_2D, format: 0x1903, // GL_RED type: gl.UNSIGNED_BYTE, - expectedError: gl.INVALID_ENUM}, + expectedError: [gl.INVALID_ENUM, gl.INVALID_OPERATION] }, {target: gl.TEXTURE_2D, format: gl.RGBA, type: gl.BYTE, - expectedError: gl.INVALID_ENUM}, + expectedError: [gl.INVALID_ENUM, gl.INVALID_OPERATION] }, {target: gl.TEXTURE_2D, format: gl.RGBA, type: gl.UNSIGNED_BYTE, diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/texture-size-limit.html b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/texture-size-limit.html index 176e1ce96a1..73bc6a7dfff 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/texture-size-limit.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/conformance/textures/texture-size-limit.html @@ -73,13 +73,11 @@ var targets = [ { target: gl.TEXTURE_2D, maxSize: gl.getParameter(gl.MAX_TEXTURE_SIZE), maxLevel: 1000, - tex: gl.createTexture(), targets: [gl.TEXTURE_2D] }, { target: gl.TEXTURE_CUBE_MAP, maxSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxLevel: 5, - tex: gl.createTexture(), targets: [ gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X, @@ -95,13 +93,15 @@ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); var trg = 0; var tt = 0; +var tex = null; runNextTest(); function runNextTest() { var t = targets[trg]; if (tt == 0) { - var tex = t.tex; + gl.deleteTexture(tex); + tex = gl.createTexture(); gl.bindTexture(t.target, tex); debug(""); @@ -127,43 +127,60 @@ function runNextTest() { function testFormatType(t, test) { debug(""); debug("testing: " + wtu.glEnumToString(gl, test.format) + ", " + wtu.glEnumToString(gl, test.type)); + for (var j = 0; j < t.targets.length; ++j) { var target = t.targets[j]; debug(""); debug(wtu.glEnumToString(gl, target)); var numLevels = numLevelsFromSize(t.maxSize); - var numTestLevels = Math.min(numLevels, t.maxLevel); // out of bounds tests + for (var i = 0; i < numLevels; i++) { + // width and height out of bounds + var size = t.maxSize >> i; + gl.texImage2D(target, i, test.format, size + 1, size + 1, 0, test.format, test.type, null); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE: level is " + i + ", size is " + + (size + 1) + "x" + (size + 1)); + } // level out of bounds gl.texImage2D(target, numLevels, test.format, 1, 1, 0, test.format, test.type, null); wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "level out of bounds: should generate INVALID_VALUE: level is: " + numLevels + ", size is 1x1."); - // width and height out of bounds - gl.texImage2D(target, 0, test.format, t.maxSize + 1, t.maxSize + 1, 0, test.format, test.type, null); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE: level is 0, size is " - + (t.maxSize + 1) + "x" + (t.maxSize + 1)); - // width and height out of bounds for specified level - gl.texImage2D(target, (numLevels - 1), test.format, 4, 4, 0, test.format, test.type, null); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds for specified level: should generate INVALID_VALUE: level is " - + (numLevels - 1) + ", size is 4x4."); + // Probe to discover the max non-OOM level. + // For instance, on some drivers (at least Intel+Mesa) we can create + // a maxLevel L8 texture, but only a maxLevel-1 RGB8 texture. + var maxLevelsForFormat = numLevels; + while (true) { + gl.texImage2D(target, maxLevelsForFormat-1, test.format, 1, 1, 0, test.format, test.type, null); + var err = gl.getError(); + if (err == gl.OUT_OF_MEMORY) { + debug("Probe failed for level=" + (maxLevelsForFormat-1) + ", reducing..."); + maxLevelsForFormat -= 1; + if (!maxLevelsForFormat) { + testFailed("Failed to allocate any levels for format " + test.format); + return; + } + continue; + } + if (err) { + testFailed("Should not hit non-OOM errors during max level probing."); + return; + } + break; + } + var numTestLevels = Math.min(maxLevelsForFormat, t.maxLevel); for (var l = 0; l < numTestLevels; ++l) { // Do bottom levels first; var size = 1 << l; - var level = numLevels - l - 1; + var level = maxLevelsForFormat - l - 1; var otherDimension = t.target == gl.TEXTURE_2D ? 1 : size; - var badSize = size * 2; - var badOtherDimension = t.target == gl.TEXTURE_2D ? 1 : badSize; - var pixels = new test.dataType(badSize * badOtherDimension * test.size); - gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, pixels); + gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, null); wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + size + "x" + otherDimension); - gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size); - gl.texImage2D(target, level, test.format, badSize, badOtherDimension, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badSize + "x" + badOtherDimension); - gl.texImage2D(target, level, test.format, badOtherDimension, badSize, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badOtherDimension + "x" + badSize); + if (otherDimension != size) { + gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size); + } } } } diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/js-test-pre.js b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/js-test-pre.js index c4bb6531acd..3c5f2c6e908 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/js-test-pre.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/js-test-pre.js @@ -49,11 +49,6 @@ window.console.log = function() { }; window.console.error = function() { }; window.internals.settings.setWebGLErrorsToConsoleEnabled(false); - - // RAF doesn't work in LayoutTests. Disable it so the tests will - // use setTimeout instead. - window.requestAnimationFrame = undefined; - window.webkitRequestAnimationFrame = undefined; } /* -- end platform specific code --*/ diff --git a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/webgl-test-harness.js b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/webgl-test-harness.js index 1bf7283aa93..a55f6837b71 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/webgl-test-harness.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-1.0.3/resources/webgl-test-harness.js @@ -616,7 +616,7 @@ TestHarness.prototype.reportResults = function(url, success, msg, skipped) { url = FilterURL(url); var test = this.getTest(url); this.clearTimeout(test); - log(success ? "PASS" : "FAIL", msg); + log((success ? "PASS" : "FAIL") + ": " + msg); this.reportFunc(TestHarness.reportType.TEST_RESULT, url, msg, success, skipped); // For each result we get, reset the timeout this.setTimeout(test); diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DBadArgs.html b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DBadArgs.html index a050d87dd1a..188b2616baf 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DBadArgs.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/more/functions/texSubImage2DBadArgs.html @@ -90,10 +90,10 @@ Tests.testTexImage2D = function(gl) { assertGLError(gl, gl.INVALID_VALUE, "negative y", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0,1,-1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); }); - assertGLError(gl, gl.INVALID_ENUM, "bad format", function(){ + assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad format", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.FLOAT,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); }); - assertGLError(gl, gl.INVALID_ENUM, "bad type", function(){ + assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad type", function(){ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.TEXTURE_2D, new Uint8Array([0,0,0,0])); }); assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/textures/misc/texture-size-limit.html b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/textures/misc/texture-size-limit.html index ec527b6068d..6576773e58a 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/textures/misc/texture-size-limit.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance/textures/misc/texture-size-limit.html @@ -73,13 +73,11 @@ var targets = [ { target: gl.TEXTURE_2D, maxSize: gl.getParameter(gl.MAX_TEXTURE_SIZE), maxLevel: 1000, - tex: gl.createTexture(), targets: [gl.TEXTURE_2D] }, { target: gl.TEXTURE_CUBE_MAP, maxSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxLevel: 5, - tex: gl.createTexture(), targets: [ gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X, @@ -95,13 +93,15 @@ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); var trg = 0; var tt = 0; +var tex = null; runNextTest(); function runNextTest() { var t = targets[trg]; if (tt == 0) { - var tex = t.tex; + gl.deleteTexture(tex); + tex = gl.createTexture(); gl.bindTexture(t.target, tex); debug(""); @@ -127,43 +127,60 @@ function runNextTest() { function testFormatType(t, test) { debug(""); debug("testing: " + wtu.glEnumToString(gl, test.format) + ", " + wtu.glEnumToString(gl, test.type)); + for (var j = 0; j < t.targets.length; ++j) { var target = t.targets[j]; debug(""); debug(wtu.glEnumToString(gl, target)); var numLevels = numLevelsFromSize(t.maxSize); - var numTestLevels = Math.min(numLevels, t.maxLevel); // out of bounds tests + for (var i = 0; i < numLevels; i++) { + // width and height out of bounds + var size = t.maxSize >> i; + gl.texImage2D(target, i, test.format, size + 1, size + 1, 0, test.format, test.type, null); + wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE: level is " + i + ", size is " + + (size + 1) + "x" + (size + 1)); + } // level out of bounds gl.texImage2D(target, numLevels, test.format, 1, 1, 0, test.format, test.type, null); wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "level out of bounds: should generate INVALID_VALUE: level is: " + numLevels + ", size is 1x1."); - // width and height out of bounds - gl.texImage2D(target, 0, test.format, t.maxSize + 1, t.maxSize + 1, 0, test.format, test.type, null); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE: level is 0, size is " - + (t.maxSize + 1) + "x" + (t.maxSize + 1)); - // width and height out of bounds for specified level - gl.texImage2D(target, (numLevels - 1), test.format, 4, 4, 0, test.format, test.type, null); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds for specified level: should generate INVALID_VALUE: level is " - + (numLevels - 1) + ", size is 4x4."); + // Probe to discover the max non-OOM level. + // For instance, on some drivers (at least Intel+Mesa) we can create + // a maxLevel L8 texture, but only a maxLevel-1 RGB8 texture. + var maxLevelsForFormat = numLevels; + while (true) { + gl.texImage2D(target, maxLevelsForFormat-1, test.format, 1, 1, 0, test.format, test.type, null); + var err = gl.getError(); + if (err == gl.OUT_OF_MEMORY) { + debug("Probe failed for level=" + (maxLevelsForFormat-1) + ", reducing..."); + maxLevelsForFormat -= 1; + if (!maxLevelsForFormat) { + testFailed("Failed to allocate any levels for format " + test.format); + return; + } + continue; + } + if (err) { + testFailed("Should not hit non-OOM errors during max level probing."); + return; + } + break; + } + var numTestLevels = Math.min(maxLevelsForFormat, t.maxLevel); for (var l = 0; l < numTestLevels; ++l) { // Do bottom levels first; var size = 1 << l; - var level = numLevels - l - 1; + var level = maxLevelsForFormat - l - 1; var otherDimension = t.target == gl.TEXTURE_2D ? 1 : size; - var badSize = size * 2; - var badOtherDimension = t.target == gl.TEXTURE_2D ? 1 : badSize; - var pixels = new test.dataType(badSize * badOtherDimension * test.size); - gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, pixels); + gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, null); wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + size + "x" + otherDimension); - gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size); - gl.texImage2D(target, level, test.format, badSize, badOtherDimension, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badSize + "x" + badOtherDimension); - gl.texImage2D(target, level, test.format, badOtherDimension, badSize, 0, test.format, test.type, pixels); - wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badOtherDimension + "x" + badSize); + if (otherDimension != size) { + gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, null); + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size); + } } } } diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/buffers/buffer-type-restrictions.html b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/buffers/buffer-type-restrictions.html index ef29a11cae4..7c19dccf3dd 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/buffers/buffer-type-restrictions.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/buffers/buffer-type-restrictions.html @@ -90,16 +90,6 @@ var testBindingFn = function(firstBindFn, secondBindFn, firstTarget, secondTarge wtu.glErrorShouldBe(gl, gl.NO_ERROR, messagePrefix + "WORK"); else wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, messagePrefix + "FAIL"); - - if ((firstTarget == gl.TRANSFORM_FEEDBACK_BUFFER && secondTarget != gl.TRANSFORM_FEEDBACK_BUFFER) || - (firstTarget != gl.TRANSFORM_FEEDBACK_BUFFER && secondTarget == gl.TRANSFORM_FEEDBACK_BUFFER)) { - bind(firstBindFn, firstTarget, buffer); - bind(secondBindFn, secondTarget, buffer); - - var message = "Binding buffer first with " + firstBindFn + " to gl." + firstTargetStr - + " and simultaneously binding buffer with " + secondBindFn + " to gl." + secondTargetStr + " should FAIL"; - wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, message); - } } var testBinding = function(firstTarget, secondTarget) { diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html index 4dfee411d15..b8460e6512e 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/conformance2/textures/misc/copy-texture-image-luma-format.html @@ -123,7 +123,7 @@ function copytexsubimage3D_luma_format() { gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, layer, 0, 0,width, height); gl.bindFramebuffer(gl.FRAMEBUFFER, null); - var program = wtu.setupProgram(gl, ["vshader", "fshader_luminance_alpha"]); + var program = wtu.setupProgram(gl, ["vshader", "fshader_luminance_alpha"], ["a_position", "a_coord"]); wtu.setupUnitQuad(gl, 0, 1); wtu.drawUnitQuad(gl); diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/js-test-pre.js b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/js-test-pre.js index 7ca8559d9bc..6b054242d99 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/js-test-pre.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/js-test-pre.js @@ -49,11 +49,6 @@ window.console.log = function() { }; window.console.error = function() { }; window.internals.settings.setWebGLErrorsToConsoleEnabled(false); - - // RAF doesn't work in LayoutTests. Disable it so the tests will - // use setTimeout instead. - window.requestAnimationFrame = undefined; - window.webkitRequestAnimationFrame = undefined; } /* -- end platform specific code --*/ diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js index 906e337b206..b2bbb850fbc 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js @@ -51,14 +51,14 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource var xhr = new XMLHttpRequest(); xhr.open("GET", resourcePath + "red-green-semi-transparent.png"); xhr.responseType = 'blob'; - xhr.send(); xhr.onload = function() { var blob = xhr.response; runImageBitmapTest(blob, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, false) .then(() => { finishTest(); }); - } + }; + xhr.send(); } return init; diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js index 823f9e394f2..ac06127d852 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-image-and-sub-image-3d-with-image-bitmap-from-blob.js @@ -51,14 +51,14 @@ function generateTest(internalFormat, pixelFormat, pixelType, prologue, resource var xhr = new XMLHttpRequest(); xhr.open("GET", resourcePath + "red-green-semi-transparent.png"); xhr.responseType = 'blob'; - xhr.send(); xhr.onload = function() { var blob = xhr.response; runImageBitmapTest(blob, 0.5, internalFormat, pixelFormat, pixelType, gl, tiu, wtu, true) .then(() => { finishTest(); }); - } + }; + xhr.send(); } return init; diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-input-validation.js b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-input-validation.js index 154dfbddf97..77237fae374 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-input-validation.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/tests/tex-input-validation.js @@ -358,11 +358,11 @@ if (contextVersion < 2) { { target: gl.TEXTURE_2D, format: 0x1903, // GL_RED type: gl.UNSIGNED_BYTE, - expectedError: gl.INVALID_ENUM }, + expectedError: [gl.INVALID_ENUM, gl.INVALID_OPERATION] }, { target: gl.TEXTURE_2D, format: gl.RGBA, type: gl.BYTE, - expectedError: gl.INVALID_ENUM } + expectedError: [gl.INVALID_ENUM, gl.INVALID_OPERATION] } ]); } else { testCases = testCases.concat([ diff --git a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/webgl-test-harness.js b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/webgl-test-harness.js index 0287bf6ecb7..4fb179f2b21 100644 --- a/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/webgl-test-harness.js +++ b/tests/wpt/mozilla/tests/webgl/conformance-2.0.0/js/webgl-test-harness.js @@ -613,7 +613,7 @@ TestHarness.prototype.reportResults = function(url, success, msg, skipped) { url = FilterURL(url); var test = this.getTest(url); this.clearTimeout(test); - log(success ? "PASS" : "FAIL", msg); + log((success ? "PASS" : "FAIL") + ": " + msg); this.reportFunc(TestHarness.reportType.TEST_RESULT, url, msg, success, skipped); // For each result we get, reset the timeout this.setTimeout(test);