File: nsihttpchanneltests.cpp

package info (click to toggle)
iceweasel 2.0.0.19-0etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 298,784 kB
  • ctags: 317,912
  • sloc: cpp: 1,796,902; ansic: 987,677; xml: 109,036; makefile: 47,777; asm: 35,201; perl: 26,983; sh: 20,879; cs: 6,232; java: 5,513; python: 3,249; pascal: 459; lex: 306; php: 244; csh: 132; objc: 97; yacc: 79; ada: 49; awk: 14; sql: 4; sed: 4
file content (530 lines) | stat: -rw-r--r-- 17,681 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
// nsIHttpChannelTests.cpp : implementation file
//

#include "stdafx.h"
#include "testembed.h"
#include "nsIHttpChannelTests.h"
#include "BrowserImpl.h"
#include "BrowserFrm.h"
#include "UrlDialog.h"
#include "ProfileMgr.h"
#include "ProfilesDlg.h"
#include "QaUtils.h"
#include "Tests.h"
#include "nsichanneltests.h"
#include "nsIHttpHeaderVisitor.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// nsIHttpChannelTests

CnsIHttpChannelTests::CnsIHttpChannelTests(nsIWebBrowser *mWebBrowser,
								   CBrowserImpl *mpBrowserImpl)
{
	qaWebBrowser = mWebBrowser;
	qaBrowserImpl = mpBrowserImpl;
}

CnsIHttpChannelTests::~CnsIHttpChannelTests()
{
}

class HeaderVisitor : public nsIHttpHeaderVisitor
{
public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIHTTPHEADERVISITOR
 
   HeaderVisitor() { }
   virtual ~HeaderVisitor() {}
 };

NS_IMPL_ISUPPORTS1(HeaderVisitor, nsIHttpHeaderVisitor)

NS_IMETHODIMP
HeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value)
{
   FormatAndPrintOutput("VisitHeader header = ", PromiseFlatCString(header).get(), 1);
   FormatAndPrintOutput("VisitHeader value = ", PromiseFlatCString(value).get(), 1);
return NS_OK;
}

/////////////////////////////////////////////////////////////////////////////
// CnsIHttpChannelTests message handlers

nsIHttpChannel * CnsIHttpChannelTests::GetHttpChannelObject(nsCAutoString theSpec)
{
	NS_NewURI(getter_AddRefs(theURI), theSpec);
	if (!theURI) 	
	   QAOutput("Didn't get URI object. Test failed.", 2);
	NS_NewChannel(getter_AddRefs(theChannel), theURI, nsnull, nsnull);
	if (!theChannel)
	   QAOutput("Didn't get Channel object. GetChannelObject Test failed.", 2);

	theHttpChannel = do_QueryInterface(theChannel);
	if (!theHttpChannel)
	   QAOutput("Didn't get httpChannel object. Test failed.", 2);

	return theHttpChannel;
}

