Bug 1095267 - Assert the promise's timeToSettle is a number only if its state isn't 'pending'. r=fitzgen

--HG--
extra : rebase_source : 226bc42d409c63c0ff8a0e8f7c560a6fca699ef6
This commit is contained in:
Marco Castelluccio 2017-06-03 20:14:13 +01:00
parent f3414f6c10
commit d66a91a2b0

View File

@ -47,8 +47,10 @@ function* testListPromises(client, form, makePromise) {
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) {