Merge pull request #89 from humphd/docs

Epic! Thanks :)
This commit is contained in:
Alan K 2014-01-14 08:47:46 -08:00
commit 19181dccbc
42 changed files with 7340 additions and 302 deletions

39
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,39 @@
# How to Contribute
The best way to get started is to read through the `Getting Started` and `Example`
sections before having a look through the open [issues](https://github.com/js-platform/filer/issues).
Some of the issues are marked as `good first bug`, but feel free to contribute to
any of the issues there, or open a new one if the thing you want to work on isn't
there yet. If you would like to have an issue assigned to you, please send me a
message and I'll update it.
## Setup
The Filer build system is based on [grunt](http://gruntjs.com/). To get a working build system
do the following:
```
npm install
npm install -g grunt-cli
```
You can now run the following grunt tasks:
* `grunt check` will run [JSHint](http://www.jshint.com/) on your code (do this before submitting a pull request) to catch errors
* `grunt develop` will create a single file version of the library for testing in `dist/idbfs.js`
* `grunt release` like `develop` but will also create a minified version of the library in `dist/idbfs.min.js`
Once you've done some hacking and you'd like to have your work merged, you'll need to
make a pull request. If you're patch includes code, make sure to check that all the
unit tests pass, including any new tests you wrote. Finally, make sure you add yourself
to the `AUTHORS` file.
## Tests
Tests are writting using [Jasmine](http://pivotal.github.io/jasmine/). You can run the tests
in your browser by opening the `tests` directory. You can also run them
[here](http://js-platform.github.io/idbfs/tests/).
## Communication
If you'd like to talk to someone about the project, you can reach us on irc.mozilla.org in the
mofodev channel. Look for "ack" or "humph".

861
README.md

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
var IDBFS = require( "src/index" );
var Filer = require( "src/index" );
return IDBFS;
return Filer;
}));

View File

@ -19,9 +19,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
} else if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define( factory );
} else if( !root.IDBFS ) {
} else if( !root.Filer ) {
// Browser globals
root.IDBFS = factory();
root.Filer = factory();
}
}( this, function() {

6473
dist/filer.js vendored Normal file

File diff suppressed because it is too large Load Diff

5
dist/filer.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,8 @@
</body>
<script src="../dist/idbfs.js"></script>
<script>
window.IDBFS = IDBFS;
var fs = new IDBFS.FileSystem({
window.Filer = Filer;
var fs = new Filer.FileSystem({
name: 'local',
flags: ['FORMAT']
});

View File

@ -1,7 +1,7 @@
var write_buffer = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
var read_buffer = new Uint8Array(16);
var fs = new FileSystem('local');
var fs = new Filer.FileSystem('local');
fs.mkdir('/tmp');
fs.open('/tmp/', 'w+', function(error, fd) {
if(error) return console.error(error);
@ -32,4 +32,4 @@ fd.then(
}
);
});
});

View File

@ -11,8 +11,8 @@ module.exports = function(grunt) {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
develop: {
src: 'dist/idbfs.js',
dest: 'dist/idbfs.min.js'
src: 'dist/filer.js',
dest: 'dist/filer.min.js'
}
},
@ -38,7 +38,7 @@ module.exports = function(grunt) {
baseUrl: "lib",
name: "build/almond",
include: ["src/index"],
out: "dist/idbfs.js",
out: "dist/filer.js",
optimize: "none",
wrap: {
startFile: 'build/wrap.start',

View File

@ -27,7 +27,7 @@ define(function(require) {
}
function NotSupported() {
throw "[IDBFS Error] Your browser doesn't support IndexedDB or WebSQL.";
throw "[Filer Error] Your browser doesn't support IndexedDB or WebSQL.";
}
NotSupported.isSupported = function() {
return false;

View File

@ -8,7 +8,7 @@ require.config({
"tests": "../tests",
"src": "../src",
"spec": "../tests/spec",
"IDBFS": "../src/index"
"Filer": "../src/index"
},
baseUrl: "../lib",
optimize: "none",

View File

@ -1,4 +1,4 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
// We reuse the same set of tests for all adapters.
// buildTestsFor() creates a set of tests bound to an
@ -6,7 +6,7 @@ define(["IDBFS"], function(IDBFS) {
function buildTestsFor(adapterName, buildAdapter) {
function encode(str) {
// TextEncoder is either native, or shimmed by IDBFS
// TextEncoder is either native, or shimmed by Filer
return (new TextEncoder("utf-8")).encode(str);
}
@ -16,15 +16,15 @@ define(["IDBFS"], function(IDBFS) {
var value2Str = "value2", value2Buffer = encode(value2Str);
function createProvider() {
var memoryProvider = new IDBFS.FileSystem.providers.Memory();
var memoryProvider = new Filer.FileSystem.providers.Memory();
return buildAdapter(memoryProvider);
}
describe("IDBFS.FileSystem.adapters." + adapterName, function() {
describe("Filer.FileSystem.adapters." + adapterName, function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
// Allow for combined adapters (e.g., 'AES+Zlib') joined by '+'
adapterName.split('+').forEach(function(name) {
expect(IDBFS.FileSystem.adapters[name].isSupported()).toEqual(true);
expect(Filer.FileSystem.adapters[name].isSupported()).toEqual(true);
});
});
@ -200,27 +200,27 @@ define(["IDBFS"], function(IDBFS) {
// Encryption
buildTestsFor('AES', function buildAdapter(provider) {
var passphrase = '' + Date.now();
return new IDBFS.FileSystem.adapters.AES(passphrase, provider);
return new Filer.FileSystem.adapters.AES(passphrase, provider);
});
buildTestsFor('TripleDES', function buildAdapter(provider) {
var passphrase = '' + Date.now();
return new IDBFS.FileSystem.adapters.TripleDES(passphrase, provider);
return new Filer.FileSystem.adapters.TripleDES(passphrase, provider);
});
buildTestsFor('Rabbit', function buildAdapter(provider) {
var passphrase = '' + Date.now();
return new IDBFS.FileSystem.adapters.Rabbit(passphrase, provider);
return new Filer.FileSystem.adapters.Rabbit(passphrase, provider);
});
// Compression
buildTestsFor('Zlib', function buildAdapter(provider) {
return new IDBFS.FileSystem.adapters.Zlib(provider);
return new Filer.FileSystem.adapters.Zlib(provider);
});
// AES + Zlib together
buildTestsFor('AES+Zlib', function buildAdapter(provider) {
var passphrase = '' + Date.now();
var zlib = new IDBFS.FileSystem.adapters.Zlib(provider);
var AESwithZlib = new IDBFS.FileSystem.adapters.AES(passphrase, zlib);
var zlib = new Filer.FileSystem.adapters.Zlib(provider);
var AESwithZlib = new Filer.FileSystem.adapters.AES(passphrase, zlib);
return AESwithZlib;
});

View File

@ -1,31 +1,31 @@
define(["IDBFS"], function(IDBFS) {
describe("IDBFS.FileSystem.adapters", function() {
define(["Filer"], function(Filer) {
describe("Filer.FileSystem.adapters", function() {
it("is defined", function() {
expect(typeof IDBFS.FileSystem.adapters).not.toEqual(undefined);
expect(typeof Filer.FileSystem.adapters).not.toEqual(undefined);
});
it("has an AES constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.AES).toEqual('function');
expect(typeof Filer.FileSystem.adapters.AES).toEqual('function');
});
it("has a TripleDES constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.TripleDES).toEqual('function');
expect(typeof Filer.FileSystem.adapters.TripleDES).toEqual('function');
});
it("has a Rabbit constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.Rabbit).toEqual('function');
expect(typeof Filer.FileSystem.adapters.Rabbit).toEqual('function');
});
it("has a default Encryption constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.Encryption).toEqual('function');
expect(typeof Filer.FileSystem.adapters.Encryption).toEqual('function');
});
it("has a Zlib constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.Zlib).toEqual('function');
expect(typeof Filer.FileSystem.adapters.Zlib).toEqual('function');
});
it("has a default Compression constructor", function() {
expect(typeof IDBFS.FileSystem.adapters.Compression).toEqual('function');
expect(typeof Filer.FileSystem.adapters.Compression).toEqual('function');
});
});
});

13
tests/spec/filer.spec.js Normal file
View File

@ -0,0 +1,13 @@
define(["Filer"], function(Filer) {
describe("Filer", function() {
it("is defined", function() {
expect(typeof Filer).not.toEqual(undefined);
});
it("has FileSystem constructor", function() {
expect(typeof Filer.FileSystem).toEqual('function');
});
});
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.close', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.link', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.lseek', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.lstat', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.mkdir', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.open', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.read', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.readdir', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.readlink', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.rename', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.rmdir', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe("fs", function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.stat', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.symlink', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.truncate', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.unlink', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.utimes', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.write', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('fs.writeFile, fs.readFile', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,13 +0,0 @@
define(["IDBFS"], function(IDBFS) {
describe("IDBFS", function() {
it("is defined", function() {
expect(typeof IDBFS).not.toEqual(undefined);
});
it("has FileSystem constructor", function() {
expect(typeof IDBFS.FileSystem).toEqual('function');
});
});
});

View File

@ -1,10 +1,10 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-mkdir.js", function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,10 +1,10 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-null-bytes.js", function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,9 +1,9 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe('path resolution', function() {
beforeEach(function() {
this.db_name = mk_db_name();
this.fs = new IDBFS.FileSystem({
this.fs = new Filer.FileSystem({
name: this.db_name,
flags: 'FORMAT'
});

View File

@ -1,12 +1,12 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe("IDBFS.FileSystem.providers.IndexedDB", function() {
describe("Filer.FileSystem.providers.IndexedDB", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
expect(IDBFS.FileSystem.providers.IndexedDB.isSupported()).toEqual(true);
expect(Filer.FileSystem.providers.IndexedDB.isSupported()).toEqual(true);
});
it("has open, getReadOnlyContext, and getReadWriteContext instance methods", function() {
var indexedDBProvider = new IDBFS.FileSystem.providers.IndexedDB();
var indexedDBProvider = new Filer.FileSystem.providers.IndexedDB();
expect(typeof indexedDBProvider.open).toEqual('function');
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
@ -25,7 +25,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.IndexedDB(this.db_name);
var provider = new Filer.FileSystem.providers.IndexedDB(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
_result = firstAccess;
@ -56,7 +56,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.IndexedDB(this.db_name);
var provider = new Filer.FileSystem.providers.IndexedDB(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -86,7 +86,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.IndexedDB(this.db_name);
var provider = new Filer.FileSystem.providers.IndexedDB(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -119,7 +119,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result1, _result2;
var provider = new IDBFS.FileSystem.providers.IndexedDB(this.db_name);
var provider = new Filer.FileSystem.providers.IndexedDB(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -163,7 +163,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.IndexedDB(this.db_name);
var provider = new Filer.FileSystem.providers.IndexedDB(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;

View File

@ -1,12 +1,12 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
describe("IDBFS.FileSystem.providers.Memory", function() {
describe("Filer.FileSystem.providers.Memory", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
expect(IDBFS.FileSystem.providers.Memory.isSupported()).toEqual(true);
expect(Filer.FileSystem.providers.Memory.isSupported()).toEqual(true);
});
it("has open, getReadOnlyContext, and getReadWriteContext instance methods", function() {
var indexedDBProvider = new IDBFS.FileSystem.providers.Memory();
var indexedDBProvider = new Filer.FileSystem.providers.Memory();
expect(typeof indexedDBProvider.open).toEqual('function');
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
@ -17,7 +17,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.Memory(this.db_name);
var provider = new Filer.FileSystem.providers.Memory(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
_result = firstAccess;
@ -40,7 +40,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.Memory(this.db_name);
var provider = new Filer.FileSystem.providers.Memory(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -70,7 +70,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.Memory(this.db_name);
var provider = new Filer.FileSystem.providers.Memory(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -103,7 +103,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result1, _result2;
var provider = new IDBFS.FileSystem.providers.Memory(this.db_name);
var provider = new Filer.FileSystem.providers.Memory(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;
@ -147,7 +147,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = new IDBFS.FileSystem.providers.Memory(this.db_name);
var provider = new Filer.FileSystem.providers.Memory(this.db_name);
provider.open(function(err, firstAccess) {
_error = err;

View File

@ -1,27 +1,27 @@
define(["IDBFS"], function(IDBFS) {
describe("IDBFS.FileSystem.providers", function() {
define(["Filer"], function(Filer) {
describe("Filer.FileSystem.providers", function() {
it("is defined", function() {
expect(typeof IDBFS.FileSystem.providers).not.toEqual(undefined);
expect(typeof Filer.FileSystem.providers).not.toEqual(undefined);
});
it("has IndexedDB constructor", function() {
expect(typeof IDBFS.FileSystem.providers.IndexedDB).toEqual('function');
expect(typeof Filer.FileSystem.providers.IndexedDB).toEqual('function');
});
it("has WebSQL constructor", function() {
expect(typeof IDBFS.FileSystem.providers.WebSQL).toEqual('function');
expect(typeof Filer.FileSystem.providers.WebSQL).toEqual('function');
});
it("has Memory constructor", function() {
expect(typeof IDBFS.FileSystem.providers.Memory).toEqual('function');
expect(typeof Filer.FileSystem.providers.Memory).toEqual('function');
});
it("has a Default constructor", function() {
expect(typeof IDBFS.FileSystem.providers.Default).toEqual('function');
expect(typeof Filer.FileSystem.providers.Default).toEqual('function');
});
it("has Fallback constructor", function() {
expect(typeof IDBFS.FileSystem.providers.Fallback).toEqual('function');
expect(typeof Filer.FileSystem.providers.Fallback).toEqual('function');
});
});
});

View File

@ -1,4 +1,4 @@
define(["IDBFS"], function(IDBFS) {
define(["Filer"], function(Filer) {
var WEBSQL_NAME = "websql-test-db";
@ -11,18 +11,18 @@ define(["IDBFS"], function(IDBFS) {
});
}
if(!IDBFS.FileSystem.providers.WebSQL.isSupported()) {
console.log("Skipping IDBFS.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
if(!Filer.FileSystem.providers.WebSQL.isSupported()) {
console.log("Skipping Filer.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
return;
}
describe("IDBFS.FileSystem.providers.WebSQL", function() {
describe("Filer.FileSystem.providers.WebSQL", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
expect(IDBFS.FileSystem.providers.WebSQL.isSupported()).toEqual(true);
expect(Filer.FileSystem.providers.WebSQL.isSupported()).toEqual(true);
});
it("has open, getReadOnlyContext, and getReadWriteContext instance methods", function() {
var webSQLProvider = new IDBFS.FileSystem.providers.WebSQL();
var webSQLProvider = new Filer.FileSystem.providers.WebSQL();
expect(typeof webSQLProvider.open).toEqual('function');
expect(typeof webSQLProvider.getReadOnlyContext).toEqual('function');
expect(typeof webSQLProvider.getReadWriteContext).toEqual('function');
@ -37,7 +37,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
var provider = this.provider = new Filer.FileSystem.providers.WebSQL(WEBSQL_NAME);
provider.open(function(err, firstAccess) {
_error = err;
_result = firstAccess;
@ -64,7 +64,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
var provider = this.provider = new Filer.FileSystem.providers.WebSQL(WEBSQL_NAME);
provider.open(function(err, firstAccess) {
_error = err;
@ -94,7 +94,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
var provider = this.provider = new Filer.FileSystem.providers.WebSQL(WEBSQL_NAME);
provider.open(function(err, firstAccess) {
_error = err;
@ -127,7 +127,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result1, _result2;
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
var provider = this.provider = new Filer.FileSystem.providers.WebSQL(WEBSQL_NAME);
provider.open(function(err, firstAccess) {
_error = err;
@ -171,7 +171,7 @@ define(["IDBFS"], function(IDBFS) {
var complete = false;
var _error, _result;
var provider = this.provider = new IDBFS.FileSystem.providers.WebSQL(WEBSQL_NAME);
var provider = this.provider = new Filer.FileSystem.providers.WebSQL(WEBSQL_NAME);
provider.open(function(err, firstAccess) {
_error = err;

View File

@ -5,10 +5,10 @@ define([
* get them running by default.
*/
// IDBFS
"spec/idbfs.spec",
// Filer
"spec/filer.spec",
// IDBFS.FileSystem.*
// Filer.FileSystem.*
"spec/fs.spec",
"spec/fs.stat.spec",
"spec/fs.lstat.spec",
@ -31,13 +31,13 @@ define([
"spec/fs.xattr.spec",
"spec/path-resolution.spec",
// IDBFS.FileSystem.providers.*
// Filer.FileSystem.providers.*
"spec/providers/providers.spec",
"spec/providers/providers.memory.spec",
"spec/providers/providers.indexeddb.spec",
"spec/providers/providers.websql.spec",
// IDBFS.FileSystem.adapters.*
// Filer.FileSystem.adapters.*
"spec/adapters/adapters.spec",
"spec/adapters/adapters.general.spec",