function runTests() {
  chrome.test.runTests([
    // Delete a file. Should succeed.
    function deleteDirectorySuccessSimple() {
      test_util.fileSystem.root.getFile(
          TESTING_C_FILE.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_C_FILE.name, entry.name);
            chrome.test.assertFalse(entry.isDirectory);
            entry.remove(chrome.test.callbackPass(), function(error) {
              chrome.test.fail(error.name);
            });
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },
    // Delete a directory which has contents, non-recursively. Should fail.
    function deleteDirectoryErrorNotEmpty() {
      test_util.fileSystem.root.getDirectory(
          TESTING_A_DIRECTORY.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_A_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
            entry.remove(function() {
              chrome.test.fail('Unexpectedly succeded to remove a directory.');
            }, chrome.test.callbackPass);
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },
    // Delete a directory which has contents, recursively. Should succeed.
    function deleteDirectoryRecursively() {
      test_util.fileSystem.root.getDirectory(
          TESTING_A_DIRECTORY.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_A_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
            entry.removeRecursively(
                chrome.test.callbackPass(),
                function(error) {
                  chrome.test.fail(error);
                });
          }), function(error) {
            chrome.test.fail(error.name);
          });
    }
  ]);
}
/**
 * Runs all of the test cases, one by one.
 */
Runs all of the test cases, one by one.
Runs all of the test cases one by one .
function runTests() {
  chrome.test.runTests([
    function deleteDirectorySuccessSimple() {
      test_util.fileSystem.root.getFile(
          TESTING_C_FILE.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_C_FILE.name, entry.name);
            chrome.test.assertFalse(entry.isDirectory);
            entry.remove(chrome.test.callbackPass(), function(error) {
              chrome.test.fail(error.name);
            });
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },
    function deleteDirectoryErrorNotEmpty() {
      test_util.fileSystem.root.getDirectory(
          TESTING_A_DIRECTORY.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_A_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
            entry.remove(function() {
              chrome.test.fail('Unexpectedly succeded to remove a directory.');
            }, chrome.test.callbackPass);
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },
    function deleteDirectoryRecursively() {
      test_util.fileSystem.root.getDirectory(
          TESTING_A_DIRECTORY.name, {create: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_A_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
            entry.removeRecursively(
                chrome.test.callbackPass(),
                function(error) {
                  chrome.test.fail(error);
                });
          }), function(error) {
            chrome.test.fail(error.name);
          });
    }
  ]);
}
function runTests ( ) { chrome . test . runTests ( [ function deleteDirectorySuccessSimple ( ) { test_util . fileSystem . root . getFile ( TESTING_C_FILE . name , { create : false } , chrome . test . callbackPass ( function ( entry ) { chrome . test . assertEq ( TESTING_C_FILE . name , entry . name ) ; chrome . test . assertFalse ( entry . isDirectory ) ; entry . remove ( chrome . test . callbackPass ( ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } , function deleteDirectoryErrorNotEmpty ( ) { test_util . fileSystem . root . getDirectory ( TESTING_A_DIRECTORY . name , { create : false } , chrome . test . callbackPass ( function ( entry ) { chrome . test . assertEq ( TESTING_A_DIRECTORY . name , entry . name ) ; chrome . test . assertTrue ( entry . isDirectory ) ; entry . remove ( function ( ) { chrome . test . fail ( 'Unexpectedly succeded to remove a directory.' ) ; } , chrome . test . callbackPass ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } , function deleteDirectoryRecursively ( ) { test_util . fileSystem . root . getDirectory ( TESTING_A_DIRECTORY . name , { create : false } , chrome . test . callbackPass ( function ( entry ) { chrome . test . assertEq ( TESTING_A_DIRECTORY . name , entry . name ) ; chrome . test . assertTrue ( entry . isDirectory ) ; entry . removeRecursively ( chrome . test . callbackPass ( ) , function ( error ) { chrome . test . fail ( error ) ; } ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } ] ) ; }
Runs all of the test cases, one by one.
Runs all of the test cases one by one .
// Delete a file. Should succeed. // Delete a directory which has contents, non-recursively. Should fail. // Delete a directory which has contents, recursively. Should succeed.