Commit 77b44ebb authored by depstein%netscape.com's avatar depstein%netscape.com
Browse files

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

parent 5ab59eca
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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
+26 −1
Original line number Diff line number Diff line
@@ -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);
}


+2 −0
Original line number Diff line number Diff line
@@ -36,7 +36,9 @@ public:
	void GetRedirectionLimitTest(nsIHttpChannel *, PRInt16);

	// response methods
	void CallResponseTests(nsIHttpChannel *, PRInt16);
	void GetResponseStatusTest(nsIHttpChannel *, PRInt16);
	void GetResponseStatusTextTest(nsIHttpChannel *, PRInt16);

public:

+2 −1
Original line number Diff line number Diff line
@@ -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
Loading