function runTests() {
  chrome.test.runTests([
    // Get actions for a directory with actions.
    function getActionsSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            chrome.fileManagerPrivate.getCustomActions(
                [dirEntry],
                chrome.test.callbackPass(function(actions) {
                  chrome.test.assertEq(2, actions.length);
                  chrome.test.assertEq(TESTING_ACTIONS_DIR_ACTIONS[0].id,
                      actions[0].id);
                  chrome.test.assertFalse(!!actions[0].title);
                  chrome.test.assertEq(TESTING_ACTIONS_DIR_ACTIONS[1].id,
                      actions[1].id);
                  chrome.test.assertEq(
                      TESTING_ACTIONS_DIR_ACTIONS[1].title,
                      actions[1].title);
                }));
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    },

    // Get actions for a directory with no actions.
    function getNoActionsSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_NO_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            chrome.fileManagerPrivate.getCustomActions(
                [dirEntry],
                chrome.test.callbackPass(function(actions) {
                  chrome.test.assertEq(0, actions.length);
                }));
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    },

    // Get actions for multiple entries.
    function getNoActionsMultipleSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            test_util.fileSystem.root.getDirectory(
                TESTING_NO_ACTIONS_DIR.name,
                {create: false},
                chrome.test.callbackPass(function(dirEntry2) {
                  chrome.fileManagerPrivate.getCustomActions(
                      [dirEntry, dirEntry2],
                      chrome.test.callbackPass(function(actions) {
                        chrome.test.assertEq(0, actions.length);
                      }));
                }),
                function(error) {
                  chrome.test.fail(error.name);
                });
          }),
          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 getActionsSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            chrome.fileManagerPrivate.getCustomActions(
                [dirEntry],
                chrome.test.callbackPass(function(actions) {
                  chrome.test.assertEq(2, actions.length);
                  chrome.test.assertEq(TESTING_ACTIONS_DIR_ACTIONS[0].id,
                      actions[0].id);
                  chrome.test.assertFalse(!!actions[0].title);
                  chrome.test.assertEq(TESTING_ACTIONS_DIR_ACTIONS[1].id,
                      actions[1].id);
                  chrome.test.assertEq(
                      TESTING_ACTIONS_DIR_ACTIONS[1].title,
                      actions[1].title);
                }));
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    },
    function getNoActionsSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_NO_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            chrome.fileManagerPrivate.getCustomActions(
                [dirEntry],
                chrome.test.callbackPass(function(actions) {
                  chrome.test.assertEq(0, actions.length);
                }));
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    },
    function getNoActionsMultipleSuccess() {
      test_util.fileSystem.root.getDirectory(
          TESTING_ACTIONS_DIR.name,
          {create: false},
          chrome.test.callbackPass(function(dirEntry) {
            test_util.fileSystem.root.getDirectory(
                TESTING_NO_ACTIONS_DIR.name,
                {create: false},
                chrome.test.callbackPass(function(dirEntry2) {
                  chrome.fileManagerPrivate.getCustomActions(
                      [dirEntry, dirEntry2],
                      chrome.test.callbackPass(function(actions) {
                        chrome.test.assertEq(0, actions.length);
                      }));
                }),
                function(error) {
                  chrome.test.fail(error.name);
                });
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    }
  ]);
}
function runTests ( ) { chrome . test . runTests ( [ function getActionsSuccess ( ) { test_util . fileSystem . root . getDirectory ( TESTING_ACTIONS_DIR . name , { create : false } , chrome . test . callbackPass ( function ( dirEntry ) { chrome . fileManagerPrivate . getCustomActions ( [ dirEntry ] , chrome . test . callbackPass ( function ( actions ) { chrome . test . assertEq ( 2 , actions . length ) ; chrome . test . assertEq ( TESTING_ACTIONS_DIR_ACTIONS [ 0 ] . id , actions [ 0 ] . id ) ; chrome . test . assertFalse ( ! ! actions [ 0 ] . title ) ; chrome . test . assertEq ( TESTING_ACTIONS_DIR_ACTIONS [ 1 ] . id , actions [ 1 ] . id ) ; chrome . test . assertEq ( TESTING_ACTIONS_DIR_ACTIONS [ 1 ] . title , actions [ 1 ] . title ) ; } ) ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } , function getNoActionsSuccess ( ) { test_util . fileSystem . root . getDirectory ( TESTING_NO_ACTIONS_DIR . name , { create : false } , chrome . test . callbackPass ( function ( dirEntry ) { chrome . fileManagerPrivate . getCustomActions ( [ dirEntry ] , chrome . test . callbackPass ( function ( actions ) { chrome . test . assertEq ( 0 , actions . length ) ; } ) ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } , function getNoActionsMultipleSuccess ( ) { test_util . fileSystem . root . getDirectory ( TESTING_ACTIONS_DIR . name , { create : false } , chrome . test . callbackPass ( function ( dirEntry ) { test_util . fileSystem . root . getDirectory ( TESTING_NO_ACTIONS_DIR . name , { create : false } , chrome . test . callbackPass ( function ( dirEntry2 ) { chrome . fileManagerPrivate . getCustomActions ( [ dirEntry , dirEntry2 ] , chrome . test . callbackPass ( function ( actions ) { chrome . test . assertEq ( 0 , actions . length ) ; } ) ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; } ) , 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 .
// Get actions for a directory with actions. // Get actions for a directory with no actions. // Get actions for multiple entries.