function verifyDirectoryEntry(directoryEntry, verifyFunction) {
  var allEntries = [];
  var reader = directoryEntry.createReader();

  function readEntries() {
    reader.readEntries(readEntriesCallback, chrome.test.fail);
  }

  function readEntriesCallback(entries) {
    if (entries.length == 0) {
      // This is the readEntries() is finished case.
      verifyFunction(directoryEntry, allEntries.sort());
      return;
    }

    allEntries = allEntries.concat(entries);
    readEntries();
  }

  readEntries();
}
// Gets the entire listing from directory, then verifies the sorted contents.
Gets the entire listing from directory, then verifies the sorted contents.
Gets the entire listing from directory then verifies the sorted contents .
function verifyDirectoryEntry(directoryEntry, verifyFunction) {
  var allEntries = [];
  var reader = directoryEntry.createReader();
  function readEntries() {
    reader.readEntries(readEntriesCallback, chrome.test.fail);
  }
  function readEntriesCallback(entries) {
    if (entries.length == 0) {
      verifyFunction(directoryEntry, allEntries.sort());
      return;
    }
    allEntries = allEntries.concat(entries);
    readEntries();
  }
  readEntries();
}
function verifyDirectoryEntry ( directoryEntry , verifyFunction ) { var allEntries = [ ] ; var reader = directoryEntry . createReader ( ) ; function readEntries ( ) { reader . readEntries ( readEntriesCallback , chrome . test . fail ) ; } function readEntriesCallback ( entries ) { if ( entries . length == 0 ) { verifyFunction ( directoryEntry , allEntries . sort ( ) ) ; return ; } allEntries = allEntries . concat ( entries ) ; readEntries ( ) ; } readEntries ( ) ; }
Gets the entire listing from directory, then verifies the sorted contents.
Gets the entire listing from directory then verifies the sorted contents .
// This is the readEntries() is finished case.