Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: msix OR os == 'win' && ccov OR os != 'win' OR tsan OR asan
- This test runs only with pattern: os != 'android'
- 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 Memory Allocation Failure Test */
async function run_test() {
if (!setupTestCommon()) {
return;
}
const badAllocEnv = "MOZ_TEST_ZUCCHINI_BAD_ALLOC";
const hadBadAllocEnv = Services.env.exists(badAllocEnv);
const originalBadAllocEnv = hadBadAllocEnv
? Services.env.get(badAllocEnv)
: "";
Services.env.set(badAllocEnv, "1");
registerCleanupFunction(() => {
Services.env.set(badAllocEnv, hadBadAllocEnv ? originalBadAllocEnv : "");
});
gTestFiles = gTestFilesPartialSuccess;
gTestDirs = gTestDirsPartialSuccess;
setTestFilesAndDirsForFailure();
await setupUpdaterTest(FILE_PARTIAL_ZUCCHINI_MAR, false);
runUpdate(STATE_FAILED_BSPATCH_MEM_ERROR, false, 1, true);
checkAppBundleModTime();
await testPostUpdateProcessing();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
await waitForUpdateXMLFiles();
await checkUpdateManager(
STATE_NONE,
false,
STATE_FAILED,
BSPATCH_MEM_ERROR,
1
);
checkCallbackLog();
}