Bug 1065185 - Fix crash IPC tests. r=bz
☠☠ backed out by 5c14c63b4c1a ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Wed, 01 Oct 2014 15:25:00 +0200
changeset 208198 6871aff5d103c075f67da97d1a9f1ea3354e223f
parent 208197 cc213ad991a8e16efc44689af8d060acda9d0f10
child 208199 76e863b63dd8018fd27853c11bca34c6d5b41df4
push id27580
push userkwierso@gmail.com
push dateWed, 01 Oct 2014 23:26:55 +0000
treeherderautoland@af6c928893c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1065185
milestone35.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 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");