void CnsIHttpChannelTests::OnStartTests(UINT nMenuID)
{
	theSpec = "http://www.netscape.com";
	theHttpChannel = GetHttpChannelObject(theSpec);
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. Test not run.", 1);
	   return;
	}
	switch(nMenuID)
	{
		case ID_INTERFACES_NSIHTTPCHANNEL_RUNALLTESTS :
			RunAllTests();
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_SETREQUESTMETHOD :
			SetRequestMethodTest(theHttpChannel, "PUT", 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETREQUESTMETHOD :
			GetRequestMethodTest(theHttpChannel, 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_SETREFERRER :
			SetReferrerTest(theHttpChannel, "https://www.sun.com", 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETREFERRER :
			GetReferrerTest(theHttpChannel, 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_SETREQUESTHEADER :
			SetRequestHeaderTest(theHttpChannel, "Content-Type", "text/html", 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETREQUESTHEADER :
			GetRequestHeaderTest(theHttpChannel, "Content-Type", 2);
			break ;
		case ID_INTERFACES_NSIHTTPCHANNEL_VISITREQUESTHEADERS :
			VisitRequestHeadersTest(theHttpChannel, 2);
			break;
		case ID_INTERFACES_NSIHTTPCHANNEL_SETALLOWPIPELINING :
			SetAllowPipeliningTest(theHttpChannel, PR_FALSE, 2);
			break;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETALLOWPIPELINING :
			GetAllowPipeliningTest(theHttpChannel, 2);
			break;
		case ID_INTERFACES_NSIHTTPCHANNEL_SETREDIRECTIONLIMIT :
			SetRedirectionLimitTest(theHttpChannel, 100, 2);
			break;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETREDIRECTIONLIMIT :
			GetRedirectionLimitTest(theHttpChannel, 2);
			break;

			// response methods

		case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUS :
			GetResponseStatusTest(theHttpChannel, 2);
			break;
		case ID_INTERFACES_NSIHTTPCHANNEL_GETRESPONSESTATUSTEXT :
			GetResponseStatusTextTest(theHttpChannel, 2);
			break;
	}
}

void CnsIHttpChannelTests::RunAllTests()
{
	theSpec = "http://www.netscape.com";
	theHttpChannel = GetHttpChannelObject(theSpec);
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. RunAllTests not run.", 1);
	   return;
	}
	QAOutput("   nsIHttpChannel request tests:");
	SetRequestMethodTest(theHttpChannel, "get", 1);
	GetRequestMethodTest(theHttpChannel, 1);
	SetRequestMethodTest(theHttpChannel, "PUT", 1);
	GetRequestMethodTest(theHttpChannel, 1);
	SetRequestMethodTest(theHttpChannel, "POST", 1);
	GetRequestMethodTest(theHttpChannel, 1);
	SetRequestMethodTest(theHttpChannel, "HEAD", 1);
	GetRequestMethodTest(theHttpChannel, 1);
	SetReferrerTest(theHttpChannel, "http://www.cisco.com", 1);
	GetReferrerTest(theHttpChannel, 1);
	SetRequestHeaderTest(theHttpChannel, "Cookie", "TheCookie", 1);
	GetRequestHeaderTest(theHttpChannel, "Cookie", 1);
	SetRequestHeaderTest(theHttpChannel, "Content-Type", "text/xml", 1);
	GetRequestHeaderTest(theHttpChannel, "Content-Type", 1);
	SetRequestHeaderTest(theHttpChannel, "Content-Length", "10000", 1);
	GetRequestHeaderTest(theHttpChannel, "Content-Length", 1);
	VisitRequestHeadersTest(theHttpChannel, 1);
	SetAllowPipeliningTest(theHttpChannel, PR_FALSE, 1);
	SetAllowPipeliningTest(theHttpChannel, PR_TRUE, 1);
	GetAllowPipeliningTest(theHttpChannel, 1);
	SetRedirectionLimitTest(theHttpChannel, 0, 1);
	SetRedirectionLimitTest(theHttpChannel, 5, 1);
	GetRedirectionLimitTest(theHttpChannel, 1);

	// see nsIRequestObserver->OnStartRequest for response tests
	CnsIChannelTests *channelObj = new CnsIChannelTests(qaWebBrowser, qaBrowserImpl);
	if (!channelObj)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetChannelObject will not be run.", 1);
	   return;
	}
	theChannel = channelObj->GetChannelObject(theSpec);
	if (!theChannel)
	{
	   QAOutput("Didn't get nsIChannel object. AsyncOpenTest will not be run.", 1);
	   return;
	}
	// this will open the channel and run the httpChannel response tests
	channelObj->AsyncOpenTest(theChannel, 1);
	QAOutput("\n");
}

void  CnsIHttpChannelTests::SetRequestMethodTest(nsIHttpChannel *theHttpChannel,
												 const char * requestType,
												 PRInt16 displayMode)
{ 
	// SetRequestMethod
	// try "GET", "PUT", "HEAD", or "POST"
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetRequestMethodTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->SetRequestMethod(nsDependentCString(requestType));
	RvTestResult(rv, "SetRequestMethod()", displayMode);
	RvTestResultDlg(rv, "SetRequestMethod() test", true);
}

void  CnsIHttpChannelTests::GetRequestMethodTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	// GetRequestMethod
	nsCAutoString method;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetRequestMethodTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetRequestMethod(method);
	RvTestResult(rv, "GetRequestMethod()", displayMode);
	RvTestResultDlg(rv, "GetRequestMethod() test");
	// if (method.Equals("POST")
	FormatAndPrintOutput("GetRequestMethod method = ", method, displayMode);
}

void CnsIHttpChannelTests::SetReferrerTest(nsIHttpChannel *theHttpChannel,
												 const char *theUrl,
												 PRInt16 displayMode)
{
	// SetReferrer
	nsCAutoString theSpec;
	theSpec = theUrl;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetReferrerTest failed.", displayMode);
	   return;
	}
	NS_NewURI(getter_AddRefs(theURI), theSpec);
	if (!theURI) 	
	   QAOutput("Didn't get URI object. Test failed.", 2);
	rv = theHttpChannel->SetReferrer(theURI);
	RvTestResult(rv, "SetReferrer()", displayMode);
	RvTestResultDlg(rv, "SetReferrer() test");
}

void CnsIHttpChannelTests::GetReferrerTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	// GetReferrer
	nsCAutoString theSpec;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetReferrerTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetReferrer(getter_AddRefs(theURI));
	RvTestResult(rv, "GetReferrer()", displayMode);
	RvTestResultDlg(rv, "GetReferrer() test");
	if (!theURI)
	   QAOutput("Didn't get nsIURI object. Test failed.", displayMode);
	else {
	   theURI->GetSpec(theSpec);
	   FormatAndPrintOutput("GetReferrerTest uri = ", theSpec, displayMode);	   
	}
}

void  CnsIHttpChannelTests::SetRequestHeaderTest(nsIHttpChannel *theHttpChannel,
												 const char *requestType,
												 const char *headerVal,
												 PRInt16 displayMode)
{
	// SetRequestHeader
	// try {"Content-Type","text/xml"}, {"Content-Length", 10000}, and
	//     {"Accept"), NS_LITERAL_CSTRING("text/xml,application/xml,application/xhtml+xml,*/*;q=0.1"),
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetRequestHeaderTest failed.", displayMode);
	   return;
	}
    rv = theHttpChannel->SetRequestHeader(nsDependentCString(requestType),
                                         nsDependentCString(headerVal),
                                         PR_FALSE);
	RvTestResult(rv, "SetRequestHeader()", displayMode);
	RvTestResultDlg(rv, "SetRequestHeader() test");
}

void  CnsIHttpChannelTests::GetRequestHeaderTest(nsIHttpChannel *theHttpChannel,
												 const char *requestType,
												 PRInt16 displayMode)
{
	// GetRequestHeader
	nsCAutoString header;
	// could be set to "referrer"

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetRequestHeaderTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetRequestHeader(nsDependentCString(requestType), header);
	RvTestResult(rv, "GetRequestHeader()", displayMode);
	RvTestResultDlg(rv, "GetRequestHeader() test");
	FormatAndPrintOutput("GetRequestHeader type = ", header, displayMode);
}

void  CnsIHttpChannelTests::VisitRequestHeadersTest(nsIHttpChannel *theHttpChannel,
												    PRInt16 displayMode)
{
	// visitRequestHeaders()
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. VisitRequestHeadersTest failed.", displayMode);
	   return;
	}
	HeaderVisitor *theVisitor = new HeaderVisitor();
	if (!theVisitor)
	   QAOutput("Didn't get nsIHttpHeaderVisitor object. Test failed.", displayMode);

	rv = theHttpChannel->VisitRequestHeaders(theVisitor);
	RvTestResult(rv, "VisitRequestHeaders()", displayMode);
	RvTestResultDlg(rv, "VisitRequestHeaders() test");
}

void  CnsIHttpChannelTests::SetAllowPipeliningTest(nsIHttpChannel *theHttpChannel,
											   PRBool mAllowPipelining,
											   PRInt16 displayMode)
{
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetAllowPipeliningTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->SetAllowPipelining(mAllowPipelining);
	RvTestResult(rv, "SetAllowPipelining()", displayMode);
	RvTestResultDlg(rv, "SetAllowPipelining() test");
	FormatAndPrintOutput("SetAllowPipelining value = ", mAllowPipelining, displayMode);

	rv = theHttpChannel->GetAllowPipelining(&mAllowPipelining);
	FormatAndPrintOutput("GetAllowPipelining value = ", mAllowPipelining, displayMode);
}

void  CnsIHttpChannelTests::GetAllowPipeliningTest(nsIHttpChannel *theHttpChannel,
												   PRInt16 displayMode)
{
	PRBool mAllowPipelining;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetAllowPipeliningTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetAllowPipelining(&mAllowPipelining);
	RvTestResult(rv, "GetAllowPipelining()", displayMode);
	RvTestResultDlg(rv, "GetAllowPipelining() test");
	FormatAndPrintOutput("GetAllowPipelining value = ", mAllowPipelining, displayMode);
}

void  CnsIHttpChannelTests::SetRedirectionLimitTest(nsIHttpChannel *theHttpChannel,
												   PRUint32 mRedirectionLimit,
												   PRInt16 displayMode)
{
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetRedirectionLimitTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->SetRedirectionLimit(mRedirectionLimit);
	RvTestResult(rv, "SetRedirectionLimit()", displayMode);
	RvTestResultDlg(rv, "SetRedirectionLimit() test");
}

void  CnsIHttpChannelTests::GetRedirectionLimitTest(nsIHttpChannel *theHttpChannel,
												    PRInt16 displayMode)
{
	PRUint32 mRedirectionLimit;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetRedirectionLimitTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetRedirectionLimit(&mRedirectionLimit);
	RvTestResult(rv, "GetRedirectionLimit()", displayMode);
	RvTestResultDlg(rv, "GetRedirectionLimit() test");
	FormatAndPrintOutput("GetRedirectionLimit value = ", mRedirectionLimit, displayMode);
}

// Response tests
// called from OnStartRequest

void CnsIHttpChannelTests::CallResponseTests(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	GetResponseStatusTest(theHttpChannel, displayMode);
	GetResponseStatusTextTest(theHttpChannel, displayMode);
	GetRequestSucceededTest(theHttpChannel, displayMode);
	SetResponseHeaderTest(theHttpChannel, "Refresh", "1001", PR_TRUE, displayMode);
	GetResponseHeaderTest(theHttpChannel, "Refresh", displayMode);
	SetResponseHeaderTest(theHttpChannel, "Set-Cookie", "MyCookie", PR_TRUE, displayMode);
	GetResponseHeaderTest(theHttpChannel, "Set-Cookie", displayMode);
	SetResponseHeaderTest(theHttpChannel, "Cache-control", "no-cache", PR_FALSE, displayMode);
	GetResponseHeaderTest(theHttpChannel, "Cache-control", displayMode);
	VisitResponseHeaderTest(theHttpChannel, displayMode);
	IsNoStoreResponseTest(theHttpChannel, displayMode);
	IsNoCacheResponseTest(theHttpChannel, displayMode);
}

void CnsIHttpChannelTests::GetResponseStatusTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	PRUint32 mResponseStatus;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetResponseStatusTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetResponseStatus(&mResponseStatus);
	RvTestResult(rv, "GetResponseStatus()", displayMode);
	FormatAndPrintOutput("GetResponseStatus value = ", mResponseStatus, displayMode);
}

void CnsIHttpChannelTests::GetResponseStatusTextTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	nsCAutoString mText;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetResponseStatusTextTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetResponseStatusText(mText);
	RvTestResult(rv, "GetResponseStatusText()", displayMode);
	FormatAndPrintOutput("GetResponseStatusText = ", mText, displayMode);
}


void CnsIHttpChannelTests::GetRequestSucceededTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	PRBool mRequest;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetRequestSucceededTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetRequestSucceeded(&mRequest);
	RvTestResult(rv, "GetRequestSucceeded()", displayMode);
	FormatAndPrintOutput("GetRequestSucceeded = ", mRequest, displayMode);
}

void CnsIHttpChannelTests::GetResponseHeaderTest(nsIHttpChannel *theHttpChannel,
												 const char * responseType,
												 PRInt16 displayMode)
{
	nsCAutoString mResponse;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. GetResponseHeaderTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->GetResponseHeader(nsDependentCString(responseType), mResponse);
	RvTestResult(rv, "GetResponseHeader()", displayMode);
	FormatAndPrintOutput("GetResponseHeader = ", mResponse, displayMode);
	FormatAndPrintOutput("GetResponseHeader response type = ", responseType, displayMode);
}
 
void CnsIHttpChannelTests::SetResponseHeaderTest(nsIHttpChannel *theHttpChannel,
												 const char * responseType,
												 const char * value,
												 PRBool merge, PRInt16 displayMode)
{
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. SetResponseHeaderTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->SetResponseHeader(nsDependentCString(responseType),
                                           nsDependentCString(value), merge);
	RvTestResult(rv, "SetResponseHeader()", displayMode);
	FormatAndPrintOutput("SetResponseHeader value = ", value, displayMode);
	FormatAndPrintOutput("SetResponseHeader response type = ", responseType, displayMode);
}

void CnsIHttpChannelTests::VisitResponseHeaderTest(nsIHttpChannel *theHttpChannel,
												   PRInt16 displayMode)
{
	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. VisitResponseHeaderTest failed.", displayMode);
	   return;
	}
	// visitResponseHeaders()
	HeaderVisitor *theVisitor = new HeaderVisitor();
	if (!theVisitor)
	   QAOutput("Didn't get nsIHttpHeaderVisitor object. Test failed.", displayMode);

	rv = theHttpChannel->VisitResponseHeaders(theVisitor);
	RvTestResult(rv, "VisitResponseHeaders()", displayMode);
}

void CnsIHttpChannelTests::IsNoStoreResponseTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	PRBool mNoResponse;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. IsNoStoreResponseTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->IsNoStoreResponse(&mNoResponse);
	RvTestResult(rv, "IsNoStoreResponse()", displayMode);
	FormatAndPrintOutput("IsNoStoreResponse = ", mNoResponse, displayMode);
}

void CnsIHttpChannelTests::IsNoCacheResponseTest(nsIHttpChannel *theHttpChannel,
												 PRInt16 displayMode)
{
	PRBool mNoResponse;

	if (!theHttpChannel)
	{
	   QAOutput("Didn't get nsIHttpChannel object. IsNoCacheResponseTest failed.", displayMode);
	   return;
	}
	rv = theHttpChannel->IsNoCacheResponse(&mNoResponse);
	RvTestResult(rv, "IsNoCacheResponse()", displayMode);
	FormatAndPrintOutput("IsNoCacheResponse = ", mNoResponse, displayMode);
}