Back to index

lightning-sunbird  0.9+nobinonly
nsihttpchanneltests.cpp
Go to the documentation of this file.
00001 // nsIHttpChannelTests.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "testembed.h"
00006 #include "nsIHttpChannelTests.h"
00007 #include "BrowserImpl.h"
00008 #include "BrowserFrm.h"
00009 #include "UrlDialog.h"
00010 #include "ProfileMgr.h"
00011 #include "ProfilesDlg.h"
00012 #include "QaUtils.h"
00013 #include "Tests.h"
00014 #include "nsichanneltests.h"
00015 #include "nsIHttpHeaderVisitor.h"
00016 
00017 #ifdef _DEBUG
00018 #define new DEBUG_NEW
00019 #undef THIS_FILE
00020 static char THIS_FILE[] = __FILE__;
00021 #endif
00022 
00024 // nsIHttpChannelTests
00025 
00026 CnsIHttpChannelTests::CnsIHttpChannelTests(nsIWebBrowser *mWebBrowser,
00027                                                            CBrowserImpl *mpBrowserImpl)
00028 {
00029        qaWebBrowser = mWebBrowser;
00030        qaBrowserImpl = mpBrowserImpl;
00031 }
00032 
00033 CnsIHttpChannelTests::~CnsIHttpChannelTests()
00034 {
00035 }
00036 
00037 class HeaderVisitor : public nsIHttpHeaderVisitor
00038 {
00039 public:
00040    NS_DECL_ISUPPORTS
00041    NS_DECL_NSIHTTPHEADERVISITOR
00042  
00043    HeaderVisitor() { }
00044    virtual ~HeaderVisitor() {}
00045  };
00046 
00047 NS_IMPL_ISUPPORTS1(HeaderVisitor, nsIHttpHeaderVisitor)
00048 
00049 NS_IMETHODIMP
00050 HeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value)
00051 {
00052    FormatAndPrintOutput("VisitHeader header = ", PromiseFlatCString(header).get(), 1);
00053    FormatAndPrintOutput("VisitHeader value = ", PromiseFlatCString(value).get(), 1);
00054 return NS_OK;
00055 }
00056 
00058 // CnsIHttpChannelTests message handlers
00059 
00060 nsIHttpChannel * CnsIHttpChannelTests::GetHttpChannelObject(nsCAutoString theSpec)
00061 {
00062        NS_NewURI(getter_AddRefs(theURI), theSpec);
00063        if (!theURI)  
00064           QAOutput("Didn't get URI object. Test failed.", 2);
00065        NS_NewChannel(getter_AddRefs(theChannel), theURI, nsnull, nsnull);
00066        if (!theChannel)
00067           QAOutput("Didn't get Channel object. GetChannelObject Test failed.", 2);
00068 
00069        theHttpChannel = do_QueryInterface(theChannel);
00070        if (!theHttpChannel)
00071           QAOutput("Didn't get httpChannel object. Test failed.", 2);
00072 
00073        return theHttpChannel;
00074 }
00075 
00076 void CnsIHttpChannelTests::OnStartTests(UINT nMenuID)
00077 {
00078        theSpec = "http://www.netscape.com";
00079        theHttpChannel = GetHttpChannelObject(theSpec);
00080        if (!theHttpChannel)
00081        {
00082           QAOutput("Didn't get nsIHttpChannel object. Test not run.", 1);
00083           return;
00084        }
00085        switch(nMenuID)
00086        {
00087               case ID_INTERFACES_NSIHTTPCHANNEL_RUNALLTESTS :
00088                      RunAllTests();
00089                      break ;
00090               case ID_INTERFACES_NSIHTTPCHANNEL_SETREQUESTMETHOD :
00091                      SetRequestMethodTest(theHttpChannel, "PUT", 2);
00092                      break ;
00093               case ID_INTERFACES_NSIHTTPCHANNEL_GETREQUESTMETHOD :
00094                      GetRequestMethodTest(theHttpChannel, 2);
00095                      break ;
00096               case ID_INTERFACES_NSIHTTPCHANNEL_SETREFERRER :
00097                      SetReferrerTest(theHttpChannel, "https://www.sun.com", 2);
00098                      break ;
00099               case ID_INTERFACES_NSIHTTPCHANNEL_GETREFERRER :
00100                      GetReferrerTest(theHttpChannel, 2);
00101                      break ;
00102               case ID_INTERFACES_NSIHTTPCHANNEL_SETREQUESTHEADER :
00103                      SetRequestHeaderTest(theHttpChannel, "Content-Type", "text/html", 2);
00104                      break ;
00105               case ID_INTERFACES_NSIHTTPCHANNEL_GETREQUESTHEADER :
00106                      GetRequestHeaderTest(theHttpChannel, "Content-Type", 2);
00107                      break ;
00108               case ID_INTERFACES_NSIHTTPCHANNEL_VISITREQUESTHEADERS :
00109                      VisitRequestHeadersTest(theHttpChannel, 2);
00110                      break;
00111               case ID_INTERFACES_NSIHTTPCHANNEL_SETALLOWPIPELINING :
00112                      SetAllowPipeliningTest(theHttpChannel, PR_FALSE, 2);
00113                      break;
00114               case ID_INTERFACES_NSIHTTPCHANNEL_GETALLOWPIPELINING :
00115                      GetAllowPipeliningTest(theHttpChannel, 2);
00116                      break;
00117               case ID_INTERFACES_NSIHTTPCHANNEL_SETREDIRECTIONLIMIT :
00118                      SetRedirectionLimitTest(theHttpChannel, 100, 2);
00119                      break;
00120               case ID_INTERFACES_NSIHTTPCHANNEL_GETREDIRECTIONLIMIT :
00121                      GetRedirectionLimitTest(theHttpChannel, 2);
00122                      break;
00123 
00124                      // response methods
00125 
00126               case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS :
00127                      GetResponseStatusTest(theHttpChannel, 2);
00128                      break;
00129               case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT :
00130                      GetResponseStatusTextTest(theHttpChannel, 2);
00131                      break;
00132        }
00133 }
00134 
00135 void CnsIHttpChannelTests::RunAllTests()
00136 {
00137        theSpec = "http://www.netscape.com";
00138        theHttpChannel = GetHttpChannelObject(theSpec);
00139        if (!theHttpChannel)
00140        {
00141           QAOutput("Didn't get nsIHttpChannel object. RunAllTests not run.", 1);
00142           return;
00143        }
00144        QAOutput("   nsIHttpChannel request tests:");
00145        SetRequestMethodTest(theHttpChannel, "get", 1);
00146        GetRequestMethodTest(theHttpChannel, 1);
00147        SetRequestMethodTest(theHttpChannel, "PUT", 1);
00148        GetRequestMethodTest(theHttpChannel, 1);
00149        SetRequestMethodTest(theHttpChannel, "POST", 1);
00150        GetRequestMethodTest(theHttpChannel, 1);
00151        SetRequestMethodTest(theHttpChannel, "HEAD", 1);
00152        GetRequestMethodTest(theHttpChannel, 1);
00153        SetReferrerTest(theHttpChannel, "http://www.cisco.com", 1);
00154        GetReferrerTest(theHttpChannel, 1);
00155        SetRequestHeaderTest(theHttpChannel, "Cookie", "TheCookie", 1);
00156        GetRequestHeaderTest(theHttpChannel, "Cookie", 1);
00157        SetRequestHeaderTest(theHttpChannel, "Content-Type", "text/xml", 1);
00158        GetRequestHeaderTest(theHttpChannel, "Content-Type", 1);
00159        SetRequestHeaderTest(theHttpChannel, "Content-Length", "10000", 1);
00160        GetRequestHeaderTest(theHttpChannel, "Content-Length", 1);
00161        VisitRequestHeadersTest(theHttpChannel, 1);
00162        SetAllowPipeliningTest(theHttpChannel, PR_FALSE, 1);
00163        SetAllowPipeliningTest(theHttpChannel, PR_TRUE, 1);
00164        GetAllowPipeliningTest(theHttpChannel, 1);
00165        SetRedirectionLimitTest(theHttpChannel, 0, 1);
00166        SetRedirectionLimitTest(theHttpChannel, 5, 1);
00167        GetRedirectionLimitTest(theHttpChannel, 1);
00168 
00169        // see nsIRequestObserver->OnStartRequest for response tests
00170        CnsIChannelTests *channelObj = new CnsIChannelTests(qaWebBrowser, qaBrowserImpl);
00171        if (!channelObj)
00172        {
00173           QAOutput("Didn't get nsIHttpChannel object. GetChannelObject will not be run.", 1);
00174           return;
00175        }
00176        theChannel = channelObj->GetChannelObject(theSpec);
00177        if (!theChannel)
00178        {
00179           QAOutput("Didn't get nsIChannel object. AsyncOpenTest will not be run.", 1);
00180           return;
00181        }
00182        // this will open the channel and run the httpChannel response tests
00183        channelObj->AsyncOpenTest(theChannel, 1);
00184        QAOutput("\n");
00185 }
00186 
00187 void  CnsIHttpChannelTests::SetRequestMethodTest(nsIHttpChannel *theHttpChannel,
00188                                                                                      const char * requestType,
00189                                                                                      PRInt16 displayMode)
00190 { 
00191        // SetRequestMethod
00192        // try "GET", "PUT", "HEAD", or "POST"
00193        if (!theHttpChannel)
00194        {
00195           QAOutput("Didn't get nsIHttpChannel object. SetRequestMethodTest failed.", displayMode);
00196           return;
00197        }
00198        rv = theHttpChannel->SetRequestMethod(nsDependentCString(requestType));
00199        RvTestResult(rv, "SetRequestMethod()", displayMode);
00200        RvTestResultDlg(rv, "SetRequestMethod() test", true);
00201 }
00202 
00203 void  CnsIHttpChannelTests::GetRequestMethodTest(nsIHttpChannel *theHttpChannel,
00204                                                                                      PRInt16 displayMode)
00205 {
00206        // GetRequestMethod
00207        nsCAutoString method;
00208 
00209        if (!theHttpChannel)
00210        {
00211           QAOutput("Didn't get nsIHttpChannel object. GetRequestMethodTest failed.", displayMode);
00212           return;
00213        }
00214        rv = theHttpChannel->GetRequestMethod(method);
00215        RvTestResult(rv, "GetRequestMethod()", displayMode);
00216        RvTestResultDlg(rv, "GetRequestMethod() test");
00217        // if (method.Equals("POST")
00218        FormatAndPrintOutput("GetRequestMethod method = ", method, displayMode);
00219 }
00220 
00221 void CnsIHttpChannelTests::SetReferrerTest(nsIHttpChannel *theHttpChannel,
00222                                                                                      const char *theUrl,
00223                                                                                      PRInt16 displayMode)
00224 {
00225        // SetReferrer
00226        nsCAutoString theSpec;
00227        theSpec = theUrl;
00228 
00229        if (!theHttpChannel)
00230        {
00231           QAOutput("Didn't get nsIHttpChannel object. SetReferrerTest failed.", displayMode);
00232           return;
00233        }
00234        NS_NewURI(getter_AddRefs(theURI), theSpec);
00235        if (!theURI)  
00236           QAOutput("Didn't get URI object. Test failed.", 2);
00237        rv = theHttpChannel->SetReferrer(theURI);
00238        RvTestResult(rv, "SetReferrer()", displayMode);
00239        RvTestResultDlg(rv, "SetReferrer() test");
00240 }
00241 
00242 void CnsIHttpChannelTests::GetReferrerTest(nsIHttpChannel *theHttpChannel,
00243                                                                                      PRInt16 displayMode)
00244 {
00245        // GetReferrer
00246        nsCAutoString theSpec;
00247 
00248        if (!theHttpChannel)
00249        {
00250           QAOutput("Didn't get nsIHttpChannel object. GetReferrerTest failed.", displayMode);
00251           return;
00252        }
00253        rv = theHttpChannel->GetReferrer(getter_AddRefs(theURI));
00254        RvTestResult(rv, "GetReferrer()", displayMode);
00255        RvTestResultDlg(rv, "GetReferrer() test");
00256        if (!theURI)
00257           QAOutput("Didn't get nsIURI object. Test failed.", displayMode);
00258        else {
00259           theURI->GetSpec(theSpec);
00260           FormatAndPrintOutput("GetReferrerTest uri = ", theSpec, displayMode);        
00261        }
00262 }
00263 
00264 void  CnsIHttpChannelTests::SetRequestHeaderTest(nsIHttpChannel *theHttpChannel,
00265                                                                                      const char *requestType,
00266                                                                                      const char *headerVal,
00267                                                                                      PRInt16 displayMode)
00268 {
00269        // SetRequestHeader
00270        // try {"Content-Type","text/xml"}, {"Content-Length", 10000}, and
00271        //     {"Accept"), NS_LITERAL_CSTRING("text/xml,application/xml,application/xhtml+xml,*/*;q=0.1"),
00272        if (!theHttpChannel)
00273        {
00274           QAOutput("Didn't get nsIHttpChannel object. SetRequestHeaderTest failed.", displayMode);
00275           return;
00276        }
00277     rv = theHttpChannel->SetRequestHeader(nsDependentCString(requestType),
00278                                          nsDependentCString(headerVal),
00279                                          PR_FALSE);
00280        RvTestResult(rv, "SetRequestHeader()", displayMode);
00281        RvTestResultDlg(rv, "SetRequestHeader() test");
00282 }
00283 
00284 void  CnsIHttpChannelTests::GetRequestHeaderTest(nsIHttpChannel *theHttpChannel,
00285                                                                                      const char *requestType,
00286                                                                                      PRInt16 displayMode)
00287 {
00288        // GetRequestHeader
00289        nsCAutoString header;
00290        // could be set to "referrer"
00291 
00292        if (!theHttpChannel)
00293        {
00294           QAOutput("Didn't get nsIHttpChannel object. GetRequestHeaderTest failed.", displayMode);
00295           return;
00296        }
00297        rv = theHttpChannel->GetRequestHeader(nsDependentCString(requestType), header);
00298        RvTestResult(rv, "GetRequestHeader()", displayMode);
00299        RvTestResultDlg(rv, "GetRequestHeader() test");
00300        FormatAndPrintOutput("GetRequestHeader type = ", header, displayMode);
00301 }
00302 
00303 void  CnsIHttpChannelTests::VisitRequestHeadersTest(nsIHttpChannel *theHttpChannel,
00304                                                                                         PRInt16 displayMode)
00305 {
00306        // visitRequestHeaders()
00307        if (!theHttpChannel)
00308        {
00309           QAOutput("Didn't get nsIHttpChannel object. VisitRequestHeadersTest failed.", displayMode);
00310           return;
00311        }
00312        HeaderVisitor *theVisitor = new HeaderVisitor();
00313        if (!theVisitor)
00314           QAOutput("Didn't get nsIHttpHeaderVisitor object. Test failed.", displayMode);
00315 
00316        rv = theHttpChannel->VisitRequestHeaders(theVisitor);
00317        RvTestResult(rv, "VisitRequestHeaders()", displayMode);
00318        RvTestResultDlg(rv, "VisitRequestHeaders() test");
00319 }
00320 
00321 void  CnsIHttpChannelTests::SetAllowPipeliningTest(nsIHttpChannel *theHttpChannel,
00322                                                                                 PRBool mAllowPipelining,
00323                                                                                 PRInt16 displayMode)
00324 {
00325        if (!theHttpChannel)
00326        {
00327           QAOutput("Didn't get nsIHttpChannel object. SetAllowPipeliningTest failed.", displayMode);
00328           return;
00329        }
00330        rv = theHttpChannel->SetAllowPipelining(mAllowPipelining);
00331        RvTestResult(rv, "SetAllowPipelining()", displayMode);
00332        RvTestResultDlg(rv, "SetAllowPipelining() test");
00333        FormatAndPrintOutput("SetAllowPipelining value = ", mAllowPipelining, displayMode);
00334 
00335        rv = theHttpChannel->GetAllowPipelining(&mAllowPipelining);
00336        FormatAndPrintOutput("GetAllowPipelining value = ", mAllowPipelining, displayMode);
00337 }
00338 
00339 void  CnsIHttpChannelTests::GetAllowPipeliningTest(nsIHttpChannel *theHttpChannel,
00340                                                                                        PRInt16 displayMode)
00341 {
00342        PRBool mAllowPipelining;
00343 
00344        if (!theHttpChannel)
00345        {
00346           QAOutput("Didn't get nsIHttpChannel object. GetAllowPipeliningTest failed.", displayMode);
00347           return;
00348        }
00349        rv = theHttpChannel->GetAllowPipelining(&mAllowPipelining);
00350        RvTestResult(rv, "GetAllowPipelining()", displayMode);
00351        RvTestResultDlg(rv, "GetAllowPipelining() test");
00352        FormatAndPrintOutput("GetAllowPipelining value = ", mAllowPipelining, displayMode);
00353 }
00354 
00355 void  CnsIHttpChannelTests::SetRedirectionLimitTest(nsIHttpChannel *theHttpChannel,
00356                                                                                        PRUint32 mRedirectionLimit,
00357                                                                                        PRInt16 displayMode)
00358 {
00359        if (!theHttpChannel)
00360        {
00361           QAOutput("Didn't get nsIHttpChannel object. SetRedirectionLimitTest failed.", displayMode);
00362           return;
00363        }
00364        rv = theHttpChannel->SetRedirectionLimit(mRedirectionLimit);
00365        RvTestResult(rv, "SetRedirectionLimit()", displayMode);
00366        RvTestResultDlg(rv, "SetRedirectionLimit() test");
00367 }
00368 
00369 void  CnsIHttpChannelTests::GetRedirectionLimitTest(nsIHttpChannel *theHttpChannel,
00370                                                                                         PRInt16 displayMode)
00371 {
00372        PRUint32 mRedirectionLimit;
00373 
00374        if (!theHttpChannel)
00375        {
00376           QAOutput("Didn't get nsIHttpChannel object. GetRedirectionLimitTest failed.", displayMode);
00377           return;
00378        }
00379        rv = theHttpChannel->GetRedirectionLimit(&mRedirectionLimit);
00380        RvTestResult(rv, "GetRedirectionLimit()", displayMode);
00381        RvTestResultDlg(rv, "GetRedirectionLimit() test");
00382        FormatAndPrintOutput("GetRedirectionLimit value = ", mRedirectionLimit, displayMode);
00383 }
00384 
00385 // Response tests
00386 // called from OnStartRequest
00387 
00388 void CnsIHttpChannelTests::CallResponseTests(nsIHttpChannel *theHttpChannel,
00389                                                                                      PRInt16 displayMode)
00390 {
00391        GetResponseStatusTest(theHttpChannel, displayMode);
00392        GetResponseStatusTextTest(theHttpChannel, displayMode);
00393        GetRequestSucceededTest(theHttpChannel, displayMode);
00394        SetResponseHeaderTest(theHttpChannel, "Refresh", "1001", PR_TRUE, displayMode);
00395        GetResponseHeaderTest(theHttpChannel, "Refresh", displayMode);
00396        SetResponseHeaderTest(theHttpChannel, "Set-Cookie", "MyCookie", PR_TRUE, displayMode);
00397        GetResponseHeaderTest(theHttpChannel, "Set-Cookie", displayMode);
00398        SetResponseHeaderTest(theHttpChannel, "Cache-control", "no-cache", PR_FALSE, displayMode);
00399        GetResponseHeaderTest(theHttpChannel, "Cache-control", displayMode);
00400        VisitResponseHeaderTest(theHttpChannel, displayMode);
00401        IsNoStoreResponseTest(theHttpChannel, displayMode);
00402        IsNoCacheResponseTest(theHttpChannel, displayMode);
00403 }
00404 
00405 void CnsIHttpChannelTests::GetResponseStatusTest(nsIHttpChannel *theHttpChannel,
00406                                                                                      PRInt16 displayMode)
00407 {
00408        PRUint32 mResponseStatus;
00409 
00410        if (!theHttpChannel)
00411        {
00412           QAOutput("Didn't get nsIHttpChannel object. GetResponseStatusTest failed.", displayMode);
00413           return;
00414        }
00415        rv = theHttpChannel->GetResponseStatus(&mResponseStatus);
00416        RvTestResult(rv, "GetResponseStatus()", displayMode);
00417        FormatAndPrintOutput("GetResponseStatus value = ", mResponseStatus, displayMode);
00418 }
00419 
00420 void CnsIHttpChannelTests::GetResponseStatusTextTest(nsIHttpChannel *theHttpChannel,
00421                                                                                      PRInt16 displayMode)
00422 {
00423        nsCAutoString mText;
00424 
00425        if (!theHttpChannel)
00426        {
00427           QAOutput("Didn't get nsIHttpChannel object. GetResponseStatusTextTest failed.", displayMode);
00428           return;
00429        }
00430        rv = theHttpChannel->GetResponseStatusText(mText);
00431        RvTestResult(rv, "GetResponseStatusText()", displayMode);
00432        FormatAndPrintOutput("GetResponseStatusText = ", mText, displayMode);
00433 }
00434 
00435 
00436 void CnsIHttpChannelTests::GetRequestSucceededTest(nsIHttpChannel *theHttpChannel,
00437                                                                                      PRInt16 displayMode)
00438 {
00439        PRBool mRequest;
00440 
00441        if (!theHttpChannel)
00442        {
00443           QAOutput("Didn't get nsIHttpChannel object. GetRequestSucceededTest failed.", displayMode);
00444           return;
00445        }
00446        rv = theHttpChannel->GetRequestSucceeded(&mRequest);
00447        RvTestResult(rv, "GetRequestSucceeded()", displayMode);
00448        FormatAndPrintOutput("GetRequestSucceeded = ", mRequest, displayMode);
00449 }
00450 
00451 void CnsIHttpChannelTests::GetResponseHeaderTest(nsIHttpChannel *theHttpChannel,
00452                                                                                      const char * responseType,
00453                                                                                      PRInt16 displayMode)
00454 {
00455        nsCAutoString mResponse;
00456 
00457        if (!theHttpChannel)
00458        {
00459           QAOutput("Didn't get nsIHttpChannel object. GetResponseHeaderTest failed.", displayMode);
00460           return;
00461        }
00462        rv = theHttpChannel->GetResponseHeader(nsDependentCString(responseType), mResponse);
00463        RvTestResult(rv, "GetResponseHeader()", displayMode);
00464        FormatAndPrintOutput("GetResponseHeader = ", mResponse, displayMode);
00465        FormatAndPrintOutput("GetResponseHeader response type = ", responseType, displayMode);
00466 }
00467  
00468 void CnsIHttpChannelTests::SetResponseHeaderTest(nsIHttpChannel *theHttpChannel,
00469                                                                                      const char * responseType,
00470                                                                                      const char * value,
00471                                                                                      PRBool merge, PRInt16 displayMode)
00472 {
00473        if (!theHttpChannel)
00474        {
00475           QAOutput("Didn't get nsIHttpChannel object. SetResponseHeaderTest failed.", displayMode);
00476           return;
00477        }
00478        rv = theHttpChannel->SetResponseHeader(nsDependentCString(responseType),
00479                                            nsDependentCString(value), merge);
00480        RvTestResult(rv, "SetResponseHeader()", displayMode);
00481        FormatAndPrintOutput("SetResponseHeader value = ", value, displayMode);
00482        FormatAndPrintOutput("SetResponseHeader response type = ", responseType, displayMode);
00483 }
00484 
00485 void CnsIHttpChannelTests::VisitResponseHeaderTest(nsIHttpChannel *theHttpChannel,
00486                                                                                        PRInt16 displayMode)
00487 {
00488        if (!theHttpChannel)
00489        {
00490           QAOutput("Didn't get nsIHttpChannel object. VisitResponseHeaderTest failed.", displayMode);
00491           return;
00492        }
00493        // visitResponseHeaders()
00494        HeaderVisitor *theVisitor = new HeaderVisitor();
00495        if (!theVisitor)
00496           QAOutput("Didn't get nsIHttpHeaderVisitor object. Test failed.", displayMode);
00497 
00498        rv = theHttpChannel->VisitResponseHeaders(theVisitor);
00499        RvTestResult(rv, "VisitResponseHeaders()", displayMode);
00500 }
00501 
00502 void CnsIHttpChannelTests::IsNoStoreResponseTest(nsIHttpChannel *theHttpChannel,
00503                                                                                      PRInt16 displayMode)
00504 {
00505        PRBool mNoResponse;
00506 
00507        if (!theHttpChannel)
00508        {
00509           QAOutput("Didn't get nsIHttpChannel object. IsNoStoreResponseTest failed.", displayMode);
00510           return;
00511        }
00512        rv = theHttpChannel->IsNoStoreResponse(&mNoResponse);
00513        RvTestResult(rv, "IsNoStoreResponse()", displayMode);
00514        FormatAndPrintOutput("IsNoStoreResponse = ", mNoResponse, displayMode);
00515 }
00516 
00517 void CnsIHttpChannelTests::IsNoCacheResponseTest(nsIHttpChannel *theHttpChannel,
00518                                                                                      PRInt16 displayMode)
00519 {
00520        PRBool mNoResponse;
00521 
00522        if (!theHttpChannel)
00523        {
00524           QAOutput("Didn't get nsIHttpChannel object. IsNoCacheResponseTest failed.", displayMode);
00525           return;
00526        }
00527        rv = theHttpChannel->IsNoCacheResponse(&mNoResponse);
00528        RvTestResult(rv, "IsNoCacheResponse()", displayMode);
00529        FormatAndPrintOutput("IsNoCacheResponse = ", mNoResponse, displayMode);
00530 }