Bug 793322 - Troubleshoot.jsm test should fail immediately instead of timing out on snapshot data validation errors. r=felipe
authorDrew Willcoxon <adw@mozilla.com>
Fri, 21 Sep 2012 15:17:35 -0700
changeset 107771 046968d6f256d9f332cd6cac7afb3c632b853c9f
parent 107770 259206b2c7b25d08ac11125c814de0ee43ea121a
child 107772 e36ba60ece12c789f2fae22546a399543afa3c02
push id23509
push userryanvm@gmail.com
push dateSat, 22 Sep 2012 12:28:38 +0000
treeherdermozilla-central@b461a7cd250e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs793322
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 793322 - Troubleshoot.jsm test should fail immediately instead of timing out on snapshot data validation errors. r=felipe
toolkit/content/tests/browser/browser_Troubleshoot.js
--- a/toolkit/content/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/content/tests/browser/browser_Troubleshoot.js
@@ -26,18 +26,23 @@ registerCleanupFunction(function () {
   // If it's not deleted, it outlives the test and is reported as a leak.
   delete window.Troubleshoot;
 });
 
 let tests = [
 
   function snapshotSchema(done) {
     Troubleshoot.snapshot(function (snapshot) {
-      validateObject(snapshot, SNAPSHOT_SCHEMA);
-      ok(true, "The snapshot should conform to the schema.");
+      try {
+        validateObject(snapshot, SNAPSHOT_SCHEMA);
+        ok(true, "The snapshot should conform to the schema.");
+      }
+      catch (err) {
+        ok(false, err);
+      }
       done();
     });
   },
 
   function modifiedPreferences(done) {
     let prefs = [
       "javascript.troubleshoot",
       "troubleshoot.foo",