2010-06-16 14:30:08 -07:00
|
|
|
Cu.import("resource://services-sync/util.js");
|
2008-06-23 21:21:40 -07:00
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// Fake Sample Data
|
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
let fakeSampleLogins = [
|
|
|
|
// Fake nsILoginInfo object.
|
|
|
|
{hostname: "www.boogle.com",
|
|
|
|
formSubmitURL: "http://www.boogle.com/search",
|
|
|
|
httpRealm: "",
|
|
|
|
username: "",
|
|
|
|
password: "",
|
|
|
|
usernameField: "test_person",
|
|
|
|
passwordField: "test_password"}
|
|
|
|
];
|
|
|
|
|
|
|
|
// ----------------------------------------
|
|
|
|
// Fake Login Manager
|
|
|
|
// ----------------------------------------
|
|
|
|
|
|
|
|
function FakeLoginManager(fakeLogins) {
|
|
|
|
this.fakeLogins = fakeLogins;
|
|
|
|
|
|
|
|
let self = this;
|
|
|
|
|
2009-03-10 04:30:30 -07:00
|
|
|
// Use a fake nsILoginManager object.
|
2011-05-19 18:08:07 -07:00
|
|
|
delete Services.logins;
|
|
|
|
Services.logins = {
|
2008-06-26 11:40:14 -07:00
|
|
|
removeAllLogins: function() { self.fakeLogins = []; },
|
2008-06-23 21:21:40 -07:00
|
|
|
getAllLogins: function() { return self.fakeLogins; },
|
|
|
|
addLogin: function(login) {
|
|
|
|
getTestLogger().info("nsILoginManager.addLogin() called " +
|
|
|
|
"with hostname '" + login.hostname + "'.");
|
|
|
|
self.fakeLogins.push(login);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|