function runTests() {
  chrome.test.runTests([
    // Read contents of a new file, which is 6GB in size. Such size does not
    // fit in a 32bit int nor in size_t (unsigned). It should be safe to assume,
    // that if 6GB are supported, then there is no 32bit bottle neck, and the
    // next one would be 64bit. File System Provider API should support files
    // with size greater or equal to 2^53.
    function readBigFileSuccess() {
      test_util.fileSystem.root.getFile(
          TESTING_6GB_FILE.name,
          {create: false},
          chrome.test.callbackPass(function(fileEntry) {
            fileEntry.file(chrome.test.callbackPass(function(file) {
              // Read 10 bytes from the 5th GB.
              var fileSlice =
                  file.slice(TESTING_TEXT_OFFSET,
                             TESTING_TEXT_OFFSET + TESTING_TEXT.length);
              var fileReader = new FileReader();
              fileReader.onload = chrome.test.callbackPass(function(e) {
                var text = fileReader.result;
                chrome.test.assertEq(TESTING_TEXT, text);
              });
              fileReader.onerror = function(e) {
                chrome.test.fail(fileReader.error.name);
              };
              fileReader.readAsText(fileSlice);
            }),
            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 readBigFileSuccess() {
      test_util.fileSystem.root.getFile(
          TESTING_6GB_FILE.name,
          {create: false},
          chrome.test.callbackPass(function(fileEntry) {
            fileEntry.file(chrome.test.callbackPass(function(file) {
              var fileSlice =
                  file.slice(TESTING_TEXT_OFFSET,
                             TESTING_TEXT_OFFSET + TESTING_TEXT.length);
              var fileReader = new FileReader();
              fileReader.onload = chrome.test.callbackPass(function(e) {
                var text = fileReader.result;
                chrome.test.assertEq(TESTING_TEXT, text);
              });
              fileReader.onerror = function(e) {
                chrome.test.fail(fileReader.error.name);
              };
              fileReader.readAsText(fileSlice);
            }),
            function(error) {
              chrome.test.fail(error.name);
            });
          }),
          function(error) {
            chrome.test.fail(error.name);
          });
    }
  ]);
}
function runTests ( ) { chrome . test . runTests ( [ function readBigFileSuccess ( ) { test_util . fileSystem . root . getFile ( TESTING_6GB_FILE . name , { create : false } , chrome . test . callbackPass ( function ( fileEntry ) { fileEntry . file ( chrome . test . callbackPass ( function ( file ) { var fileSlice = file . slice ( TESTING_TEXT_OFFSET , TESTING_TEXT_OFFSET + TESTING_TEXT . length ) ; var fileReader = new FileReader ( ) ; fileReader . onload = chrome . test . callbackPass ( function ( e ) { var text = fileReader . result ; chrome . test . assertEq ( TESTING_TEXT , text ) ; } ) ; fileReader . onerror = function ( e ) { chrome . test . fail ( fileReader . error . name ) ; } ; fileReader . readAsText ( fileSlice ) ; } ) , 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 .
// Read contents of a new file, which is 6GB in size. Such size does not // fit in a 32bit int nor in size_t (unsigned). It should be safe to assume, // that if 6GB are supported, then there is no 32bit bottle neck, and the // next one would be 64bit. File System Provider API should support files // with size greater or equal to 2^53. // Read 10 bytes from the 5th GB.