Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
-
CI results over the last 21 days131Runs100%Pass0Failures0Timeouts0Crashes36Skips
Scheduled runs skipped per day (up to 22.6%) Oct 18Nov 7 - This test gets skipped with pattern: msix
- This test runs only with pattern: (os != 'android') && (os == 'win')
- Manifest: toolkit/mozapps/update/tests/unit_update_binary/xpcshell_base.toml
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
*/
/* Zucchini Partial MAR File Patch Apply In-Page Error Test */
async function run_test() {
if (!setupTestCommon()) {
return;
}
const pageErrorEnv = "MOZ_TEST_ZUCCHINI_WRITE_PAGE_ERROR";
const hadPageErrorEnv = Services.env.exists(pageErrorEnv);
const originalPageErrorEnv = hadPageErrorEnv
? Services.env.get(pageErrorEnv)
: "";
Services.env.set(pageErrorEnv, "1");
registerCleanupFunction(() => {
Services.env.set(pageErrorEnv, hadPageErrorEnv ? originalPageErrorEnv : "");
});
gTestFiles = gTestFilesPartialSuccess;
gTestDirs = gTestDirsPartialSuccess;
setTestFilesAndDirsForFailure();
await setupUpdaterTest(FILE_PARTIAL_ZUCCHINI_MAR, false);
runUpdate(
STATE_FAILED_UNEXPECTED_BSPATCH_ERROR,
false,
USE_EXECV ? 0 : 1,
true
);
checkAppBundleModTime();
await testPostUpdateProcessing();
checkPostUpdateRunningFile(false);
checkUpdateLogContains(
"EXCEPTION_IN_PAGE_ERROR while writing to mapped files"
);
// kStatusDiskFull
checkUpdateLogContains(
"FromZucchiniStatus: encountered zucchini error 8, converting to updater " +
"error " +
UNEXPECTED_BSPATCH_ERROR
);
// Recovering from the in-page error must release the mapped draft, otherwise
// the updater can neither remove it nor move it out of the way.
checkUpdateLogContains(
"draft_discard: discarding draft file: searchplugins/searchpluginspng1.png" +
".moz-draft"
);
Assert.ok(
!getLogFileContents().includes("draft_discard: unable to remove"),
"the updater should be able to remove the draft"
);
checkFilesAfterUpdateFailure(getApplyDirFile);
await waitForUpdateXMLFiles();
await checkUpdateManager(
STATE_NONE,
false,
STATE_FAILED,
UNEXPECTED_BSPATCH_ERROR,
1
);
checkCallbackLog();
}