started spec tests and exposed to FileSystem prototype

This commit is contained in:
Barry Tulchinsky 2013-12-20 11:50:59 -05:00
parent a83ccf6154
commit 5d022c3ca3
2 changed files with 47 additions and 1 deletions

View File

@ -2076,7 +2076,32 @@ define(function(require) {
}
);
};
FileSystem.prototype.setxattr = function (path, name, value, flag, callback) {
callback = maybeCallback(arguments[arguments.length - 1]);
var fs = this;
var error = fs.queueOrRun(
function () {
var context = fs.provider.getReadWriteContext();
_setxattr(context, path, name, value, flag, callback);
}
);
if (error) {
callback(error);
}
};
FileSystem.prototype.getxattr = function (path, name, callback) {
callback = maybeCallback(callback);
var fs = this;
var error = fs.queueOrRun(
function () {
var context = fs.provider.getReadWriteContext();
_getxattr(context, path, name, callback);
}
);
if (error) {
callback(error);
}
};
return FileSystem;
});

View File

@ -0,0 +1,21 @@
define(["IDBFS"], function(IDBFS) {
describe('fs.utimes', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});
});
afterEach(function() {
indexedDB.deleteDatabase(this.db_name);
delete this.fs;
});
});
it('should be a function', function () {
expect(typeof this.setxattr).toEqual('function');
});
}