Skip to content

Commit c88f0ab

Browse files
author
Sandor Molnar
committed
Backed out 16 changesets (bug 1824112) for causing mochitest failures in toolkit/components/passwordmgr/test/mochitest/test_autocomplete_tab_between_fields.html CLOSED TREE
Backed out changeset 6830c9a5d1ce (bug 1824112) Backed out changeset ebfc28fdb638 (bug 1824112) Backed out changeset ae112f47fdf1 (bug 1824112) Backed out changeset 7295fad178a2 (bug 1824112) Backed out changeset 3074e99ee5a0 (bug 1824112) Backed out changeset a821ff170e11 (bug 1824112) Backed out changeset 7bfa8564a6b5 (bug 1824112) Backed out changeset ce59496fc86f (bug 1824112) Backed out changeset e3f3d730e9fa (bug 1824112) Backed out changeset b2f3bcc9bf07 (bug 1824112) Backed out changeset 03447a1935df (bug 1824112) Backed out changeset fc82a197b868 (bug 1824112) Backed out changeset 406121a380d9 (bug 1824112) Backed out changeset 196bb8eb2cc0 (bug 1824112) Backed out changeset 0948d06a3c2c (bug 1824112) Backed out changeset bc994ffb1614 (bug 1824112)
1 parent 9574f88 commit c88f0ab

File tree

99 files changed

+2979
-2607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2979
-2607
lines changed

