mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Merge last good mozilla-central revision into tracemonkey.
This commit is contained in:
commit
19ed1e45c7
@ -44,15 +44,16 @@ relativesrcdir = content/canvas/test/webgl
|
|||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
_TEST_FILES = \
|
_TEST_FILES = \
|
||||||
test_webgl_conformance_test_suite.html \
|
test_webgl_conformance_test_suite.html \
|
||||||
00_testFIXME_list.txt \
|
00_testFIXME_list.txt \
|
||||||
failing_tests.txt \
|
failing_tests_linux.txt \
|
||||||
$(NULL)
|
failing_tests_windows.txt \
|
||||||
|
failing_tests_mac.txt \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
libs:: $(_TEST_FILES)
|
libs:: $(_TEST_FILES)
|
||||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
$(TAR) cC $(srcdir) \
|
$(TAR) cC $(srcdir) \
|
||||||
resources \
|
resources \
|
||||||
conformance \
|
conformance \
|
||||||
more \
|
| $(TAR) xC $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
| $(TAR) xC $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
conformance/canvas-test.html
|
|
||||||
conformance/constants.html
|
|
||||||
conformance/context-attributes-alpha-depth-stencil-antialias.html
|
|
||||||
conformance/context-attributes.html
|
|
||||||
conformance/context-type-test.html
|
|
||||||
conformance/gl-get-calls.html
|
|
||||||
conformance/gl-teximage.html
|
|
||||||
conformance/glsl-conformance.html
|
|
||||||
conformance/methods.html
|
|
||||||
conformance/program-test.html
|
|
||||||
conformance/read-pixels-pack-alignment.html
|
|
||||||
conformance/tex-image-and-sub-image-2d-with-video.html
|
|
||||||
conformance/tex-image-with-invalid-data.html
|
|
||||||
conformance/tex-input-validation.html
|
|
||||||
more/conformance/constants.html
|
|
||||||
more/conformance/getContext.html
|
|
||||||
more/conformance/quickCheckAPI.html
|
|
||||||
more/conformance/quickCheckAPIBadArgs.html
|
|
||||||
more/functions/bufferDataBadArgs.html
|
|
||||||
more/functions/copyTexImage2D.html
|
|
||||||
more/functions/copyTexImage2DBadArgs.html
|
|
||||||
more/functions/copyTexSubImage2D.html
|
|
||||||
more/functions/copyTexSubImage2DBadArgs.html
|
|
||||||
more/functions/deleteBufferBadArgs.html
|
|
||||||
more/functions/drawElementsBadArgs.html
|
|
||||||
more/functions/getImageData.html
|
|
||||||
more/functions/readPixelsBadArgs.html
|
|
||||||
more/functions/texImage2DBadArgs.html
|
|
||||||
more/functions/texSubImage2DBadArgs.html
|
|
||||||
more/functions/texSubImage2DHTMLBadArgs.html
|
|
||||||
more/functions/uniformiBadArgs.html
|
|
||||||
more/functions/uniformMatrixBadArgs.html
|
|
||||||
more/glsl/arrayOutOfBounds.html
|
|
10
content/canvas/test/webgl/failing_tests_linux.txt
Normal file
10
content/canvas/test/webgl/failing_tests_linux.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
conformance/context-attributes.html
|
||||||
|
conformance/gl-enum-tests.html
|
||||||
|
conformance/gl-get-active-attribute.html
|
||||||
|
conformance/gl-get-calls.html
|
||||||
|
conformance/gl-teximage.html
|
||||||
|
conformance/gl-uniform-bool.html
|
||||||
|
conformance/gl-vertexattribpointer.html
|
||||||
|
conformance/glsl-2types-of-textures-on-same-unit.html
|
||||||
|
conformance/is-object.html
|
||||||
|
conformance/uninitialized-test.html
|
9
content/canvas/test/webgl/failing_tests_mac.txt
Normal file
9
content/canvas/test/webgl/failing_tests_mac.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
conformance/canvas-test.html
|
||||||
|
conformance/canvas-test.html
|
||||||
|
conformance/context-attributes.html
|
||||||
|
conformance/gl-enum-tests.html
|
||||||
|
conformance/gl-get-calls.html
|
||||||
|
conformance/gl-object-get-calls.html
|
||||||
|
conformance/gl-teximage.html
|
||||||
|
conformance/gl-vertexattribpointer.html
|
||||||
|
conformance/texture-npot.html
|
10
content/canvas/test/webgl/failing_tests_windows.txt
Normal file
10
content/canvas/test/webgl/failing_tests_windows.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
conformance/context-attributes.html
|
||||||
|
conformance/gl-enum-tests.html
|
||||||
|
conformance/gl-get-active-attribute.html
|
||||||
|
conformance/gl-get-calls.html
|
||||||
|
conformance/gl-teximage.html
|
||||||
|
conformance/gl-uniform-bool.html
|
||||||
|
conformance/gl-vertexattribpointer.html
|
||||||
|
conformance/glsl-2types-of-textures-on-same-unit.html
|
||||||
|
conformance/is-object.html
|
||||||
|
conformance/uninitialized-test.html
|
@ -18,24 +18,24 @@ Mochitest version of the WebGL Conformance Test Suite
|
|||||||
* @param {string} url The url of the external file.
|
* @param {string} url The url of the external file.
|
||||||
* @return {string} the loaded text if the request is synchronous.
|
* @return {string} the loaded text if the request is synchronous.
|
||||||
*/
|
*/
|
||||||
var loadTextFileSynchronous = function(url) {
|
var loadTextFileSynchronous = function (url) {
|
||||||
var error = 'loadTextFileSynchronous failed to load url "' + url + '"';
|
var error = 'loadTextFileSynchronous failed to load url "' + url + '"';
|
||||||
var request;
|
var request;
|
||||||
if (window.XMLHttpRequest) {
|
if (window.XMLHttpRequest) {
|
||||||
request = new XMLHttpRequest();
|
request = new XMLHttpRequest();
|
||||||
if (request.overrideMimeType) {
|
if (request.overrideMimeType) {
|
||||||
request.overrideMimeType('text/plain');
|
request.overrideMimeType('text/plain');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw 'XMLHttpRequest is disabled';
|
||||||
}
|
}
|
||||||
} else {
|
request.open('GET', url, false);
|
||||||
throw 'XMLHttpRequest is disabled';
|
request.send(null);
|
||||||
}
|
if (request.readyState != 4) {
|
||||||
request.open('GET', url, false);
|
throw error;
|
||||||
request.send(null);
|
}
|
||||||
if (request.readyState != 4) {
|
return request.responseText;
|
||||||
throw error;
|
};
|
||||||
}
|
|
||||||
return request.responseText;
|
|
||||||
};
|
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
|
||||||
@ -55,52 +55,23 @@ function start() {
|
|||||||
return prefSvc().getBoolPref("webgl.enabled_for_all_sites");
|
return prefSvc().getBoolPref("webgl.enabled_for_all_sites");
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAnglePath(path) {
|
function setPreferGL(value) {
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
if (path == null) {
|
prefSvc().setBoolPref("webgl.prefer_gl", value);
|
||||||
try {
|
}
|
||||||
prefSvc().clearUserPref("gfx.angle.egl.path");
|
|
||||||
} catch (e) {
|
function getPreferGL() {
|
||||||
// ignore
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
}
|
var retval = false;
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
retval = prefSvc().getBoolPref("webgl.prefer_gl");
|
||||||
f.initWithPath(path);
|
} catch (ex) { }
|
||||||
prefSvc().setComplexValue("gfx.angle.egl.path", Components.interfaces.nsILocalFile, f);
|
return retval;
|
||||||
} catch (e) {
|
|
||||||
// ignore -- the path is likely not valid, e.g. trying to use a path of "C:\libs" on non-windows boxes.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAnglePath() {
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
if (prefSvc().getPrefType("gfx.angle.egl.path") == Components.interfaces.nsIPrefBranch.PREF_INVALID)
|
|
||||||
return null;
|
|
||||||
return prefSvc().getComplexValue("gfx.angle.egl.path", Components.interfaces.nsILocalFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPreferEgl() {
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
if (prefSvc().getPrefType("webgl.prefer_egl") == Components.interfaces.nsIPrefBranch.PREF_INVALID)
|
|
||||||
return null;
|
|
||||||
return prefSvc().getBoolPref("webgl.prefer_egl");
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPreferEgl(val) {
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
||||||
if (val == null) {
|
|
||||||
prefSvc().clearUserPref("webgl.prefer_egl");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
prefSvc().setBoolPref("webgl.prefer_egl", val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreOldPrefs() {
|
function restoreOldPrefs() {
|
||||||
setEnabledForAllSites(saved_enabled_for_all_sites);
|
setEnabledForAllSites(saved_enabled_for_all_sites);
|
||||||
setAnglePath(saved_angle_path);
|
setPreferGL(saved_prefer_gl);
|
||||||
setPreferEgl(saved_prefer_egl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEnv(env) {
|
function getEnv(env) {
|
||||||
@ -255,6 +226,7 @@ function start() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Reporter.prototype.startPage = function(url) {
|
Reporter.prototype.startPage = function(url) {
|
||||||
|
dump('WebGL mochitest: starting page ' + url + '\n');
|
||||||
var page = this.pagesByURL[url];
|
var page = this.pagesByURL[url];
|
||||||
this.currentPage = page;
|
this.currentPage = page;
|
||||||
statusTextNode.textContent = 'Running URL: ' + url;
|
statusTextNode.textContent = 'Running URL: ' + url;
|
||||||
@ -292,10 +264,14 @@ function start() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Reporter.prototype.completedCurrentTestSuiteRun = function() {
|
Reporter.prototype.finishedTestSuite = function() {
|
||||||
timesTestSuiteAlreadyRun++;
|
for (var i = 0; i < testsExpectedToFail.length; ++i)
|
||||||
runTestSuite();
|
if (testsSuccessful.indexOf(testsExpectedToFail[i]) != -1)
|
||||||
};
|
ok(false, 'Test expected to fail, but passed: ' + testsExpectedToFail[i]);
|
||||||
|
restoreOldPrefs();
|
||||||
|
statusTextNode.textContent = 'Finished';
|
||||||
|
SimpleTest.finish();
|
||||||
|
}
|
||||||
|
|
||||||
Reporter.prototype.reportFunc = function(type, msg, success) {
|
Reporter.prototype.reportFunc = function(type, msg, success) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -308,7 +284,7 @@ function start() {
|
|||||||
case reportType.FINISH_PAGE:
|
case reportType.FINISH_PAGE:
|
||||||
return this.finishPage(success);
|
return this.finishPage(success);
|
||||||
case reportType.FINISHED_ALL_TESTS:
|
case reportType.FINISHED_ALL_TESTS:
|
||||||
this.completedCurrentTestSuiteRun();
|
this.finishedTestSuite();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
throw 'unhandled';
|
throw 'unhandled';
|
||||||
@ -316,20 +292,16 @@ function start() {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function doRunTests() {
|
function runTestSuite() {
|
||||||
var reporter = new Reporter();
|
var reporter = new Reporter();
|
||||||
|
|
||||||
// set WebGL-related preferences needed to run WebGL tests
|
// set WebGL-related preferences needed to run WebGL tests
|
||||||
setEnabledForAllSites(true);
|
setEnabledForAllSites(true);
|
||||||
|
|
||||||
// if this wasn't specified, then set it to our expected dir for the build
|
// XXX temporary hack. Until the DirectX runtime is deployed on test slaves, we just use OpenGL,
|
||||||
// machines
|
// so that rel-eng can safely deploy DirectX runtime without getting sudden mochitest failures
|
||||||
if (!saved_angle_path) {
|
// (e.g. if there's a ANGLE bug).
|
||||||
// For windows test runners. For everyone else, it doesn't matter,
|
setPreferGL(true);
|
||||||
// we'll use ANGLE if it's installed according to the prefs.
|
|
||||||
setAnglePath("C:\\libs");
|
|
||||||
setPreferEgl(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to create a dummy WebGL context, just to catch context creation failures once here,
|
// try to create a dummy WebGL context, just to catch context creation failures once here,
|
||||||
// rather than having them result in 100's of failures (one in each test page)
|
// rather than having them result in 100's of failures (one in each test page)
|
||||||
@ -351,50 +323,68 @@ function start() {
|
|||||||
window.webglTestHarness = testHarness;
|
window.webglTestHarness = testHarness;
|
||||||
testHarness.runTests();
|
testHarness.runTests();
|
||||||
} else {
|
} else {
|
||||||
// if the webgl context is null, we agreed that we wouldn't fail the test, we only add a TODO mentioning
|
var errmsg = "Can't create a WebGL context";
|
||||||
// that the GL setup needs to be fixed in order for these tests to be actually run. The reason why we don't
|
|
||||||
// currently want to fail the test is that we want to be able to land this mochitest as soon as possible and
|
|
||||||
// just take care of the GL setups on the test machines afterwards.
|
|
||||||
var errmsg = "Disabled, because we were unable to create a WebGL context anyhow.";
|
|
||||||
reporter.fullResultsNode.textContent = errmsg;
|
reporter.fullResultsNode.textContent = errmsg;
|
||||||
todo(false, errmsg);
|
ok(false, errmsg);
|
||||||
reporter.completedCurrentTestSuiteRun();
|
dump("WebGL mochitest failed: " + errmsg + "\n");
|
||||||
|
reporter.finishedTestSuite();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function runTestSuite() {
|
|
||||||
if (timesTestSuiteAlreadyRun == 1) {
|
|
||||||
for (var i = 0; i < testsExpectedToFail.length; ++i) {
|
|
||||||
if (testsSuccessful.indexOf(testsExpectedToFail[i]) != -1) {
|
|
||||||
todo(false, 'Test expected to fail, but passed: ' + testsExpectedToFail[i]);
|
|
||||||
dump('Test expected to fail, but passed: ' + testsExpectedToFail[i] + '\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
restoreOldPrefs();
|
|
||||||
statusTextNode.textContent = 'Finished';
|
|
||||||
SimpleTest.finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
doRunTests();
|
|
||||||
};
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.requestLongerTimeout(2);
|
SimpleTest.requestLongerTimeout(2);
|
||||||
|
|
||||||
if (getEnv("MOZ_WEBGL_TEST_SUITE") == null) {
|
var kIsWindows = false;
|
||||||
// webgl test suite is disabled unless the env var is set
|
var kIsMac = false;
|
||||||
todo(false, 'WebGL test suite is disabled!');
|
var kIsLinux = false;
|
||||||
SimpleTest.finish();
|
if (navigator.platform.indexOf("Win") == 0)
|
||||||
return;
|
kIsWindows = true;
|
||||||
|
else if (navigator.platform.indexOf("Linux") == 0)
|
||||||
|
kIsLinux = true;
|
||||||
|
else if (navigator.platform.indexOf("Mac") == 0)
|
||||||
|
kIsMac = true;
|
||||||
|
|
||||||
|
// we currently disable this test on versions of Windows older than Windows Vista,
|
||||||
|
// due to failure to load ANGLE on win 2003 test slaves, see bug 582053.
|
||||||
|
if (kIsWindows) {
|
||||||
|
// code borrowed from browser/components/wintaskbar/test/browser_taskbar_preview.js
|
||||||
|
var isWinVistaOrHigher = false;
|
||||||
|
try {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
var version = Components.classes["@mozilla.org/system-info;1"]
|
||||||
|
.getService(Components.interfaces.nsIPropertyBag2)
|
||||||
|
.getProperty("version");
|
||||||
|
isWinVistaOrHigher = (parseFloat(version) >= 6.0);
|
||||||
|
} catch (ex) {}
|
||||||
|
if (!isWinVistaOrHigher) {
|
||||||
|
dump("WebGL mochitest disabled on Windows versions older than Vista");
|
||||||
|
SimpleTest.finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var timesTestSuiteAlreadyRun = 0;
|
// we currently disable this test on version of Mac OSX older than 10.6,
|
||||||
|
// due to various weird failures, including one making getRenderbufferParameter tests
|
||||||
|
// on DEPTH_STENCIL fail
|
||||||
|
if (kIsMac) {
|
||||||
|
// code borrowed from browser/components/wintaskbar/test/browser_taskbar_preview.js
|
||||||
|
var is106orHigher = false;
|
||||||
|
try {
|
||||||
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||||
|
var version = Components.classes["@mozilla.org/system-info;1"]
|
||||||
|
.getService(Components.interfaces.nsIPropertyBag2)
|
||||||
|
.getProperty("version");
|
||||||
|
is106orHigher = (parseFloat(version) >= 10.6);
|
||||||
|
} catch (ex) { }
|
||||||
|
if (!is106orHigher) {
|
||||||
|
dump("WebGL mochitest disabled on Mac OSX versions older than 10.6");
|
||||||
|
SimpleTest.finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var saved_enabled_for_all_sites = getEnabledForAllSites();
|
var saved_enabled_for_all_sites = getEnabledForAllSites();
|
||||||
var saved_angle_path = getAnglePath();
|
var saved_prefer_gl = getPreferGL();
|
||||||
var saved_prefer_egl = getPreferEgl();
|
|
||||||
|
|
||||||
var statusElem = document.getElementById("status");
|
var statusElem = document.getElementById("status");
|
||||||
var statusTextNode = document.createTextNode('');
|
var statusTextNode = document.createTextNode('');
|
||||||
@ -404,7 +394,22 @@ function start() {
|
|||||||
var expectedtofailTextNode = document.createTextNode('');
|
var expectedtofailTextNode = document.createTextNode('');
|
||||||
expectedtofailElem.appendChild(expectedtofailTextNode);
|
expectedtofailElem.appendChild(expectedtofailTextNode);
|
||||||
|
|
||||||
var testsExpectedToFail = loadTextFileSynchronous('failing_tests.txt').split('\n');
|
// Windows uses the ANGLE library for rendering. Until everything is perfect, this means a different set of
|
||||||
|
// failing tests. It's easier to do a platform check for Windows than for ANGLE itself.
|
||||||
|
// Moreover, we currently also have different tests failing on Mac and on Linux,
|
||||||
|
// presumably due to differences in the drivers.
|
||||||
|
var failingTestsFilename;
|
||||||
|
if (kIsWindows)
|
||||||
|
failingTestsFilename = 'failing_tests_windows.txt';
|
||||||
|
else if (kIsLinux)
|
||||||
|
failingTestsFilename = 'failing_tests_linux.txt';
|
||||||
|
else if (kIsMac)
|
||||||
|
failingTestsFilename = 'failing_tests_mac.txt';
|
||||||
|
|
||||||
|
var testsExpectedToFail = loadTextFileSynchronous(failingTestsFilename)
|
||||||
|
.replace(/\r/g, '') // convert to unix line breaks
|
||||||
|
.split('\n');
|
||||||
|
|
||||||
var testsSuccessful = [];
|
var testsSuccessful = [];
|
||||||
|
|
||||||
runTestSuite();
|
runTestSuite();
|
||||||
|
@ -1116,8 +1116,12 @@ class TypedArrayTemplate
|
|||||||
if (v.isInt32())
|
if (v.isInt32())
|
||||||
return NativeType(v.toInt32());
|
return NativeType(v.toInt32());
|
||||||
|
|
||||||
if (v.isDouble())
|
if (v.isDouble()) {
|
||||||
return NativeType(v.toDouble());
|
double d = v.toDouble();
|
||||||
|
if (!ArrayTypeIsFloatingPoint() && JS_UNLIKELY(JSDOUBLE_IS_NaN(d)))
|
||||||
|
return NativeType(int32(0));
|
||||||
|
return NativeType(d);
|
||||||
|
}
|
||||||
|
|
||||||
if (v.isPrimitive() && !v.isMagic()) {
|
if (v.isPrimitive() && !v.isMagic()) {
|
||||||
jsdouble dval;
|
jsdouble dval;
|
||||||
|
@ -333,6 +333,10 @@ function test()
|
|||||||
checkThrows(function() new Float32Array(null));
|
checkThrows(function() new Float32Array(null));
|
||||||
checkThrows(function() new Float32Array(undefined));
|
checkThrows(function() new Float32Array(undefined));
|
||||||
|
|
||||||
|
// check that NaN conversions happen correctly with array conversions
|
||||||
|
check(function() (new Int32Array([NaN])[0]) == 0);
|
||||||
|
check(function() { var q = new Float32Array([NaN])[0]; return q != q; });
|
||||||
|
|
||||||
print ("done");
|
print ("done");
|
||||||
|
|
||||||
reportCompare(0, TestFailCount, "typed array tests");
|
reportCompare(0, TestFailCount, "typed array tests");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user