B2G/gecko/dom/workers/test/fileReaderSyncErrors_worker.js
/**
 * Passes junk arguments to FileReaderSync methods and expects an exception to
 * be thrown.
 */
Passes junk arguments to FileReaderSync methods and expects an exception to
be thrown.
Passes junk arguments to FileReaderSync methods and expects an exception to be thrown .
function fileReaderJunkArgument(blob) {
  var fileReader = new FileReaderSync();
  try {
    fileReader.readAsBinaryString(blob);
    is(false, true, "Should have thrown an exception calling readAsBinaryString.");
  } catch(ex) {
    is(true, true, "Should have thrown an exception.");
  }
  try {
    fileReader.readAsDataURL(blob);
    is(false, true, "Should have thrown an exception calling readAsDataURL.");
  } catch(ex) {
    is(true, true, "Should have thrown an exception.");
  }
  try {
    fileReader.readAsArrayBuffer(blob);
    is(false, true, "Should have thrown an exception calling readAsArrayBuffer.");
  } catch(ex) {
    is(true, true, "Should have thrown an exception.");
  }
  try {
    fileReader.readAsText(blob);
    is(false, true, "Should have thrown an exception calling readAsText.");
  } catch(ex) {
    is(true, true, "Should have thrown an exception.");
  }
}
function fileReaderJunkArgument ( blob ) { var fileReader = new FileReaderSync ( ) ; try { fileReader . readAsBinaryString ( blob ) ; is ( false , true , "Should have thrown an exception calling readAsBinaryString." ) ; } catch ( ex ) { is ( true , true , "Should have thrown an exception." ) ; } try { fileReader . readAsDataURL ( blob ) ; is ( false , true , "Should have thrown an exception calling readAsDataURL." ) ; } catch ( ex ) { is ( true , true , "Should have thrown an exception." ) ; } try { fileReader . readAsArrayBuffer ( blob ) ; is ( false , true , "Should have thrown an exception calling readAsArrayBuffer." ) ; } catch ( ex ) { is ( true , true , "Should have thrown an exception." ) ; } try { fileReader . readAsText ( blob ) ; is ( false , true , "Should have thrown an exception calling readAsText." ) ; } catch ( ex ) { is ( true , true , "Should have thrown an exception." ) ; } }
Passes junk arguments to FileReaderSync methods and expects an exception to
 be thrown.
Passes junk arguments to FileReaderSync methods and expects an exception to be thrown .