Back out another suspect just in case. CLOSED TREE. a=orange
authorJonas Sicking <jonas@sicking.cc>
Fri, 20 May 2011 17:20:37 -0700
changeset 69822 21c304c5f351b4e14bf4ef9c2a8058041e1c6742
parent 69821 0569f7995cd07375664c68de46dc403c861f3765
child 69823 d02f592810cdd87526282563272b17e4a64e52b4
push id20115
push usersicking@mozilla.com
push dateSat, 21 May 2011 00:20:45 +0000
treeherdermozilla-central@21c304c5f351 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersorange
milestone6.0a1
first release with
nightly linux32
21c304c5f351 / 6.0a1 / 20110521030612 / files
nightly linux64
21c304c5f351 / 6.0a1 / 20110521030612 / files
nightly mac
21c304c5f351 / 6.0a1 / 20110521030612 / files
nightly win32
21c304c5f351 / 6.0a1 / 20110521030612 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Back out another suspect just in case. CLOSED TREE. a=orange
content/base/public/nsIDOMFileReader.idl
content/base/src/nsDOMFileReader.cpp
content/base/src/nsDOMFileReader.h
content/base/test/test_fileapi.html
--- a/content/base/public/nsIDOMFileReader.idl
+++ b/content/base/public/nsIDOMFileReader.idl
@@ -36,34 +36,31 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMEventTarget.idl"
 
 interface nsIDOMEventListener;
 interface nsIDOMBlob;
 interface nsIDOMFileError;
 
-[scriptable, uuid(3d77e784-1459-4206-b8a2-0855d826f569)]
+[scriptable, uuid(f186170f-f07c-4f0b-9e3c-08f7dd496e74)]
 interface nsIDOMFileReader : nsISupports 
 {
-  [implicit_jscontext]
-  void readAsArrayBuffer(in nsIDOMBlob filedata);
   void readAsBinaryString(in nsIDOMBlob filedata);
   void readAsText(in nsIDOMBlob filedata, [optional] in DOMString encoding);
   void readAsDataURL(in nsIDOMBlob file);
 
   void abort();
 
   const unsigned short EMPTY = 0;
   const unsigned short LOADING = 1;
   const unsigned short DONE = 2;
   readonly attribute unsigned short readyState;
 
-  [implicit_jscontext]
-  readonly attribute jsval result;
+  readonly attribute DOMString result;
   readonly attribute nsIDOMFileError error;
 };
 
 %{ C++
 #define NS_FILEREADER_CID                            \
 {0x06aa7c21, 0xfe05, 0x4cf2,                         \
 {0xb1, 0xc4, 0x0c, 0x71, 0x26, 0xa4, 0xf7, 0x13}}
 #define NS_FILEREADER_CONTRACTID \
--- a/content/base/src/nsDOMFileReader.cpp
+++ b/content/base/src/nsDOMFileReader.cpp
@@ -72,124 +72,86 @@
 #include "nsIDOMClassInfo.h"
 #include "nsCExternalHandlerService.h"
 #include "nsIStreamConverterService.h"
 #include "nsEventDispatcher.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsLayoutStatics.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsFileDataProtocolHandler.h"
-#include "xpcprivate.h"
-#include "xpcquickstubs.h"
-#include "jstypedarray.h"
 
 #define LOAD_STR "load"
 #define ERROR_STR "error"
 #define ABORT_STR "abort"
 #define LOADSTART_STR "loadstart"
 #define PROGRESS_STR "progress"
 #define UPLOADPROGRESS_STR "uploadprogress"
 #define LOADEND_STR "loadend"
 
 #define NS_PROGRESS_EVENT_INTERVAL 50
 const PRUint64 kUnknownSize = PRUint64(-1);
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMFileReader)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMFileReader,
                                                   nsXHREventTarget)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFile)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mProgressNotifier)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPrincipal)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mChannel)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMFileReader,
                                                 nsXHREventTarget)
