Files
firefox/toolkit/mozapps/update/tests/browser/browser_updatesPartialPatchApplyFailureWithCompleteValidationFailure.js
T
Robert Strong d05a99a232 Bug 1372523 - Update tests for the removal of the isSecurityUpdate, showNeverForVersion, and showPrompt attributes from nsIUpdate. r=mhowell
Converts the test functions getLocalPatchString, getLocalUpdateString, getRemotePatchString, and getRemoteUpdateString to use an object as a param.
2017-06-14 16:18:42 -07:00

34 lines
1.2 KiB
JavaScript

add_task(async function testPartialPatchApplyFailureWithCompleteValidationFailure() {
// because of the way we're simulating failure, we have to just pretend we've already
// retried.
SpecialPowers.pushPrefEnv({set: [[PREF_APP_UPDATE_DOWNLOADPROMPTMAXATTEMPTS, 0]]});
let patchProps = {type: "partial",
state: STATE_PENDING};
let patches = getLocalPatchString(patchProps);
patchProps = {size: "1234",
selected: "false"};
patches += getLocalPatchString(patchProps);
let updateProps = {isCompleteUpdate: "false"};
let updates = getLocalUpdateString(updateProps, patches);
await runUpdateProcessingTest(updates, [
{
// 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);
}
},
]);
});