function addWatcher() {
      test_util.fileSystem.root.getFile(
          TESTING_FILE.name,
          {create: false},
          chrome.test.callbackPass(function(fileEntry) {
            chrome.test.assertEq(TESTING_FILE.name, fileEntry.name);
            chrome.fileManagerPrivate.addFileWatch(
                fileEntry,
                chrome.test.callbackPass(function(result) {
                  chrome.test.assertTrue(result);
                  chrome.fileSystemProvider.getAll(
                      chrome.test.callbackPass(function(fileSystems) {
                        chrome.test.assertEq(1, fileSystems.length);
                        chrome.test.assertEq(
                            1, fileSystems[0].watchers.length);
                        var watcher = fileSystems[0].watchers[0];
                        chrome.test.assertEq(
                            '/' + TESTING_FILE.name, watcher.entryPath);
                        chrome.test.assertFalse(watcher.recursive);
                        chrome.test.assertEq(undefined, watcher.tag);
                      }));
                }));
          }), function(error) {
            chrome.test.fail(error.name);
          });
    }
// Add an entry watcher on an existing file.
Add an entry watcher on an existing file.
Add an entry watcher on an existing file .
function addWatcher() {
      test_util.fileSystem.root.getFile(
          TESTING_FILE.name,
          {create: false},
          chrome.test.callbackPass(function(fileEntry) {
            chrome.test.assertEq(TESTING_FILE.name, fileEntry.name);
            chrome.fileManagerPrivate.addFileWatch(
                fileEntry,
                chrome.test.callbackPass(function(result) {
                  chrome.test.assertTrue(result);
                  chrome.fileSystemProvider.getAll(
                      chrome.test.callbackPass(function(fileSystems) {
                        chrome.test.assertEq(1, fileSystems.length);
                        chrome.test.assertEq(
                            1, fileSystems[0].watchers.length);
                        var watcher = fileSystems[0].watchers[0];
                        chrome.test.assertEq(
                            '/' + TESTING_FILE.name, watcher.entryPath);
                        chrome.test.assertFalse(watcher.recursive);
                        chrome.test.assertEq(undefined, watcher.tag);
                      }));
                }));
          }), function(error) {
            chrome.test.fail(error.name);
          });
    }
function addWatcher ( ) { test_util . fileSystem . root . getFile ( TESTING_FILE . name , { create : false } , chrome . test . callbackPass ( function ( fileEntry ) { chrome . test . assertEq ( TESTING_FILE . name , fileEntry . name ) ; chrome . fileManagerPrivate . addFileWatch ( fileEntry , chrome . test . callbackPass ( function ( result ) { chrome . test . assertTrue ( result ) ; chrome . fileSystemProvider . getAll ( chrome . test . callbackPass ( function ( fileSystems ) { chrome . test . assertEq ( 1 , fileSystems . length ) ; chrome . test . assertEq ( 1 , fileSystems [ 0 ] . watchers . length ) ; var watcher = fileSystems [ 0 ] . watchers [ 0 ] ; chrome . test . assertEq ( '/' + TESTING_FILE . name , watcher . entryPath ) ; chrome . test . assertFalse ( watcher . recursive ) ; chrome . test . assertEq ( undefined , watcher . tag ) ; } ) ) ; } ) ) ; } ) , function ( error ) { chrome . test . fail ( error . name ) ; } ) ; }
Add an entry watcher on an existing file.
Add an entry watcher on an existing file .