-  if (tmp->mResultArrayBufferRooted) {
-    tmp->UnrootResultArrayBuffer();
-  }
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFile)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mProgressNotifier)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPrincipal)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mChannel)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMFileReader)
-  if(tmp->mResultArrayBuffer) {
-    NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->mResultArrayBuffer,
-                                               "mResultArrayBuffer")
-  }
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
 DOMCI_DATA(FileReader, nsDOMFileReader)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMFileReader)
   NS_INTERFACE_MAP_ENTRY(nsIDOMFileReader)
   NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
   NS_INTERFACE_MAP_ENTRY(nsICharsetDetectionObserver)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(FileReader)
 NS_INTERFACE_MAP_END_INHERITING(nsXHREventTarget)
 
 NS_IMPL_ADDREF_INHERITED(nsDOMFileReader, nsXHREventTarget)
 NS_IMPL_RELEASE_INHERITED(nsDOMFileReader, nsXHREventTarget)
 
-//array buffer holder root/unroot
-void
-nsDOMFileReader::RootResultArrayBuffer()
-{
-  NS_ASSERTION(!mResultArrayBufferRooted, "This should be false!");
-  NS_HOLD_JS_OBJECTS(this, nsDOMFileReader);
-  mResultArrayBufferRooted = true;
-}
-
-void
-nsDOMFileReader::UnrootResultArrayBuffer()
-{
-  NS_ASSERTION(mResultArrayBufferRooted, "This should be true!");
-  NS_DROP_JS_OBJECTS(this, nsDOMFileReader);
-  mResultArrayBufferRooted = false;
-  mResultArrayBuffer = nsnull;
-}
-
 //nsICharsetDetectionObserver
 
 NS_IMETHODIMP
 nsDOMFileReader::Notify(const char *aCharset, nsDetectionConfident aConf)
 {
   mCharset = aCharset;
   return NS_OK;
 }
 
 //nsDOMFileReader constructors/initializers
 
 nsDOMFileReader::nsDOMFileReader()
   : mFileData(nsnull),
     mDataLen(0), mDataFormat(FILE_AS_BINARY),
-    mResultArrayBuffer(nsnull),
-    mResultArrayBufferRooted(false),
     mReadyState(nsIDOMFileReader::EMPTY),
     mProgressEventWasDelayed(PR_FALSE),
     mTimerIsActive(PR_FALSE),
     mReadTotal(0), mReadTransferred(0)
 {
   nsLayoutStatics::AddRef();
-  SetDOMStringToNull(mResult);
 }
 
 nsDOMFileReader::~nsDOMFileReader()
 {
-  if (mResultArrayBufferRooted) {
-    UnrootResultArrayBuffer();
-  }
   if (mListenerManager) 
     mListenerManager->Disconnect();
 
   FreeFileData();
 
   nsLayoutStatics::Release();
 }
 