browser/components/aboutlogins/tests/browser/browser_loginItemErrors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ add_task(async function test_showLoginItemErrors() {
2121
"user2",
2222
"pass2"
2323
);
24-
LOGIN_TO_UPDATE = await Services.logins.addLoginAsync(LOGIN_TO_UPDATE);
24+
LOGIN_TO_UPDATE = Services.logins.addLogin(LOGIN_TO_UPDATE);
2525
EXPECTED_ERROR_MESSAGE = "This login already exists.";
2626
const LOGIN_UPDATES = {
2727
origin: "https://example.com",

browser/components/aboutlogins/tests/browser/browser_openFiltered.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ add_setup(async function() {
66
"passwordmgr-storage-changed",
77
(_, data) => data == "addLogin"
88
);
9-
TEST_LOGIN1 = await Services.logins.addLoginAsync(TEST_LOGIN1);
9+
TEST_LOGIN1 = Services.logins.addLogin(TEST_LOGIN1);
1010
await storageChangedPromised;
1111
storageChangedPromised = TestUtils.topicObserved(
1212
"passwordmgr-storage-changed",
1313
(_, data) => data == "addLogin"
1414
);
15-
TEST_LOGIN2 = await Services.logins.addLoginAsync(TEST_LOGIN2);
15+
TEST_LOGIN2 = Services.logins.addLogin(TEST_LOGIN2);
1616
await storageChangedPromised;
1717
let tabOpenedPromise = BrowserTestUtils.waitForNewTab(
1818
gBrowser,

browser/components/aboutlogins/tests/browser/head.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ let TEST_LOGIN3 = new nsLoginInfo(
5454
TEST_LOGIN3.QueryInterface(Ci.nsILoginMetaInfo).timePasswordChanged = 123456;
5555

5656
async function addLogin(login) {
57-
const result = await Services.logins.addLoginAsync(login);
57+
let storageChangedPromised = TestUtils.topicObserved(
58+
"passwordmgr-storage-changed",
59+
(_, data) => data == "addLogin"
60+
);
61+
login = Services.logins.addLogin(login);
62+
await storageChangedPromised;
5863
registerCleanupFunction(() => {
5964
let matchData = Cc["@mozilla.org/hash-property-bag;1"].createInstance(
6065
Ci.nsIWritablePropertyBag2
6166
);
62-
matchData.setPropertyAsAUTF8String("guid", result.guid);
67+
matchData.setPropertyAsAUTF8String("guid", login.guid);
6368

6469
let logins = Services.logins.searchLogins(matchData);
6570
if (!logins.length) {
@@ -71,7 +76,7 @@ async function addLogin(login) {
7176
// matches the login that it will be removing.
7277
Services.logins.removeLogin(logins[0]);
7378
});
74-
return result;
79+
return login;
7580
}
7681

7782
let EXPECTED_BREACH = null;

browser/components/aboutlogins/tests/unit/test_getPotentialBreachesByLoginGUID.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const LOGIN_WITH_NON_STANDARD_URI = LoginTestUtils.testData.formLogin({
110110
});
111111

112112
add_task(async function test_notBreachedLogin() {
113-
await Services.logins.addLoginAsync(NOT_BREACHED_LOGIN);
113+
Services.logins.addLogin(NOT_BREACHED_LOGIN);
114114
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
115115
[NOT_BREACHED_LOGIN],
116116
TEST_BREACHES
@@ -123,7 +123,7 @@ add_task(async function test_notBreachedLogin() {
123123
});
124124

125125
add_task(async function test_breachedLogin() {
126-
await Services.logins.addLoginAsync(BREACHED_LOGIN);
126+
Services.logins.addLogin(BREACHED_LOGIN);
127127
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
128128
[NOT_BREACHED_LOGIN, BREACHED_LOGIN],
129129
TEST_BREACHES
@@ -141,7 +141,7 @@ add_task(async function test_breachedLogin() {
141141
});
142142

143143
add_task(async function test_breachedLoginAfterCrashingUriLogin() {
144-
await Services.logins.addLoginAsync(CRASHING_URI_LOGIN);
144+
Services.logins.addLogin(CRASHING_URI_LOGIN);
145145

146146
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
147147
[CRASHING_URI_LOGIN, BREACHED_LOGIN],
@@ -160,7 +160,7 @@ add_task(async function test_breachedLoginAfterCrashingUriLogin() {
160160
});
161161

162162
add_task(async function test_notBreachedSubdomain() {
163-
await Services.logins.addLoginAsync(NOT_BREACHED_SUBDOMAIN_LOGIN);
163+
Services.logins.addLogin(NOT_BREACHED_SUBDOMAIN_LOGIN);
164164

165165
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
166166
[NOT_BREACHED_LOGIN, NOT_BREACHED_SUBDOMAIN_LOGIN],
@@ -174,7 +174,7 @@ add_task(async function test_notBreachedSubdomain() {
174174
});
175175

176176
add_task(async function test_breachedSubdomain() {
177-
await Services.logins.addLoginAsync(BREACHED_SUBDOMAIN_LOGIN);
177+
Services.logins.addLogin(BREACHED_SUBDOMAIN_LOGIN);
178178

179179
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
180180
[NOT_BREACHED_SUBDOMAIN_LOGIN, BREACHED_SUBDOMAIN_LOGIN],
@@ -188,9 +188,7 @@ add_task(async function test_breachedSubdomain() {
188188
});
189189

190190
add_task(async function test_breachedSiteWithoutPasswords() {
191-
await Services.logins.addLoginAsync(
192-
LOGIN_FOR_BREACHED_SITE_WITHOUT_PASSWORDS
193-
);
191+
Services.logins.addLogin(LOGIN_FOR_BREACHED_SITE_WITHOUT_PASSWORDS);
194192

195193
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
196194
[LOGIN_FOR_BREACHED_SITE_WITHOUT_PASSWORDS],
@@ -254,7 +252,7 @@ add_task(async function test_newBreachAfterDismissal() {
254252
});
255253

256254
add_task(async function test_ExceptionsThrownByNonStandardURIsAreCaught() {
257-
await Services.logins.addLoginAsync(LOGIN_WITH_NON_STANDARD_URI);
255+
Services.logins.addLogin(LOGIN_WITH_NON_STANDARD_URI);
258256

259257
const breachesByLoginGUID = await LoginBreaches.getPotentialBreachesByLoginGUID(
260258
[LOGIN_WITH_NON_STANDARD_URI, BREACHED_LOGIN],

browser/components/extensions/test/xpcshell/test_ext_browsingData_passwords.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ const NEW_HOST = "http://mozilla.com";
1010
const FXA_HOST = "chrome://FirefoxAccounts";
1111

1212
function checkLoginExists(host, shouldExist) {
13-
const logins = Services.logins.findLogins(host, "", null);
13+
let logins = Services.logins.findLogins(host, "", null);
1414
equal(
1515
logins.length,
1616
shouldExist ? 1 : 0,
1717
`Login was ${shouldExist ? "" : "not "} found.`
1818
);
1919
}
2020

21-
async function addLogin(host, timestamp) {
21+
function addLogin(host, timestamp) {
2222
checkLoginExists(host, false);
2323
let login = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(
2424
Ci.nsILoginInfo
2525
);
2626
login.init(host, "", null, LOGIN_USERNAME, LOGIN_PASSWORD);
2727
login.QueryInterface(Ci.nsILoginMetaInfo);
2828
login.timePasswordChanged = timestamp;
29-
await Services.logins.addLoginAsync(login);
29+
Services.logins.addLogin(login);
3030
checkLoginExists(host, true);
3131
}
3232

3333
async function setupPasswords() {
3434
Services.logins.removeAllUserFacingLogins();
35-
await addLogin(FXA_HOST, REFERENCE_DATE);
36-
await addLogin(NEW_HOST, REFERENCE_DATE);
37-
await addLogin(OLD_HOST, REFERENCE_DATE - 10000);
35+
addLogin(FXA_HOST, REFERENCE_DATE);
36+
addLogin(NEW_HOST, REFERENCE_DATE);
37+
addLogin(OLD_HOST, REFERENCE_DATE - 10000);
3838
}
3939

4040
add_task(async function testPasswords() {
@@ -49,7 +49,7 @@ add_task(async function testPasswords() {
4949
});
5050
}
5151

52-
const extension = ExtensionTestUtils.loadExtension({
52+
let extension = ExtensionTestUtils.loadExtension({
5353
background,
5454
manifest: {
5555
permissions: ["browsingData"],

browser/components/migration/tests/marionette/test_refresh_firefox.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ class TestFirefoxRefresh(MarionetteTestCase):
4040
_expectedURLs = ["about:robots", "about:mozilla"]
4141

4242
def savePassword(self):
43-
self.runAsyncCode(
43+
self.runCode(
4444
"""
45-
let [username, password, resolve] = arguments;
4645
let myLogin = new global.LoginInfo(
4746
"test.marionette.mozilla.com",
4847
"http://test.marionette.mozilla.com/some/form/",
4948
null,
50-
username,
51-
password,
49+
arguments[0],
50+
arguments[1],
5251
"username",
5352
"password"
5453
);
55-
Services.logins.addLoginAsync(myLogin)
56-
.then(() => resolve(false), resolve);
54+
Services.logins.addLogin(myLogin)
5755
""",
5856
script_args=(self._username, self._password),
5957
)

browser/components/migration/tests/unit/test_Chrome_passwords.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ var loginCrypto;
104104
var dbConn;
105105

106106
async function promiseSetPassword(login) {
107-
const encryptedString = await loginCrypto.encryptData(
107+
let encryptedString = await loginCrypto.encryptData(
108108
login.password,
109109
login.version
110110
);
111111
info(`promiseSetPassword: ${encryptedString}`);
112-
const passwordValue = new Uint8Array(
112+
let passwordValue = new Uint8Array(
113113
loginCrypto.stringToArray(encryptedString)
114114
);
115115
return dbConn.execute(
@@ -177,7 +177,7 @@ function checkLoginsAreEqual(passwordManagerLogin, chromeLogin, id) {
177177
}
178178

179179
function generateDifferentLogin(login) {
180-
const newLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(
180+
let newLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(
181181
Ci.nsILoginInfo
182182
);
183183

@@ -206,13 +206,13 @@ add_task(async function setup() {
206206
// would block the test from finishing if Chrome has already created a matching
207207
// Keychain entry. This allows us to still exercise the keychain lookup code.
208208
// The mock encryption passphrase is used when the Keychain item isn't found.
209-
const mockMacOSKeychain = {
209+
let mockMacOSKeychain = {
210210
passphrase: "bW96aWxsYWZpcmVmb3g=",
211211
serviceName: "TESTING Chrome Safe Storage",
212212
accountName: "TESTING Chrome",
213213
};
214214
if (AppConstants.platform == "macosx") {
215-
const { ChromeMacOSLoginCrypto } = ChromeUtils.importESModule(
215+
let { ChromeMacOSLoginCrypto } = ChromeUtils.importESModule(
216216
"resource:///modules/ChromeMacOSLoginCrypto.sys.mjs"
217217
);
218218
loginCrypto = new ChromeMacOSLoginCrypto(
@@ -230,7 +230,7 @@ add_task(async function setup() {
230230
"Login Data",
231231
];
232232
} else if (AppConstants.platform == "win") {
233-
const { ChromeWindowsLoginCrypto } = ChromeUtils.importESModule(
233+
let { ChromeWindowsLoginCrypto } = ChromeUtils.importESModule(
234234
"resource:///modules/ChromeWindowsLoginCrypto.sys.mjs"
235235
);
236236
loginCrypto = new ChromeWindowsLoginCrypto("Chrome");
@@ -246,18 +246,18 @@ add_task(async function setup() {
246246
} else {
247247
throw new Error("Not implemented");
248248
}
249-
const dirSvcFile = do_get_file(dirSvcPath);
249+
let dirSvcFile = do_get_file(dirSvcPath);
250250
registerFakePath(pathId, dirSvcFile);
251251

252252
info(PathUtils.join(dirSvcFile.path, ...profilePathSegments));
253-
const loginDataFilePath = PathUtils.join(
253+
let loginDataFilePath = PathUtils.join(
254254
dirSvcFile.path,
255255
...profilePathSegments
256256
);
257257
dbConn = await Sqlite.openConnection({ path: loginDataFilePath });
258258

259259
if (AppConstants.platform == "macosx") {
260-
const migrator = await MigrationUtils.getMigrator("chrome");
260+
let migrator = await MigrationUtils.getMigrator("chrome");
261261
Object.assign(migrator, {
262262
_keychainServiceName: mockMacOSKeychain.serviceName,
263263
_keychainAccountName: mockMacOSKeychain.accountName,
@@ -275,11 +275,11 @@ add_task(async function setup() {
275275
});
276276

277277
add_task(async function test_importIntoEmptyDB() {
278-
for (const login of TEST_LOGINS) {
278+
for (let login of TEST_LOGINS) {
279279
await promiseSetPassword(login);
280280
}
281281

282-
const migrator = await MigrationUtils.getMigrator("chrome");
282+
let migrator = await MigrationUtils.getMigrator("chrome");
283283
Assert.ok(
284284
await migrator.isSourceAvailable(),
285285
"Sanity check the source exists"
@@ -315,7 +315,7 @@ add_task(async function test_importIntoEmptyDB() {
315315

316316
// Test that existing logins for the same primary key don't get overwritten
317317
add_task(async function test_importExistingLogins() {
318-
const migrator = await MigrationUtils.getMigrator("chrome");
318+
let migrator = await MigrationUtils.getMigrator("chrome");
319319
Assert.ok(
320320
await migrator.isSourceAvailable(),
321321
"Sanity check the source exists"
@@ -329,7 +329,7 @@ add_task(async function test_importExistingLogins() {
329329
"There are no logins after removing all of them"
330330
);
331331

332-
const newLogins = [];
332+
let newLogins = [];
333333

334334
// Create 3 new logins that are different but where the key properties are still the same.
335335
for (let i = 0; i < 3; i++) {

browser/components/protections/test/browser/browser_protections_lockwise.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const { AboutProtectionsParent } = ChromeUtils.importESModule(
1212
const ABOUT_LOGINS_URL = "about:logins";
1313

1414
add_task(async function testNoLoginsLockwiseCardUI() {
15-
const tab = await BrowserTestUtils.openNewForegroundTab({
15+
let tab = await BrowserTestUtils.openNewForegroundTab({
1616
url: "about:protections",
1717
gBrowser,
1818
});
19-
const aboutLoginsPromise = BrowserTestUtils.waitForNewTab(
19+
let aboutLoginsPromise = BrowserTestUtils.waitForNewTab(
2020
gBrowser,
2121
ABOUT_LOGINS_URL
2222
);
@@ -76,26 +76,26 @@ add_task(async function testNoLoginsLockwiseCardUI() {
7676
);
7777
savePasswordsButton.click();
7878
});
79-
const loginsTab = await aboutLoginsPromise;
79+
let loginsTab = await aboutLoginsPromise;
8080
info("about:logins was successfully opened in a new tab");
8181
gBrowser.removeTab(loginsTab);
8282
gBrowser.removeTab(tab);
8383
});
8484

8585
add_task(async function testLockwiseCardUIWithLogins() {
86-
const tab = await BrowserTestUtils.openNewForegroundTab({
86+
let tab = await BrowserTestUtils.openNewForegroundTab({
8787
url: "about:protections",
8888
gBrowser,
8989
});
90-
const aboutLoginsPromise = BrowserTestUtils.waitForNewTab(
90+
let aboutLoginsPromise = BrowserTestUtils.waitForNewTab(
9191
gBrowser,
9292
ABOUT_LOGINS_URL
9393
);
9494

9595
info(
9696
"Add a login and check that lockwise card content for a logged in user is displayed correctly"
9797
);
98-
await Services.logins.addLoginAsync(TEST_LOGIN1);
98+
Services.logins.addLogin(TEST_LOGIN1);
9999
await BrowserTestUtils.reloadTab(tab);
100100

101101
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
@@ -172,14 +172,14 @@ add_task(async function testLockwiseCardUIWithLogins() {
172172
);
173173
managePasswordsButton.click();
174174
});
175-
const loginsTab = await aboutLoginsPromise;
175+
let loginsTab = await aboutLoginsPromise;
176176
info("about:logins was successfully opened in a new tab");
177177
gBrowser.removeTab(loginsTab);
178178

179179
info(
180180
"Add another login and check that the scanned text about stored logins is updated after reload."
181181
);
182-
await Services.logins.addLoginAsync(TEST_LOGIN2);
182+
Services.logins.addLogin(TEST_LOGIN2);
183183
await BrowserTestUtils.reloadTab(tab);
184184

185185
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
@@ -204,11 +204,11 @@ add_task(async function testLockwiseCardUIWithBreachedLogins() {
204204
info(
205205
"Add a breached login and test that the lockwise scanned text is displayed correctly"
206206
);
207-
const tab = await BrowserTestUtils.openNewForegroundTab({
207+
let tab = await BrowserTestUtils.openNewForegroundTab({
208208
url: "about:protections",
209209
gBrowser,
210210
});
211-
await Services.logins.addLoginAsync(TEST_LOGIN1);
211+
Services.logins.addLogin(TEST_LOGIN1);
212212

213213
info("Mock monitor data with a breached login to test the Lockwise UI");
214214
AboutProtectionsParent.setTestOverride(
@@ -261,7 +261,7 @@ add_task(async function testLockwiseCardUIWithBreachedLogins() {
261261
});
262262

263263
add_task(async function testLockwiseCardPref() {
264-
const tab = await BrowserTestUtils.openNewForegroundTab({
264+
let tab = await BrowserTestUtils.openNewForegroundTab({
265265
url: "about:protections",
266266
gBrowser,
267267
});

0 commit comments

Comments
 (0)