Closed Bug 1258858 Opened 4 years ago Closed 4 years ago

"alarmsMap.get(...) is undefined" error in test_webextension.js

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: kmag, Assigned: kmag)

Details

(Whiteboard: [alarms])

Attachments

(1 file)

No description provided.
Comment on attachment 8733582 [details]
MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan

https://reviewboard.mozilla.org/r/41821/#review38377

nice, thanks!
Attachment #8733582 - Flags: review?(aswan) → review+
Comment on attachment 8733582 [details]
MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan

https://reviewboard.mozilla.org/r/41821/#review38395

::: toolkit/mozapps/extensions/test/xpcshell/test_webextension.js:172
(Diff revision 1)
>    let addon = yield promiseAddonByID(ID);
>  
>    equal(addon.name, "Web Extensiøn foo ☹");
>    equal(addon.description, "Descriptïon bar ☹ of add-on");
>  
> +  yield promiseAddonStartup(ID);

Wait, I tried this out and it seemed to have the desired effect but looking more closely, promiseAddonStartup() doesn't take an argument...
Attachment #8733582 - Flags: review+
https://reviewboard.mozilla.org/r/41821/#review38395

> Wait, I tried this out and it seemed to have the desired effect but looking more closely, promiseAddonStartup() doesn't take an argument...

Also, is there a race?  promiseAddonStartup() looks for a "startup" event on the Management object, but if that is something that comes from restarting the addon manager, it would probably be safer to start the listener and get a promise (ie call promiseAddonStartup) before restarting the manager and then yield that promise later?
https://reviewboard.mozilla.org/r/41821/#review38395

> Also, is there a race?  promiseAddonStartup() looks for a "startup" event on the Management object, but if that is something that comes from restarting the addon manager, it would probably be safer to start the listener and get a promise (ie call promiseAddonStartup) before restarting the manager and then yield that promise later?

Yeah, I copied this from a `promiseAddonByID` line and forgot to remove the argument.

And, no, I don't think there's a race. `promiseRestartManager` should always resolve before the async code from the bootstrap `startup` methods have had a chance to run, so the listener will always be added before the event is fired. If this ever turns out not to be true, then all of the other tests that depend on this will need to change as well.
Comment on attachment 8733582 [details]
MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/41821/diff/1-2/
Attachment #8733582 - Attachment description: MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r?aswan → MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan
Attachment #8733582 - Flags: review?(aswan)
Attachment #8733582 - Flags: review?(aswan) → review+
Comment on attachment 8733582 [details]
MozReview Request: Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan

https://reviewboard.mozilla.org/r/41821/#review38683
https://hg.mozilla.org/integration/fx-team/rev/ab10aef83718f44aa6d12efb95ae263b888c8dce
Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan
https://hg.mozilla.org/mozilla-central/rev/ab10aef83718
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Component: Add-ons Manager → WebExtensions
Whiteboard: [alarms]
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.