Passing nsISupports context to AsyncOpen() in nsichanneltests.cpp. Triggers post-AsyncOpen nsIChannel tests. Not part of the build.

This commit is contained in:
depstein%netscape.com 2002-12-24 21:22:59 +00:00
Родитель 64df219fb4
Коммит ef653515b3
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -542,12 +542,13 @@ NS_IMETHODIMP CBrowserImpl::OnStartRequest(nsIRequest *request,
RequestName(request, stringMsg, 1);
// these are for nsIChannel tests found in nsichanneltests.cpp (post AsyncOpen() tests)
// they will only be run if a nsISupports context was passed to AsyncOpen()
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
CBrowserImpl *aBrowserImpl = new CBrowserImpl();
CnsIChannelTests *obj = new CnsIChannelTests(mWebBrowser, aBrowserImpl);
if (obj)
if (obj && ctxt)
obj->PostAsyncTests(channel, 1);
else
else if (!obj && ctxt)
QAOutput("No object to run PostAsyncTests().", 1);
if (!ctxt)

Просмотреть файл

@ -164,8 +164,8 @@ void CnsIChannelTests::GetURITest(nsIChannel *theChannel, PRInt16 displayMode)
void CnsIChannelTests::SetOwnerTest(nsIChannel *theChannel, PRInt16 displayMode)
{
theSupports = do_QueryInterface(theChannel);
rv = theChannel->SetOwner(theSupports);
theSupports = do_QueryInterface(qaWebBrowser);
rv = theChannel->SetOwner(theChannel);
RvTestResult(rv, "SetOwner", displayMode);
if (displayMode == 1)
RvTestResultDlg(rv, "SetOwner");
@ -211,7 +211,7 @@ void CnsIChannelTests::GetNotificationsTest(nsIChannel *theChannel, PRInt16 disp
void CnsIChannelTests::GetSecurityInfoTest(nsIChannel *theChannel, PRInt16 displayMode)
{
theSupports = do_QueryInterface(theChannel);
theSupports = do_QueryInterface(qaWebBrowser);
if (!theChannel)
{
QAOutput("Didn't get nsIChannel object. GetSecurityInfoTest failed.", displayMode);
@ -308,7 +308,11 @@ void CnsIChannelTests::AsyncOpenTest(nsIChannel *theChannel, PRInt16 displayMode
return;
}
// this calls nsIStreamListener::OnDataAvailable()
rv = theChannel->AsyncOpen(listener, nsnull);
theSupports = do_QueryInterface(theChannel);
if (!theSupports)
QAOutput("Didn't get the nsISupports object. AsyncOpen() failed.", displayMode);
rv = theChannel->AsyncOpen(listener, theSupports);
RvTestResult(rv, "AsyncOpen()", displayMode);
if (displayMode == 1)
RvTestResultDlg(rv, "AsyncOpen()");