@@ -268,63 +230,46 @@ nsDOMFileReader::GetInterface(const nsII
 NS_IMETHODIMP
 nsDOMFileReader::GetReadyState(PRUint16 *aReadyState)
 {
   *aReadyState = mReadyState;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMFileReader::GetResult(JSContext* aCx, jsval* aResult)
+nsDOMFileReader::GetResult(nsAString& aResult)
 {
-  if (mDataFormat == FILE_AS_ARRAYBUFFER) {
-    if (mReadyState == nsIDOMFileReader::DONE) {
-      *aResult = OBJECT_TO_JSVAL(mResultArrayBuffer);
-    } else {
-      *aResult = JSVAL_NULL;
-    }
-    return NS_OK;
-  }
-  
-  if (!xpc_qsStringToJsval(aCx, mResult, aResult)) {
-    return NS_ERROR_FAILURE;
-  }
+  aResult = mResult;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMFileReader::GetError(nsIDOMFileError** aError)
 {
   NS_IF_ADDREF(*aError = mError);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMFileReader::ReadAsArrayBuffer(nsIDOMBlob* aFile, JSContext* aCx)
-{
-  return ReadFileContent(aCx, aFile, EmptyString(), FILE_AS_ARRAYBUFFER);
-}
-
-NS_IMETHODIMP
 nsDOMFileReader::ReadAsBinaryString(nsIDOMBlob* aFile)
 {
-  return ReadFileContent(nsnull, aFile, EmptyString(), FILE_AS_BINARY);
+  return ReadFileContent(aFile, EmptyString(), FILE_AS_BINARY);
 }
 
 NS_IMETHODIMP
 nsDOMFileReader::ReadAsText(nsIDOMBlob* aFile,
                             const nsAString &aCharset)
 {
-  return ReadFileContent(nsnull, aFile, aCharset, FILE_AS_TEXT);
+  return ReadFileContent(aFile, aCharset, FILE_AS_TEXT);
 }
 
 NS_IMETHODIMP
 nsDOMFileReader::ReadAsDataURL(nsIDOMBlob* aFile)
 {
-  return ReadFileContent(nsnull, aFile, EmptyString(), FILE_AS_DATAURL);
+  return ReadFileContent(aFile, EmptyString(), FILE_AS_DATAURL);
 }
 
 NS_IMETHODIMP
 nsDOMFileReader::Abort()
 {
   if (mReadyState != nsIDOMFileReader::LOADING)
     return NS_OK;
 
@@ -332,19 +277,16 @@ nsDOMFileReader::Abort()
   mProgressEventWasDelayed = PR_FALSE;
   mTimerIsActive = PR_FALSE;
   if (mProgressNotifier) {
     mProgressNotifier->Cancel();
   }
 
   //Revert status, result and readystate attributes
   SetDOMStringToNull(mResult);
-  if (mResultArrayBufferRooted) {
-    UnrootResultArrayBuffer();
-  }
   mReadyState = nsIDOMFileReader::DONE;
   mError = new nsDOMFileError(nsIDOMFileError::ABORT_ERR);
     
   //Non-null channel indicates a read is currently active
   if (mChannel) {
     //Cancel request requires an error status
     mChannel->Cancel(NS_ERROR_FAILURE);
     mChannel = nsnull;
@@ -437,24 +379,16 @@ nsDOMFileReader::OnDataAvailable(nsIRequ
     mResult.GetMutableData(&buf, oldLen + aCount);
     NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
 
     PRUint32 bytesRead = 0;
     aInputStream->ReadSegments(ReadFuncBinaryString, buf + oldLen, aCount,
                                &bytesRead);
     NS_ASSERTION(bytesRead == aCount, "failed to read data");
   }
-  else if (mDataFormat == FILE_AS_ARRAYBUFFER) {
-    js::ArrayBuffer* abuf = js::ArrayBuffer::fromJSObject(mResultArrayBuffer);
-    NS_ASSERTION(abuf, "What happened?");
-  
-    PRUint32 bytesRead = 0;
-    aInputStream->Read((char*)abuf->data + aOffset, aCount, &bytesRead);
-    NS_ASSERTION(bytesRead == aCount, "failed to read data");
-  }
   else {
     //Update memory buffer to reflect the contents of the file
     mFileData = (char *)PR_Realloc(mFileData, aOffset + aCount);
     NS_ENSURE_TRUE(mFileData, NS_ERROR_OUT_OF_MEMORY);
 
     PRUint32 bytesRead = 0;
     aInputStream->Read(mFileData + aOffset, aCount, &bytesRead);
     NS_ASSERTION(bytesRead == aCount, "failed to read data");
@@ -500,18 +434,16 @@ nsDOMFileReader::OnStopRequest(nsIReques
   if (NS_FAILED(aStatus)) {
     FreeFileData();
     DispatchError(aStatus);
     return NS_OK;
   }
 
   nsresult rv = NS_OK;
   switch (mDataFormat) {
-    case FILE_AS_ARRAYBUFFER:
-      break; //Already accumulated mResultArrayBuffer
     case FILE_AS_BINARY:
       break; //Already accumulated mResult
     case FILE_AS_TEXT:
       rv = GetAsText(mCharset, mFileData, mDataLen, mResult);
       break;
     case FILE_AS_DATAURL:
       rv = GetAsDataURL(mFile, mFileData, mDataLen, mResult);
       break;
@@ -531,18 +463,17 @@ nsDOMFileReader::OnStopRequest(nsIReques
   DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
 
   return NS_OK;
 }
 
 // Helper methods
 
 nsresult
-nsDOMFileReader::ReadFileContent(JSContext* aCx,
-                                 nsIDOMBlob* aFile,
+nsDOMFileReader::ReadFileContent(nsIDOMBlob* aFile,
                                  const nsAString &aCharset,
                                  eDataFormat aDataFormat)
 {
   nsresult rv;
   NS_ENSURE_TRUE(aFile, NS_ERROR_NULL_POINTER);
 
   //Implicit abort to clear any other activity going on
   Abort();
@@ -577,25 +508,16 @@ nsDOMFileReader::ReadFileContent(JSConte
   mFile->GetSize(&mReadTotal);
 
   rv = mChannel->AsyncOpen(this, nsnull);
   NS_ENSURE_SUCCESS(rv, rv);
 
   //FileReader should be in loading state here
   mReadyState = nsIDOMFileReader::LOADING;
   DispatchProgressEvent(NS_LITERAL_STRING(LOADSTART_STR));
-  
-  if (mDataFormat == FILE_AS_ARRAYBUFFER) {
-    mResultArrayBuffer = js_CreateArrayBuffer(aCx, mReadTotal);
-    if (!mResultArrayBuffer) {
-      NS_WARNING("Failed to create JS array buffer");
-      return NS_ERROR_FAILURE;
-    }
-    RootResultArrayBuffer();
-  }
  
   return NS_OK;
 }
 
 void
 nsDOMFileReader::DispatchError(nsresult rv)
 {
   //Set the status attribute, and dispatch the error event
--- a/content/base/src/nsDOMFileReader.h
+++ b/content/base/src/nsDOMFileReader.h
@@ -75,18 +75,17 @@ class nsDOMFileReader : public nsXHREven
 {
 public:
   nsDOMFileReader();
   virtual ~nsDOMFileReader();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMFILEREADER
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(nsDOMFileReader,
-                                                         nsXHREventTarget)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMFileReader, nsXHREventTarget)
 
   NS_FORWARD_NSIXMLHTTPREQUESTEVENTTARGET(nsXHREventTarget::);
         
   // nsIStreamListener
   NS_DECL_NSISTREAMLISTENER
                                
   // nsIRequestObserver
   NS_DECL_NSIREQUESTOBSERVER
@@ -105,29 +104,25 @@ public:
   NS_FORWARD_NSIDOMNSEVENTTARGET(nsXHREventTarget::)
 
   // nsICharsetDetectionObserver
   NS_IMETHOD Notify(const char *aCharset, nsDetectionConfident aConf);
 
   void DispatchProgressEvent(const nsAString& aType);
 
   nsresult Init();
-  
-  void RootResultArrayBuffer();
-  void UnrootResultArrayBuffer();
 
 protected:
   enum eDataFormat {
-    FILE_AS_ARRAYBUFFER,
     FILE_AS_BINARY,
     FILE_AS_TEXT,
     FILE_AS_DATAURL
   };
 
-  nsresult ReadFileContent(JSContext* aCx, nsIDOMBlob *aFile, const nsAString &aCharset, eDataFormat aDataFormat); 
+  nsresult ReadFileContent(nsIDOMBlob *aFile, const nsAString &aCharset, eDataFormat aDataFormat); 
   nsresult GetAsText(const nsACString &aCharset,
                      const char *aFileData, PRUint32 aDataLen, nsAString &aResult);
   nsresult GetAsDataURL(nsIDOMBlob *aFile, const char *aFileData, PRUint32 aDataLen, nsAString &aResult); 
   nsresult GuessCharset(const char *aFileData, PRUint32 aDataLen, nsACString &aCharset); 
   nsresult ConvertStream(const char *aFileData, PRUint32 aDataLen, const char *aCharset, nsAString &aResult); 
   void DispatchError(nsresult rv);
   void StartProgressEventTimer();
 
@@ -139,19 +134,16 @@ protected:
 
   char *mFileData;
   nsCOMPtr<nsIDOMBlob> mFile;
   nsCString mCharset;
   PRUint32 mDataLen;
 
   eDataFormat mDataFormat;
 
-  JSObject* mResultArrayBuffer;
-  bool mResultArrayBufferRooted;
-  
   nsString mResult;
   PRUint16 mReadyState;
 
   PRBool mProgressEventWasDelayed;
   PRBool mTimerIsActive;
   nsCOMPtr<nsIDOMFileError> mError;
 
   nsCOMPtr<nsITimer> mProgressNotifier;
--- a/content/base/test/test_fileapi.html
+++ b/content/base/test/test_fileapi.html
@@ -93,28 +93,16 @@ r.addEventListener("load", function() { 
 r.addEventListener("loadstart", function() { onloadStartHasRunBinary = true }, false);
 r.readAsBinaryString(binaryFile);
 r.onload = getLoadHandler(testBinaryData, testBinaryData.length, "binary reading");
 is(r.readyState, FileReader.LOADING, "correct loading binary readyState");
 is(onloadHasRunBinary, false, "binary loading must be async");
 is(onloadStartHasRunBinary, true, "binary loadstart should fire sync");
 expectedTestCount++;
 
-var onloadHasRunArrayBuffer = false;
-var onloadStartHasRunArrayBuffer = false;
-r = new FileReader();
-is(r.readyState, FileReader.EMPTY, "correct initial arrayBuffer readyState");
-r.addEventListener("load", function() { onloadHasRunArrayBuffer = true }, false);
-r.addEventListener("loadstart", function() { onloadStartHasRunArrayBuffer = true }, false);
-r.readAsArrayBuffer(binaryFile);
-r.onload = getLoadHandlerForArrayBuffer(testBinaryData, testBinaryData.length, "array buffer reading");
-is(r.readyState, FileReader.LOADING, "correct loading arrayBuffer readyState");
-is(onloadHasRunArrayBuffer, false, "arrayBuffer loading must be async");
-is(onloadStartHasRunArrayBuffer, true, "arrayBuffer loadstart should fire sync");
-expectedTestCount++;
 
 // Test a variety of encodings, and make sure they work properly
 r = new FileReader();
 r.onload = getLoadHandler(testASCIIData, testASCIIData.length, "no encoding reading");
 r.readAsText(asciiFile, "");
 expectedTestCount++;
 
 r = new FileReader();
@@ -131,24 +119,16 @@ expectedTestCount++;
 
 r = new FileReader();
 r.readAsText(createFileWithData(convertToUTF16(testTextData)), "utf-16");
 r.onload = getLoadHandler(testTextData,
                           convertToUTF16(testTextData).length,
                           "utf16 reading");
 expectedTestCount++;
 
-// Test get result without reading
-r = new FileReader();
-is(r.readyState, FileReader.EMPTY,
-  "readyState in test reader get result without reading");
-is(r.error, null,
-  "no error in test reader get result without reading");
-is(r.result, null,
-  "result in test reader get result without reading");
 
 // Test loading an empty file works (and doesn't crash!)
 var emptyFile = createFileWithData("");
 dump("hello nurse");
 r = new FileReader();
 r.onload = getLoadHandler("", 0, "empty no encoding reading");
 r.readAsText(emptyFile, "");
 expectedTestCount++;
@@ -164,21 +144,16 @@ r.readAsText(emptyFile, "utf-16");
 expectedTestCount++;
 
 r = new FileReader();
 r.onload = getLoadHandler("", 0, "empty binary string reading");
 r.readAsBinaryString(emptyFile);
 expectedTestCount++;
 
 r = new FileReader();
-r.onload = getLoadHandlerForArrayBuffer("", 0, "empty array buffer reading");
-r.readAsArrayBuffer(emptyFile);
-expectedTestCount++;
-
-r = new FileReader();
 r.onload = getLoadHandler(convertToDataURL(""), 0, "empt binary string reading");
 r.readAsDataURL(emptyFile);
 expectedTestCount++;
 
 
 // Test reusing a FileReader to read multiple times
 r = new FileReader();
 r.onload = getLoadHandler(testASCIIData,
@@ -223,31 +198,16 @@ var makeAnotherReadListener3 = function(
                             testBinaryData.length,
                             "reused reading data url");
   r.readAsDataURL(binaryFile);
 };
 r.addEventListener("load", makeAnotherReadListener3, false);
 r.readAsDataURL(binaryFile);
 expectedTestCount += 2;
 
-r = new FileReader();
-r.onload = getLoadHandlerForArrayBuffer(testBinaryData,
-                          testBinaryData.length,
-                          "to-be-reused reading arrayBuffer")
-var makeAnotherReadListener4 = function(event) {
-  r = event.target;
-  r.removeEventListener("load", makeAnotherReadListener4, false);
-  r.onload = getLoadHandlerForArrayBuffer(testBinaryData,
-                            testBinaryData.length,
-                            "reused reading arrayBuffer");
-  r.readAsArrayBuffer(binaryFile);
-};
-r.addEventListener("load", makeAnotherReadListener4, false);
-r.readAsArrayBuffer(binaryFile);
-expectedTestCount += 2;
 
 //Test data-URI encoding on differing file sizes
 dataurldata = testBinaryData.substr(0, testBinaryData.length -
                                        testBinaryData.length % 3);
 is(dataurldata.length % 3, 0, "Want to test data with length % 3 == 0");
 r = new FileReader();
 r.onload = getLoadHandler(convertToDataURL(dataurldata),
                           dataurldata.length,
@@ -345,40 +305,19 @@ function getLoadHandler(expectedResult, 
        "readyState in test " + testName);
     is(event.target.error, null,
        "no error in test " + testName);
     is(event.target.result, expectedResult,
        "result in test " + testName);
     is(event.lengthComputable, true,
        "lengthComputable in test " + testName);
     is(event.loaded, expectedLength,
-       "loaded in test " + testName);
+       "lengthComputable in test " + testName);
     is(event.total, expectedLength,
-       "total in test " + testName);
-    testHasRun();
-  }
-}
-
-function getLoadHandlerForArrayBuffer(expectedResult, expectedLength, testName) {
-  return function (event) {
-    is(event.target.readyState, FileReader.DONE,
-       "readyState in test " + testName);
-    is(event.target.error, null,
-       "no error in test " +  testName);
-    is(event.lengthComputable, true,
        "lengthComputable in test " + testName);
-    is(event.loaded, expectedLength,
-       "loaded in test " + testName);
-    is(event.total, expectedLength,
-       "total in test " + testName);
-    is(event.target.result.byteLength, expectedLength,
-       "array buffer size in test " + testName);
-    var u8v = new Uint8Array(event.target.result);
-    is(String.fromCharCode.apply(String, u8v), expectedResult,
-       "array buffer contents in test " + testName);
     testHasRun();
   }
 }
 
 function testHasRun() {
  //alert(testRanCounter);
  ++testRanCounter;
  if (testRanCounter == expectedTestCount) {