зеркало из https://github.com/mozilla/pjs.git
Passing nsISupports context to AsyncOpen() in nsichanneltests.cpp. Triggers post-AsyncOpen nsIChannel tests. Not part of the build.
This commit is contained in:
Родитель
6661e825d5
Коммит
ae1d48af76
|
@ -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()");
|
||||
|
|
Загрузка…
Ссылка в новой задаче