From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../update/tests/unit_service_updater/marFailurePartialSvc.js | 2 +- .../marFileInUseStageFailureCompleteSvc_win.js | 6 ++---- .../unit_service_updater/marFileInUseStageFailurePartialSvc_win.js | 6 ++---- .../unit_service_updater/marFileInUseSuccessCompleteSvc_win.js | 6 ++---- .../unit_service_updater/marFileInUseSuccessPartialSvc_win.js | 6 ++---- .../unit_service_updater/marFileLockedFailureCompleteSvc_win.js | 2 +- .../unit_service_updater/marFileLockedFailurePartialSvc_win.js | 2 +- .../marFileLockedStageFailureCompleteSvc_win.js | 2 +- .../marFileLockedStageFailurePartialSvc_win.js | 2 +- .../update/tests/unit_service_updater/marStageFailurePartialSvc.js | 2 +- .../tests/unit_service_updater/marStageSuccessCompleteSvc.js | 7 ++++--- .../update/tests/unit_service_updater/marStageSuccessPartialSvc.js | 7 ++++--- .../update/tests/unit_service_updater/marSuccessPartialSvc.js | 7 ++++--- 13 files changed, 26 insertions(+), 31 deletions(-) (limited to 'toolkit/mozapps/update/tests/unit_service_updater') diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js index de8db067bc..379fb00a27 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js @@ -10,7 +10,7 @@ async function run_test() { return; } gTestFiles = gTestFilesPartialSuccess; - gTestFiles[11].originalFile = "partial.png"; + getTestFileByName("0exe0.exe").originalFile = "partial.png"; gTestDirs = gTestDirsPartialSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_PARTIAL_MAR, false); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js index b93b023934..11181f4420 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js @@ -15,10 +15,8 @@ async function run_test() { gTestFiles = gTestFilesCompleteSuccess; gTestDirs = gTestDirsCompleteSuccess; await setupUpdaterTest(FILE_COMPLETE_MAR, false); - await runHelperFileInUse( - gTestFiles[13].relPathDir + gTestFiles[13].fileName, - false - ); + const testFile = getTestFileByName("0exe0.exe"); + await runHelperFileInUse(testFile.relPathDir + testFile.fileName, false); await stageUpdate(STATE_AFTER_STAGE, true); checkPostUpdateRunningFile(false); checkFilesAfterUpdateSuccess(getStageDirFile, true); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js index b41da12396..def7f8db9c 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js @@ -15,10 +15,8 @@ async function run_test() { gTestFiles = gTestFilesPartialSuccess; gTestDirs = gTestDirsPartialSuccess; await setupUpdaterTest(FILE_PARTIAL_MAR, false); - await runHelperFileInUse( - gTestFiles[11].relPathDir + gTestFiles[11].fileName, - false - ); + const testFile = getTestFileByName("0exe0.exe"); + await runHelperFileInUse(testFile.relPathDir + testFile.fileName, false); await stageUpdate(STATE_AFTER_STAGE, true); checkPostUpdateRunningFile(false); checkFilesAfterUpdateSuccess(getStageDirFile, true); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js index 4b946ac3e4..d1f938bb02 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js @@ -11,10 +11,8 @@ async function run_test() { gTestFiles = gTestFilesCompleteSuccess; gTestDirs = gTestDirsCompleteSuccess; await setupUpdaterTest(FILE_COMPLETE_MAR, false); - await runHelperFileInUse( - gTestFiles[13].relPathDir + gTestFiles[13].fileName, - false - ); + const testFile = getTestFileByName("0exe0.exe"); + await runHelperFileInUse(testFile.relPathDir + testFile.fileName, false); runUpdate(STATE_SUCCEEDED, false, 0, true); await waitForHelperExit(); await checkPostUpdateAppLog(); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js index 15c3a1121a..f851c543a6 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js @@ -11,10 +11,8 @@ async function run_test() { gTestFiles = gTestFilesPartialSuccess; gTestDirs = gTestDirsPartialSuccess; await setupUpdaterTest(FILE_PARTIAL_MAR, false); - await runHelperFileInUse( - gTestFiles[11].relPathDir + gTestFiles[11].fileName, - false - ); + const testFile = getTestFileByName("0exe0.exe"); + await runHelperFileInUse(testFile.relPathDir + testFile.fileName, false); runUpdate(STATE_SUCCEEDED, false, 0, true); await waitForHelperExit(); await checkPostUpdateAppLog(); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js index 698ccb7fe5..5517d5ed81 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js @@ -12,7 +12,7 @@ async function run_test() { gTestDirs = gTestDirsCompleteSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_COMPLETE_MAR, false); - await runHelperLockFile(gTestFiles[3]); + await runHelperLockFile(getTestFileByName("searchpluginspng0.png")); runUpdate(STATE_FAILED_WRITE_ERROR, false, 1, true); await waitForHelperExit(); standardInit(); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js index c8c019ec5c..03eb6122c8 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js @@ -12,7 +12,7 @@ async function run_test() { gTestDirs = gTestDirsPartialSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_PARTIAL_MAR, false); - await runHelperLockFile(gTestFiles[2]); + await runHelperLockFile(getTestFileByName("searchpluginspng1.png")); runUpdate(STATE_FAILED_READ_ERROR, false, 1, true); await waitForHelperExit(); standardInit(); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js index 7b582dbd45..4d5fe599cf 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js @@ -13,7 +13,7 @@ async function run_test() { gTestDirs = gTestDirsCompleteSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_COMPLETE_MAR, false); - await runHelperLockFile(gTestFiles[3]); + await runHelperLockFile(getTestFileByName("searchpluginspng0.png")); await stageUpdate(STATE_AFTER_STAGE, true); checkPostUpdateRunningFile(false); // Files aren't checked after staging since this test locks a file which diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js index bf3abd8c37..3d4a8e0c51 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js @@ -13,7 +13,7 @@ async function run_test() { gTestDirs = gTestDirsPartialSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_PARTIAL_MAR, false); - await runHelperLockFile(gTestFiles[2]); + await runHelperLockFile(getTestFileByName("searchpluginspng1.png")); await stageUpdate(STATE_AFTER_STAGE, true); checkPostUpdateRunningFile(false); // Files aren't checked after staging since this test locks a file which diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js index a1a0de0fe4..47c184e67b 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js @@ -11,7 +11,7 @@ async function run_test() { } const STATE_AFTER_STAGE = STATE_FAILED; gTestFiles = gTestFilesPartialSuccess; - gTestFiles[11].originalFile = "partial.png"; + getTestFileByName("0exe0.exe").originalFile = "partial.png"; gTestDirs = gTestDirsPartialSuccess; setTestFilesAndDirsForFailure(); await setupUpdaterTest(FILE_PARTIAL_MAR, false); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js index 943a45ba95..2c9c3298d4 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js @@ -11,9 +11,10 @@ async function run_test() { } const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED; gTestFiles = gTestFilesCompleteSuccess; - gTestFiles[gTestFiles.length - 1].originalContents = null; - gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n"; - gTestFiles[gTestFiles.length - 1].comparePerms = 0o644; + const channelPrefs = getTestFileByName(FILE_CHANNEL_PREFS); + channelPrefs.originalContents = null; + channelPrefs.compareContents = "FromComplete\n"; + channelPrefs.comparePerms = 0o644; gTestDirs = gTestDirsCompleteSuccess; setupSymLinks(); await setupUpdaterTest(FILE_COMPLETE_MAR, false); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js index dd5c240919..e565ffe550 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js @@ -11,9 +11,10 @@ async function run_test() { } const STATE_AFTER_STAGE = gIsServiceTest ? STATE_APPLIED_SVC : STATE_APPLIED; gTestFiles = gTestFilesPartialSuccess; - gTestFiles[gTestFiles.length - 1].originalContents = null; - gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n"; - gTestFiles[gTestFiles.length - 1].comparePerms = 0o644; + const channelPrefs = getTestFileByName(FILE_CHANNEL_PREFS); + channelPrefs.originalContents = null; + channelPrefs.compareContents = "FromPartial\n"; + channelPrefs.comparePerms = 0o644; gTestDirs = gTestDirsPartialSuccess; preventDistributionFiles(); await setupUpdaterTest(FILE_PARTIAL_MAR, true); diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js index 8e8e9d094a..f4f856278c 100644 --- a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js +++ b/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js @@ -10,9 +10,10 @@ async function run_test() { return; } gTestFiles = gTestFilesPartialSuccess; - gTestFiles[gTestFiles.length - 1].originalContents = null; - gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n"; - gTestFiles[gTestFiles.length - 1].comparePerms = 0o644; + const channelPrefs = getTestFileByName(FILE_CHANNEL_PREFS); + channelPrefs.originalContents = null; + channelPrefs.compareContents = "FromPartial\n"; + channelPrefs.comparePerms = 0o644; gTestDirs = gTestDirsPartialSuccess; // The third parameter will test that a relative path that contains a // directory traversal to the post update binary doesn't execute. -- cgit v1.2.3