started spec tests and exposed to FileSystem prototype
This commit is contained in:
parent
a83ccf6154
commit
5d022c3ca3
27
src/fs.js
27
src/fs.js
|
@ -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;
|
||||
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue