function readAndExpectContent(entry, expectSuccess, expectedContent, callback) {
  var error = 'Reading file \'' + entry.fullPath + '\'.';
  var reader = new FileReader();

  reader.onload = function() {
    chrome.test.assertTrue(expectSuccess, error);
    assertEqAndRunCallback(expectedContent, reader.result, error, callback);
  };

  entry.file(reader.readAsText.bind(reader),
             assertEqAndRunCallback.bind(null,
                 false, expectSuccess, error, callback));
}
/**
 * Attempts to read file and asserts that the read success and file content are
 * as expected (|expectSuccess|, |expectedContent|). On success |callback| is
 * called, otherwise current test is failed.
 *
 * @param {FileEntry} entry Entry to be read.
 * @param {boolean} expectSuccess Whether the read should succeed.
 * @param {string} expectedContent If the read succeeds, the expected content to
 *     be read from file. If the read fails, it is ignored.
 * @param {function()} callback Function called if the read ends as defined by
 *     |expectSuccess| and |expectedContent|.
 */
Attempts to read file and asserts that the read success and file content are
as expected (|expectSuccess|, |expectedContent|). On success |callback| is
called, otherwise current test is failed.

@param {FileEntry} entry Entry to be read.
@param {boolean} expectSuccess Whether the read should succeed.
@param {string} expectedContent If the read succeeds, the expected content to
be read from file. If the read fails, it is ignored.
@param {function()} callback Function called if the read ends as defined by
|expectSuccess| and |expectedContent|.
Attempts to read file and asserts that the read success and file content are as expected ( |expectSuccess| |expectedContent| ) . On success |callback| is called otherwise current test is failed . @param { FileEntry } entry Entry to be read . @param { boolean } expectSuccess Whether the read should succeed . @param { string } expectedContent If the read succeeds the expected content to be read from file . If the read fails it is ignored . @param { function () } callback Function called if the read ends as defined by |expectSuccess| and |expectedContent| .
function readAndExpectContent(entry, expectSuccess, expectedContent, callback) {
  var error = 'Reading file \'' + entry.fullPath + '\'.';
  var reader = new FileReader();
  reader.onload = function() {
    chrome.test.assertTrue(expectSuccess, error);
    assertEqAndRunCallback(expectedContent, reader.result, error, callback);
  };
  entry.file(reader.readAsText.bind(reader),
             assertEqAndRunCallback.bind(null,
                 false, expectSuccess, error, callback));
}
function readAndExpectContent ( entry , expectSuccess , expectedContent , callback ) { var error = 'Reading file \'' + entry . fullPath + '\'.' ; var reader = new FileReader ( ) ; reader . onload = function ( ) { chrome . test . assertTrue ( expectSuccess , error ) ; assertEqAndRunCallback ( expectedContent , reader . result , error , callback ) ; } ; entry . file ( reader . readAsText . bind ( reader ) , assertEqAndRunCallback . bind ( null , false , expectSuccess , error , callback ) ) ; }
Attempts to read file and asserts that the read success and file content are
 as expected (|expectSuccess|, |expectedContent|).
Attempts to read file and asserts that the read success and file content are as expected ( |expectSuccess| |expectedContent| ) .