Don't use deprecated Promise.defer in unit tests

RESOLVED FIXED in Firefox 35

Status

P1
major
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mikedeboer, Assigned: mikedeboer)

Tracking

unspecified
mozilla36
Points:
1
Bug Flags:
firefox-backlog +
in-testsuite +
qe-verify -

Firefox Tracking Flags

(firefox35 fixed, firefox36 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
Since bug 1083989 landed, our tests have become incompatible with the way Promise.jsm should be referenced.

There are two ways to fix this: load Promise.jsm explicitly in each test or convert to the `new Promise((resolve, reject) => {})` syntax.

`Promise.defer()` is now deprecated as it is incompatible with DOM Promises.
Flags: qe-verify-
Flags: needinfo?(mmucci)
Flags: firefox-backlog+
(Assignee)

Comment 1

4 years ago
Created attachment 8515925 [details] [diff] [review]
Patch v1: stop using Promise.defer in Loop mochitests
Attachment #8515925 - Flags: review?(standard8)
(Assignee)

Comment 2

4 years ago
Created attachment 8515926 [details] [diff] [review]
Patch v1: no ws
Comment on attachment 8515925 [details] [diff] [review]
Patch v1: stop using Promise.defer in Loop mochitests

Review of attachment 8515925 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, r=Standard8 with the nit addressed.

::: browser/components/loop/test/mochitest/browser_LoopContacts.js
@@ +202,5 @@
> +      Assert.ok(!err, "There shouldn't be an error");
> +      compareContacts(contact, kContacts[1]);
> +      resolve();
> +    });
> +});

nit: needs two-space indent I think
Attachment #8515925 - Flags: review?(standard8) → review+
Added to IT 36.2
Flags: needinfo?(mmucci)
https://hg.mozilla.org/mozilla-central/rev/90161c011c6c
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
status-firefox35: --- → fixed
status-firefox36: --- → fixed
Comment on attachment 8515925 [details] [diff] [review]
Patch v1: stop using Promise.defer in Loop mochitests

Approval Request Comment
Landed on aurora per IRC with lsblakk with a=loop-only
Attachment #8515925 - Flags: approval-mozilla-aurora?
Attachment #8515925 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.