tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 585b43268ba2e04303e84ce446adcf7a42867b78
parent a381c04b4eb8db653c6eac708e673e91ff2aee03
Author: Johannes Schmidt <joschmidt@mozilla.com>
Date:   Thu, 16 Oct 2025 17:11:37 +0000

Bug 1993218 - fix rust mirror csv import test - r=dimi

Differential Revision: https://phabricator.services.mozilla.com/D268855

Diffstat:
Mtoolkit/components/passwordmgr/test/browser/browser_rust_mirror.js | 20++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/toolkit/components/passwordmgr/test/browser/browser_rust_mirror.js b/toolkit/components/passwordmgr/test/browser/browser_rust_mirror.js @@ -116,14 +116,22 @@ add_task(async function test_mirror_removeLogin() { */ add_task(async function test_mirror_csv_import_add() { await SpecialPowers.pushPrefEnv({ - set: [["signon.rustMirror.enabled", true]], + set: [ + ["signon.rustMirror.enabled", true], + ["signon.rustMirror.migrationNeeded", true], + ], }); let csvFile = await LoginTestUtils.file.setupCsvFileWithLines([ "url,username,password,httpRealm,formActionOrigin,guid,timeCreated,timeLastUsed,timePasswordChanged", `https://example.com,joe@example.com,qwerty,My realm,,{5ec0d12f-e194-4279-ae1b-d7d281bb46f0},1589617814635,1589710449871,1589617846802`, ]); + const prefChangePromise = TestUtils.waitForPrefChange( + "signon.rustMirror.migrationNeeded" + ); await LoginCSVImport.importFromCSV(csvFile.path); + // wait for the mirror to complete + await prefChangePromise; // note LoginManagerRustStorage is a singleton and already initialized when // Services.logins gets initialized. @@ -143,7 +151,10 @@ add_task(async function test_mirror_csv_import_add() { */ add_task(async function test_mirror_csv_import_modify() { await SpecialPowers.pushPrefEnv({ - set: [["signon.rustMirror.enabled", true]], + set: [ + ["signon.rustMirror.enabled", true], + ["signon.rustMirror.migrationNeeded", true], + ], }); // create a login @@ -153,12 +164,17 @@ add_task(async function test_mirror_csv_import_modify() { password: "password", }); const login = await Services.logins.addLoginAsync(loginInfo); + const prefChangePromise = TestUtils.waitForPrefChange( + "signon.rustMirror.migrationNeeded" + ); // and import it, so we update let csvFile = await LoginTestUtils.file.setupCsvFileWithLines([ "url,username,password,httpRealm,formActionOrigin,guid,timeCreated,timeLastUsed,timePasswordChanged", `https://example.com,username,qwerty,My realm,,${login.guid},1589617814635,1589710449871,1589617846802`, ]); await LoginCSVImport.importFromCSV(csvFile.path); + // wait for the mirror to complete + await prefChangePromise; // note LoginManagerRustStorage is a singleton and already initialized when // Services.logins gets initialized.