diff options
author | Steve Block <steveblock@google.com> | 2010-08-25 14:36:30 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-08-25 14:36:30 +0100 |
commit | e45c1cdad9627f8b5f50f55c4a9642c1703a616a (patch) | |
tree | b58b96f635e30448a045dfcac3656ae7ddbbb1ad /LayoutTests/http/tests/resources/post-and-verify.cgi | |
parent | 734a2cd65c426074c10e2d6d01a7cc3b67d1cdaf (diff) | |
download | external_webkit-e45c1cdad9627f8b5f50f55c4a9642c1703a616a.zip external_webkit-e45c1cdad9627f8b5f50f55c4a9642c1703a616a.tar.gz external_webkit-e45c1cdad9627f8b5f50f55c4a9642c1703a616a.tar.bz2 |
Add LayoutTests/http/tests/resources at r65615
These scripts are required to run the http tests, eg
http/tests/appcache/fail-on-update.html
Change-Id: I6173fcb9bc0d77a5cfc94fce45d02b1704ee6306
Diffstat (limited to 'LayoutTests/http/tests/resources/post-and-verify.cgi')
-rwxr-xr-x | LayoutTests/http/tests/resources/post-and-verify.cgi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/resources/post-and-verify.cgi b/LayoutTests/http/tests/resources/post-and-verify.cgi new file mode 100755 index 0000000..2c7aa62 --- /dev/null +++ b/LayoutTests/http/tests/resources/post-and-verify.cgi @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w + +print "Content-type: text/plain\n\n"; + +if ($ENV{'REQUEST_METHOD'} eq "POST") { + if ($ENV{'CONTENT_LENGTH'}) { + read(STDIN, $postData, $ENV{'CONTENT_LENGTH'}) || die "Could not get post data\n"; + } else { + $postData = ""; + } + + @list = split(/&/, $ENV{'QUERY_STRING'}); + foreach $element (@list) { + ($key, $value) = split(/=/, $element); + $values{$key} = $value; + } + + open FILE, $values{'path'} || die("Could not open file\n"); + seek FILE, $values{'start'}, 0; + read FILE, $expectedData, $values{'length'}; + close(FILE); + + if ($postData eq $expectedData) { + print "OK"; + } else { + print "FAILED"; + } +} else { + print "Wrong method: " . $ENV{'REQUEST_METHOD'} . "\n"; +} |