Bug 1065185 - Fix crash IPC tests. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Fri, 03 Oct 2014 10:05:49 +0200
changeset 208537 0e962be2f1262163e0e1530f238250eb5d86a1fd
parent 208536 8e64e5a4157c8622f49784e77fdefb4bb0e8a55d
child 208538 7fe212396640d6efbf8af7a2a0785f075d112964
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz
bugs1065185
milestone35.0a1
Bug 1065185 - Fix crash IPC tests. r=bz
dom/ipc/tests/test_CrashService_crash.html
dom/plugins/test/mochitest/utils.js
--- a/dom/ipc/tests/test_CrashService_crash.html
+++ b/dom/ipc/tests/test_CrashService_crash.html
@@ -50,37 +50,37 @@ SpecialPowers.pushPrefEnv({'set':[
       };
       privateNoteIntentionalCrash();
       crash();
     }, false);
 
     // Finally, poll for the new crash record.
     function tryGetCrash() {
       info("Waiting for getCrashes");
-      crashMan.getCrashes().then(function (crashes) {
+      crashMan.getCrashes().then(SpecialPowers.wrapCallback(function (crashes) {
         if (crashes.length) {
           is(crashes.length, 1, "There should be only one record");
-          var crash = SpecialPowers.wrap(crashes[0]);
+          var crash = crashes[0];
           ok(crash.isOfType(crashMan.PROCESS_TYPE_CONTENT,
                             crashMan.CRASH_TYPE_CRASH),
              "Record should be a content crash");
           ok(!!crash.id, "Record should have an ID");
           ok(!!crash.crashDate, "Record should have a crash date");
           var dateMS = crash.crashDate.valueOf();
           var twoMin = 1000 * 60 * 2;
           ok(crashDateMS - twoMin <= dateMS &&
              dateMS <= crashDateMS + twoMin,
              "Record's crash date should be nowish: " +
              "now=" + crashDateMS + " recordDate=" + dateMS);
           SimpleTest.finish();
         }
         else {
           setTimeout(tryGetCrash, 1000);
         }
-      }, function (err) {
+      }), function (err) {
         ok(false, "Error getting crashes: " + err);
         SimpleTest.finish();
       });
     }
     setTimeout(tryGetCrash, 1000);
 
   }, function () {
     ok(false, "pruneOldCrashes error");
--- a/dom/plugins/test/mochitest/utils.js
+++ b/dom/plugins/test/mochitest/utils.js
@@ -64,34 +64,34 @@ function crashAndGetCrashServiceRecord(c
     catch (e) {
       ok(true, "p." + crashMethodName + "() should throw an exception");
     }
 
     // The crash record store is written and read back asyncly, so poll for
     // the new record.
     function tryGetCrash() {
       info("Waiting for getCrashes");
-      crashMan.getCrashes().then(function (crashes) {
+      crashMan.getCrashes().then(SpecialPowers.wrapCallback(function (crashes) {
         if (crashes.length) {
           is(crashes.length, 1, "There should be only one record");
           var crash = SpecialPowers.wrap(crashes[0]);
           ok(!!crash.id, "Record should have an ID");
           ok(!!crash.crashDate, "Record should have a crash date");
           var dateMS = crash.crashDate.valueOf();
           var twoMin = 1000 * 60 * 2;
           ok(crashDateMS - twoMin <= dateMS &&
              dateMS <= crashDateMS + twoMin,
              "Record's crash date should be nowish: " +
              "now=" + crashDateMS + " recordDate=" + dateMS);
           callback(crashMan, crash);
         }
         else {
           setTimeout(tryGetCrash, 1000);
         }
-      }, function (err) {
+      }), function (err) {
         ok(false, "Error getting crashes: " + err);
         SimpleTest.finish();
       });
     }
     setTimeout(tryGetCrash, 1000);
 
   }, function () {
     ok(false, "pruneOldCrashes error");