Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 Cu.import("resource://services-sync/util.js");
3 // ----------------------------------------
4 // Fake Sample Data
5 // ----------------------------------------
7 let fakeSampleLogins = [
8 // Fake nsILoginInfo object.
9 {hostname: "www.boogle.com",
10 formSubmitURL: "http://www.boogle.com/search",
11 httpRealm: "",
12 username: "",
13 password: "",
14 usernameField: "test_person",
15 passwordField: "test_password"}
16 ];
18 // ----------------------------------------
19 // Fake Login Manager
20 // ----------------------------------------
22 function FakeLoginManager(fakeLogins) {
23 this.fakeLogins = fakeLogins;
25 let self = this;
27 // Use a fake nsILoginManager object.
28 delete Services.logins;
29 Services.logins = {
30 removeAllLogins: function() { self.fakeLogins = []; },
31 getAllLogins: function() { return self.fakeLogins; },
32 addLogin: function(login) {
33 getTestLogger().info("nsILoginManager.addLogin() called " +
34 "with hostname '" + login.hostname + "'.");
35 self.fakeLogins.push(login);
36 }
37 };
38 }