Bug 1365772 - Refactor gfx blocklist tests to fail on unsupported platforms. r?kats draft
authorAlexis Beingessner <a.beingessner@gmail.com>
Tue, 30 May 2017 09:25:40 -0400
changeset 596750 7c88ebc77b56b7cdd2ac14f5dd9640f4adf0b831
parent 596749 60002d19bab68b6857c92ff1fc838f49f0b3217b
child 634064 921db901f4dce8cb7e00752ae5dd880d6ddf5a23
push id64750
push userbmo:a.beingessner@gmail.com
push dateMon, 19 Jun 2017 19:05:50 +0000
reviewerskats
bugs1365772
milestone56.0a1
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
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
@@ -30,20 +30,17 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x9876");
@@ -60,23 +57,27 @@ function run_test() {
       gfxInfo.spoofDeviceID("0x9876");
       gfxInfo.spoofOSVersion(0x1090);
       break;
     case "Android":
       gfxInfo.spoofVendorID("abcd");
       gfxInfo.spoofDeviceID("aabb");
       gfxInfo.spoofDriverVersion("5");
       break;
+    default:
+      do_check_true(false);
+      return;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
+
   function checkBlacklist() {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
     do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);
 
     status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT3D_9_LAYERS);
     do_check_eq(status, Ci.nsIGfxInfo.FEATURE_STATUS_OK);
 
     status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_CANVAS2D_ACCELERATION);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.2202");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xdcdc");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.1112");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xdcdc");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.1110");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xdcdc");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.1111");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabab");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.2201");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
@@ -30,45 +30,39 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabab");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.2202");
       // 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");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
@@ -30,20 +30,17 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   gfxInfo.spoofVendorID("0xabcd");
   gfxInfo.spoofDeviceID("0x6666");
 
   // Spoof the OS version so it matches the test file.
   switch (get_platform()) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
@@ -30,20 +30,17 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x1234");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
@@ -30,45 +30,40 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofDriverVersion("8.52.322.2201");
       // 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;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
@@ -29,46 +29,41 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   gfxInfo.spoofDriverVersion("8.52.322.2201");
   gfxInfo.spoofVendorID("0xabcd");
   gfxInfo.spoofDeviceID("0x1234");
 
   // Spoof the version of the OS appropriately to test the test file.
   switch (get_platform()) {
     case "WINNT":
       // 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;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
@@ -30,45 +30,40 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   gfxInfo.spoofDriverVersion("8.52.322.2202");
   gfxInfo.spoofVendorID("0xabcd");
   gfxInfo.spoofDeviceID("0x1234");
 
   // Spoof the version of the OS appropriately to test the test file.
   switch (get_platform()) {
     case "WINNT":
       // 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;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
@@ -30,46 +30,41 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   gfxInfo.spoofDriverVersion("8.52.322.2201");
   gfxInfo.spoofVendorID("0xabcd");
   gfxInfo.spoofDeviceID("0x1234");
 
   // Spoof the version of the OS appropriately to test the test file.
   switch (get_platform()) {
     case "WINNT":
       // 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;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
@@ -30,20 +30,17 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xdcba");
       gfxInfo.spoofDeviceID("0x1234");
@@ -60,16 +57,19 @@ function run_test() {
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofOSVersion(0x1090);
       break;
     case "Android":
       gfxInfo.spoofVendorID("dcba");
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
+    default:
+      do_check_true(false);
+      return;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
@@ -29,20 +29,17 @@ function load_blocklist(file) {
   blocklist.notify(null);
 }
 
 // Performs the initial setup
 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x1234");
@@ -59,16 +56,19 @@ function run_test() {
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofOSVersion(0x1090);
       break;
     case "Android":
       gfxInfo.spoofVendorID("abcd");
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
+    default:
+      do_check_true(false);
+      return;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "15.0", "8");
   startupManager();
 
   do_test_pending();
 
   function checkBlacklist() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
@@ -35,20 +35,17 @@ function run_test() {
   try {
     var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
   } catch (e) {
     do_test_finished();
     return;
   }
 
   // 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);
 
   // Set the vendor/device ID, etc, to match the test file.
   switch (get_platform()) {
     case "WINNT":
       gfxInfo.spoofVendorID("0xabcd");
       gfxInfo.spoofDeviceID("0x1234");
@@ -65,16 +62,19 @@ function run_test() {
       gfxInfo.spoofDeviceID("0x1234");
       gfxInfo.spoofOSVersion(0x1090);
       break;
     case "Android":
       gfxInfo.spoofVendorID("abcd");
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
+    default:
+      do_check_true(false);
+      return;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
   do_test_pending();
 
   function blacklistAdded(aSubject, aTopic, aData) {
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
@@ -189,50 +189,71 @@ skip-if = os == "android"
 [test_error.js]
 [test_experiment.js]
 [test_filepointer.js]
 # Bug 676992: test consistently hangs on Android
 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]
 [test_install_icons.js]
 # Bug 676992: test consistently hangs on Android
 skip-if = os == "android"
 [test_install_strictcompat.js]
 # Bug 676992: test consistently hangs on Android