function fileDisplay(path) {
  var appId;

  var expectedFilesBefore =
      TestEntryInfo.getExpectedRows(path == RootPath.DRIVE ?
          BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET).sort();

  var expectedFilesAfter =
      expectedFilesBefore.concat([ENTRIES.newlyAdded.getExpectedRow()]).sort();

  StepsRunner.run([
    function() {
      setupAndWaitUntilReady(null, path, this.next);
    },
    // Verify the file list.
    function(result) {
      appId = result.windowId;
      var filesBefore = result.fileList;
      chrome.test.assertEq(expectedFilesBefore, filesBefore);
      this.next();
    },
    // Add new file entries.
    function() {
      addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
    },
    // Wait for the new file entries.
    function(result) {
      if (!result)
        chrome.test.assertTrue(false, 'Failed: adding new files');
      remoteCall.waitForFileListChange(appId, expectedFilesBefore.length).
          then(this.next);
    },
    // Verify the new file list.
    function(filesAfter) {
      chrome.test.assertEq(expectedFilesAfter, filesAfter);
      checkIfNoErrorsOccured(this.next);
    },
  ]);
}
/**
 * Checks if the files initially added by the C++ side are displayed, and
 * that files subsequently added are also displayed.
 *
 * @param {string} path Directory path to be tested.
 */
Checks if the files initially added by the C++ side are displayed, and
that files subsequently added are also displayed.

@param {string} path Directory path to be tested.
Checks if the files initially added by the C ++ side are displayed and that files subsequently added are also displayed . @param { string } path Directory path to be tested .
function fileDisplay(path) {
  var appId;
  var expectedFilesBefore =
      TestEntryInfo.getExpectedRows(path == RootPath.DRIVE ?
          BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET).sort();
  var expectedFilesAfter =
      expectedFilesBefore.concat([ENTRIES.newlyAdded.getExpectedRow()]).sort();
  StepsRunner.run([
    function() {
      setupAndWaitUntilReady(null, path, this.next);
    },
    function(result) {
      appId = result.windowId;
      var filesBefore = result.fileList;
      chrome.test.assertEq(expectedFilesBefore, filesBefore);
      this.next();
    },
    function() {
      addEntries(['local', 'drive'], [ENTRIES.newlyAdded], this.next);
    },
    function(result) {
      if (!result)
        chrome.test.assertTrue(false, 'Failed: adding new files');
      remoteCall.waitForFileListChange(appId, expectedFilesBefore.length).
          then(this.next);
    },
    function(filesAfter) {
      chrome.test.assertEq(expectedFilesAfter, filesAfter);
      checkIfNoErrorsOccured(this.next);
    },
  ]);
}
function fileDisplay ( path ) { var appId ; var expectedFilesBefore = TestEntryInfo . getExpectedRows ( path == RootPath . DRIVE ? BASIC_DRIVE_ENTRY_SET : BASIC_LOCAL_ENTRY_SET ) . sort ( ) ; var expectedFilesAfter = expectedFilesBefore . concat ( [ ENTRIES . newlyAdded . getExpectedRow ( ) ] ) . sort ( ) ; StepsRunner . run ( [ function ( ) { setupAndWaitUntilReady ( null , path , this . next ) ; } , function ( result ) { appId = result . windowId ; var filesBefore = result . fileList ; chrome . test . assertEq ( expectedFilesBefore , filesBefore ) ; this . next ( ) ; } , function ( ) { addEntries ( [ 'local' , 'drive' ] , [ ENTRIES . newlyAdded ] , this . next ) ; } , function ( result ) { if ( ! result ) chrome . test . assertTrue ( false , 'Failed: adding new files' ) ; remoteCall . waitForFileListChange ( appId , expectedFilesBefore . length ) . then ( this . next ) ; } , function ( filesAfter ) { chrome . test . assertEq ( expectedFilesAfter , filesAfter ) ; checkIfNoErrorsOccured ( this . next ) ; } , ] ) ; }
Checks if the files initially added by the C++ side are displayed, and
 that files subsequently added are also displayed.
Checks if the files initially added by the C ++ side are displayed and that files subsequently added are also displayed .
// Verify the file list. // Add new file entries. // Wait for the new file entries. // Verify the new file list.