Added nsIHttpChannel->GetResponseText test. Not part of the build.

git-svn-id: svn://10.0.0.236/trunk@135925 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
depstein%netscape.com
2003-01-07 04:26:49 +00:00
parent 0edc4cf988
commit c9f4a3195f
7 changed files with 36 additions and 4 deletions

View File

@@ -556,9 +556,10 @@ NS_IMETHODIMP CBrowserImpl::OnStartRequest(nsIRequest *request,
if (!httpObj)
QAOutput("No object to run GetResponseStatusTest().", 1);
else
else {
httpObj->GetResponseStatusTest(httpChannel, 1);
httpObj->GetResponseStatusTextTest(httpChannel, 1);
}
if (!ctxt)
QAOutput("OnStartRequest():We didn't get the nsISupports object.", 1);

View File

@@ -308,6 +308,7 @@ BEGIN_MESSAGE_MAP(CTests, CWnd)
ON_COMMAND(ID_INTERFACES_NSIHTTPCHANNEL_SETREDIRECTIONLIMIT, OnInterfacesNsihttpchannel)
ON_COMMAND(ID_INTERFACES_NSIHTTPCHANNEL_GETREDIRECTIONLIMIT, OnInterfacesNsihttpchannel)
ON_COMMAND(ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS, OnInterfacesNsihttpchannel)
ON_COMMAND(ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT, OnInterfacesNsihttpchannel)
ON_COMMAND(ID_INTERFACES_RUNALLTESTCASES, OnInterfacesRunalltestcases)
//}}AFX_MSG_MAP

View File

@@ -105,6 +105,9 @@ void CnsIHttpChannelTests::OnStartTests(UINT nMenuID)
case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS :
GetResponseStatusTest(theHttpChannel, 2);
break;
case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT :
GetResponseStatusTextTest(theHttpChannel, 2);
break;
}
}
@@ -132,9 +135,11 @@ void CnsIHttpChannelTests::RunAllTests()
SetRedirectionLimitTest(theHttpChannel, 5, 1);
GetRedirectionLimitTest(theHttpChannel, 1);
// see nsIRequestObserver->OnStartRequest for response tests
// see nsIRequestObserver->OnStartRequest for Successful response tests
// we're running response tests here to verify they fail when called here.
GetResponseStatusTest(theHttpChannel, 1);
GetResponseStatusTextTest(theHttpChannel, 1);
QAOutput("\n");
}
@@ -263,6 +268,15 @@ void CnsIHttpChannelTests::GetRedirectionLimitTest(nsIHttpChannel *theHttpChann
FormatAndPrintOutput("GetRedirectionLimit value = ", mRedirectionLimit, displayMode);
}
// Response tests
void CnsIHttpChannelTests::CallResponseTests(nsIHttpChannel *theHttpChannel,
PRInt16 displayMode)
{
GetResponseStatusTest(theHttpChannel, displayMode);
GetResponseStatusTextTest(theHttpChannel, displayMode);
}
void CnsIHttpChannelTests::GetResponseStatusTest(nsIHttpChannel *theHttpChannel,
PRInt16 displayMode)
{
@@ -273,4 +287,15 @@ void CnsIHttpChannelTests::GetResponseStatusTest(nsIHttpChannel *theHttpChannel,
FormatAndPrintOutput("GetResponseStatus value = ", mResponseStatus, displayMode);
}
void CnsIHttpChannelTests::GetResponseStatusTextTest(nsIHttpChannel *theHttpChannel,
PRInt16 displayMode)
{
nsCAutoString mText;
rv = theHttpChannel->GetResponseStatusText(mText);
RvTestResult(rv, "GetResponseStatusText()", displayMode);
FormatAndPrintOutput("GetResponseStatusText = ", mText, displayMode);
}

View File

@@ -36,7 +36,9 @@ public:
void GetRedirectionLimitTest(nsIHttpChannel *, PRInt16);
// response methods
void CallResponseTests(nsIHttpChannel *, PRInt16);
void GetResponseStatusTest(nsIHttpChannel *, PRInt16);
void GetResponseStatusTextTest(nsIHttpChannel *, PRInt16);
public:

View File

@@ -305,6 +305,7 @@
#define ID_INTERFACES_NSIHTTPCHANNEL_SETREDIRECTIONLIMIT 33042
#define ID_INTERFACES_NSIHTTPCHANNEL_GETREDIRECTIONLIMIT 33043
#define ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS 33044
#define ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT 33045
#define ID_CLIPBOARDCMD_PASTE 42789
#define ID_CLIPBOARDCMD_COPYSELECTION 42790
#define ID_CLIPBOARDCMD_SELECTALL 42791
@@ -321,7 +322,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 153
#define _APS_NEXT_COMMAND_VALUE 33045
#define _APS_NEXT_COMMAND_VALUE 33046
#define _APS_NEXT_CONTROL_VALUE 1033
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@@ -670,6 +670,8 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "GetResponseStatus", ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS
MENUITEM "GetResponseStatusText", ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT
END
END
POPUP "T&ools"