NS_ASSERTION(!gTestAsyncOpen || mAsyncOpenCompleted, "AsyncOpen failed");
InputTestConsumer::OnDataAvailable(nsIChannel* channel,                                    nsISupports* context,                                   nsIInputStream *aIStream,                                    PRUint32 aSourceOffset,                                   PRUint32 aLength){  char buf[1025];  PRUint32 amt, size;  nsresult rv;  URLLoadInfo* info = (URLLoadInfo*)context;  while (aLength) {    size = PR_MIN(aLength, sizeof(buf));    rv = aIStream->Read(buf, size, &amt);    if (NS_FAILED(rv)) {      NS_ASSERTION((NS_BASE_STREAM_WOULD_BLOCK != rv),                    "The stream should never block.");      return rv;    }    if (gVerbose) {      buf[amt] = '\0';      puts(buf);    }    if (info) {      info->mBytesRead += amt;    }    aLength -= amt;  }  return NS_OK;}