incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [29/34] updated mobile spec tests for CordovaJS
Date Mon, 09 Apr 2012 22:40:30 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/5bca3c1a/tests/MobileSpecUnitTests/www/autotest/tests/file.tests.js
----------------------------------------------------------------------
diff --git a/tests/MobileSpecUnitTests/www/autotest/tests/file.tests.js b/tests/MobileSpecUnitTests/www/autotest/tests/file.tests.js
index 7c05eb1..2370fa5 100644
--- a/tests/MobileSpecUnitTests/www/autotest/tests/file.tests.js
+++ b/tests/MobileSpecUnitTests/www/autotest/tests/file.tests.js
@@ -1,38 +1,41 @@
 /**
  * Retrieves root file system entries once, so they don't have to be 
  * repeated for every test (file system shouldn't change during test run). 
- */
-var temp_root, persistent_root;
+ */ 
+var getFileSystemRoot = (function() {
 
-var getFileSystemRoot = (function () {
+    // private
+    var temp_root, persistent_root;
 
-    var onError = function (error) {
+    var onError = function(error) {
         console.log('unable to retrieve file system: ' + error.code);
     };
-
+    
     // one-time retrieval of the root file system entry
-    if (typeof persistent_root === 'undefined' && typeof temp_root === 'undefined') 
-    {
+    var init = function() {
         window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
-                function (fileSystem) {
+                function(fileSystem) {
                     persistent_root = fileSystem.root;
                 }, onError);
-
         window.requestFileSystem(LocalFileSystem.TEMPORARY, 0,
-                function (fileSystem) {
+                function(fileSystem) {
                     temp_root = fileSystem.root;
                 }, onError);
-    }
-
-    // public function returns root
-    return persistent_root;
-
-});
+    };
+    document.addEventListener("deviceready", init, true);
+
+    // public function returns private root entry
+    return function() {
+        // When testing, it is a good idea to run the test suite once for each
+        // file system type.  Just change the return value from this function.  
+        //return temp_root;
+        return persistent_root;
+    };
+}()); // execute immediately
 
-Tests.prototype.FileTests = function () {
-    getFileSystemRoot();
+Tests.prototype.FileTests = function() {
     module('FileError interface');
-    test("FileError constants should be defined", function () {
+    test("FileError constants should be defined", function() {
         expect(12);
         equal(FileError.NOT_FOUND_ERR, 1, "FileError.NOT_FOUND_ERR should be defined");
         equal(FileError.SECURITY_ERR, 2, "FileError.SECURITY_ERR should be defined");
@@ -47,132 +50,220 @@ Tests.prototype.FileTests = function () {
         equal(FileError.TYPE_MISMATCH_ERR, 11, "FileError.TYPE_MISMATCH_ERR should be defined");
         equal(FileError.PATH_EXISTS_ERR, 12, "FileError.PATH_EXISTS_ERR should be defined");
     });
-    module('LocalFileSystem interface');
-    test("window.requestFileSystem function should be defined", function () {
+
+    module('LocalFileSystem interface', {
+        // setup function will run before each test
+        setup: function() {
+            var that = this;
+            this.root = getFileSystemRoot();
+            this.fail = function(error) {
+                console.log('file error: ' + error.code);
+            };
+            this.unexpectedSuccess = function() {
+                console.log('!!! success function called when not expected !!!');
+            };
+            // deletes specified file or directory
+            this.deleteEntry = function(name, success, error) {
+                // deletes entry, if it exists
+                window.resolveLocalFileSystemURI(that.root.toURL() + '/' + name, 
+                        function(entry) {
+                            console.log('Deleting: ' + entry.fullPath);
+                            if (entry.isDirectory === true) {
+                                entry.removeRecursively(success, error); 
+                            }
+                            else {
+                                entry.remove(success, error);
+                            }
+                        }, 
+                        // doesn't exist
+                        success);
+            };
+            // deletes and re-creates the specified file
+            this.createFile = function(fileName, success, error) {
+                that.deleteEntry(fileName, function() {
+                    console.log('Creating file: ' + that.root.fullPath + '/' + fileName);
+                    that.root.getFile(fileName, {create: true}, success, error);                
+                }, error);
+            };
+            // deletes and re-creates the specified directory
+            this.createDirectory = function(dirName, success, error) {
+                that.deleteEntry(dirName, function() {
+                   console.log('Creating directory: ' + that.root.fullPath + '/' + dirName);
+                   that.root.getDirectory(dirName, {create: true}, success, error); 
+                }, error);
+            };
+        }
+    });
+    test("window.requestFileSystem function should be defined", function() {
         expect(1);
         ok(typeof window.requestFileSystem === 'function', "window.requestFileSystem should be a function.");
     });
-    test("window.resolveLocalFileSystemURI function should be defined", function () {
+    test("window.resolveLocalFileSystemURI function should be defined", function() {
         expect(1);
         ok(typeof window.resolveLocalFileSystemURI === 'function', "window.resolveLocalFileSystemURI should be a function.");
     });
-    test("File system types should be defined", function () {
+    test("File system types should be defined", function() {
         expect(2);
         equal(LocalFileSystem.TEMPORARY, 0, "LocalFileSystem.TEMPORARY should be defined");
         equal(LocalFileSystem.PERSISTENT, 1, "LocalFileSystem.PERSISTENT should be defined");
     });
-    test("retrieve PERSISTENT file system", function () {
+    test("retrieve PERSISTENT file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(4);
 
-        var testPersistent = function (fileSystem) {
+        var testPersistent = function(fileSystem) {
             ok(typeof fileSystem !== 'undefined' && fileSystem !== null, "window.requestFileSystem should return an object.");
             ok(typeof fileSystem.name !== 'undefined' && fileSystem.name !== null, "filesystem should include a 'name' property.");
             equal(fileSystem.name, "persistent", "file system 'name' attribute should be set properly");
             ok(typeof fileSystem.root !== 'undefined' && fileSystem.root !== null, "filesystem should include a 'root' property.");
             QUnit.start();
         };
-
+        
         // retrieve PERSISTENT file system
-        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, testPersistent,
-                function (error) {
+        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, testPersistent, 
+                function(error) {
                     console.log('error retrieving file system: ' + error.code);
-                });
+                });            
     });
-    test("retrieve TEMPORARY file system", function () {
+    test("retrieve TEMPORARY file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(4);
 
-        var testTemporary = function (fileSystem) {
+        var testTemporary = function(fileSystem) {
             ok(typeof fileSystem !== 'undefined' && fileSystem !== null, "window.requestFileSystem should return an object.");
             ok(typeof fileSystem.name !== 'undefined' && fileSystem.name !== null, "filesystem should include a 'name' property.");
             equal(fileSystem.name, "temporary", "file system 'name' attribute should be set properly");
             ok(typeof fileSystem.root !== 'undefined' && fileSystem.root !== null, "filesystem should include a 'root' property.");
             QUnit.start();
         };
-
+        
         // Request the file system
-        window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, testTemporary,
-                function (error) {
+        window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, testTemporary, 
+                function(error) {
                     console.log('error retrieving file system: ' + error.code);
-                });
+                });            
     });
-    test("request a file system that is too large", function () {
+    test("request a file system that is too large", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
 
-        var failFS = function (error) {
+        var failFS = function(error) {
             ok(error !== null, "error should not be null.");
-            equal(error.code, FileError.QUOTA_EXCEEDED_ERR, "Should receive error code FileError.QUOTA_EXCEEDED_ERR");
+            equal(error.code, FileError.QUOTA_EXCEEDED_ERR, "Shoud receive error code FileError.QUOTA_EXCEEDED_ERR");
             QUnit.start();
         };
-
+        
         // Request the file system
         window.requestFileSystem(LocalFileSystem.TEMPORARY, 1000000000000000, null, failFS);
     });
-    test("request a file system that does not exist", function () {
+    test("request a file system that does not exist", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
 
-        var failFS = function (error) {
+        var failFS = function(error) {
             ok(typeof error !== 'undefined' && error !== null, "error should not be null.");
-            equal(error.code, FileError.SYNTAX_ERR, "Should receive error code FileError.SYNTAX_ERR");
+            equal(error.code, FileError.SYNTAX_ERR, "Shoud receive error code FileError.SYNTAX_ERR");
             QUnit.start();
         };
-
+        
         // Request the file system
         window.requestFileSystem(-1, 0, null, failFS);
     });
-    test("resolve invalid file name", function () {
+    test("resolve valid file name", function() {
+        QUnit.stop(Tests.TEST_TIMEOUT);
+        expect(2);
+        
+        var fileName = "resolve.file.uri",
+            that = this,
+            resolveCallback = function(entry) {
+                // lookup file system entry
+                window.resolveLocalFileSystemURI(entry.toURI(), testEntry, this.fail);
+            },
+            testEntry = function(fileEntry) {
+                ok(typeof fileEntry !== 'undefined' && fileEntry !== null, "fileEntry should not be null.");
+                ok(fileEntry.name == fileName, "fileEntry.name should equal 'resolve.file.uri'");
+
+                // cleanup
+                that.deleteEntry(fileName);
+                QUnit.start();
+            };
+        
+        // create a new file entry
+        this.createFile(fileName, resolveCallback, this.fail);
+    });
+    test("resolve valid file name with parameters", function() {
+        QUnit.stop(Tests.TEST_TIMEOUT);
+        expect(2);
+        
+        var fileName = "resolve.file.uri.params",
+            that = this,
+            resolveCallback = function(entry) {
+                // lookup file system entry
+                window.resolveLocalFileSystemURI(entry.toURI() + "?1234567890", testEntry, this.fail);
+            },
+            testEntry = function(fileEntry) {
+                ok(typeof fileEntry !== 'undefined' && fileEntry !== null, "fileEntry should not be null.");
+                ok(fileEntry.name == fileName, "fileEntry.name should equal 'resolve.file.uri.params'");
+
+                // cleanup
+                that.deleteEntry(fileName);
+                QUnit.start();
+            };
+        
+        // create a new file entry
+        this.createFile(fileName, resolveCallback, this.fail);
+    });
+    test("resolve invalid file name", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
 
-        var failURI = function (error) {
+        var failURL = function(error) {
             ok(typeof error !== 'undefined' && error !== null, "error should not be null.");
-            equal(error.code, FileError.NOT_FOUND_ERR, "Should receive error code FileError.NOT_FOUND_ERR");
+            equal(error.code, FileError.NOT_FOUND_ERR, "Shoud receive error code FileError.NOT_FOUND_ERR");
             QUnit.start();
         };
-
+        
         // lookup file system entry
-        window.resolveLocalFileSystemURI("file:///this.is.not.a.valid.file.txt", null, failURI);
+        window.resolveLocalFileSystemURI("file:///this.is.not.a.valid.file.txt", null, failURL);
     });
-    test("resolve invalid URI", function () {
+    test("resolve invalid URL", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
 
-        var failURI = function (error) {
+        var failURL = function(error) {
             ok(typeof error !== 'undefined' && error !== null, "error should not be null.");
-            equal(error.code, FileError.ENCODING_ERR, "Should receive an error code FileError.ENCODING_ERR");
+            equal(error.code, FileError.ENCODING_ERR, "Shoud receive an error code FileError.ENCODING_ERR");
             QUnit.start();
         };
-
+        
         // lookup file system entry
-        window.resolveLocalFileSystemURI("file://c:/directory:/this.is.not.a.valid.url", null, failURI);
+        window.resolveLocalFileSystemURI("/this.is.not.a.valid.url", null, failURL);
     });
+
     module('Metadata interface');
-    test("Metadata constructor should exist", function () {
+    test("Metadata constructor should exist", function() {
         expect(2);
         var metadata = new Metadata();
         ok(metadata !== null, "Metadata object should not be null.");
         ok(typeof metadata.modificationTime !== 'undefined', "Metadata object should have a 'modificationTime' property.");
     });
     module('Flags interface');
-    test("Flags constructor should exist", function () {
+    test("Flags constructor should exist", function() {
         expect(5);
         var flags = new Flags(false, true);
         ok(flags !== null, "Flags object should not be null.");
         ok(typeof flags.create !== 'undefined' && flags.create !== null, "Flags object should have a 'create' property.");
         equal(flags.create, false, "Flags.create should be set properly");
         ok(typeof flags.exclusive !== 'undefined' && flags.exclusive !== null, "Flags object should have an 'exclusive' property.");
-        equal(flags.exclusive, true, "flags.exclusive should be set properly")
+        equal(flags.exclusive, true, "flags.exclusive should be set properly");
     });
     module('FileSystem interface');
-    test("FileSystem root should be a DirectoryEntry", function () {
+    test("FileSystem root should be a DirectoryEntry", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(15);
 
         var root = getFileSystemRoot(),
-            testFSRoot = function (entry) {
+            testFSRoot = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "entry should be non-null");
                 equal(entry.isFile, false, "entry.isFile should be false");
                 equal(entry.isDirectory, true, "entry.isDirectory should be true");
@@ -181,7 +272,7 @@ Tests.prototype.FileTests = function () {
                 ok(typeof entry.getMetadata === 'function', "entry object should have a 'getMetadata' function.");
                 ok(typeof entry.moveTo === 'function', "entry object should have a 'moveTo' function.");
                 ok(typeof entry.copyTo === 'function', "entry object should have a 'copyTo' function.");
-                ok(typeof entry.toURI === 'function', "entry object should have a 'toURI' function.");
+                ok(typeof entry.toURL === 'function', "entry object should have a 'toURL' function.");
                 ok(typeof entry.remove === 'function', "entry object should have a 'remove' function.");
                 ok(typeof entry.getParent === 'function', "entry object should have a 'getParent' function.");
                 ok(typeof entry.createReader === 'function', "entry object should have a 'createReader' function.");
@@ -189,479 +280,479 @@ Tests.prototype.FileTests = function () {
                 ok(typeof entry.getDirectory === 'function', "entry object should have a 'getDirectory' function.");
                 ok(typeof entry.removeRecursively === 'function', "entry object should have a 'removeRecursively' function.");
                 QUnit.start();
-            };
-
-        window.resolveLocalFileSystemURI(root.toURI(), testFSRoot, null);
+        };
+    
+        window.resolveLocalFileSystemURI(root.toURL(), testFSRoot, null);
 
     });
     module('DirectoryEntry interface', {
         // setup function will run before each test
-        setup: function () {
+        setup: function() {
             this.root = getFileSystemRoot();
-            this.fail = function (error) {
+            this.fail = function(error) {
                 console.log('file error: ' + error.code);
             };
-            this.unexpectedSuccess = function () {
+            this.unexpectedSuccess = function() {
                 console.log('!!! success function called when not expected !!!');
             };
         }
     });
-    test("DirectoryEntry.getFile: get Entry for file that does not exist", function () {
+    test("DirectoryEntry.getFile: get Entry for file that does not exist", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "de.no.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            testFile = function (error) {
+            testFile = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving a file that does not exist is an error");
                 equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-
+                
                 // cleanup
                 QUnit.start();
             };
-
+                
         // create:false, exclusive:false, file does not exist
-        this.root.getFile(fileName, { create: false }, null, testFile);
+        this.root.getFile(fileName, {create:false}, null, testFile); 
     });
-    test("DirectoryEntry.getFile: create new file", function () {
+    test("DirectoryEntry.getFile: create new file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var fileName = "de.create.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            testFile = function (entry) {
+            testFile = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "file entry should not be null");
                 equal(entry.isFile, true, "entry 'isFile' attribute should be true");
                 equal(entry.isDirectory, false, "entry 'isDirectory' attribute should be false");
                 equal(entry.name, fileName, "entry 'name' attribute should be set");
                 equal(entry.fullPath, filePath, "entry 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 entry.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create:true, exclusive:false, file does not exist
-        this.root.getFile(fileName, { create: true }, testFile, this.fail);
+        this.root.getFile(fileName, {create: true}, testFile, this.fail); 
     });
-    test("DirectoryEntry.getFile: create new file (exclusive)", function () {
+    test("DirectoryEntry.getFile: create new file (exclusive)", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var fileName = "de.create.exclusive.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            testFile = function (entry) {
+            testFile = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "file entry should not be null");
                 equal(entry.isFile, true, "entry 'isFile' attribute should be true");
                 equal(entry.isDirectory, false, "entry 'isDirectory' attribute should be false");
                 equal(entry.name, fileName, "entry 'name' attribute should be set");
                 equal(entry.fullPath, filePath, "entry 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 entry.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create:true, exclusive:true, file does not exist
-        this.root.getFile(fileName, { create: true, exclusive: true }, testFile, this.fail);
+        this.root.getFile(fileName, {create: true, exclusive:true}, testFile, this.fail); 
     });
-    test("DirectoryEntry.getFile: create file that already exists", function () {
+    test("DirectoryEntry.getFile: create file that already exists", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var fileName = "de.create.existing.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            getFile = function (file) {
+            getFile = function(file) {
                 // create:true, exclusive:false, file exists
-                that.root.getFile(fileName, { create: true }, testFile, that.fail);
+                that.root.getFile(fileName, {create:true}, testFile, that.fail);             
             },
-            testFile = function (entry) {
+            testFile = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "file entry should not be null");
                 equal(entry.isFile, true, "entry 'isFile' attribute should be true");
                 equal(entry.isDirectory, false, "entry 'isDirectory' attribute should be false");
                 equal(entry.name, fileName, "entry 'name' attribute should be set");
                 equal(entry.fullPath, filePath, "entry 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 entry.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create file to kick off test
-        this.root.getFile(fileName, { create: true }, getFile, this.fail);
+        this.root.getFile(fileName, {create:true}, getFile, this.fail); 
     });
-    test("DirectoryEntry.getFile: create file that already exists (exclusive)", function () {
+    test("DirectoryEntry.getFile: create file that already exists (exclusive)", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "de.create.exclusive.existing.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
             existingFile,
-            getFile = function (file) {
+            getFile = function(file) {
                 existingFile = file;
                 // create:true, exclusive:true, file exists
-                that.root.getFile(fileName, { create: true, exclusive: true }, null, testFile);
+                that.root.getFile(fileName, {create:true, exclusive:true}, null, testFile);             
             },
-            testFile = function (error) {
+            testFile = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "creating exclusive file that already exists is an error");
                 equal(error.code, FileError.PATH_EXISTS_ERR, "error code should be FileError.PATH_EXISTS_ERR");
-
+               
                 // cleanup
                 existingFile.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create file to kick off test
-        this.root.getFile(fileName, { create: true }, getFile, this.fail);
+        this.root.getFile(fileName, {create:true}, getFile, this.fail); 
     });
-    test("DirectoryEntry.getFile: get Entry for existing file", function () {
+    test("DirectoryEntry.getFile: get Entry for existing file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var fileName = "de.get.file",
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            getFile = function (file) {
+            getFile = function(file) {
                 // create:false, exclusive:false, file exists
-                that.root.getFile(fileName, { create: false }, testFile, that.fail);
+                that.root.getFile(fileName, {create:false}, testFile, that.fail);             
             },
-            testFile = function (entry) {
+            testFile = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "file entry should not be null");
                 equal(entry.isFile, true, "entry 'isFile' attribute should be true");
                 equal(entry.isDirectory, false, "entry 'isDirectory' attribute should be false");
                 equal(entry.name, fileName, "entry 'name' attribute should be set");
                 equal(entry.fullPath, filePath, "entry 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 entry.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create file to kick off test
-        this.root.getFile(fileName, { create: true }, getFile, this.fail);
+        this.root.getFile(fileName, {create:true}, getFile, this.fail); 
     });
-    test("DirectoryEntry.getFile: get FileEntry for invalid path", function () {
+    test("DirectoryEntry.getFile: get FileEntry for invalid path", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
-        var fileName = "de/\invalid:path<>",
+        
+        var fileName = "de:invalid:path",
             that = this,
-            testFile = function (error) {
+            testFile = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving a file using an invalid path is an error");
                 equal(error.code, FileError.ENCODING_ERR, "error code should be FileError.ENCODING_ERR");
-
+                
                 // cleanup
                 QUnit.start();
             };
-
+                
         // create:false, exclusive:false, invalid path
-        this.root.getFile(fileName, { create: false }, null, testFile);
+        this.root.getFile(fileName, {create:false}, null, testFile); 
     });
-    test("DirectoryEntry.getDirectory: get Entry for directory that does not exist", function () {
+    test("DirectoryEntry.getDirectory: get Entry for directory that does not exist", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var dirName = "de.no.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            testDir = function (error) {
+            testDir = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving a directory that does not exist is an error");
                 equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-
+                
                 // cleanup
                 QUnit.start();
             };
-
+                
         // create:false, exclusive:false, directory does not exist
-        this.root.getDirectory(dirName, { create: false }, null, testDir);
+        this.root.getDirectory(dirName, {create:false}, null, testDir); 
     });
-    test("DirectoryEntry.getDirectory: create new dir with space then resolveFileSystemURI", function () {
+    test("DirectoryEntry.getDirectory: create new dir with space then resolveFileSystemURL", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de create dir",
-        dirPath = this.root.fullPath + dirName,
+        dirPath = this.root.fullPath + '/' + dirName,
         that = this,
-        getDir = function (dirEntry) {
-            console.log("getDir");
-            var dirURI = dirEntry.toURI();
-            // now encode URI and try to resolve
-            window.resolveLocalFileSystemURI(dirURI, testDirFromURI, that.fail);
-
+        getDir = function(dirEntry) {
+            
+            var dirURL = dirEntry.toURL();
+            // now encode URL and try to resolve
+            window.resolveLocalFileSystemURI(dirURL, testDirFromURL, that.fail);
+            
         },
-        testDirFromURI = function (directory) {
+        testDirFromURL = function(directory) {
             ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
             equal(directory.isFile, false, "directory 'isFile' attribute should be false");
             equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
             equal(directory.name, dirName, "directory 'name' attribute should be set");
             equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+            
             // cleanup
             directory.remove(null, that.fail);
             QUnit.start();
         };
-
+        
         // create:true, exclusive:false, directory does not exist
-        this.root.getDirectory(dirName, { create: true }, getDir, this.fail);
+        this.root.getDirectory(dirName, {create: true}, getDir, this.fail); 
     });
-    test("DirectoryEntry.getDirectory: create new dir with space resolveFileSystemURI with encoded URI", function () {
+    test("DirectoryEntry.getDirectory: create new dir with space resolveFileSystemURL with encoded URL", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de create dir",
-        dirPath = this.root.fullPath + dirName,
+        dirPath = this.root.fullPath + '/' + dirName,
         that = this,
-        getDir = function (dirEntry) {
-
-            var dirURI = dirEntry.toURI();
-            // now encode URI and try to resolve
-            window.resolveLocalFileSystemURI(encodeURI(dirURI), testDirFromURI, that.fail);
-
+        getDir = function(dirEntry) {
+            
+            var dirURL = dirEntry.toURL();
+            // now encode URL and try to resolve
+            window.resolveLocalFileSystemURI(encodeURI(dirURL), testDirFromURL, that.fail);
+            
         },
-        testDirFromURI = function (directory) {
+        testDirFromURL = function(directory) {
             ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
             equal(directory.isFile, false, "directory 'isFile' attribute should be false");
             equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
             equal(directory.name, dirName, "directory 'name' attribute should be set");
             equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+        
             // cleanup
             directory.remove(null, that.fail);
             QUnit.start();
         };
-
+        
         // create:true, exclusive:false, directory does not exist
-        this.root.getDirectory(dirName, { create: true }, getDir, this.fail);
+        this.root.getDirectory(dirName, {create: true}, getDir, this.fail); 
     });
 
-    test("DirectoryEntry.getDirectory: create new directory", function () {
+    test("DirectoryEntry.getDirectory: create new directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de.create.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            testDir = function (directory) {
+            testDir = function(directory) {
                 ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
                 equal(directory.isFile, false, "directory 'isFile' attribute should be false");
                 equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
                 equal(directory.name, dirName, "directory 'name' attribute should be set");
                 equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 directory.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create:true, exclusive:false, directory does not exist
-        this.root.getDirectory(dirName, { create: true }, testDir, this.fail);
+        this.root.getDirectory(dirName, {create: true}, testDir, this.fail); 
     });
-
-    test("DirectoryEntry.getDirectory: create new directory (exclusive)", function () {
+    
+    test("DirectoryEntry.getDirectory: create new directory (exclusive)", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de.create.exclusive.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            testDir = function (directory) {
+            testDir = function(directory) {
                 ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
                 equal(directory.isFile, false, "directory 'isFile' attribute should be false");
                 equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
                 equal(directory.name, dirName, "directory 'name' attribute should be set");
                 equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+               
                 // cleanup
                 directory.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create:true, exclusive:true, directory does not exist
-        this.root.getDirectory(dirName, { create: true, exclusive: true }, testDir, this.fail);
+        this.root.getDirectory(dirName, {create: true, exclusive:true}, testDir, this.fail); 
     });
-    test("DirectoryEntry.getDirectory: create directory that already exists", function () {
+    test("DirectoryEntry.getDirectory: create directory that already exists", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de.create.existing.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            getDir = function (directory) {
+            getDir = function(directory) {
                 // create:true, exclusive:false, directory exists
-                that.root.getDirectory(dirName, { create: true }, testDir, that.fail);
+                that.root.getDirectory(dirName, {create:true}, testDir, that.fail);             
             },
-            testDir = function (directory) {
+            testDir = function(directory) {
                 ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
                 equal(directory.isFile, false, "directory 'isFile' attribute should be false");
                 equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
                 equal(directory.name, dirName, "directory 'name' attribute should be set");
                 equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 directory.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create directory to kick off test
-        this.root.getDirectory(dirName, { create: true }, getDir, this.fail);
+        this.root.getDirectory(dirName, {create:true}, getDir, this.fail); 
     });
-    test("DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function () {
+    test("DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var dirName = "de.create.exclusive.existing.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
             existingDir,
-            getDir = function (directory) {
+            getDir = function(directory) {
                 existingDir = directory;
                 // create:true, exclusive:true, directory exists
-                that.root.getDirectory(dirName, { create: true, exclusive: true }, null, testDir);
+                that.root.getDirectory(dirName, {create:true, exclusive:true}, null, testDir);             
             },
-            testDir = function (error) {
+            testDir = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "creating exclusive directory that already exists is an error");
                 equal(error.code, FileError.PATH_EXISTS_ERR, "error code should be FileError.PATH_EXISTS_ERR");
-
+                
                 // cleanup
                 existingDir.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create directory to kick off test
-        this.root.getDirectory(dirName, { create: true }, getDir, this.fail);
+        this.root.getDirectory(dirName, {create:true}, getDir, this.fail); 
     });
-    test("DirectoryEntry.getDirectory: get Entry for existing directory", function () {
+    test("DirectoryEntry.getDirectory: get Entry for existing directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(5);
-
+        
         var dirName = "de.get.dir",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            getDir = function (directory) {
+            getDir = function(directory) {
                 // create:false, exclusive:false, directory exists
-                that.root.getDirectory(dirName, { create: false }, testDir, that.fail);
+                that.root.getDirectory(dirName, {create:false}, testDir, that.fail);             
             },
-            testDir = function (directory) {
+            testDir = function(directory) {
                 ok(typeof directory !== 'undefined' && directory !== null, "directory entry should not be null");
                 equal(directory.isFile, false, "directory 'isFile' attribute should be false");
                 equal(directory.isDirectory, true, "directory 'isDirectory' attribute should be true");
                 equal(directory.name, dirName, "directory 'name' attribute should be set");
                 equal(directory.fullPath, dirPath, "directory 'fullPath' attribute should be set");
-
+                
                 // cleanup
                 directory.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create directory to kick off test
-        this.root.getDirectory(dirName, { create: true }, getDir, this.fail);
+        this.root.getDirectory(dirName, {create:true}, getDir, this.fail); 
     });
-    test("DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function () {
+    test("DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
-        var dirName = "de:<>invalid:path",
+        
+        var dirName = "de:invalid:path",
             that = this,
-            testDir = function (error) {
+            testDir = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving a directory using an invalid path is an error");
                 equal(error.code, FileError.ENCODING_ERR, "error code should be FileError.ENCODING_ERR");
-
+                
                 // cleanup
                 QUnit.start();
             };
-
+                
         // create:false, exclusive:false, invalid path
-        this.root.getDirectory(dirName, { create: false }, null, testDir);
+        this.root.getDirectory(dirName, {create:false}, null, testDir); 
     });
-    test("DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function () {
+    test("DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "de.existing.file",
             existingFile,
-            filePath = this.root.fullPath + fileName,
+            filePath = this.root.fullPath + '/' + fileName,
             that = this,
-            getDir = function (file) {
+            getDir = function(file) {
                 existingFile = file;
                 // create:false, exclusive:false, existing file
-                that.root.getDirectory(fileName, { create: false }, null, testDir);
+                that.root.getDirectory(fileName, {create:false}, null, testDir);             
             },
-            testDir = function (error) {
+            testDir = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving directory for existing file is an error");
                 equal(error.code, FileError.TYPE_MISMATCH_ERR, "error code should be FileError.TYPE_MISMATCH_ERR");
-
+                
                 // cleanup
                 existingFile.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create file to kick off test
-        this.root.getFile(fileName, { create: true }, getDir, this.fail);
+        this.root.getFile(fileName, {create:true}, getDir, this.fail); 
     });
-    test("DirectoryEntry.getFile: get FileEntry for existing directory", function () {
+    test("DirectoryEntry.getFile: get FileEntry for existing directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var dirName = "de.existing.dir",
             existingDir,
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            getFile = function (directory) {
+            getFile = function(directory) {
                 existingDir = directory;
                 // create:false, exclusive:false, existing directory
-                that.root.getFile(dirName, { create: false }, null, testFile);
+                that.root.getFile(dirName, {create:false}, null, testFile);             
             },
-            testFile = function (error) {
+            testFile = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "retrieving file for existing directory is an error");
                 equal(error.code, FileError.TYPE_MISMATCH_ERR, "error code should be FileError.TYPE_MISMATCH_ERR");
-
+               
                 // cleanup
                 existingDir.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create directory to kick off test
-        this.root.getDirectory(dirName, { create: true }, getFile, this.fail);
+        this.root.getDirectory(dirName, {create:true}, getFile, this.fail); 
     });
-    test("DirectoryEntry.removeRecursively on directory", function () {
+    test("DirectoryEntry.removeRecursively on directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var dirName = "de.removeRecursively",
             subDirName = "dir",
-            dirPath = this.root.fullPath + dirName,
-        //subDirPath = this.root.fullPath + '/' + subDirName,
-			subDirPath = dirPath + '/' + subDirName,
+            dirPath = this.root.fullPath + '/' + dirName,
+            //subDirPath = this.root.fullPath + '/' + subDirName,
+            subDirPath = dirPath + '/' + subDirName,
             that = this,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 // delete directory
-                var deleteDirectory = function (directory) {
-                    entry.removeRecursively(testRemove, that.fail);
-                };
+                var deleteDirectory = function(directory) {
+                    entry.removeRecursively(testRemove, that.fail);  
+                }; 
                 // create a sub-directory within directory
-                entry.getDirectory(subDirName, { create: true }, deleteDirectory, that.fail);
-            },
-				testRemove = function () {
-				    // test that removed directory no longer exists
-				    that.root.getDirectory(dirName, { create: false }, null, testDirExists);
-				},
-				testDirExists = function (error) {
-				    ok(typeof error !== 'undefined' && error !== null, "removed directory should not exist");
-				    equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-				    QUnit.start();
-				};
+                entry.getDirectory(subDirName, {create: true}, deleteDirectory, that.fail);
+                },
+                testRemove = function() {
+                    // test that removed directory no longer exists
+                    that.root.getDirectory(dirName, {create:false}, null, testDirExists);
+                },
+                testDirExists = function(error){
+                    ok(typeof error !== 'undefined' && error !== null, "removed directory should not exist");
+                    equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
+                    QUnit.start();
+                };
 
         // create a new directory entry to kick off test
-        this.root.getDirectory(dirName, { create: true }, entryCallback, this.fail);
+        this.root.getDirectory(dirName, {create:true}, entryCallback, this.fail);
     });
-    test("DirectoryEntry.createReader: create reader on existing directory", function () {
+    test("DirectoryEntry.createReader: create reader on existing directory", function() {
         expect(2);
-
+        
         // create reader for root directory 
         var reader = this.root.createReader();
         ok(typeof reader !== 'undefined' && reader !== null, "reader object should not be null");
@@ -669,81 +760,81 @@ Tests.prototype.FileTests = function () {
     });
     module('DirectoryReader interface', {
         // setup function will run before each test
-        setup: function () {
+        setup: function() {
             this.root = getFileSystemRoot();
-            this.fail = function (error) {
+            this.fail = function(error) {
                 console.log('file error: ' + error.code);
-            };
+            };   
         }
     });
-    test("DirectoryReader.readEntries: read contents of existing directory", function () {
+    test("DirectoryReader.readEntries: read contents of existing directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(4);
-
+        
         var reader,
-		 testEntries = function (entries) {
-		     ok(typeof entries !== 'undefined' && entries !== null, "directory entries should not be null");
-		     ok(entries.constructor === Array, "readEntries should return an array of entries");
-		     QUnit.start();
-		 };
-
+         testEntries = function(entries) {
+                ok(typeof entries !== 'undefined' && entries !== null, "directory entries should not be null");
+                ok(entries.constructor === Array, "readEntries should return an array of entries");
+                QUnit.start();
+            };
+                
         // create reader for root directory 
         reader = this.root.createReader();
         ok(typeof reader !== 'undefined' && reader !== null, "reader object should not be null");
         ok(typeof reader.readEntries === 'function', "reader object should have a 'readEntries' method");
-
+        
         // read entries
         reader.readEntries(testEntries, this.fail);
     });
-    test("DirectoryReader.readEntries: read contents of directory that has been removed", function () {
+    test("DirectoryReader.readEntries: read contents of directory that has been removed", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(4);
-
+        
         var dirName = "de.createReader.notfound",
-            dirPath = this.root.fullPath + dirName,
+            dirPath = this.root.fullPath + '/' + dirName,
             that = this,
-            entryCallback = function (directory) {
+            entryCallback = function(directory) {
                 // read entries
-                var readEntries = function () {
+                var readEntries = function() {
                     var reader = directory.createReader();
                     reader.readEntries(null, testReader);
                 };
                 // delete directory
-                directory.removeRecursively(readEntries, that.fail);
+                directory.removeRecursively(readEntries, that.fail);  
             },
-            testReader = function (error) {
-                var testDirectoryExists = function (error) {
+            testReader = function(error) {
+                var testDirectoryExists = function(error) {
                     ok(typeof error !== 'undefined' && error !== null, "reading entries on a directory that does not exist is an error")
                     equal(error.code, FileError.NOT_FOUND_ERR, "removed directory should not exist");
                     QUnit.start();
                 };
                 ok(typeof error !== 'undefined' && error !== null, "reading entries on a directory that does not exist is an error")
                 equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-                that.root.getDirectory(dirName, { create: false }, null, testDirectoryExists);
+                that.root.getDirectory(dirName, {create:false}, null, testDirectoryExists);
             };
 
         // create a new directory entry to kick off test
-        this.root.getDirectory(dirName, { create: true }, entryCallback, this.fail);
+        this.root.getDirectory(dirName, {create:true}, entryCallback, this.fail);
     });
-    test("DirectoryEntry.removeRecursively on root file system", function () {
+    test("DirectoryEntry.removeRecursively on root file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
-        var testRemove = function (error) {
-            ok(typeof error !== 'undefined' && error !== null, "removing root file system should generate an error");
-            equal(error.code, FileError.NO_MODIFICATION_ALLOWED_ERR, "error code should be FileError.NO_MODIFICATION_ALLOWED_ERR");
-            QUnit.start();
-        };
+        
+        var testRemove = function(error) {
+                ok(typeof error !== 'undefined' && error !== null, "removing root file system should generate an error");
+                equal(error.code, FileError.NO_MODIFICATION_ALLOWED_ERR, "error code should be FileError.NO_MODIFICATION_ALLOWED_ERR");
+                QUnit.start();
+            };
 
         // remove root file system
         this.root.removeRecursively(null, testRemove);
     });
     module('File interface');
-    test("File constructor should be defined", function () {
+    test("File constructor should be defined", function() {
         expect(1);
         ok(typeof File === 'function', "File constructor should be a function.");
     });
-    test("File attributes should be defined", function () {
+    test("File attributes should be defined", function() {
         expect(5);
         var file = new File();
         ok(typeof file.name !== 'undefined', "File object should have a 'name' attribute");
@@ -754,152 +845,152 @@ Tests.prototype.FileTests = function () {
     });
     module('FileEntry interface', {
         // setup function will run before each test
-        setup: function () {
+        setup: function() {
             this.root = getFileSystemRoot();
-            this.fail = function (error) {
+            this.fail = function(error) {
                 console.log('file error: ' + error.code);
-            };
+            };   
         }
     });
-    test("FileEntry methods should be defined", function () {
+    test("FileEntry methods should be defined", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(3);
-
+        
         var fileName = "fe.methods",
             that = this,
-            testFileEntry = function (fileEntry) {
+            testFileEntry = function(fileEntry) {
                 ok(typeof fileEntry !== 'undefined' && fileEntry !== null, "FileEntry should not be null");
                 ok(typeof fileEntry.createWriter === 'function', "FileEntry should have a 'createWriter' method");
                 ok(typeof fileEntry.file === 'function', "FileEntry should have a 'file' method");
-
+                
                 // cleanup 
                 fileEntry.remove(null, that.fail);
                 QUnit.start();
             };
-
+                
         // create a new file entry to kick off test
-        this.root.getFile(fileName, { create: true }, testFileEntry, this.fail);
+        this.root.getFile(fileName, {create:true}, testFileEntry, this.fail);
     });
-    test("FileEntry.createWriter should return a FileWriter object", function () {
+    test("FileEntry.createWriter should return a FileWriter object", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "fe.createWriter",
             that = this,
             testFile,
-            entryCallback = function (fileEntry) {
+            entryCallback = function(fileEntry) {
                 testFile = fileEntry;
                 fileEntry.createWriter(testWriter, that.fail);
             },
-            testWriter = function (writer) {
+            testWriter = function(writer) {
                 ok(typeof writer !== 'undefined' && writer !== null, "FileWriter object should not be null");
                 ok(writer.constructor === FileWriter, "writer should be a FileWriter object");
-
+                
                 // cleanup 
                 testFile.remove(null, that.fail);
-                QUnit.start();
+                QUnit.start();                
             };
-
+                
         // create a new file entry to kick off test
-        this.root.getFile(fileName, { create: true }, entryCallback, this.fail);
+        this.root.getFile(fileName, {create:true}, entryCallback, this.fail);
     });
-    test("FileEntry.file should return a File object", function () {
+    test("FileEntry.file should return a File object", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "fe.file",
             that = this,
             newFile,
-            entryCallback = function (fileEntry) {
+            entryCallback = function(fileEntry) {
                 newFile = fileEntry;
                 fileEntry.file(testFile, that.fail);
             },
-            testFile = function (file) {
+            testFile = function(file) {
                 ok(typeof file !== 'undefined' && file !== null, "File object should not be null");
                 ok(file.constructor === File, "File object should be a File");
-
+                
                 // cleanup 
                 newFile.remove(null, that.fail);
-                QUnit.start();
+                QUnit.start();                
             };
-
+                
         // create a new file entry to kick off test
-        this.root.getFile(fileName, { create: true }, entryCallback, this.fail);
+        this.root.getFile(fileName, {create:true}, entryCallback, this.fail);
     });
-    test("FileEntry.file: on File that has been removed", function () {
+    test("FileEntry.file: on File that has been removed", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "fe.no.file",
             that = this,
-            entryCallback = function (fileEntry) {
+            entryCallback = function(fileEntry) {
                 // create File object
-                var getFile = function () {
+                var getFile = function() {
                     fileEntry.file(null, testFile);
                 };
                 // delete file
                 fileEntry.remove(getFile, that.fail);
             },
-            testFile = function (error) {
+            testFile = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "invoking FileEntry.file on a file that does not exist is an error");
                 equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-                QUnit.start();
+                QUnit.start();                
             };
-
+                
         // create a new file entry to kick off test
-        this.root.getFile(fileName, { create: true }, entryCallback, this.fail);
+        this.root.getFile(fileName, {create:true}, entryCallback, this.fail);
     });
     module('Entry interface', {
         // setup function will run before each test
-        setup: function () {
+        setup: function() {
             var that = this;
             this.root = getFileSystemRoot();
-            this.fail = function (error) {
+            this.fail = function(error) {
                 console.log('file error: ' + error.code);
             };
-            this.unexpectedSuccess = function () {
+            this.unexpectedSuccess = function() {
                 console.log('!!! success function called when not expected !!!');
             };
             // deletes specified file or directory
-            this.deleteEntry = function (name, success, error) {
+            this.deleteEntry = function(name, success, error) {
                 // deletes entry, if it exists
-                window.resolveLocalFileSystemURI(that.root.toURI() + '/' + name,
-                        function (entry) {
+                window.resolveLocalFileSystemURI(that.root.toURL() + '/' + name, 
+                        function(entry) {
                             console.log('Deleting: ' + entry.fullPath);
                             if (entry.isDirectory === true) {
-                                entry.removeRecursively(success, error);
+                                entry.removeRecursively(success, error); 
                             }
                             else {
                                 entry.remove(success, error);
                             }
-                        },
-                // doesn't exist
+                        }, 
+                        // doesn't exist
                         success);
             };
             // deletes and re-creates the specified file
-            this.createFile = function (fileName, success, error) {
-                that.deleteEntry(fileName, function () {
+            this.createFile = function(fileName, success, error) {
+                that.deleteEntry(fileName, function() {
                     console.log('Creating file: ' + that.root.fullPath + '/' + fileName);
-                    that.root.getFile(fileName, { create: true }, success, error);
+                    that.root.getFile(fileName, {create: true}, success, error);                
                 }, error);
             };
             // deletes and re-creates the specified directory
-            this.createDirectory = function (dirName, success, error) {
-                that.deleteEntry(dirName, function () {
-                    console.log('Creating directory: ' + that.root.fullPath + '/' + dirName);
-                    that.root.getDirectory(dirName, { create: true }, success, error);
+            this.createDirectory = function(dirName, success, error) {
+                that.deleteEntry(dirName, function() {
+                   console.log('Creating directory: ' + that.root.fullPath + '/' + dirName);
+                   that.root.getDirectory(dirName, {create: true}, success, error); 
                 }, error);
             };
         }
     });
-    test("Entry object", function () {
+    test("Entry object", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(13);
 
         var fileName = "entry",
             that = this,
-            fullPath = this.root.fullPath + fileName,
-            testEntry = function (entry) {
+            fullPath = this.root.fullPath + '/' + fileName,
+            testEntry = function(entry) {
                 ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
                 equal(entry.isFile, true, "entry.isFile should be true");
                 equal(entry.isDirectory, false, "entry.isDirectory should be false");
@@ -908,12 +999,12 @@ Tests.prototype.FileTests = function () {
                 ok(typeof entry.getMetadata === 'function', "entry object should have a 'getMetadata' function.");
                 ok(typeof entry.moveTo === 'function', "entry object should have a 'moveTo' function.");
                 ok(typeof entry.copyTo === 'function', "entry object should have a 'copyTo' function.");
-                ok(typeof entry.toURI === 'function', "entry object should have a 'toURI' function.");
+                ok(typeof entry.toURL === 'function', "entry object should have a 'toURL' function.");
                 ok(typeof entry.remove === 'function', "entry object should have a 'remove' function.");
                 ok(typeof entry.getParent === 'function', "entry object should have a 'getParent' function.");
                 ok(typeof entry.createWriter === 'function', "entry object should have a 'createWriter' function.");
                 ok(typeof entry.file === 'function', "entry object should have a 'file' function.");
-
+                
                 // cleanup
                 that.deleteEntry(fileName);
                 QUnit.start();
@@ -922,83 +1013,87 @@ Tests.prototype.FileTests = function () {
         // create a new file entry
         this.createFile(fileName, testEntry, this.fail);
     });
-    test("Entry.getMetadata on file", function () {
+    test("Entry.getMetadata on file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
-        expect(2);
-
+        expect(3);
+        
         var fileName = "entry.metadata.file",
             that = this,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 entry.getMetadata(testMetadata, this.fail);
             },
-            testMetadata = function (metadata) {
+            testMetadata = function(metadata) {
                 ok(typeof metadata !== 'undefined' && metadata !== null, "metadata should not be null.");
                 ok(metadata.modificationTime instanceof Date, "metadata.modificationTime should be Date object");
+                ok(isNaN(metadata.modificationTime.getTime()) !== true, "metadata.modificationTime should not be an Invalid Date");
 
                 // cleanup
                 that.deleteEntry(fileName);
                 QUnit.start();
             };
-
+        
         // create a new file entry
         this.createFile(fileName, entryCallback, this.fail);
     });
-    test("Entry.getMetadata on directory", function () {
+    test("Entry.getMetadata on directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
-        expect(2);
-
+        expect(3);
+        
         var dirName = "entry.metadata.dir",
             that = this,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 entry.getMetadata(testMetadata, this.fail);
             },
-            testMetadata = function (metadata) {
+            testMetadata = function(metadata) {
                 ok(typeof metadata !== 'undefined' && metadata !== null, "metadata should not be null.");
                 ok(metadata.modificationTime instanceof Date, "metadata.modificationTime should be Date object");
+                ok(isNaN(metadata.modificationTime.getTime()) !== true, "metadata.modificationTime should not be an Invalid Date");
 
                 // cleanup
                 that.deleteEntry(dirName);
                 QUnit.start();
             };
-
+        
         // create a new directory entry
         this.createDirectory(dirName, entryCallback, this.fail);
     });
-    test("Entry.getParent on file in root file system", function () {
+    test("Entry.getParent on file in root file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
-        expect(2);
-
+        expect(3);
+        
         var fileName = "entry.parent.file",
             that = this,
             rootPath = this.root.fullPath,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 entry.getParent(testParent, this.fail);
             },
-            testParent = function (parent) {
+            testParent = function(parent) {
                 ok(typeof parent !== 'undefined' && parent !== null, "parent directory should not be null.");
                 equal(parent.fullPath, rootPath, "parent fullPath should be root file system");
+                ok(typeof parent.getParent === 'function', "entry object should have a 'getParent' function.");
 
                 // cleanup
                 that.deleteEntry(fileName);
                 QUnit.start();
             };
-
+    
         // create a new file entry
         this.createFile(fileName, entryCallback, this.fail);
     });
-    test("Entry.getParent on directory in root file system", function () {
+    test("Entry.getParent on directory in root file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
-        expect(2);
-
+        expect(3);
+        
         var dirName = "entry.parent.dir",
             that = this,
             rootPath = this.root.fullPath,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 entry.getParent(testParent, this.fail);
             },
-            testParent = function (parent) {
+            testParent = function(parent) {
                 ok(typeof parent !== 'undefined' && parent !== null, "parent directory should not be null.");
                 equal(parent.fullPath, rootPath, "parent fullPath should be root file system");
+                ok(typeof parent.getParent === 'function', "entry object should have a 'getParent' function.");
 
                 // cleanup
                 that.deleteEntry(dirName);
@@ -1008,51 +1103,52 @@ Tests.prototype.FileTests = function () {
         // create a new directory entry
         this.createDirectory(dirName, entryCallback, this.fail);
     });
-    test("Entry.getParent on root file system", function () {
+    test("Entry.getParent on root file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
-        expect(2);
-
+        expect(3);
+        
         var rootPath = this.root.fullPath,
-		 testParent = function (parent) {
-		     ok(typeof parent !== 'undefined' && parent !== null, "parent directory should not be null.");
-		     equal(parent.fullPath, rootPath, "parent fullPath should be root file system");
-		     QUnit.start();
-		 };
+         testParent = function(parent) {
+                ok(typeof parent !== 'undefined' && parent !== null, "parent directory should not be null.");
+                equal(parent.fullPath, rootPath, "parent fullPath should be root file system");
+                ok(typeof parent.getParent === 'function', "entry object should have a 'getParent' function.");
+                QUnit.start();
+            };
 
         // create a new directory entry
         this.root.getParent(testParent, this.fail);
     });
-    test("Entry.toURI on file", function () {
+    test("Entry.toURL on file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var fileName = "entry.uri.file",
             that = this,
             rootPath = this.root.fullPath,
-            testURI = function (entry) {
-                var uri = entry.toURI();
-                ok(typeof uri !== 'undefined' && uri !== null, "URI should not be null.");
-                ok(uri.indexOf(rootPath) !== -1, "URI should contain root file system path");
+            testURL = function(entry) {
+                var uri = entry.toURL();
+                ok(typeof uri !== 'undefined' && uri !== null, "URL should not be null.");
+                ok(uri.indexOf(rootPath) !== -1, "URL should contain root file system path");
 
                 // cleanup
                 that.deleteEntry(fileName);
                 QUnit.start();
             };
-
+    
         // create a new file entry
-        this.createFile(fileName, testURI, this.fail);
+        this.createFile(fileName, testURL, this.fail);
     });
-    test("Entry.toURI on directory", function () {
+    test("Entry.toURL on directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var dirName = "entry.uri.dir",
             that = this,
             rootPath = this.root.fullPath,
-            testURI = function (entry) {
-                var uri = entry.toURI();
-                ok(typeof uri !== 'undefined' && uri !== null, "URI should not be null.");
-                ok(uri.indexOf(rootPath) !== -1, "URI should contain root file system path");
+            testURL = function(entry) {
+                var uri = entry.toURL();
+                ok(typeof uri !== 'undefined' && uri !== null, "URL should not be null.");
+                ok(uri.indexOf(rootPath) !== -1, "URL should contain root file system path");
 
                 // cleanup
                 that.deleteEntry(dirName);
@@ -1060,393 +1156,393 @@ Tests.prototype.FileTests = function () {
             };
 
         // create a new directory entry
-        this.createDirectory(dirName, testURI, this.fail);
+        this.createDirectory(dirName, testURL, this.fail);
     });
-    test("Entry.remove on file", function () {
+    test("Entry.remove on file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(3);
-
+        
         var fileName = "entry.rm.file",
             that = this,
-            fullPath = this.root.fullPath + fileName,
-		 entryCallback = function (entry) {
-		     var checkRemove = function () {
-		         that.root.getFile(fileName, null, that.unexpectedSuccess, testRemove);
-		     };
-		     ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
-		     entry.remove(checkRemove, that.fail);
-		 },
-			testRemove = function (error) {
-			    ok(typeof error !== 'undefined' && error !== null, "file should not exist");
-			    equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
-			    // cleanup
-			    that.deleteEntry(fileName);
-			    QUnit.start();
-			};
-
+            fullPath = this.root.fullPath + '/' + fileName,
+         entryCallback = function(entry) {
+                var checkRemove = function() {
+                    that.root.getFile(fileName, null, that.unexpectedSuccess, testRemove);  
+                };
+                ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
+                entry.remove(checkRemove, that.fail);
+            },
+            testRemove = function(error) {
+                ok(typeof error !== 'undefined' && error !== null, "file should not exist");
+                equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR"); 
+                // cleanup
+                that.deleteEntry(fileName);
+                QUnit.start();
+            };
+    
         // create a new file entry
         this.createFile(fileName, entryCallback, this.fail);
     });
-    test("Entry.remove on empty directory", function () {
+    test("Entry.remove on empty directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(3);
-
+        
         var dirName = "entry.rm.dir",
             that = this,
-            fullPath = this.root.fullPath + dirName,
-            entryCallback = function (entry) {
-                var checkRemove = function () {
-                    that.root.getDirectory(dirName, null, that.unexpectedSuccess, testRemove);
+            fullPath = this.root.fullPath + '/' + dirName,
+            entryCallback = function(entry) {
+                var checkRemove = function() {
+                    that.root.getDirectory(dirName, null, that.unexpectedSuccess, testRemove);  
                 };
                 ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
                 entry.remove(checkRemove, that.fail);
             },
-            testRemove = function (error) {
+            testRemove = function(error) {
                 ok(typeof error !== 'undefined' && error !== null, "directory should not exist");
-                equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR");
+                equal(error.code, FileError.NOT_FOUND_ERR, "error code should be FileError.NOT_FOUND_ERR"); 
                 // cleanup
-                that.deleteEntry(dirName);
+                that.deleteEntry(dirName);                
                 QUnit.start();
             };
 
         // create a new directory entry
         this.createDirectory(dirName, entryCallback, this.fail);
     });
-    test("Entry.remove on non-empty directory", function () {
+    test("Entry.remove on non-empty directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(4);
-
+        
         var dirName = "entry.rm.dir.not.empty",
             that = this,
-            fullPath = this.root.fullPath + dirName,
+            fullPath = this.root.fullPath + '/' + dirName,
             fileName = "remove.txt",
-            entryCallback = function (entry) {
-                var checkFile = function (error) {
+            entryCallback = function(entry) {
+                var checkFile = function(error) {
                     ok(typeof error !== 'undefined' && error !== null, "removing non-empty directory should generate an error");
                     equal(error.code, FileError.INVALID_MODIFICATION_ERR, "error code should be FileError.INVALID_MODIFICATION_ERR");
                     // verify that dir still exists
-                    that.root.getDirectory(dirName, null, testRemove, that.fail);
+                    that.root.getDirectory(dirName, null, testRemove, that.fail);  
                 };
                 // delete directory
-                var deleteDirectory = function (fileEntry) {
-                    entry.remove(that.unexpectedSuccess, checkFile);
-                };
+                var deleteDirectory = function(fileEntry) {
+                    entry.remove(that.unexpectedSuccess, checkFile);  
+                }; 
                 // create a file within directory, then try to delete directory
-                entry.getFile(fileName, { create: true }, deleteDirectory, that.fail);
+                entry.getFile(fileName, {create: true}, deleteDirectory, that.fail);
             },
-			testRemove = function (entry) {
-			    ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
-			    equal(entry.fullPath, fullPath, "dir entry should still exisit");
-			    // cleanup
-			    that.deleteEntry(dirName);
-			    QUnit.start();
-			};
+            testRemove = function(entry) {
+                ok(typeof entry !== 'undefined' && entry !== null, "entry should not be null.");
+                equal(entry.fullPath, fullPath, "dir entry should still exisit");
+                // cleanup
+                that.deleteEntry(dirName);
+                QUnit.start();
+            };
 
         // create a new directory entry
         this.createDirectory(dirName, entryCallback, this.fail);
     });
-    test("Entry.remove on root file system", function () {
+    test("Entry.remove on root file system", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
-        var testRemove = function (error) {
-            ok(typeof error !== 'undefined' && error !== null, "removing root file system should generate an error");
-            equal(error.code, FileError.NO_MODIFICATION_ALLOWED_ERR, "error code should be FileError.NO_MODIFICATION_ALLOWED_ERR");
-            QUnit.start();
-        };
+        
+        var testRemove = function(error) {
+                ok(typeof error !== 'undefined' && error !== null, "removing root file system should generate an error");
+                equal(error.code, FileError.NO_MODIFICATION_ALLOWED_ERR, "error code should be FileError.NO_MODIFICATION_ALLOWED_ERR");
+                QUnit.start();
+            };
 
         // remove entry that doesn't exist
         this.root.remove(null, testRemove);
     });
-    test("Entry.copyTo: file", function () {
+    test("Entry.copyTo: file", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(10);
-
+        
         var file1 = "entry.copy.file1",
             file2 = "entry.copy.file2",
             that = this,
-            fullPath = this.root.fullPath + file2,
-            entryCallback = function (entry) {
+            fullPath = this.root.fullPath + '/' + file2,
+            entryCallback = function(entry) {
                 // copy file1 to file2
                 entry.copyTo(that.root, file2, testCopy, that.fail);
             },
-			testCopy = function (entry) {
-
-			    ok(typeof entry !== 'undefined' && entry !== null, "copied file entry should not be null");
-			    equals(entry.isFile, true, "entry 'isFile' attribute should be set to true");
-			    equals(entry.isDirectory, false, "entry 'isDirectory' attribute should be set to false");
-			    equals(entry.fullPath, fullPath, "entry 'fullPath' should be set correctly");
-			    equals(entry.name, file2, "entry 'name' attribute should be set correctly");
-			    that.root.getFile(file2, { create: false }, testFileExists, null);
-
-			},
-			testFileExists = function (entry2) {
-			    // a bit redundant since copy returned this entry already
-			    ok(typeof entry2 !== 'undefined' && entry2 !== null, "copied file entry should not be null");
-			    equals(entry2.isFile, true, "entry 'isFile' attribute should be set to true");
-			    equals(entry2.isDirectory, false, "entry 'isDirectory' attribute should be set to false");
-			    equals(entry2.fullPath, fullPath, "entry 'fullPath' should be set correctly");
-			    equals(entry2.name, file2, "entry 'name' attribute should be set correctly");
-
-			    // cleanup
-			    that.deleteEntry(file1);
-			    that.deleteEntry(file2);
-			    QUnit.start();
-			};
+            testCopy = function(entry) {
+                
+                ok(typeof entry !== 'undefined' && entry !== null, "copied file entry should not be null");
+                equals(entry.isFile, true, "entry 'isFile' attribute should be set to true");
+                equals(entry.isDirectory, false, "entry 'isDirectory' attribute should be set to false");
+                equals(entry.fullPath, fullPath, "entry 'fullPath' should be set correctly");
+                equals(entry.name, file2, "entry 'name' attribute should be set correctly");
+                that.root.getFile(file2, {create:false}, testFileExists, null);                           
+                
+            },
+            testFileExists = function(entry2) {
+                // a bit redundant since copy returned this entry already
+                ok(typeof entry2 !== 'undefined' && entry2 !== null, "copied file entry should not be null");
+                equals(entry2.isFile, true, "entry 'isFile' attribute should be set to true");
+                equals(entry2.isDirectory, false, "entry 'isDirectory' attribute should be set to false");
+                equals(entry2.fullPath, fullPath, "entry 'fullPath' should be set correctly");
+                equals(entry2.name, file2, "entry 'name' attribute should be set correctly");
+         
+                // cleanup
+                that.deleteEntry(file1);
+                that.deleteEntry(file2);
+                QUnit.start();
+            };
 
         // create a new file entry to kick off test
         this.createFile(file1, entryCallback, this.fail);
     });
-    test("Entry.copyTo: file onto itself", function () {
+    test("Entry.copyTo: file onto itself", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(2);
-
+        
         var file1 = "entry.copy.fos.file1",
             that = this,
-            entryCallback = function (entry) {
+            entryCallback = function(entry) {
                 // copy file1 onto itself
                 entry.copyTo(that.root, null, null, testCopy);
             },
-		 testCopy = function (error) {
-		     ok(typeof error !== 'undefined' && error !== null, "it is an error to copy an entry into its parent if a different name is not specified");
-		     equal(error.code, FileError.INVALID_MODIFICATION_ERR, "error code should be FileError.INVALID_MODIFICATION_ERR");
+         testCopy = function(error) {
+                ok(typeof error !== 'undefined' && error !== null, "it is an error to copy an entry into its parent if a different name is not specified");
+                equal(error.code, FileError.INVALID_MODIFICATION_ERR, "error code should be FileError.INVALID_MODIFICATION_ERR");
 
-		     // cleanup
-		     that.deleteEntry(file1);
-		     QUnit.start();
-		 };
+                // cleanup
+                that.deleteEntry(file1);
+                QUnit.start();
+            };
 
         // create a new file entry to kick off test
         this.createFile(file1, entryCallback, this.fail);
     });
-    test("Entry.copyTo: directory", function () {
+    test("Entry.copyTo: directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(15);
-
+        
         var file1 = "file1",
             srcDir = "entry.copy.srcDir",
             dstDir = "entry.copy.dstDir",
-            dstPath = this.root.fullPath + dstDir,
+            dstPath = this.root.fullPath + '/' + dstDir,
             filePath = dstPath + '/' + file1,
             that = this,
-            entryCallback = function (directory) {
-                var copyDir = function (fileEntry) {
+            entryCallback = function(directory) {
+                var copyDir = function(fileEntry) {
                     // copy srcDir to dstDir
-                    directory.copyTo(that.root, dstDir, testCopy, that.fail);
+                    directory.copyTo(that.root, dstDir, testCopy, that.fail);                    
                 };
-                // create a file within new directory
-                directory.getFile(file1, { create: true }, copyDir, that.fail);
+              // create a file within new directory
+              directory.getFile(file1, {create: true}, copyDir, that.fail);
             },
-            testCopy = function (directory) {
-
+            testCopy = function(directory) {
+                
                 ok(typeof directory !== 'undefined' && directory !== null, "copied directory entry should not be null");
                 equals(directory.isFile, false, "entry 'isFile' attribute should be false");
                 equals(directory.isDirectory, true, "entry 'isDirectory' attribute should be true");
                 equals(directory.fullPath, dstPath, "entry 'fullPath' should be set correctly");
                 equals(directory.name, dstDir, "entry 'name' attribute should be set correctly");
+         
+                that.root.getDirectory(dstDir, {create:false}, testDirExists, that.fail);
+           },
+            testDirExists = function(dirEntry) {
+                 ok(typeof dirEntry !== 'undefined' && dirEntry !== null, "copied directory entry should not be null");
+                 equals(dirEntry.isFile, false, "entry 'isFile' attribute should be false");
+                 equals(dirEntry.isDirectory, true, "entry 'isDirectory' attribute should be true");
+                 equals(dirEntry.fullPath, dstPath, "entry 'fullPath' should be set correctly");
+                 equals(dirEntry.name, dstDir, "entry 'name' attribute should be set correctly");
+                 
+                 dirEntry.getFile(file1, {create:false}, testFileExists, that.fail);
+         
+         };
+            testFileExists = function(fileEntry) {
+                ok(typeof fileEntry !== 'undefined' && fileEntry !== null, "copied directory entry should not be null");
+                equals(fileEntry.isFile, true, "entry 'isFile' attribute should be true");
+                equals(fileEntry.isDirectory, false, "entry 'isDirectory' attribute should be false");
+                equals(fileEntry.fullPath, filePath, "entry 'fullPath' should be set correctly");
+                equals(fileEntry.name, file1, "entry 'name' attribute should be set correctly");
+                
 
-                that.root.getDirectory(dstDir, { create: false }, testDirExists, that.fail);
-            },
-            testDirExists = function (dirEntry) {
-                ok(typeof dirEntry !== 'undefined' && dirEntry !== null, "copied directory entry should not be null");
-                equals(dirEntry.isFile, false, "entry 'isFile' attribute should be false");
-                equals(dirEntry.isDirectory, true, "entry 'isDirectory' attribute should be true");
-                equals(dirEntry.fullPath, dstPath, "entry 'fullPath' should be set correctly");
-                equals(dirEntry.name, dstDir, "entry 'name' attribute should be set correctly");
-
-                dirEntry.getFile(file1, { create: false }, testFileExists, that.fail);
-
+                // cleanup
+                that.deleteEntry(srcDir);
+                that.deleteEntry(dstDir);
+                QUnit.start();
             };
-        testFileExists = function (fileEntry) {
-            ok(typeof fileEntry !== 'undefined' && fileEntry !== null, "copied directory entry should not be null");
-            equals(fileEntry.isFile, true, "entry 'isFile' attribute should be true");
-            equals(fileEntry.isDirectory, false, "entry 'isDirectory' attribute should be false");
-            equals(fileEntry.fullPath, filePath, "entry 'fullPath' should be set correctly");
-            equals(fileEntry.name, file1, "entry 'name' attribute should be set correctly");
-
-
-            // cleanup
-            that.deleteEntry(srcDir);
-            that.deleteEntry(dstDir);
-            QUnit.start();
-        };
 
         // create a new directory entry to kick off test
         this.createDirectory(srcDir, entryCallback, this.fail);
     });
-    test("Entry.copyTo: directory to backup at same root directory", function () {
+    test("Entry.copyTo: directory to backup at same root directory", function() {
         QUnit.stop(Tests.TEST_TIMEOUT);
         expect(15);
-
+        
         var file1 = "file1",
             srcDir = "entry.copy.srcDir",
             dstDir = "entry.copy.srcDir-backup",
-            dstPath = this.root.fullPath + dstDir,
+            dstPath = this.root.fullPath + '/' + dstDir,
             filePath = dstPath + '/' + file1,
             that = this,
-            entryCallback = function (directory) {
-                var copyDir = function (fileEntry) {
+            entryCallback = function(directory) {
+                var copyDir = function(fileEntry) {
                     // copy srcDir to dstDir
-                    directory.copyTo(that.root, dstDir, testCopy, that.fail);
+                    directory.copyTo(that.root, dstDir, testCopy, that.fail);                    
                 };
-                // create a file within new directory
-                directory.getFile(file1, { create: true }, copyDir, that.fail);
+              // create a file within new directory
+              directory.getFile(file1, {create: true}, copyDir, that.fail);
             },
-            testCopy = function (dir

<TRUNCATED>

Mime
View raw message