File: response.t

package info (click to toggle)
libapache-asp-perl 2.62-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,108 kB
  • ctags: 830
  • sloc: perl: 6,033; php: 417; sh: 65; lisp: 22; makefile: 10
file content (43 lines) | stat: -rw-r--r-- 1,495 bytes parent folder | download | duplicates (7)
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
use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self(NoState => 1);

__END__

<% use lib '.';	use T;	$t =T->new();

# IsClientConnected Tests
$t->eok($Response->{IsClientConnected}, "\$Response->{IsClientConnected}");
$t->eok($Response->IsClientConnected, "\$Response->IsClientConnected");
$Server->{asp}{r}->connection->aborted(1);
$Response->Flush; # updates {IsClientConnected}
$t->eok(! $Response->{IsClientConnected}, "\$Response->{IsClientConnected} after aborted/Flush()");
$t->eok(! $Response->IsClientConnected, "\$Response->IsClientConnected after aborted");

# AddHeader() member setting
my $date = &Apache::ASP::Date::time2str($time);
$Response->AddHeader('expires', $date);
$t->eok($Response->{ExpiresAbsolute} eq $date, "\$Response->AddHeader('Expires', ...) did not set ExpiresAbsolute member");
$Response->AddHeader('Content-type', 'text/plain');
$t->eok($Response->{ContentType} eq 'text/plain', "\$Response->AddHeader('Content-Type', ...) did not set ContentType member");
$Response->AddHeader('Cache-Control', 'no-cache');
$t->eok($Response->{CacheControl} eq 'no-cache', "\$Response->AddHeader('Cache-Control', ...) did not set CacheControl member");

# reset
$Server->{asp}{r}->connection->aborted(0);
$Response->{IsClientConnected} = 1;
$t->eok($Response->IsClientConnected, "\$Response->IsClientConnected after reset");

$t->{t} += 3; 
$t->done;
$Response->Write("");

%>
ok
ok
<% 
	print "ok\n";
#	$Response->AppendToLog("logging ok");
#	$Response->Debug("logging ok");
%>