Closed Bug 1299551 Opened 9 years ago Closed 9 years ago

Update test_webextension_install.js to wait for add-ons to finish installing

Categories

(WebExtensions :: General, defect, P5)

defect

Tracking

(firefox52 fixed)

RESOLVED FIXED
mozilla52
Iteration:
52.1 - Oct 3
Tracking Status
firefox52 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

References

Details

(Whiteboard: triaged)

Attachments

(1 file)

This is a follow-up to bug 1297752. The test in question installs a number of webextensions, but does not wait for the startup to complete before continuing through the test. It was suggested that we should add a promiseAddonStartup to the tests, although Kris also mentioned that that was a hack that we want to get rid of eventually. This bug is to address the issue, either by simply adding promiseAddonStartup to the tests, or by implementing a better solution and then updating the tests accordingly. Kris, can you comment on which approach you wanted to see taken for this?
Assignee: nobody → bob.silverberg
Priority: -- → P5
Summary: Update test_webestension_install.js to wait for add-ons to finish installing → Update test_webextension_install.js to wait for add-ons to finish installing
Whiteboard: triaged
Kris, you were going to add a comment about what you think would be a better approach for this.
Flags: needinfo?(kmaglione+bmo)
Yeah, I think we should update as many of these tests as possible to just use ExtensionTestUtils.loadExtension rather than using hacks to wait for them to finish starting up.
Flags: needinfo?(kmaglione+bmo)
I updated as many as seemed logical. There are three tests that seem to need to load files from disk that I didn't change.
Status: NEW → ASSIGNED
Iteration: --- → 52.1 - Oct 3
Comment on attachment 8792668 [details] Bug 1299551 - Update test_webextension_install.js to wait for add-ons to finish installing, https://reviewboard.mozilla.org/r/79584/#review80804 Looks great. Thanks! ::: toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js:240 (Diff revision 1) > - yield Assert.rejects(AddonManager.installTemporaryAddon(addonDir), > + yield Assert.rejects(extension.startup(), > expectedMsg, > "Install rejects when specified maxVersion is not valid"); Oh, good, I wasn't 100% sure this would work. ::: toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js:291 (Diff revision 1) > - "the-addon-sub-dir"); > + manifest: testManifest, > + useAddonManager: "temporary", > + }); > > expectedMsg = new RegExp("Add-on strict_min_max@tests.mozilla.org is not compatible with application version. " + > "add-on minVersion: 2. add-on maxVersion: 1."); Can you fix the indentation of these regexps so the second line aligns with the opening `(`? It looks like whoever originally wrote it didn't re-align after they removed the `let`.
Attachment #8792668 - Flags: review?(kmaglione+bmo) → review+
Try looks good. Requesting check in.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/4dfd7fba6157 Update test_webextension_install.js to wait for add-ons to finish installing, r=kmag
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: