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
Родитель 6c09312d2a
Коммит d4048117ef
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -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);
},

Просмотреть файл

@ -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');