mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 18:51:48 -10:00
Since we now have a store of notifications that is global across all windows, it no longer makes sense to consume the API from within browser.js. This patch moves the browser.js logic out into a jsm file that is wired up through nsBrowserGlue, such that it will be lazily instantiated on the first update event it would receive[1]. We decided to move this into toolkit, as this piece of the system is fairly generic and shouldn't differ between applications. [1]: There is a change to nsBrowserGlue to use "global[module]" instead of this[module]. This mirrors the code for all the other types of notifications, and I suspect it was just a latent bug, since the original diff that includes this line makes no use of it. MozReview-Commit-ID: 8EQdM9BOpgl
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
add_task(async function testPartialPatchWithBadPartialSize() {
|
|
SpecialPowers.pushPrefEnv({set: [[PREF_APP_UPDATE_DOWNLOADPROMPTMAXATTEMPTS, 2]]});
|
|
let updateParams = "partialPatchOnly=1&invalidPartialSize=1";
|
|
|
|
await runUpdateTest(updateParams, 1, [
|
|
{
|
|
// if we fail maxBackgroundErrors download attempts, then we want to
|
|
// first show the user an update available prompt.
|
|
notificationId: "update-available",
|
|
button: "button"
|
|
},
|
|
{
|
|
notificationId: "update-available",
|
|
button: "button"
|
|
},
|
|
{
|
|
// if we have only an invalid patch, then something's wrong and we don't
|
|
// have an automatic way to fix it, so show the manual update
|
|
// doorhanger.
|
|
notificationId: "update-manual",
|
|
button: "button",
|
|
beforeClick() {
|
|
checkWhatsNewLink("update-manual-whats-new");
|
|
},
|
|
async cleanup() {
|
|
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
|
is(gBrowser.selectedBrowser.currentURI.spec,
|
|
URL_MANUAL_UPDATE, "Landed on manual update page.")
|
|
gBrowser.removeTab(gBrowser.selectedTab);
|
|
}
|
|
},
|
|
]);
|
|
});
|