Bug 1095267 - Assert the promise's timeToSettle is a number only if its state isn't 'pending'. r=fitzgen
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Sat, 03 Jun 2017 20:14:13 +0100
changeset 410508 baa5389ec6b2398ff4840fe666dba955b0d43de0
parent 410507 32bf1cf6c7a8e96c662c5fac490212071fdef6e6
child 410509 3f6e08c5233f6a98703c85b3fc0b0e833fb9696b
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1095267
milestone55.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 1095267 - Assert the promise's timeToSettle is a number only if its state isn't 'pending'. r=fitzgen
devtools/server/tests/unit/test_promises_actor_list_promises.js
--- a/devtools/server/tests/unit/test_promises_actor_list_promises.js
+++ b/devtools/server/tests/unit/test_promises_actor_list_promises.js
@@ -42,18 +42,20 @@ function* testListPromises(client, form,
   let promises = yield front.listPromises();
 
   let found = false;
   for (let p of promises) {
     equal(p.type, "object", "Expect type to be Object");
     equal(p.class, "Promise", "Expect class to be Promise");
     equal(typeof p.promiseState.creationTimestamp, "number",
       "Expect creation timestamp to be a number");
-    equal(typeof p.promiseState.timeToSettle, "number",
-      "Expect time to settle to be a number");
+    if (p.promiseState.state !== "pending") {
+      equal(typeof p.promiseState.timeToSettle, "number",
+        "Expect time to settle to be a number");
+    }
 
     if (p.promiseState.state === "fulfilled" &&
         p.promiseState.value === resolution) {
       found = true;
     }
   }
 
   ok(found, "Found our promise");