function runTests() {
  chrome.test.runTests([
    // Create a directory (not exclusive). Should succeed.
    function createDirectorySuccessSimple() {
      test_util.fileSystem.root.getDirectory(
          TESTING_DIRECTORY.name, {create: true, exclusive: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },

    // Create a directory (exclusive). Should fail, since the directory already
    // exists.
    function createDirectoryErrorExists() {
      test_util.fileSystem.root.getDirectory(
          TESTING_DIRECTORY.name, {create: true, exclusive: true},
          function(entry) {
            chrome.test.fail('Created a directory, but should fail.');
          }, chrome.test.callbackPass(function(error) {
            chrome.test.assertEq('InvalidModificationError', 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 createDirectorySuccessSimple() {
      test_util.fileSystem.root.getDirectory(
          TESTING_DIRECTORY.name, {create: true, exclusive: false},
          chrome.test.callbackPass(function(entry) {
            chrome.test.assertEq(TESTING_DIRECTORY.name, entry.name);
            chrome.test.assertTrue(entry.isDirectory);
          }), function(error) {
            chrome.test.fail(error.name);
          });
    },
    function createDirectoryErrorExists() {
      test_util.fileSystem.root.getDirectory(
          TESTING_DIRECTORY.name, {create: true, exclusive: true},
          function(entry) {
            chrome.test.fail('Created a directory, but should fail.');
          }, chrome.test.callbackPass(function(error) {
            chrome.test.assertEq('InvalidModificationError', error.name);
          }));
    }
  ]);
}
function runTests ( ) { chrome . test . runTests ( [ function createDirectorySuccessSimple ( ) { test_util . fileSystem . root . getDirectory ( TESTING_DIRECTORY . name , { create : true , exclusive : false } , chrome . test . callbackPass ( function ( entry ) { chrome . test . assertEq ( TESTING_DIRECTORY . name , entry . name ) ; chrome . test . assertTrue ( entry . isDirectory ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } , function createDirectoryErrorExists ( ) { test_util . fileSystem . root . getDirectory ( TESTING_DIRECTORY . name , { create : true , exclusive : true } , function ( entry ) { chrome . test . fail ( 'Created a directory, but should fail.' ) ; } , chrome . test . callbackPass ( function ( error ) { chrome . test . assertEq ( 'InvalidModificationError' , error . name ) ; } ) ) ; } ] ) ; }
Runs all of the test cases, one by one.
Runs all of the test cases one by one .
// Create a directory (not exclusive). Should succeed. // Create a directory (exclusive). Should fail, since the directory already // exists.