s/IDBFS/Filer/ in all files, docs, tests. Fixes #54
This commit is contained in:
parent
745641811e
commit
641eb870a7
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
var IDBFS = require( "src/index" );
|
var Filer = require( "src/index" );
|
||||||
|
|
||||||
return IDBFS;
|
return Filer;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
} else if (typeof define === "function" && define.amd) {
|
} else if (typeof define === "function" && define.amd) {
|
||||||
// AMD. Register as an anonymous module.
|
// AMD. Register as an anonymous module.
|
||||||
define( factory );
|
define( factory );
|
||||||
} else if( !root.IDBFS ) {
|
} else if( !root.Filer ) {
|
||||||
// Browser globals
|
// Browser globals
|
||||||
root.IDBFS = factory();
|
root.Filer = factory();
|
||||||
}
|
}
|
||||||
|
|
||||||
}( this, function() {
|
}( this, function() {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -8,8 +8,8 @@
|
||||||
</body>
|
</body>
|
||||||
<script src="../dist/idbfs.js"></script>
|
<script src="../dist/idbfs.js"></script>
|
||||||
<script>
|
<script>
|
||||||
window.IDBFS = IDBFS;
|
window.Filer = Filer;
|
||||||
var fs = new IDBFS.FileSystem({
|
var fs = new Filer.FileSystem({
|
||||||
name: 'local',
|
name: 'local',
|
||||||
flags: ['FORMAT']
|
flags: ['FORMAT']
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 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 read_buffer = new Uint8Array(16);
|
||||||
|
|
||||||
var fs = new FileSystem('local');
|
var fs = new Filer.FileSystem('local');
|
||||||
fs.mkdir('/tmp');
|
fs.mkdir('/tmp');
|
||||||
fs.open('/tmp/', 'w+', function(error, fd) {
|
fs.open('/tmp/', 'w+', function(error, fd) {
|
||||||
if(error) return console.error(error);
|
if(error) return console.error(error);
|
||||||
|
@ -32,4 +32,4 @@ fd.then(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,8 +11,8 @@ module.exports = function(grunt) {
|
||||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
|
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
|
||||||
},
|
},
|
||||||
develop: {
|
develop: {
|
||||||
src: 'dist/idbfs.js',
|
src: 'dist/filer.js',
|
||||||
dest: 'dist/idbfs.min.js'
|
dest: 'dist/filer.min.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ module.exports = function(grunt) {
|
||||||
baseUrl: "lib",
|
baseUrl: "lib",
|
||||||
name: "build/almond",
|
name: "build/almond",
|
||||||
include: ["src/index"],
|
include: ["src/index"],
|
||||||
out: "dist/idbfs.js",
|
out: "dist/filer.js",
|
||||||
optimize: "none",
|
optimize: "none",
|
||||||
wrap: {
|
wrap: {
|
||||||
startFile: 'build/wrap.start',
|
startFile: 'build/wrap.start',
|
||||||
|
|
|
@ -27,7 +27,7 @@ define(function(require) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function NotSupported() {
|
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() {
|
NotSupported.isSupported = function() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -8,7 +8,7 @@ require.config({
|
||||||
"tests": "../tests",
|
"tests": "../tests",
|
||||||
"src": "../src",
|
"src": "../src",
|
||||||
"spec": "../tests/spec",
|
"spec": "../tests/spec",
|
||||||
"IDBFS": "../src/index"
|
"Filer": "../src/index"
|
||||||
},
|
},
|
||||||
baseUrl: "../lib",
|
baseUrl: "../lib",
|
||||||
optimize: "none",
|
optimize: "none",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
// We reuse the same set of tests for all adapters.
|
// We reuse the same set of tests for all adapters.
|
||||||
// buildTestsFor() creates a set of tests bound to an
|
// buildTestsFor() creates a set of tests bound to an
|
||||||
|
@ -6,7 +6,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
|
|
||||||
function buildTestsFor(adapterName, buildAdapter) {
|
function buildTestsFor(adapterName, buildAdapter) {
|
||||||
function encode(str) {
|
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);
|
return (new TextEncoder("utf-8")).encode(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,15 +16,15 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var value2Str = "value2", value2Buffer = encode(value2Str);
|
var value2Str = "value2", value2Buffer = encode(value2Str);
|
||||||
|
|
||||||
function createProvider() {
|
function createProvider() {
|
||||||
var memoryProvider = new IDBFS.FileSystem.providers.Memory();
|
var memoryProvider = new Filer.FileSystem.providers.Memory();
|
||||||
return buildAdapter(memoryProvider);
|
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() {
|
it("is supported -- if it isn't, none of these tests can run.", function() {
|
||||||
// Allow for combined adapters (e.g., 'AES+Zlib') joined by '+'
|
// Allow for combined adapters (e.g., 'AES+Zlib') joined by '+'
|
||||||
adapterName.split('+').forEach(function(name) {
|
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
|
// Encryption
|
||||||
buildTestsFor('AES', function buildAdapter(provider) {
|
buildTestsFor('AES', function buildAdapter(provider) {
|
||||||
var passphrase = '' + Date.now();
|
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) {
|
buildTestsFor('TripleDES', function buildAdapter(provider) {
|
||||||
var passphrase = '' + Date.now();
|
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) {
|
buildTestsFor('Rabbit', function buildAdapter(provider) {
|
||||||
var passphrase = '' + Date.now();
|
var passphrase = '' + Date.now();
|
||||||
return new IDBFS.FileSystem.adapters.Rabbit(passphrase, provider);
|
return new Filer.FileSystem.adapters.Rabbit(passphrase, provider);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compression
|
// Compression
|
||||||
buildTestsFor('Zlib', function buildAdapter(provider) {
|
buildTestsFor('Zlib', function buildAdapter(provider) {
|
||||||
return new IDBFS.FileSystem.adapters.Zlib(provider);
|
return new Filer.FileSystem.adapters.Zlib(provider);
|
||||||
});
|
});
|
||||||
|
|
||||||
// AES + Zlib together
|
// AES + Zlib together
|
||||||
buildTestsFor('AES+Zlib', function buildAdapter(provider) {
|
buildTestsFor('AES+Zlib', function buildAdapter(provider) {
|
||||||
var passphrase = '' + Date.now();
|
var passphrase = '' + Date.now();
|
||||||
var zlib = new IDBFS.FileSystem.adapters.Zlib(provider);
|
var zlib = new Filer.FileSystem.adapters.Zlib(provider);
|
||||||
var AESwithZlib = new IDBFS.FileSystem.adapters.AES(passphrase, zlib);
|
var AESwithZlib = new Filer.FileSystem.adapters.AES(passphrase, zlib);
|
||||||
return AESwithZlib;
|
return AESwithZlib;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
describe("IDBFS.FileSystem.adapters", function() {
|
describe("Filer.FileSystem.adapters", function() {
|
||||||
it("is defined", 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() {
|
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() {
|
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() {
|
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() {
|
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() {
|
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() {
|
it("has a default Compression constructor", function() {
|
||||||
expect(typeof IDBFS.FileSystem.adapters.Compression).toEqual('function');
|
expect(typeof Filer.FileSystem.adapters.Compression).toEqual('function');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -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');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.close', function() {
|
describe('fs.close', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.link', function() {
|
describe('fs.link', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.lseek', function() {
|
describe('fs.lseek', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.lstat', function() {
|
describe('fs.lstat', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.mkdir', function() {
|
describe('fs.mkdir', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.open', function() {
|
describe('fs.open', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.read', function() {
|
describe('fs.read', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.readdir', function() {
|
describe('fs.readdir', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.readlink', function() {
|
describe('fs.readlink', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.rename', function() {
|
describe('fs.rename', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.rmdir', function() {
|
describe('fs.rmdir', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe("fs", function() {
|
describe("fs", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.stat', function() {
|
describe('fs.stat', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.symlink', function() {
|
describe('fs.symlink', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.truncate', function() {
|
describe('fs.truncate', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.unlink', function() {
|
describe('fs.unlink', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.utimes', function() {
|
describe('fs.utimes', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.write', function() {
|
describe('fs.write', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('fs.writeFile, fs.readFile', function() {
|
describe('fs.writeFile, fs.readFile', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -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');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
|
@ -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() {
|
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-mkdir.js", function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -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() {
|
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-null-bytes.js", function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
describe('path resolution', function() {
|
describe('path resolution', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.db_name = mk_db_name();
|
this.db_name = mk_db_name();
|
||||||
this.fs = new IDBFS.FileSystem({
|
this.fs = new Filer.FileSystem({
|
||||||
name: this.db_name,
|
name: this.db_name,
|
||||||
flags: 'FORMAT'
|
flags: 'FORMAT'
|
||||||
});
|
});
|
||||||
|
|
|
@ -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() {
|
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() {
|
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.open).toEqual('function');
|
||||||
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
|
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
|
||||||
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
|
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
|
||||||
|
@ -25,7 +25,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
_result = firstAccess;
|
_result = firstAccess;
|
||||||
|
@ -56,7 +56,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result1, _result2;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
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() {
|
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.open).toEqual('function');
|
||||||
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
|
expect(typeof indexedDBProvider.getReadOnlyContext).toEqual('function');
|
||||||
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
|
expect(typeof indexedDBProvider.getReadWriteContext).toEqual('function');
|
||||||
|
@ -17,7 +17,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
_result = firstAccess;
|
_result = firstAccess;
|
||||||
|
@ -40,7 +40,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result1, _result2;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
describe("IDBFS.FileSystem.providers", function() {
|
describe("Filer.FileSystem.providers", function() {
|
||||||
it("is defined", 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() {
|
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() {
|
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() {
|
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() {
|
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() {
|
it("has Fallback constructor", function() {
|
||||||
expect(typeof IDBFS.FileSystem.providers.Fallback).toEqual('function');
|
expect(typeof Filer.FileSystem.providers.Fallback).toEqual('function');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(["IDBFS"], function(IDBFS) {
|
define(["Filer"], function(Filer) {
|
||||||
|
|
||||||
var WEBSQL_NAME = "websql-test-db";
|
var WEBSQL_NAME = "websql-test-db";
|
||||||
|
|
||||||
|
@ -11,18 +11,18 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IDBFS.FileSystem.providers.WebSQL.isSupported()) {
|
if(!Filer.FileSystem.providers.WebSQL.isSupported()) {
|
||||||
console.log("Skipping IDBFS.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
|
console.log("Skipping Filer.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
|
||||||
return;
|
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() {
|
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() {
|
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.open).toEqual('function');
|
||||||
expect(typeof webSQLProvider.getReadOnlyContext).toEqual('function');
|
expect(typeof webSQLProvider.getReadOnlyContext).toEqual('function');
|
||||||
expect(typeof webSQLProvider.getReadWriteContext).toEqual('function');
|
expect(typeof webSQLProvider.getReadWriteContext).toEqual('function');
|
||||||
|
@ -37,7 +37,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
_result = firstAccess;
|
_result = firstAccess;
|
||||||
|
@ -64,7 +64,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result1, _result2;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ define(["IDBFS"], function(IDBFS) {
|
||||||
var complete = false;
|
var complete = false;
|
||||||
var _error, _result;
|
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) {
|
provider.open(function(err, firstAccess) {
|
||||||
_error = err;
|
_error = err;
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ define([
|
||||||
* get them running by default.
|
* get them running by default.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// IDBFS
|
// Filer
|
||||||
"spec/idbfs.spec",
|
"spec/filer.spec",
|
||||||
|
|
||||||
// IDBFS.FileSystem.*
|
// Filer.FileSystem.*
|
||||||
"spec/fs.spec",
|
"spec/fs.spec",
|
||||||
"spec/fs.stat.spec",
|
"spec/fs.stat.spec",
|
||||||
"spec/fs.lstat.spec",
|
"spec/fs.lstat.spec",
|
||||||
|
@ -31,13 +31,13 @@ define([
|
||||||
"spec/fs.xattr.spec",
|
"spec/fs.xattr.spec",
|
||||||
"spec/path-resolution.spec",
|
"spec/path-resolution.spec",
|
||||||
|
|
||||||
// IDBFS.FileSystem.providers.*
|
// Filer.FileSystem.providers.*
|
||||||
"spec/providers/providers.spec",
|
"spec/providers/providers.spec",
|
||||||
"spec/providers/providers.memory.spec",
|
"spec/providers/providers.memory.spec",
|
||||||
"spec/providers/providers.indexeddb.spec",
|
"spec/providers/providers.indexeddb.spec",
|
||||||
"spec/providers/providers.websql.spec",
|
"spec/providers/providers.websql.spec",
|
||||||
|
|
||||||
// IDBFS.FileSystem.adapters.*
|
// Filer.FileSystem.adapters.*
|
||||||
"spec/adapters/adapters.spec",
|
"spec/adapters/adapters.spec",
|
||||||
"spec/adapters/adapters.general.spec",
|
"spec/adapters/adapters.general.spec",
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue