Finished test_passwords.js, although it raises a number of strict warnings.

This commit is contained in:
Atul Varma 2008-06-18 18:08:33 -07:00
parent 837747b2b8
commit 6046183cfa
2 changed files with 11 additions and 1 deletions

View File

@ -164,6 +164,7 @@ function FakeDAVService(contents) {
FakeDAVService.prototype = {
PUT: function fake_PUT(path, data, onComplete) {
Log4Moz.Service.rootLogger.info("Putting " + path);
this.fakeContents[path] = data;
makeFakeAsyncFunc({status: 200}).async(this, onComplete);
},

View File

@ -15,7 +15,8 @@ function run_test() {
var fts = new FakeTimerService();
var logStats = initTestLogging();
ID.set('Engine:PBE:default', new Identity('Mozilla Services Encryption Passphrase', 'foo'));
ID.set('Engine:PBE:default',
new Identity('Mozilla Services Encryption Passphrase', 'foo'));
// The JS module we're testing, with all members exposed.
var passwords = loadInSandbox("resource://weave/engines/passwords.js");
@ -40,6 +41,14 @@ function run_test() {
return {exists: function() {return false;}};
};
Utils.open = function fake_open(file, mode) {
let fakeStream = {
writeString: function(data) {Log4Moz.Service.rootLogger.debug(data);},
close: function() {}
};
return [fakeStream];
};
// Ensure that _hashLoginInfo() works.
var fakeUserHash = passwords._hashLoginInfo(fakeUser);
do_check_eq(typeof fakeUserHash, 'string');