зеркало из https://github.com/mozilla/gecko-dev.git
Bug 819507 - Stop relying on deprecated behavior in passwordmgr mozStorage tests. r=dolske
This commit is contained in:
Родитель
5bc21d4b5a
Коммит
a77855ef90
|
@ -215,47 +215,6 @@ do_check_eq(logins[0].guid, guid3, "checking guid3");
|
|||
|
||||
/* ========== 11 ========== */
|
||||
testnum++;
|
||||
testdesc = "login w/o nsILoginMetaInfo impl";
|
||||
|
||||
var wonkyDelegate = new nsLoginInfo;
|
||||
wonkyDelegate.init("http://wonky", null, "wonkyness",
|
||||
"wonkyuser", "wonkypass", "u", "p");
|
||||
|
||||
var wonkyLogin = {
|
||||
QueryInterface : function (iid) {
|
||||
var interfaces = [Ci.nsILoginInfo, Ci.nsISupports];
|
||||
if (!interfaces.some( function(v) { return iid.equals(v) }))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
},
|
||||
hostname: wonkyDelegate.hostname,
|
||||
formSubmitURL: wonkyDelegate.formSubmitURL,
|
||||
httpRealm: wonkyDelegate.httpRealm,
|
||||
username: wonkyDelegate.username,
|
||||
password: wonkyDelegate.password,
|
||||
usernameField: wonkyDelegate.usernameField,
|
||||
passwordField: wonkyDelegate.passwordField,
|
||||
equals: wonkyDelegate.equals,
|
||||
matches: wonkyDelegate.matches,
|
||||
clone: wonkyDelegate.clone
|
||||
};
|
||||
|
||||
storage.addLogin(wonkyLogin);
|
||||
LoginTest.checkStorageData(storage, [], [testuser1, testuser2, testuser3, wonkyLogin]);
|
||||
|
||||
logins = storage.findLogins({}, "http://wonky", null, "");
|
||||
do_check_eq(logins.length, 1, "expecting 1 login");
|
||||
logins[0].QueryInterface(Ci.nsILoginMetaInfo);
|
||||
do_check_true(isGUID.test(logins[0].guid), "wonky guid is set");
|
||||
|
||||
storage.modifyLogin(wonkyLogin, wonkyLogin);
|
||||
LoginTest.checkStorageData(storage, [], [testuser1, testuser2, testuser3, wonkyLogin]);
|
||||
storage.removeLogin(wonkyLogin);
|
||||
LoginTest.checkStorageData(storage, [], [testuser1, testuser2, testuser3]);
|
||||
|
||||
|
||||
/* ========== 12 ========== */
|
||||
testnum++;
|
||||
testdesc = "check values for v4 DB addLogin";
|
||||
|
||||
var timeuser1 = new nsLoginInfo();
|
||||
|
@ -280,7 +239,7 @@ do_check_eq(time1, tu1.timePasswordChanged);
|
|||
do_check_eq(1, tu1.timesUsed);
|
||||
|
||||
|
||||
/* ========== 13 ========== */
|
||||
/* ========== 12 ========== */
|
||||
testnum++;
|
||||
testdesc = "check values for v4 DB addLogin part 2";
|
||||
|
||||
|
@ -311,7 +270,7 @@ do_check_eq(789, tu2.timePasswordChanged);
|
|||
do_check_eq(42, tu2.timesUsed);
|
||||
|
||||
|
||||
/* ========== 14 ========== */
|
||||
/* ========== 13 ========== */
|
||||
testnum++;
|
||||
testdesc = "check values for v4 DB modifyLogin";
|
||||
|
||||
|
@ -342,7 +301,7 @@ do_check_true(LoginTest.is_about_now(tu2.timePasswordChanged));
|
|||
do_check_eq(8, tu2.timesUsed);
|
||||
|
||||
|
||||
/* ========== 15 ========== */
|
||||
/* ========== 14 ========== */
|
||||
testnum++;
|
||||
testdesc = "check values for v4 DB modifyLogin part 2";
|
||||
|
||||
|
@ -374,7 +333,7 @@ do_check_eq(888, tu2.timePasswordChanged);
|
|||
do_check_eq(10, tu2.timesUsed);
|
||||
|
||||
|
||||
/* ========== 16 ========== */
|
||||
/* ========== 15 ========== */
|
||||
testnum++;
|
||||
testdesc = "check values for v4 DB modifyLogin part 3";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче