Bug 1365772 - Refactor gfx blocklist tests to fail on unsupported platforms. r=kats

They currently silently pass and early-exit under several conditions, which is really confusing if you're trying to actually run them properly. They should either be marked as skipping or failing to hint to the developer that something strange is happening. It appears that skip-if simply doesn't function correctly when applied to these tests, so fail-if is used. fail-if is also useful because it forces anyone introducing a new platform to evaluate how these tests should handle it.

MozReview-Commit-ID: CPYdL242bGc

--HG--
extra : rebase_source : 243ede16d4015969a6abfd64e6071131ce5a9f2a
This commit is contained in:
Alexis Beingessner 2017-05-30 09:25:40 -04:00
Родитель 5c589ff480
Коммит d1bf902f83
17 изменённых файлов: 96 добавлений и 136 удалений

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -65,6 +62,9 @@ function run_test() {
gfxInfo.spoofDeviceID("aabb");
gfxInfo.spoofDriverVersion("5");
break;
default:
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
@ -72,6 +72,7 @@ function run_test() {
do_test_pending();
function checkBlacklist() {
var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on Darwin.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("abcd");
gfxInfo.spoofDeviceID("wxyz");
gfxInfo.spoofDriverVersion("6");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on Darwin.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on OS X.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("dcdc");
gfxInfo.spoofDeviceID("uiop");
gfxInfo.spoofDriverVersion("6");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on OS X.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "15.0", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on Darwin.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("dcdc");
gfxInfo.spoofDeviceID("uiop");
gfxInfo.spoofDriverVersion("4");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on Darwin.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on Darwin.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("dcdc");
gfxInfo.spoofDeviceID("uiop");
gfxInfo.spoofDriverVersion("5");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on Darwin.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on Darwin.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("abab");
gfxInfo.spoofDeviceID("ghjk");
gfxInfo.spoofDriverVersion("6");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on Darwin.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't support driver versions on Linux.
do_test_finished();
return;
case "Darwin":
// We don't support driver versions on Darwin.
do_test_finished();
return;
case "Android":
gfxInfo.spoofVendorID("abab");
gfxInfo.spoofDeviceID("ghjk");
gfxInfo.spoofDriverVersion("7");
break;
default:
// We don't support driver versions on Linux.
// We don't support driver versions on Darwin.
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -51,19 +48,17 @@ function run_test() {
// Windows Vista
gfxInfo.spoofOSVersion(0x60000);
break;
case "Linux":
// We don't have any OS versions on Linux, just "Linux".
do_test_finished();
return;
case "Darwin":
gfxInfo.spoofVendorID("0xabcd");
gfxInfo.spoofDeviceID("0x1234");
gfxInfo.spoofOSVersion(0x1080);
break;
case "Android":
default:
// On Android, the driver version is used as the OS version (because
// there's so many of them).
do_test_finished();
//
// We don't have any OS versions on Linux, just "Linux".
do_check_true(false);
return;
}

Просмотреть файл

@ -34,10 +34,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -52,18 +49,16 @@ function run_test() {
// Windows 8
gfxInfo.spoofOSVersion(0x60002);
break;
case "Linux":
// We don't have any OS versions on Linux, just "Linux".
do_test_finished();
return;
case "Darwin":
// Mountain Lion
gfxInfo.spoofOSVersion(0x1090);
break;
case "Android":
default:
// We don't have any OS versions on Linux, just "Linux".
//
// On Android, the driver version is used as the OS version (because
// there's so many of them).
do_test_finished();
do_check_true(false);
return;
}

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -53,17 +50,15 @@ function run_test() {
// Windows 8
gfxInfo.spoofOSVersion(0x60002);
break;
case "Linux":
// We don't have any OS versions on Linux, just "Linux".
do_test_finished();
return;
case "Darwin":
gfxInfo.spoofOSVersion(0x1080);
break;
case "Android":
default:
// We don't have any OS versions on Linux, just "Linux".
//
// On Android, the driver version is used as the OS version (because
// there's so many of them).
do_test_finished();
do_check_true(false);
return;
}

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -53,18 +50,16 @@ function run_test() {
// Windows 7
gfxInfo.spoofOSVersion(0x60001);
break;
case "Linux":
// We don't have any OS versions on Linux, just "Linux".
do_test_finished();
return;
case "Darwin":
// Lion
gfxInfo.spoofOSVersion(0x1080);
break;
case "Android":
default:
// We don't have any OS versions on Linux, just "Linux".
//
// On Android, the driver version is used as the OS version (because
// there's so many of them).
do_test_finished();
do_check_true(false);
return;
}

Просмотреть файл

@ -35,10 +35,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -65,6 +62,9 @@ function run_test() {
gfxInfo.spoofDeviceID("asdf");
gfxInfo.spoofDriverVersion("5");
break;
default:
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -34,10 +34,7 @@ function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -64,6 +61,9 @@ function run_test() {
gfxInfo.spoofDeviceID("asdf");
gfxInfo.spoofDriverVersion("5");
break;
default:
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "15.0", "8");

Просмотреть файл

@ -40,10 +40,7 @@ function run_test() {
}
// We can't do anything if we can't spoof the stuff we need.
if (!(gfxInfo instanceof Ci.nsIGfxInfoDebug)) {
do_test_finished();
return;
}
do_check_true(gfxInfo instanceof Ci.nsIGfxInfoDebug);
gfxInfo.QueryInterface(Ci.nsIGfxInfoDebug);
@ -70,6 +67,9 @@ function run_test() {
gfxInfo.spoofDeviceID("asdf");
gfxInfo.spoofDriverVersion("5");
break;
default:
do_check_true(false);
return;
}
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");

Просмотреть файл

@ -194,40 +194,61 @@ skip-if = os == "android"
[test_fuel.js]
[test_general.js]
[test_getresource.js]
# All the following failures are expected -- certain platforms don't have the
# concepts these tests check for. We fail so that if a new platform is added,
# it won't silently pass these tests without auditing.
[test_gfxBlacklist_Device.js]
fail-if = !debug
tags = blocklist
[test_gfxBlacklist_DriverNew.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_Equal_DriverNew.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_Equal_DriverOld.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_Equal_OK.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_GTE_DriverOld.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_GTE_OK.js]
fail-if = !debug || os == "mac" || os == "linux"
tags = blocklist
[test_gfxBlacklist_No_Comparison.js]
fail-if = !debug
tags = blocklist
[test_gfxBlacklist_OK.js]
fail-if = !debug
tags = blocklist
[test_gfxBlacklist_OS.js]
fail-if = !debug || os == "android" || os == "linux"
tags = blocklist
[test_gfxBlacklist_OSVersion_match.js]
fail-if = !debug || os == "android" || os == "linux"
tags = blocklist
[test_gfxBlacklist_OSVersion_mismatch_OSVersion.js]
fail-if = !debug || os == "android" || os == "linux"
tags = blocklist
[test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js]
fail-if = !debug || os == "android" || os == "linux"
tags = blocklist
[test_gfxBlacklist_Vendor.js]
fail-if = !debug
tags = blocklist
[test_gfxBlacklist_Version.js]
fail-if = !debug
tags = blocklist
[test_gfxBlacklist_prefs.js]
fail-if = !debug
# Bug 1248787 - consistently fails
skip-if = true
tags = blocklist
[test_hasbinarycomponents.js]
[test_hotfix.js]
[test_install.js]