rv = fts->CreateTransport(fs, "load", nsnull, &fileTrans);
rv = fts->CreateTransport(fs, "load", &fileTrans);
TestAsyncOpen(const char* fileName, PRUint32 offset, PRInt32 length){    nsresult rv;    NS_WITH_SERVICE(nsIFileTransportService, fts, kFileTransportServiceCID, &rv);    if (NS_FAILED(rv)) return rv;    nsFileSpec fs(fileName);    nsIChannel* fileTrans;    rv = fts->CreateTransport(fs, "load", nsnull, &fileTrans);    if (NS_FAILED(rv)) return rv;    MyListener* listener = new MyListener(1);    if (listener == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(listener);    rv = listener->Init(fs);    if (NS_FAILED(rv)) return rv;    MyOpenObserver* openObserver = new MyOpenObserver();    if (openObserver == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(openObserver);    gDone = PR_FALSE;    rv = fileTrans->AsyncOpen(openObserver, nsnull);    if (NS_FAILED(rv)) return rv;    rv = fileTrans->AsyncRead(offset + 10, length, nsnull, listener);    if (NS_FAILED(rv)) return rv;#if 0    rv = fileTrans->AsyncRead(offset, length, nsnull, listener);    if (NS_FAILED(rv)) return rv;    rv = fileTrans->AsyncRead(offset + 100, length, nsnull, listener);    if (NS_FAILED(rv)) return rv;#endif    while (!gDone) {        PLEvent* event;        rv = gEventQ->GetEvent(&event);        if (NS_FAILED(rv)) return rv;        rv = gEventQ->HandleEvent(event);        if (NS_FAILED(rv)) return rv;    }    NS_RELEASE(openObserver);    NS_RELEASE(listener);    NS_RELEASE(fileTrans);    return NS_OK;}