summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-25 10:58:37 +0000
committerSteve Block <steveblock@google.com>2010-02-25 11:17:52 +0000
commitcfb0617749a64f2e177386b030d46007b8c4b179 (patch)
tree033b0b4e1b1eaa96831b52fc1ec6675132f33035 /LayoutTests/http
parent4175d59b46f96005f0c64978b1a94e3fe60f1e8e (diff)
downloadexternal_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.zip
external_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.tar.gz
external_webkit-cfb0617749a64f2e177386b030d46007b8c4b179.tar.bz2
Adds layout tests for HTML5 features
The following layout tests should all pass on Android, as they are for recently implemented HTML5 features ... - fast/dom/Geolocation - storage - http/tests/appcache This change adds these tests to the Android tree, at the current WebKit revision r54731. This is so that we can easily keep track of which tests should always be green, and so that we can add Android-specific test results. We also add the following paths ... - fast/js/resources - used by the Geolocation tests - http/conf - used by the Appcache tests Tests that are currently failing are added to the DumpRenderTree skipped list temporarily, to keep all tests green. Change-Id: Id96c05e3746ed64e4e4c40c99567b8def688f90a
Diffstat (limited to 'LayoutTests/http')
-rw-r--r--LayoutTests/http/conf/apache2-debian-httpd.conf677
-rw-r--r--LayoutTests/http/conf/apache2-httpd.conf702
-rw-r--r--LayoutTests/http/conf/cygwin-httpd.conf731
-rw-r--r--LayoutTests/http/conf/fedora-httpd.conf882
-rw-r--r--LayoutTests/http/conf/httpd.conf739
-rwxr-xr-xLayoutTests/http/conf/libphp4.dllbin0 -> 3363586 bytes
-rw-r--r--LayoutTests/http/conf/mime.types600
-rw-r--r--LayoutTests/http/conf/webkit-httpd.pem28
-rw-r--r--LayoutTests/http/tests/appcache/404-manifest-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/404-manifest.html59
-rw-r--r--LayoutTests/http/tests/appcache/404-resource-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/404-resource.html39
-rw-r--r--LayoutTests/http/tests/appcache/access-via-redirect-expected.txt3
-rw-r--r--LayoutTests/http/tests/appcache/access-via-redirect.php7
-rw-r--r--LayoutTests/http/tests/appcache/auth-expected.txt5
-rw-r--r--LayoutTests/http/tests/appcache/auth.html28
-rw-r--r--LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back.html27
-rw-r--r--LayoutTests/http/tests/appcache/cyrillic-uri-expected.txt13
-rw-r--r--LayoutTests/http/tests/appcache/cyrillic-uri.html82
-rw-r--r--LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/deferred-events-delete-while-raising.html35
-rw-r--r--LayoutTests/http/tests/appcache/deferred-events-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/deferred-events.html24
-rw-r--r--LayoutTests/http/tests/appcache/destroyed-frame-expected.txt5
-rw-r--r--LayoutTests/http/tests/appcache/destroyed-frame.html52
-rw-r--r--LayoutTests/http/tests/appcache/detached-iframe-expected.txt3
-rw-r--r--LayoutTests/http/tests/appcache/detached-iframe.html15
-rw-r--r--LayoutTests/http/tests/appcache/different-origin-manifest-expected.txt3
-rw-r--r--LayoutTests/http/tests/appcache/different-origin-manifest.html36
-rw-r--r--LayoutTests/http/tests/appcache/different-scheme-expected.txt3
-rw-r--r--LayoutTests/http/tests/appcache/different-scheme.html28
-rw-r--r--LayoutTests/http/tests/appcache/disabled-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/disabled.html51
-rw-r--r--LayoutTests/http/tests/appcache/dynamic-entries-no-cache-expected.txt27
-rw-r--r--LayoutTests/http/tests/appcache/dynamic-entries-no-cache.html-disabled119
-rw-r--r--LayoutTests/http/tests/appcache/empty-manifest-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/empty-manifest.html23
-rw-r--r--LayoutTests/http/tests/appcache/fail-on-update-expected.txt1
-rw-r--r--LayoutTests/http/tests/appcache/fail-on-update.html47
-rw-r--r--LayoutTests/http/tests/appcache/fallback-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/fallback.html171
-rw-r--r--LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt10
-rw-r--r--LayoutTests/http/tests/appcache/foreign-iframe-main.html39
-rw-r--r--LayoutTests/http/tests/appcache/idempotent-update-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/idempotent-update.html56
-rw-r--r--LayoutTests/http/tests/appcache/local-content-expected.txt7
-rw-r--r--LayoutTests/http/tests/appcache/local-content.html51
-rw-r--r--LayoutTests/http/tests/appcache/main-resource-hash-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/main-resource-hash.html51
-rw-r--r--LayoutTests/http/tests/appcache/manifest-containing-itself-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/manifest-containing-itself.html24
-rw-r--r--LayoutTests/http/tests/appcache/manifest-parsing-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/manifest-parsing.html66
-rw-r--r--LayoutTests/http/tests/appcache/manifest-redirect-2-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/manifest-redirect-2.html40
-rw-r--r--LayoutTests/http/tests/appcache/manifest-redirect-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/manifest-redirect.html40
-rw-r--r--LayoutTests/http/tests/appcache/manifest-with-empty-file-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/manifest-with-empty-file.html21
-rw-r--r--LayoutTests/http/tests/appcache/max-size-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/max-size.html28
-rw-r--r--LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress.html21
-rw-r--r--LayoutTests/http/tests/appcache/non-html-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/non-html.xhtml103
-rw-r--r--LayoutTests/http/tests/appcache/offline-access-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/offline-access.html57
-rw-r--r--LayoutTests/http/tests/appcache/online-whitelist-expected.txt4
-rw-r--r--LayoutTests/http/tests/appcache/online-whitelist.html77
-rw-r--r--LayoutTests/http/tests/appcache/reload-expected.txt8
-rw-r--r--LayoutTests/http/tests/appcache/reload.html40
-rw-r--r--LayoutTests/http/tests/appcache/remove-cache-expected.txt10
-rw-r--r--LayoutTests/http/tests/appcache/remove-cache.html111
-rw-r--r--LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/resource-redirect-2.html40
-rw-r--r--LayoutTests/http/tests/appcache/resource-redirect-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/resource-redirect.html40
-rw-r--r--LayoutTests/http/tests/appcache/resources/.htaccess5
-rw-r--r--LayoutTests/http/tests/appcache/resources/404-resource.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/abe.pngbin0 -> 12242 bytes
-rw-r--r--LayoutTests/http/tests/appcache/resources/access-via-redirect.html46
-rw-r--r--LayoutTests/http/tests/appcache/resources/access-via-redirect.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/auth/iframe.php16
-rw-r--r--LayoutTests/http/tests/appcache/resources/auth/manifest.php12
-rw-r--r--LayoutTests/http/tests/appcache/resources/auth/setup.php10
-rw-r--r--LayoutTests/http/tests/appcache/resources/auth/subresource.php10
-rw-r--r--LayoutTests/http/tests/appcache/resources/counter.php23
-rw-r--r--LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.html22
-rw-r--r--LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/cyrillic-uri-form.html28
-rw-r--r--LayoutTests/http/tests/appcache/resources/cyrillic-uri.manifest10
-rw-r--r--LayoutTests/http/tests/appcache/resources/different-scheme.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/empty.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/empty.txt0
-rw-r--r--LayoutTests/http/tests/appcache/resources/fail-on-update.php38
-rw-r--r--LayoutTests/http/tests/appcache/resources/fallback-redirect.php8
-rw-r--r--LayoutTests/http/tests/appcache/resources/fallback.manifest5
-rw-r--r--LayoutTests/http/tests/appcache/resources/foreign-iframe-subresource.js1
-rw-r--r--LayoutTests/http/tests/appcache/resources/foreign-iframe.html4
-rw-r--r--LayoutTests/http/tests/appcache/resources/foreign-iframe.manifest4
-rw-r--r--LayoutTests/http/tests/appcache/resources/idempotent-update.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/intercept/.htaccess2
-rw-r--r--LayoutTests/http/tests/appcache/resources/local-content.manifest4
-rw-r--r--LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.html27
-rw-r--r--LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/manifest-containing-itself.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/manifest-parsing.manifest6
-rw-r--r--LayoutTests/http/tests/appcache/resources/manifest-redirect-2.php7
-rw-r--r--LayoutTests/http/tests/appcache/resources/manifest-redirect.php7
-rw-r--r--LayoutTests/http/tests/appcache/resources/manifest-with-empty-file.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/maxsize.manifest3
-rw-r--r--LayoutTests/http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/non-html.manifest8
-rw-r--r--LayoutTests/http/tests/appcache/resources/not-in-cache.txt1
-rw-r--r--LayoutTests/http/tests/appcache/resources/offline-access-frame.html30
-rw-r--r--LayoutTests/http/tests/appcache/resources/offline-access.js18
-rw-r--r--LayoutTests/http/tests/appcache/resources/offline-access.manifest5
-rw-r--r--LayoutTests/http/tests/appcache/resources/online-whitelist.manifest14
-rw-r--r--LayoutTests/http/tests/appcache/resources/print-uri.php7
-rw-r--r--LayoutTests/http/tests/appcache/resources/reload-iframe.html21
-rw-r--r--LayoutTests/http/tests/appcache/resources/reload-iframe.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html37
-rw-r--r--LayoutTests/http/tests/appcache/resources/remove-cache-frame.html64
-rw-r--r--LayoutTests/http/tests/appcache/resources/resource-redirect-2.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/resource-redirect-2.php7
-rw-r--r--LayoutTests/http/tests/appcache/resources/resource-redirect.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/resource-redirect.php7
-rw-r--r--LayoutTests/http/tests/appcache/resources/simple.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/simple.txt1
-rw-r--r--LayoutTests/http/tests/appcache/resources/slow-resource.php3
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframe-1.html7
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframe-2.html11
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframe-3.html26
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframe-4.html26
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframes-1.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframes-2.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframes-3.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/subframes-4.manifest2
-rw-r--r--LayoutTests/http/tests/appcache/resources/uncacheable-resource.php13
-rw-r--r--LayoutTests/http/tests/appcache/resources/versioned-manifest.php37
-rw-r--r--LayoutTests/http/tests/appcache/resources/whitelist-wildcard.manifest3
-rw-r--r--LayoutTests/http/tests/appcache/resources/wrong-content-type.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/wrong-signature-2.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/wrong-signature.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-2.manifest1
-rw-r--r--LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html36
-rw-r--r--LayoutTests/http/tests/appcache/resources/xhr-foreign-resource.manifest3
-rw-r--r--LayoutTests/http/tests/appcache/simple-expected.txt2
-rw-r--r--LayoutTests/http/tests/appcache/simple.html55
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-1-expected.txt8
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-1.html38
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-2-expected.txt7
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-2.html42
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-3-expected.txt10
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-3.html60
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-4-expected.txt10
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-4.html60
-rw-r--r--LayoutTests/http/tests/appcache/update-cache-expected.txt10
-rw-r--r--LayoutTests/http/tests/appcache/update-cache.html69
-rw-r--r--LayoutTests/http/tests/appcache/whitelist-wildcard-expected.txt3
-rw-r--r--LayoutTests/http/tests/appcache/whitelist-wildcard.html29
-rw-r--r--LayoutTests/http/tests/appcache/wrong-content-type-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/wrong-content-type.html40
-rw-r--r--LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/wrong-signature-2.html40
-rw-r--r--LayoutTests/http/tests/appcache/wrong-signature-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/wrong-signature.html40
-rw-r--r--LayoutTests/http/tests/appcache/xhr-foreign-resource-expected.txt6
-rw-r--r--LayoutTests/http/tests/appcache/xhr-foreign-resource.html79
170 files changed, 7643 insertions, 0 deletions
diff --git a/LayoutTests/http/conf/apache2-debian-httpd.conf b/LayoutTests/http/conf/apache2-debian-httpd.conf
new file mode 100644
index 0000000..03aa9c8
--- /dev/null
+++ b/LayoutTests/http/conf/apache2-debian-httpd.conf
@@ -0,0 +1,677 @@
+##
+## httpd.conf -- Apache HTTP server configuration file
+##
+
+#
+# Based upon the NCSA server configuration files originally by Rob McCool.
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/> for detailed information about
+# the directives.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# After this file is processed, the server will look for and process
+# /private/etc/apache2/srm.conf and then /private/etc/apache2/access.conf
+# unless you have overridden these with ResourceConfig and/or
+# AccessConfig directives here.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/usr/local/apache" will be interpreted by the
+# server as "/usr/local/apache/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+ServerRoot "/usr"
+
+#
+# The LockFile directive sets the path to the lockfile used when Apache
+# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
+# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
+# its default value. The main reason for changing it is if the logs
+# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
+# DISK. The PID of the main server process is automatically appended to
+# the filename.
+#
+LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+#
+# Server-pool size regulation. Rather than making you guess how many
+# server processes you need, Apache dynamically adapts to the load it
+# sees --- that is, it tries to maintain enough server processes to
+# handle the current load, plus a few spare servers to handle transient
+# load spikes (e.g., multiple simultaneous requests from a single
+# Netscape browser).
+#
+# It does this by periodically checking how many servers are waiting
+# for a request. If there are fewer than MinSpareServers, it creates
+# a new spare. If there are more than MaxSpareServers, some of the
+# spares die off. The default values are probably OK for most sites.
+#
+MinSpareServers 1
+MaxSpareServers 5
+
+#
+# Number of servers to start initially --- should be a reasonable ballpark
+# figure.
+#
+StartServers 1
+
+#
+# Limit on total number of servers running, i.e., limit on the number
+# of clients who can simultaneously connect --- if this limit is ever
+# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
+# It is intended mainly as a brake to keep a runaway server from taking
+# the system with it as it spirals down...
+#
+MaxClients 150
+
+#
+# MaxRequestsPerChild: the number of requests each child process is
+# allowed to process before the child dies. The child will exit so
+# as to avoid problems after prolonged use when Apache (and maybe the
+# libraries it uses) leak memory or other resources. On most systems, this
+# isn't really needed, but a few (such as Solaris) do have notable leaks
+# in the libraries. For these platforms, set to something like 10000
+# or so; a setting of 0 means unlimited.
+#
+# NOTE: This value does not include keepalive requests after the initial
+# request per connection. For example, if a child process handles
+# an initial request and 10 subsequent "keptalive" requests, it
+# would only count as 1 request towards this limit.
+#
+MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Configured from the httpd command line for WebKit layout tests.
+# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
+#
+#Listen 3000
+Listen 127.0.0.1:8080
+Listen 127.0.0.1:8443
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Please read the file http://httpd.apache.org/docs/dso.html for more
+# details about the DSO mechanism and run `httpd -l' for the list of already
+# built-in (statically linked and thus always available) modules in your httpd
+# binary.
+#
+# Note: The order in which modules are loaded is important. Don't change
+# the order below without expert advice.
+#
+# Example:
+# LoadModule foo_module libexec/mod_foo.so
+#LoadModule vhost_alias_module /usr/lib/apache2/modules/mod_vhost_alias.so
+#LoadModule env_module /usr/lib/apache2/modules/mod_env.so
+#LoadModule log_config_module /usr/lib/apache2/modules/mod_log_config.so
+#LoadModule mime_magic_module /usr/lib/apache2/modules/mod_mime_magic.so
+LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
+LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
+#LoadModule status_module /usr/lib/apache2/modules/mod_status.so
+#LoadModule info_module /usr/lib/apache2/modules/mod_info.so
+LoadModule include_module /usr/lib/apache2/modules/mod_include.so
+#LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so
+#LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
+LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
+LoadModule asis_module /usr/lib/apache2/modules/mod_asis.so
+LoadModule imagemap_module /usr/lib/apache2/modules/mod_imagemap.so
+LoadModule actions_module /usr/lib/apache2/modules/mod_actions.so
+#LoadModule speling_module /usr/lib/apache2/modules/mod_speling.so
+#LoadModule userdir_module /usr/lib/apache2/modules/mod_userdir.so
+LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
+LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
+LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
+#LoadModule auth_module /usr/lib/apache2/modules/mod_auth_basic.so
+#LoadModule anon_auth_module /usr/lib/apache2/modules/mod_auth_anon.so
+#LoadModule dbm_auth_module /usr/lib/apache2/modules/mod_auth_dbm.so
+#LoadModule digest_module /usr/lib/apache2/modules/mod_digest.so
+#LoadModule proxy_module /usr/lib/apache2/modules/libproxy.so
+#LoadModule cern_meta_module /usr/lib/apache2/modules/mod_cern_meta.so
+#LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so
+LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
+#LoadModule usertrack_module /usr/lib/apache2/modules/mod_usertrack.so
+#LoadModule log_forensic_module /usr/lib/apache2/modules/mod_log_forensic.so
+#LoadModule unique_id_module /usr/lib/apache2/modules/mod_unique_id.so
+#LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
+#LoadModule dav_module /usr/lib/apache2/modules/libdav.so
+LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
+#LoadModule perl_module /usr/lib/apache2/modules/libperl.so
+LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
+#LoadModule hfs_apple_module /usr/lib/apache2/modules/mod_hfs_apple.so
+#LoadModule bonjour_module /usr/lib/apache2/modules/mod_bonjour.so
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerName allows you to set a host name which is sent back to clients for
+# your server if it's different than the one the program would get (i.e., use
+# "www" instead of the host's real name).
+#
+# Note: You cannot just invent host names and hope they work. The name you
+# define here must be a valid DNS name for your host. If you don't understand
+# this, ask your network administrator.
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address (e.g., http://123.45.67.89/)
+# anyway, and this will make redirections work in a sensible way.
+#
+# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
+# machine always knows itself by this address. If you use Apache strictly for
+# local testing and development, you may use 127.0.0.1 as the server name.
+#
+ServerName 127.0.0.1
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#DocumentRoot "/Library/WebServer/Documents"
+
+#
+# Each directory to which Apache has access, can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+<Directory />
+#
+# This may also be "None", "All", or any combination of "Indexes",
+# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# This controls which options the .htaccess files in directories can
+# override. Can also be "All", or any combination of "Options", "FileInfo",
+# "AuthConfig", and "Limit"
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+</Directory>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for access control information.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess files from being viewed by
+# Web clients. Since .htaccess files often contain authorization
+# information, access is disallowed for security reasons. Comment
+# these lines out if you want Web visitors to see the contents of
+# .htaccess files. If you change the AccessFileName directive above,
+# be sure to make the corresponding changes here.
+#
+# Also, folks tend to use names such as .htpasswd for password
+# files, so this will protect those as well.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
+# document that was negotiated on the basis of content. This asks proxy
+# servers not to cache the document. Uncommenting the following line disables
+# this behavior, and proxies will be allowed to cache the documents.
+#
+#CacheNegotiatedDocs
+
+#
+# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
+# Apache needs to construct a self-referencing URL (a URL that refers back
+# to the server the response is coming from) it will use ServerName and
+# Port to form a "canonical" name. With this setting off, Apache will
+# use the hostname:port that the client supplied, when possible. This
+# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
+#
+UseCanonicalName On
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#<IfModule mod_mime.c>
+# TypesConfig /private/etc/apache2/mime.types
+#</IfModule>
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#ErrorLog "/tmp/layout-test-results/error_log"
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#CustomLog "/tmp/layout-test-results/access_log" common
+
+#
+# If you prefer a single logfile with access, agent, and referer information
+# (Combined Logfile Format) you can use the following directive.
+#
+#CustomLog "/tmp/layout-test-results/access_log" combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (error documents, FTP directory listings,
+# mod_status and mod_info output etc., but not CGI generated documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+<IfModule mod_alias.c>
+</IfModule>
+# End of aliases.
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Format: Redirect old-URI new-URL
+#
+
+#
+# Document types.
+#
+<IfModule mod_mime.c>
+
+ #
+ # AddLanguage allows you to specify the language of a document. You can
+ # then use content negotiation to give a browser a file in a language
+ # it can understand.
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in quite
+ # some cases the two character 'Language' abbreviation is not
+ # identical to the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. But there is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
+ # French (fr) - German (de) - Greek-Modern (el)
+ # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
+ # Portugese (pt) - Luxembourgeois* (ltz)
+ # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
+ # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
+ # Russian (ru)
+ #
+ AddLanguage da .dk
+ AddLanguage nl .nl
+ AddLanguage en .en
+ AddLanguage et .ee
+ AddLanguage fr .fr
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage he .he
+ AddCharset ISO-8859-8 .iso8859-8
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddCharset ISO-2022-JP .jis
+ AddLanguage kr .kr
+ AddCharset ISO-2022-KR .iso-kr
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddCharset ISO-8859-2 .iso-pl
+ AddLanguage pt .pt
+ AddLanguage pt-br .pt-br
+ AddLanguage ltz .lu
+ AddLanguage ca .ca
+ AddLanguage es .es
+ AddLanguage sv .sv
+ AddLanguage cs .cz .cs
+ AddLanguage ru .ru
+ AddLanguage zh-TW .zh-tw
+ AddCharset Big5 .Big5 .big5
+ AddCharset WINDOWS-1251 .cp-1251
+ AddCharset CP866 .cp866
+ AddCharset ISO-8859-5 .iso-ru
+ AddCharset KOI8-R .koi8-r
+ AddCharset UCS-2 .ucs2
+ AddCharset UCS-4 .ucs4
+ AddCharset UTF-8 .utf8
+
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ <IfModule mod_negotiation.c>
+ LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
+ </IfModule>
+
+ #
+ # AddType allows you to tweak mime.types without actually editing it, or to
+ # make certain files to be certain types.
+ #
+ AddType application/x-tar .tgz
+
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have nothing
+ # to do with the FancyIndexing customization directives above.
+ #
+ AddEncoding x-compress .Z
+ AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ #AddType application/x-compress .Z
+ #AddType application/x-gzip .gz .tgz
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers",
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action command (see below)
+ #
+ # If you want to use server side includes, or CGI outside
+ # ScriptAliased directories, uncomment the following lines.
+ #
+ # To use CGI scripts:
+ #
+ AddHandler cgi-script .cgi .pl
+
+ #
+ # To use server-parsed HTML files
+ #
+ AddType text/html .shtml
+ AddHandler server-parsed .shtml
+
+ #
+ # Uncomment the following line to enable Apache's send-asis HTTP file
+ # feature
+ #
+ AddHandler send-as-is asis
+
+ #
+ # If you wish to use server-parsed imagemap files, use
+ #
+ #AddHandler imap-file map
+
+ #
+ # To enable type maps, you might want to use
+ #
+ #AddHandler type-map var
+
+</IfModule>
+# End of document types.
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# MetaDir: specifies the name of the directory in which Apache can find
+# meta information files. These files contain additional HTTP headers
+# to include when sending the document
+#
+#MetaDir .web
+
+#
+# MetaSuffix: specifies the file name suffix for the file containing the
+# meta information.
+#
+#MetaSuffix .meta
+
+#
+# Customizable error response (Apache style)
+# these come in three flavors
+#
+# 1) plain text
+#ErrorDocument 500 "The server made a boo boo.
+# n.b. the single leading (") marks it as text, it does not get output
+#
+# 2) local redirects
+#ErrorDocument 404 /missing.html
+# to redirect to local URL /missing.html
+#ErrorDocument 404 /cgi-bin/missing_handler.pl
+# N.B.: You can redirect to a script or a document using server-side-includes.
+#
+# 3) external redirects
+#ErrorDocument 402 http://some.other-server.com/subscription_info.html
+# N.B.: Many of the environment variables associated with the original
+# request will *not* be available to such a script.
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+# ProxyRequests On
+
+# <Directory proxy:*>
+# Order deny,allow
+# Deny from all
+# Allow from .your-domain.com
+# </Directory>
+
+ #
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+ # Set to one of: Off | On | Full | Block
+ #
+# ProxyVia On
+
+ #
+ # To enable the cache as well, edit and uncomment the following lines:
+ # (no cacheing without CacheRoot)
+ #
+# CacheRoot "/private/var/run/proxy"
+# CacheSize 5
+# CacheGcInterval 4
+# CacheMaxExpire 24
+# CacheLastModifiedFactor 0.1
+# CacheDefaultExpire 1
+# NoCache a-domain.com another-domain.edu joes.garage-sale.com
+
+#</IfModule>
+# End of proxy directives.
+
+
+<IfModule mod_php5.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost 127.0.0.1:8443>
+ ServerName 127.0.0.1
+ SSLEngine On
+</VirtualHost>
diff --git a/LayoutTests/http/conf/apache2-httpd.conf b/LayoutTests/http/conf/apache2-httpd.conf
new file mode 100644
index 0000000..980e4e2
--- /dev/null
+++ b/LayoutTests/http/conf/apache2-httpd.conf
@@ -0,0 +1,702 @@
+##
+## httpd.conf -- Apache HTTP server configuration file
+##
+
+#
+# Based upon the NCSA server configuration files originally by Rob McCool.
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/> for detailed information about
+# the directives.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# After this file is processed, the server will look for and process
+# /private/etc/apache2/srm.conf and then /private/etc/apache2/access.conf
+# unless you have overridden these with ResourceConfig and/or
+# AccessConfig directives here.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/usr/local/apache" will be interpreted by the
+# server as "/usr/local/apache/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+ServerRoot "/usr"
+
+#
+# The LockFile directive sets the path to the lockfile used when Apache
+# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
+# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
+# its default value. The main reason for changing it is if the logs
+# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
+# DISK. The PID of the main server process is automatically appended to
+# the filename.
+#
+LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+#
+# Server-pool size regulation. Rather than making you guess how many
+# server processes you need, Apache dynamically adapts to the load it
+# sees --- that is, it tries to maintain enough server processes to
+# handle the current load, plus a few spare servers to handle transient
+# load spikes (e.g., multiple simultaneous requests from a single
+# Netscape browser).
+#
+# It does this by periodically checking how many servers are waiting
+# for a request. If there are fewer than MinSpareServers, it creates
+# a new spare. If there are more than MaxSpareServers, some of the
+# spares die off. The default values are probably OK for most sites.
+#
+MinSpareServers 1
+MaxSpareServers 5
+
+#
+# Number of servers to start initially --- should be a reasonable ballpark
+# figure.
+#
+StartServers 1
+
+#
+# Limit on total number of servers running, i.e., limit on the number
+# of clients who can simultaneously connect --- if this limit is ever
+# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
+# It is intended mainly as a brake to keep a runaway server from taking
+# the system with it as it spirals down...
+#
+MaxClients 150
+
+#
+# MaxRequestsPerChild: the number of requests each child process is
+# allowed to process before the child dies. The child will exit so
+# as to avoid problems after prolonged use when Apache (and maybe the
+# libraries it uses) leak memory or other resources. On most systems, this
+# isn't really needed, but a few (such as Solaris) do have notable leaks
+# in the libraries. For these platforms, set to something like 10000
+# or so; a setting of 0 means unlimited.
+#
+# NOTE: This value does not include keepalive requests after the initial
+# request per connection. For example, if a child process handles
+# an initial request and 10 subsequent "keptalive" requests, it
+# would only count as 1 request towards this limit.
+#
+MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Configured from the httpd command line for WebKit layout tests.
+# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
+#
+#Listen 3000
+Listen 127.0.0.1:8080
+Listen 127.0.0.1:8443
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Please read the file http://httpd.apache.org/docs/dso.html for more
+# details about the DSO mechanism and run `httpd -l' for the list of already
+# built-in (statically linked and thus always available) modules in your httpd
+# binary.
+#
+# Note: The order in which modules are loaded is important. Don't change
+# the order below without expert advice.
+#
+# Example:
+# LoadModule foo_module libexec/mod_foo.so
+#LoadModule authn_file_module libexec/apache2/mod_authn_file.so
+#LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
+#LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
+#LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
+#LoadModule authn_default_module libexec/apache2/mod_authn_default.so
+LoadModule authz_host_module libexec/apache2/mod_authz_host.so
+#LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so
+#LoadModule authz_user_module libexec/apache2/mod_authz_user.so
+#LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so
+#LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so
+#LoadModule authz_default_module libexec/apache2/mod_authz_default.so
+#LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so
+#LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
+#LoadModule cache_module libexec/apache2/mod_cache.so
+#LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so
+#LoadModule mem_cache_module libexec/apache2/mod_mem_cache.so
+#LoadModule dbd_module libexec/apache2/mod_dbd.so
+#LoadModule dumpio_module libexec/apache2/mod_dumpio.so
+#LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
+LoadModule include_module libexec/apache2/mod_include.so
+#LoadModule filter_module libexec/apache2/mod_filter.so
+#LoadModule substitute_module libexec/apache2/mod_substitute.so
+#LoadModule deflate_module libexec/apache2/mod_deflate.so
+LoadModule log_config_module libexec/apache2/mod_log_config.so
+#LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so
+#LoadModule logio_module libexec/apache2/mod_logio.so
+#LoadModule env_module libexec/apache2/mod_env.so
+#LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so
+#LoadModule cern_meta_module libexec/apache2/mod_cern_meta.so
+#LoadModule expires_module libexec/apache2/mod_expires.so
+LoadModule headers_module libexec/apache2/mod_headers.so
+#LoadModule ident_module libexec/apache2/mod_ident.so
+#LoadModule usertrack_module libexec/apache2/mod_usertrack.so
+#LoadModule unique_id_module libexec/apache2/mod_unique_id.so
+#LoadModule setenvif_module libexec/apache2/mod_setenvif.so
+#LoadModule version_module libexec/apache2/mod_version.so
+#LoadModule proxy_module libexec/apache2/mod_proxy.so
+#LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
+#LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
+#LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
+#LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so
+#LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so
+LoadModule ssl_module libexec/apache2/mod_ssl.so
+LoadModule mime_module libexec/apache2/mod_mime.so
+#LoadModule dav_module libexec/apache2/mod_dav.so
+#LoadModule status_module libexec/apache2/mod_status.so
+#LoadModule autoindex_module libexec/apache2/mod_autoindex.so
+LoadModule asis_module libexec/apache2/mod_asis.so
+#LoadModule info_module libexec/apache2/mod_info.so
+LoadModule cgi_module libexec/apache2/mod_cgi.so
+#LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
+#LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
+LoadModule negotiation_module libexec/apache2/mod_negotiation.so
+#LoadModule dir_module libexec/apache2/mod_dir.so
+LoadModule imagemap_module libexec/apache2/mod_imagemap.so
+LoadModule actions_module libexec/apache2/mod_actions.so
+#LoadModule speling_module libexec/apache2/mod_speling.so
+#LoadModule userdir_module libexec/apache2/mod_userdir.so
+LoadModule alias_module libexec/apache2/mod_alias.so
+LoadModule rewrite_module libexec/apache2/mod_rewrite.so
+#LoadModule bonjour_module libexec/apache2/mod_bonjour.so
+LoadModule php5_module libexec/apache2/libphp5.so
+#LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerName allows you to set a host name which is sent back to clients for
+# your server if it's different than the one the program would get (i.e., use
+# "www" instead of the host's real name).
+#
+# Note: You cannot just invent host names and hope they work. The name you
+# define here must be a valid DNS name for your host. If you don't understand
+# this, ask your network administrator.
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address (e.g., http://123.45.67.89/)
+# anyway, and this will make redirections work in a sensible way.
+#
+# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
+# machine always knows itself by this address. If you use Apache strictly for
+# local testing and development, you may use 127.0.0.1 as the server name.
+#
+ServerName 127.0.0.1
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#DocumentRoot "/Library/WebServer/Documents"
+
+#
+# Each directory to which Apache has access, can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+<Directory />
+#
+# This may also be "None", "All", or any combination of "Indexes",
+# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# This controls which options the .htaccess files in directories can
+# override. Can also be "All", or any combination of "Options", "FileInfo",
+# "AuthConfig", and "Limit"
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+</Directory>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for access control information.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess files from being viewed by
+# Web clients. Since .htaccess files often contain authorization
+# information, access is disallowed for security reasons. Comment
+# these lines out if you want Web visitors to see the contents of
+# .htaccess files. If you change the AccessFileName directive above,
+# be sure to make the corresponding changes here.
+#
+# Also, folks tend to use names such as .htpasswd for password
+# files, so this will protect those as well.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
+# document that was negotiated on the basis of content. This asks proxy
+# servers not to cache the document. Uncommenting the following line disables
+# this behavior, and proxies will be allowed to cache the documents.
+#
+#CacheNegotiatedDocs
+
+#
+# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
+# Apache needs to construct a self-referencing URL (a URL that refers back
+# to the server the response is coming from) it will use ServerName and
+# Port to form a "canonical" name. With this setting off, Apache will
+# use the hostname:port that the client supplied, when possible. This
+# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
+#
+UseCanonicalName On
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#<IfModule mod_mime.c>
+# TypesConfig /private/etc/apache2/mime.types
+#</IfModule>
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#ErrorLog "/tmp/layout-test-results/error_log"
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#CustomLog "/tmp/layout-test-results/access_log" common
+
+#
+# If you prefer a single logfile with access, agent, and referer information
+# (Combined Logfile Format) you can use the following directive.
+#
+#CustomLog "/tmp/layout-test-results/access_log" combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (error documents, FTP directory listings,
+# mod_status and mod_info output etc., but not CGI generated documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+<IfModule mod_alias.c>
+</IfModule>
+# End of aliases.
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Format: Redirect old-URI new-URL
+#
+
+#
+# Document types.
+#
+<IfModule mod_mime.c>
+
+ #
+ # AddLanguage allows you to specify the language of a document. You can
+ # then use content negotiation to give a browser a file in a language
+ # it can understand.
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in quite
+ # some cases the two character 'Language' abbreviation is not
+ # identical to the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. But there is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
+ # French (fr) - German (de) - Greek-Modern (el)
+ # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
+ # Portugese (pt) - Luxembourgeois* (ltz)
+ # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
+ # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
+ # Russian (ru)
+ #
+ AddLanguage da .dk
+ AddLanguage nl .nl
+ AddLanguage en .en
+ AddLanguage et .ee
+ AddLanguage fr .fr
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage he .he
+ AddCharset ISO-8859-8 .iso8859-8
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddCharset ISO-2022-JP .jis
+ AddLanguage kr .kr
+ AddCharset ISO-2022-KR .iso-kr
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddCharset ISO-8859-2 .iso-pl
+ AddLanguage pt .pt
+ AddLanguage pt-br .pt-br
+ AddLanguage ltz .lu
+ AddLanguage ca .ca
+ AddLanguage es .es
+ AddLanguage sv .sv
+ AddLanguage cs .cz .cs
+ AddLanguage ru .ru
+ AddLanguage zh-TW .zh-tw
+ AddCharset Big5 .Big5 .big5
+ AddCharset WINDOWS-1251 .cp-1251
+ AddCharset CP866 .cp866
+ AddCharset ISO-8859-5 .iso-ru
+ AddCharset KOI8-R .koi8-r
+ AddCharset UCS-2 .ucs2
+ AddCharset UCS-4 .ucs4
+ AddCharset UTF-8 .utf8
+
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ <IfModule mod_negotiation.c>
+ LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
+ </IfModule>
+
+ #
+ # AddType allows you to tweak mime.types without actually editing it, or to
+ # make certain files to be certain types.
+ #
+ AddType application/x-tar .tgz
+
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have nothing
+ # to do with the FancyIndexing customization directives above.
+ #
+ AddEncoding x-compress .Z
+ AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ #AddType application/x-compress .Z
+ #AddType application/x-gzip .gz .tgz
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers",
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action command (see below)
+ #
+ # If you want to use server side includes, or CGI outside
+ # ScriptAliased directories, uncomment the following lines.
+ #
+ # To use CGI scripts:
+ #
+ AddHandler cgi-script .cgi .pl
+
+ #
+ # To use server-parsed HTML files
+ #
+ AddType text/html .shtml
+ AddHandler server-parsed .shtml
+
+ #
+ # Uncomment the following line to enable Apache's send-asis HTTP file
+ # feature
+ #
+ AddHandler send-as-is asis
+
+ #
+ # If you wish to use server-parsed imagemap files, use
+ #
+ #AddHandler imap-file map
+
+ #
+ # To enable type maps, you might want to use
+ #
+ #AddHandler type-map var
+
+</IfModule>
+# End of document types.
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# MetaDir: specifies the name of the directory in which Apache can find
+# meta information files. These files contain additional HTTP headers
+# to include when sending the document
+#
+#MetaDir .web
+
+#
+# MetaSuffix: specifies the file name suffix for the file containing the
+# meta information.
+#
+#MetaSuffix .meta
+
+#
+# Customizable error response (Apache style)
+# these come in three flavors
+#
+# 1) plain text
+#ErrorDocument 500 "The server made a boo boo.
+# n.b. the single leading (") marks it as text, it does not get output
+#
+# 2) local redirects
+#ErrorDocument 404 /missing.html
+# to redirect to local URL /missing.html
+#ErrorDocument 404 /cgi-bin/missing_handler.pl
+# N.B.: You can redirect to a script or a document using server-side-includes.
+#
+# 3) external redirects
+#ErrorDocument 402 http://some.other-server.com/subscription_info.html
+# N.B.: Many of the environment variables associated with the original
+# request will *not* be available to such a script.
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+# ProxyRequests On
+
+# <Directory proxy:*>
+# Order deny,allow
+# Deny from all
+# Allow from .your-domain.com
+# </Directory>
+
+ #
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+ # Set to one of: Off | On | Full | Block
+ #
+# ProxyVia On
+
+ #
+ # To enable the cache as well, edit and uncomment the following lines:
+ # (no cacheing without CacheRoot)
+ #
+# CacheRoot "/private/var/run/proxy"
+# CacheSize 5
+# CacheGcInterval 4
+# CacheMaxExpire 24
+# CacheLastModifiedFactor 0.1
+# CacheDefaultExpire 1
+# NoCache a-domain.com another-domain.edu joes.garage-sale.com
+
+#</IfModule>
+# End of proxy directives.
+
+
+<IfModule mod_php5.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost 127.0.0.1:8443>
+ ServerName 127.0.0.1
+ SSLEngine On
+</VirtualHost>
diff --git a/LayoutTests/http/conf/cygwin-httpd.conf b/LayoutTests/http/conf/cygwin-httpd.conf
new file mode 100644
index 0000000..a79ed39
--- /dev/null
+++ b/LayoutTests/http/conf/cygwin-httpd.conf
@@ -0,0 +1,731 @@
+##
+## httpd.conf -- Apache HTTP server configuration file
+##
+
+#
+# Based upon the NCSA server configuration files originally by Rob McCool.
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/> for detailed information about
+# the directives.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# After this file is processed, the server will look for and process
+# /private/etc/httpd/srm.conf and then /private/etc/httpd/access.conf
+# unless you have overridden these with ResourceConfig and/or
+# AccessConfig directives here.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/usr/local/apache" will be interpreted by the
+# server as "/usr/local/apache/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# ServerType is either inetd, or standalone. Inetd mode is only supported on
+# Unix platforms.
+#
+ServerType standalone
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+ServerRoot "/usr"
+
+#
+# The LockFile directive sets the path to the lockfile used when Apache
+# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
+# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
+# its default value. The main reason for changing it is if the logs
+# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
+# DISK. The PID of the main server process is automatically appended to
+# the filename.
+#
+LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# In the standard configuration, the server will process httpd.conf (this
+# file, specified by the -f command line option), srm.conf, and access.conf
+# in that order. The latter two files are now distributed empty, as it is
+# recommended that all directives be kept in a single file for simplicity.
+# The commented-out values below are the built-in defaults. You can have the
+# server ignore these files altogether by using "/dev/null" (for Unix) or
+# "nul" (for Win32) for the arguments to the directives.
+#
+ResourceConfig /dev/null
+AccessConfig /dev/null
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+#
+# Server-pool size regulation. Rather than making you guess how many
+# server processes you need, Apache dynamically adapts to the load it
+# sees --- that is, it tries to maintain enough server processes to
+# handle the current load, plus a few spare servers to handle transient
+# load spikes (e.g., multiple simultaneous requests from a single
+# Netscape browser).
+#
+# It does this by periodically checking how many servers are waiting
+# for a request. If there are fewer than MinSpareServers, it creates
+# a new spare. If there are more than MaxSpareServers, some of the
+# spares die off. The default values are probably OK for most sites.
+#
+MinSpareServers 1
+MaxSpareServers 5
+
+#
+# Number of servers to start initially --- should be a reasonable ballpark
+# figure.
+#
+StartServers 1
+
+#
+# Limit on total number of servers running, i.e., limit on the number
+# of clients who can simultaneously connect --- if this limit is ever
+# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
+# It is intended mainly as a brake to keep a runaway server from taking
+# the system with it as it spirals down...
+#
+MaxClients 150
+
+#
+# MaxRequestsPerChild: the number of requests each child process is
+# allowed to process before the child dies. The child will exit so
+# as to avoid problems after prolonged use when Apache (and maybe the
+# libraries it uses) leak memory or other resources. On most systems, this
+# isn't really needed, but a few (such as Solaris) do have notable leaks
+# in the libraries. For these platforms, set to something like 10000
+# or so; a setting of 0 means unlimited.
+#
+# NOTE: This value does not include keepalive requests after the initial
+# request per connection. For example, if a child process handles
+# an initial request and 10 subsequent "keptalive" requests, it
+# would only count as 1 request towards this limit.
+#
+MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#Listen 3000
+Listen 127.0.0.1:8080
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Please read the file http://httpd.apache.org/docs/dso.html for more
+# details about the DSO mechanism and run `httpd -l' for the list of already
+# built-in (statically linked and thus always available) modules in your httpd
+# binary.
+#
+# Note: The order in which modules are loaded is important. Don't change
+# the order below without expert advice.
+#
+# Example:
+# LoadModule foo_module libexec/mod_foo.so
+#LoadModule vhost_alias_module lib/apache/mod_vhost_alias.dll
+#LoadModule env_module lib/apache/mod_env.dll
+LoadModule config_log_module lib/apache/mod_log_config.dll
+#LoadModule agent_log_module lib/apache/mod_log_agent.dll
+#LoadModule referer_log_module lib/apache/mod_log_referer.dll
+#LoadModule mime_magic_module lib/apache/mod_mime_magic.dll
+LoadModule mime_module lib/apache/mod_mime.dll
+LoadModule negotiation_module lib/apache/mod_negotiation.dll
+#LoadModule status_module lib/apache/mod_status.dll
+#LoadModule info_module lib/apache/mod_info.dll
+LoadModule includes_module lib/apache/mod_include.dll
+#LoadModule autoindex_module lib/apache/mod_autoindex.dll
+#LoadModule dir_module lib/apache/mod_dir.dll
+LoadModule cgi_module lib/apache/mod_cgi.dll
+LoadModule asis_module lib/apache/mod_asis.dll
+LoadModule imap_module lib/apache/mod_imap.dll
+LoadModule action_module lib/apache/mod_actions.dll
+#LoadModule speling_module lib/apache/mod_speling.dll
+#LoadModule userdir_module lib/apache/mod_userdir.dll
+LoadModule alias_module lib/apache/mod_alias.dll
+LoadModule rewrite_module lib/apache/mod_rewrite.dll
+LoadModule access_module lib/apache/mod_access.dll
+LoadModule auth_module lib/apache/mod_auth.dll
+#LoadModule anon_auth_module lib/apache/mod_auth_anon.dll
+#LoadModule digest_module lib/apache/mod_digest.dll
+#LoadModule proxy_module lib/apache/libproxy.dll
+#LoadModule cern_meta_module lib/apache/mod_cern_meta.dll
+#LoadModule expires_module lib/apache/mod_expires.dll
+LoadModule headers_module lib/apache/mod_headers.dll
+#LoadModule usertrack_module lib/apache/mod_usertrack.dll
+#LoadModule example_module lib/apache/mod_example.dll
+#LoadModule log_forensic_module lib/apache/mod_log_forensic.dll
+#LoadModule unique_id_module lib/apache/mod_unique_id.dll
+#LoadModule setenvif_module lib/apache/mod_setenvif.dll
+LoadModule php4_module lib/apache/libphp4.dll
+#LoadModule hfs_apple_module lib/apache/mod_hfs_apple.so
+#LoadModule bonjour_module lib/apache/mod_bonjour.so
+
+# Reconstruction of the complete module list from all available modules
+# (static and shared ones) to achieve correct module execution order.
+# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
+ClearModuleList
+#AddModule mod_vhost_alias.c
+#AddModule mod_env.c
+AddModule mod_log_config.c
+#AddModule mod_mime_magic.c
+AddModule mod_mime.c
+AddModule mod_negotiation.c
+#AddModule mod_status.c
+#AddModule mod_info.c
+AddModule mod_include.c
+#AddModule mod_autoindex.c
+#AddModule mod_dir.c
+AddModule mod_cgi.c
+AddModule mod_asis.c
+AddModule mod_imap.c
+AddModule mod_actions.c
+#AddModule mod_speling.c
+#AddModule mod_userdir.c
+AddModule mod_alias.c
+AddModule mod_rewrite.c
+AddModule mod_access.c
+AddModule mod_auth.c
+#AddModule mod_auth_anon.c
+#AddModule mod_auth_dbm.c
+#AddModule mod_digest.c
+#AddModule mod_proxy.c
+#AddModule mod_cern_meta.c
+#AddModule mod_expires.c
+AddModule mod_headers.c
+#AddModule mod_usertrack.c
+#AddModule mod_log_forensic.c
+#AddModule mod_unique_id.c
+AddModule mod_so.c
+#AddModule mod_setenvif.c
+#AddModule mod_dav.c
+#AddModule mod_ssl.c
+#AddModule mod_perl.c
+AddModule mod_php4.c
+#AddModule mod_hfs_apple.c
+#AddModule mod_bonjour.c
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerName allows you to set a host name which is sent back to clients for
+# your server if it's different than the one the program would get (i.e., use
+# "www" instead of the host's real name).
+#
+# Note: You cannot just invent host names and hope they work. The name you
+# define here must be a valid DNS name for your host. If you don't understand
+# this, ask your network administrator.
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address (e.g., http://123.45.67.89/)
+# anyway, and this will make redirections work in a sensible way.
+#
+# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
+# machine always knows itself by this address. If you use Apache strictly for
+# local testing and development, you may use 127.0.0.1 as the server name.
+#
+ServerName 127.0.0.1
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#DocumentRoot "/var/www/htdocs"
+
+#
+# Each directory to which Apache has access, can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+<Directory />
+#
+# This may also be "None", "All", or any combination of "Indexes",
+# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# This controls which options the .htaccess files in directories can
+# override. Can also be "All", or any combination of "Options", "FileInfo",
+# "AuthConfig", and "Limit"
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+</Directory>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for access control information.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess files from being viewed by
+# Web clients. Since .htaccess files often contain authorization
+# information, access is disallowed for security reasons. Comment
+# these lines out if you want Web visitors to see the contents of
+# .htaccess files. If you change the AccessFileName directive above,
+# be sure to make the corresponding changes here.
+#
+# Also, folks tend to use names such as .htpasswd for password
+# files, so this will protect those as well.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
+# document that was negotiated on the basis of content. This asks proxy
+# servers not to cache the document. Uncommenting the following line disables
+# this behavior, and proxies will be allowed to cache the documents.
+#
+#CacheNegotiatedDocs
+
+#
+# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
+# Apache needs to construct a self-referencing URL (a URL that refers back
+# to the server the response is coming from) it will use ServerName and
+# Port to form a "canonical" name. With this setting off, Apache will
+# use the hostname:port that the client supplied, when possible. This
+# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
+#
+UseCanonicalName On
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#<IfModule mod_mime.c>
+# TypesConfig /etc/apache/mime.types
+#</IfModule>
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#ErrorLog "/tmp/layout-test-results/error_log"
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#CustomLog "/tmp/layout-test-results/access_log" common
+
+#
+# If you prefer a single logfile with access, agent, and referer information
+# (Combined Logfile Format) you can use the following directive.
+#
+#CustomLog "/tmp/layout-test-results/access_log" combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (error documents, FTP directory listings,
+# mod_status and mod_info output etc., but not CGI generated documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+<IfModule mod_alias.c>
+</IfModule>
+# End of aliases.
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Format: Redirect old-URI new-URL
+#
+
+#
+# Document types.
+#
+<IfModule mod_mime.c>
+
+ #
+ # AddLanguage allows you to specify the language of a document. You can
+ # then use content negotiation to give a browser a file in a language
+ # it can understand.
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in quite
+ # some cases the two character 'Language' abbreviation is not
+ # identical to the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. But there is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
+ # French (fr) - German (de) - Greek-Modern (el)
+ # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
+ # Portugese (pt) - Luxembourgeois* (ltz)
+ # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
+ # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
+ # Russian (ru)
+ #
+ AddLanguage da .dk
+ AddLanguage nl .nl
+ AddLanguage en .en
+ AddLanguage et .ee
+ AddLanguage fr .fr
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage he .he
+ AddCharset ISO-8859-8 .iso8859-8
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddCharset ISO-2022-JP .jis
+ AddLanguage kr .kr
+ AddCharset ISO-2022-KR .iso-kr
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddCharset ISO-8859-2 .iso-pl
+ AddLanguage pt .pt
+ AddLanguage pt-br .pt-br
+ AddLanguage ltz .lu
+ AddLanguage ca .ca
+ AddLanguage es .es
+ AddLanguage sv .sv
+ AddLanguage cs .cz .cs
+ AddLanguage ru .ru
+ AddLanguage zh-TW .zh-tw
+ AddCharset Big5 .Big5 .big5
+ AddCharset WINDOWS-1251 .cp-1251
+ AddCharset CP866 .cp866
+ AddCharset ISO-8859-5 .iso-ru
+ AddCharset KOI8-R .koi8-r
+ AddCharset UCS-2 .ucs2
+ AddCharset UCS-4 .ucs4
+ AddCharset UTF-8 .utf8
+
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ <IfModule mod_negotiation.c>
+ LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
+ </IfModule>
+
+ #
+ # AddType allows you to tweak mime.types without actually editing it, or to
+ # make certain files to be certain types.
+ #
+ AddType application/x-tar .tgz
+
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have nothing
+ # to do with the FancyIndexing customization directives above.
+ #
+ AddEncoding x-compress .Z
+ AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ #AddType application/x-compress .Z
+ #AddType application/x-gzip .gz .tgz
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers",
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action command (see below)
+ #
+ # If you want to use server side includes, or CGI outside
+ # ScriptAliased directories, uncomment the following lines.
+ #
+ # To use CGI scripts:
+ #
+ AddHandler cgi-script .cgi .pl
+
+ #
+ # To use server-parsed HTML files
+ #
+ AddType text/html .shtml
+ AddHandler server-parsed .shtml
+
+ #
+ # Uncomment the following line to enable Apache's send-asis HTTP file
+ # feature
+ #
+ AddHandler send-as-is asis
+
+ #
+ # If you wish to use server-parsed imagemap files, use
+ #
+ #AddHandler imap-file map
+
+ #
+ # To enable type maps, you might want to use
+ #
+ #AddHandler type-map var
+
+</IfModule>
+# End of document types.
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# MetaDir: specifies the name of the directory in which Apache can find
+# meta information files. These files contain additional HTTP headers
+# to include when sending the document
+#
+#MetaDir .web
+
+#
+# MetaSuffix: specifies the file name suffix for the file containing the
+# meta information.
+#
+#MetaSuffix .meta
+
+#
+# Customizable error response (Apache style)
+# these come in three flavors
+#
+# 1) plain text
+#ErrorDocument 500 "The server made a boo boo.
+# n.b. the single leading (") marks it as text, it does not get output
+#
+# 2) local redirects
+#ErrorDocument 404 /missing.html
+# to redirect to local URL /missing.html
+#ErrorDocument 404 /cgi-bin/missing_handler.pl
+# N.B.: You can redirect to a script or a document using server-side-includes.
+#
+# 3) external redirects
+#ErrorDocument 402 http://some.other-server.com/subscription_info.html
+# N.B.: Many of the environment variables associated with the original
+# request will *not* be available to such a script.
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+# ProxyRequests On
+
+# <Directory proxy:*>
+# Order deny,allow
+# Deny from all
+# Allow from .your-domain.com
+# </Directory>
+
+ #
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+ # Set to one of: Off | On | Full | Block
+ #
+# ProxyVia On
+
+ #
+ # To enable the cache as well, edit and uncomment the following lines:
+ # (no cacheing without CacheRoot)
+ #
+# CacheRoot "/private/var/run/proxy"
+# CacheSize 5
+# CacheGcInterval 4
+# CacheMaxExpire 24
+# CacheLastModifiedFactor 0.1
+# CacheDefaultExpire 1
+# NoCache a-domain.com another-domain.edu joes.garage-sale.com
+
+#</IfModule>
+# End of proxy directives.
+
+
+<IfModule mod_php4.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
diff --git a/LayoutTests/http/conf/fedora-httpd.conf b/LayoutTests/http/conf/fedora-httpd.conf
new file mode 100644
index 0000000..cd71d88
--- /dev/null
+++ b/LayoutTests/http/conf/fedora-httpd.conf
@@ -0,0 +1,882 @@
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
+# In particular, see
+# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
+# for a discussion of each configuration directive.
+#
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/etc/httpd" will be interpreted by the
+# server as "/etc/httpd/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# Don't give away too much information about all the subcomponents
+# we are running. Comment out this line if you don't mind remote sites
+# finding out what major optional modules you are running
+ServerTokens OS
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+# Do NOT add a slash at the end of the directory path.
+#
+ServerRoot "/etc/httpd"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+MinSpareServers 1
+MaxSpareServers 5
+StartServers 1
+MaxClients 150
+
+##
+## Server-Pool Size Regulation (MPM specific)
+##
+
+# prefork MPM
+# StartServers: number of server processes to start
+# MinSpareServers: minimum number of server processes which are kept spare
+# MaxSpareServers: maximum number of server processes which are kept spare
+# ServerLimit: maximum value for MaxClients for the lifetime of the server
+# MaxClients: maximum number of server processes allowed to start
+# MaxRequestsPerChild: maximum number of requests a server process serves
+
+# worker MPM
+# StartServers: initial number of server processes to start
+# MaxClients: maximum number of simultaneous client connections
+# MinSpareThreads: minimum number of worker threads which are kept spare
+# MaxSpareThreads: maximum number of worker threads which are kept spare
+# ThreadsPerChild: constant number of worker threads in each server process
+# MaxRequestsPerChild: maximum number of requests a server process serves
+
+MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, in addition to the default. See also the <VirtualHost>
+# directive.
+#
+# Change this to Listen on specific IP addresses as shown below to
+# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
+#
+#Listen 12.34.56.78:80
+Listen 127.0.0.1:8080
+Listen 127.0.0.1:8443
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Statically compiled modules (those listed by `httpd -l') do not need
+# to be loaded here.
+#
+# Example:
+# LoadModule foo_module modules/mod_foo.so
+#
+#LoadModule auth_basic_module modules/mod_auth_basic.so
+#LoadModule auth_digest_module modules/mod_auth_digest.so
+#LoadModule authn_file_module modules/mod_authn_file.so
+#LoadModule authn_alias_module modules/mod_authn_alias.so
+#LoadModule authn_anon_module modules/mod_authn_anon.so
+#LoadModule authn_dbm_module modules/mod_authn_dbm.so
+#LoadModule authn_default_module modules/mod_authn_default.so
+LoadModule authz_host_module modules/mod_authz_host.so
+#LoadModule authz_user_module modules/mod_authz_user.so
+#LoadModule authz_owner_module modules/mod_authz_owner.so
+#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
+#LoadModule authz_dbm_module modules/mod_authz_dbm.so
+#LoadModule authz_default_module modules/mod_authz_default.so
+#LoadModule ldap_module modules/mod_ldap.so
+#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
+LoadModule include_module modules/mod_include.so
+LoadModule log_config_module modules/mod_log_config.so
+#LoadModule logio_module modules/mod_logio.so
+#LoadModule env_module modules/mod_env.so
+#LoadModule ext_filter_module modules/mod_ext_filter.so
+#LoadModule mime_magic_module modules/mod_mime_magic.so
+#LoadModule expires_module modules/mod_expires.so
+#LoadModule deflate_module modules/mod_deflate.so
+LoadModule headers_module modules/mod_headers.so
+#LoadModule usertrack_module modules/mod_usertrack.so
+#LoadModule setenvif_module modules/mod_setenvif.so
+LoadModule mime_module modules/mod_mime.so
+#LoadModule dav_module modules/mod_dav.so
+#LoadModule status_module modules/mod_status.so
+#LoadModule autoindex_module modules/mod_autoindex.so
+#LoadModule info_module modules/mod_info.so
+#LoadModule dav_fs_module modules/mod_dav_fs.so
+#LoadModule vhost_alias_module modules/mod_vhost_alias.so
+LoadModule negotiation_module modules/mod_negotiation.so
+#LoadModule dir_module modules/mod_dir.so
+LoadModule actions_module modules/mod_actions.so
+#LoadModule speling_module modules/mod_speling.so
+#LoadModule userdir_module modules/mod_userdir.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule rewrite_module modules/mod_rewrite.so
+#LoadModule proxy_module modules/mod_proxy.so
+#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
+#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
+#LoadModule proxy_http_module modules/mod_proxy_http.so
+#LoadModule proxy_connect_module modules/mod_proxy_connect.so
+#LoadModule cache_module modules/mod_cache.so
+#LoadModule suexec_module modules/mod_suexec.so
+#LoadModule disk_cache_module modules/mod_disk_cache.so
+#LoadModule file_cache_module modules/mod_file_cache.so
+#LoadModule mem_cache_module modules/mod_mem_cache.so
+LoadModule cgi_module modules/mod_cgi.so
+LoadModule ssl_module modules/mod_ssl.so
+LoadModule php5_module modules/libphp5.so
+
+#
+# The following modules are not loaded by default:
+#
+#LoadModule cern_meta_module modules/mod_cern_meta.so
+LoadModule asis_module modules/mod_asis.so
+
+#
+# Load config files from the config directory "/etc/httpd/conf.d".
+#
+#Include conf.d/*.conf
+
+#
+# ExtendedStatus controls whether Apache will generate "full" status
+# information (ExtendedStatus On) or just basic information (ExtendedStatus
+# Off) when the "server-status" handler is called. The default is Off.
+#
+#ExtendedStatus On
+
+#
+# If you wish httpd to run as a different user or group, you must run
+# httpd as root initially and it will switch.
+#
+# User/Group: The name (or #number) of the user/group to run httpd as.
+# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
+# . On HPUX you may not be able to use shared memory as nobody, and the
+# suggested workaround is to create a user www and use that user.
+# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
+# when the value of (unsigned)Group is above 60000;
+# don't use Group #-1 on these systems!
+#
+User apache
+Group apache
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerAdmin: Your address, where problems with the server should be
+# e-mailed. This address appears on some server-generated pages, such
+# as error documents. e.g. admin@your-domain.com
+#
+ServerAdmin root@localhost
+
+#
+# ServerName gives the name and port that the server uses to identify itself.
+# This can often be determined automatically, but we recommend you specify
+# it explicitly to prevent problems during startup.
+#
+# If this is not set to valid DNS name for your host, server-generated
+# redirections will not work. See also the UseCanonicalName directive.
+#
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address anyway, and this will make
+# redirections work in a sensible way.
+#
+ServerName 127.0.0.1
+
+#
+# UseCanonicalName: Determines how Apache constructs self-referencing
+# URLs and the SERVER_NAME and SERVER_PORT variables.
+# When set "Off", Apache will use the Hostname and Port supplied
+# by the client. When set "On", Apache will use the value of the
+# ServerName directive.
+#
+UseCanonicalName On
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+#DocumentRoot "/var/www/html"
+
+#
+# Each directory to which Apache has access can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+# Note that from this point forward you must specifically allow
+# particular features to be enabled - so if something's not working as
+# you might expect, make sure that you have specifically enabled it
+# below.
+#
+
+#
+# This should be changed to whatever you set DocumentRoot to.
+#
+<Directory />
+
+#
+# Possible values for the Options directive are "None", "All",
+# or any combination of:
+# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+# The Options directive is both complicated and important. Please see
+# http://httpd.apache.org/docs/2.2/mod/core.html#options
+# for more information.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# AllowOverride controls what directives may be placed in .htaccess files.
+# It can be "All", "None", or any combination of the keywords:
+# Options FileInfo AuthConfig Limit
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+
+</Directory>
+
+#
+#
+# Control access to UserDir directories. The following is an example
+# for a site where these directories are restricted to read-only.
+#
+#<Directory /home/*/public_html>
+# AllowOverride FileInfo AuthConfig Limit
+# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
+# <Limit GET POST OPTIONS>
+# Order allow,deny
+# Allow from all
+# </Limit>
+# <LimitExcept GET POST OPTIONS>
+# Order deny,allow
+# Deny from all
+# </LimitExcept>
+#</Directory>
+
+#
+# DirectoryIndex: sets the file that Apache will serve if a directory
+# is requested.
+#
+# The index.html.var file (a type-map) is used to deliver content-
+# negotiated documents. The MultiViews Option can be used for the
+# same purpose, but it is much slower.
+#
+#DirectoryIndex index.html index.html.var
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for additional configuration directives. See also the AllowOverride
+# directive.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess and .htpasswd files from being
+# viewed by Web clients.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+TypesConfig /etc/mime.types
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# EnableMMAP: Control whether memory-mapping is used to deliver
+# files (assuming that the underlying OS supports it).
+# The default is on; turn this off if you serve from NFS-mounted
+# filesystems. On some systems, turning it off (regardless of
+# filesystem) can improve performance; for details, please see
+# http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
+#
+#EnableMMAP off
+
+#
+# EnableSendfile: Control whether the sendfile kernel support is
+# used to deliver files (assuming that the OS supports it).
+# The default is on; turn this off if you serve from NFS-mounted
+# filesystems. Please see
+# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
+#
+#EnableSendfile off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+#ErrorLog /tmp/WebKit/error_log
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+# "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
+# requires the mod_logio module to be loaded.
+#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+#CustomLog logs/access_log common
+
+#
+# If you would like to have separate agent and referer logfiles, uncomment
+# the following directives.
+#
+#CustomLog logs/referer_log referer
+#CustomLog logs/agent_log agent
+
+#
+# For a single logfile with access, agent, and referer information
+# (Combined Logfile Format), use the following directive:
+#
+#CustomLog logs/access_log combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (internal error documents, FTP directory
+# listings, mod_status and mod_info output etc., but not CGI generated
+# documents or custom error documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+# Note that if you include a trailing / on fakename then the server will
+# require it to be present in the URL. So "/icons" isn't aliased in this
+# example, only "/icons/". If the fakename is slash-terminated, then the
+# realname must also be slash terminated, and if the fakename omits the
+# trailing slash, the realname must also omit it.
+#
+# We include the /icons/ alias for FancyIndexed directory listings. If you
+# do not use FancyIndexing, you may comment this out.
+#
+#
+# ScriptAlias: This controls which directories contain server scripts.
+# ScriptAliases are essentially the same as Aliases, except that
+# documents in the realname directory are treated as applications and
+# run by the server when requested rather than as documents sent to the client.
+# The same rules about trailing "/" apply to ScriptAlias directives as to
+# Alias.
+#
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Example:
+# Redirect permanent /foo http://www.example.com/bar
+
+#
+# Directives controlling the display of server-generated directory listings.
+#
+
+#
+# AddDescription allows you to place a short description after a file in
+# server-generated indexes. These are only displayed for FancyIndexed
+# directories.
+# Format: AddDescription "description" filename
+#
+#AddDescription "GZIP compressed document" .gz
+#AddDescription "tar archive" .tar
+#AddDescription "GZIP compressed tar archive" .tgz
+
+#
+# DefaultLanguage and AddLanguage allows you to specify the language of
+# a document. You can then use content negotiation to give a browser a
+# file in a language the user can understand.
+#
+# Specify a default language. This means that all data
+# going out without a specific language tag (see below) will
+# be marked with this one. You probably do NOT want to set
+# this unless you are sure it is correct for all cases.
+#
+# * It is generally better to not mark a page as
+# * being a certain language than marking it with the wrong
+# * language!
+#
+# DefaultLanguage nl
+#
+# Note 1: The suffix does not have to be the same as the language
+# keyword --- those with documents in Polish (whose net-standard
+# language code is pl) may wish to use "AddLanguage pl .po" to
+# avoid the ambiguity with the common suffix for perl scripts.
+#
+# Note 2: The example entries below illustrate that in some cases
+# the two character 'Language' abbreviation is not identical to
+# the two character 'Country' code for its country,
+# E.g. 'Danmark/dk' versus 'Danish/da'.
+#
+# Note 3: In the case of 'ltz' we violate the RFC by using a three char
+# specifier. There is 'work in progress' to fix this and get
+# the reference data for rfc1766 cleaned up.
+#
+# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
+# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
+# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
+# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
+# Norwegian (no) - Polish (pl) - Portugese (pt)
+# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
+# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
+#
+AddLanguage ca .ca
+AddLanguage cs .cz .cs
+AddLanguage da .dk
+AddLanguage de .de
+AddLanguage el .el
+AddLanguage en .en
+AddLanguage eo .eo
+AddLanguage es .es
+AddLanguage et .et
+AddLanguage fr .fr
+AddLanguage he .he
+AddLanguage hr .hr
+AddLanguage it .it
+AddLanguage ja .ja
+AddLanguage ko .ko
+AddLanguage ltz .ltz
+AddLanguage nl .nl
+AddLanguage nn .nn
+AddLanguage no .no
+AddLanguage pl .po
+AddLanguage pt .pt
+AddLanguage pt-BR .pt-br
+AddLanguage ru .ru
+AddLanguage sv .sv
+AddLanguage zh-CN .zh-cn
+AddLanguage zh-TW .zh-tw
+AddCharset Big5 .Big5 .big5
+AddCharset WINDOWS-1251 .cp-1251
+AddCharset CP866 .cp866
+AddCharset ISO-8859-5 .iso-ru
+AddCharset KOI8-R .koi8-r
+AddCharset UCS-2 .ucs2
+AddCharset UCS-4 .ucs4
+AddCharset UTF-8 .utf8
+
+#
+# LanguagePriority allows you to give precedence to some languages
+# in case of a tie during content negotiation.
+#
+# Just list the languages in decreasing order of preference. We have
+# more or less alphabetized them here. You probably want to change this.
+#
+<IfModule mod_negotiation.c>
+ LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+</IfModule>
+
+#
+# ForceLanguagePriority allows you to serve a result page rather than
+# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
+# [in case no accepted languages matched the available variants]
+#
+#ForceLanguagePriority Prefer Fallback
+
+#
+# Specify a default charset for all content served; this enables
+# interpretation of all content as UTF-8 by default. To use the
+# default browser choice (ISO-8859-1), or to allow the META tags
+# in HTML content to override this choice, comment out this
+# directive:
+#
+#AddDefaultCharset UTF-8
+
+#
+# AddType allows you to add to or override the MIME configuration
+# file mime.types for specific file types.
+#
+#AddType application/x-tar .tgz
+
+#
+# AddEncoding allows you to have certain browsers uncompress
+# information on the fly. Note: Not all browsers support this.
+# Despite the name similarity, the following Add* directives have nothing
+# to do with the FancyIndexing customization directives above.
+#
+AddEncoding x-compress .Z
+AddEncoding x-gzip .gz .tgz
+
+# If the AddEncoding directives above are commented-out, then you
+# probably should define those extensions to indicate media types:
+#
+#AddType application/x-compress .Z
+#AddType application/x-gzip .gz .tgz
+
+#
+# MIME-types for downloading Certificates and CRLs
+#
+AddType application/x-x509-ca-cert .crt
+AddType application/x-pkcs7-crl .crl
+
+#
+# AddHandler allows you to map certain file extensions to "handlers":
+# actions unrelated to filetype. These can be either built into the server
+# or added with the Action directive (see below)
+#
+# To use CGI scripts outside of ScriptAliased directories:
+# (You will also need to add "ExecCGI" to the "Options" directive.)
+#
+AddHandler cgi-script .cgi .pl
+
+#
+# Filters allow you to process content before it is sent to the client.
+#
+# To parse .shtml files for server-side includes (SSI):
+# (You will also need to add "Includes" to the "Options" directive.)
+#
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+
+#
+# For files that include their own HTTP headers:
+#
+AddHandler send-as-is asis
+
+#
+# For type maps (negotiated resources):
+# (This is enabled by default to allow the Apache "It Worked" page
+# to be distributed in multiple languages.)
+#
+#AddHandler type-map var
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# Customizable error responses come in three flavors:
+# 1) plain text 2) local redirects 3) external redirects
+#
+# Some examples:
+#ErrorDocument 500 "The server made a boo boo."
+#ErrorDocument 404 /missing.html
+#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
+#ErrorDocument 402 http://www.example.com/subscription_info.html
+#
+
+#
+# Putting this all together, we can internationalize error responses.
+#
+# We use Alias to redirect any /error/HTTP_<error>.html.var response to
+# our collection of by-error message multi-language collections. We use
+# includes to substitute the appropriate text.
+#
+# You can modify the messages' appearance without changing any of the
+# default HTTP_<error>.html.var files by adding the line:
+#
+# Alias /error/include/ "/your/include/path/"
+#
+# which allows you to create your own set of files by starting with the
+# /var/www/error/include/ files and
+# copying them to /your/include/path/, even on a per-VirtualHost basis.
+#
+
+#
+# The following directives modify normal HTTP response behavior to
+# handle known problems with browser implementations.
+#
+#BrowserMatch "Mozilla/2" nokeepalive
+#BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
+#BrowserMatch "RealPlayer 4\.0" force-response-1.0
+#BrowserMatch "Java/1\.0" force-response-1.0
+#BrowserMatch "JDK/1\.0" force-response-1.0
+
+#
+# The following directive disables redirects on non-GET requests for
+# a directory that does not include the trailing slash. This fixes a
+# problem with Microsoft WebFolders which does not appropriately handle
+# redirects for folders with DAV methods.
+# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
+#
+#BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
+#BrowserMatch "MS FrontPage" redirect-carefully
+#BrowserMatch "^WebDrive" redirect-carefully
+#BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
+#BrowserMatch "^gnome-vfs/1.0" redirect-carefully
+#BrowserMatch "^XML Spy" redirect-carefully
+#BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
+
+#
+# Allow server status reports generated by mod_status,
+# with the URL of http://servername/server-status
+# Change the ".example.com" to match your domain to enable.
+#
+#<Location /server-status>
+# SetHandler server-status
+# Order deny,allow
+# Deny from all
+# Allow from .example.com
+#</Location>
+
+#
+# Allow remote server configuration reports, with the URL of
+# http://servername/server-info (requires that mod_info.c be loaded).
+# Change the ".example.com" to match your domain to enable.
+#
+#<Location /server-info>
+# SetHandler server-info
+# Order deny,allow
+# Deny from all
+# Allow from .example.com
+#</Location>
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+#ProxyRequests On
+#
+#<Proxy *>
+# Order deny,allow
+# Deny from all
+# Allow from .example.com
+#</Proxy>
+
+#
+# Enable/disable the handling of HTTP/1.1 "Via:" headers.
+# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+# Set to one of: Off | On | Full | Block
+#
+#ProxyVia On
+
+#
+# To enable a cache of proxied content, uncomment the following lines.
+# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
+#
+#<IfModule mod_disk_cache.c>
+# CacheEnable disk /
+# CacheRoot "/var/cache/mod_proxy"
+#</IfModule>
+#
+
+#</IfModule>
+# End of proxy directives.
+
+### Section 3: Virtual Hosts
+#
+# VirtualHost: If you want to maintain multiple domains/hostnames on your
+# machine you can setup VirtualHost containers for them. Most configurations
+# use only name-based virtual hosts so the server doesn't need to worry about
+# IP addresses. This is indicated by the asterisks in the directives below.
+#
+# Please see the documentation at
+# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
+# for further details before you try to setup virtual hosts.
+#
+# You may use the command line option '-S' to verify your virtual host
+# configuration.
+
+#
+# Use name-based virtual hosting.
+#
+#NameVirtualHost *:80
+#
+# NOTE: NameVirtualHost cannot be used without a port specifier
+# (e.g. :80) if mod_ssl is being used, due to the nature of the
+# SSL protocol.
+#
+
+#
+# VirtualHost example:
+# Almost any Apache directive may go into a VirtualHost container.
+# The first VirtualHost section is used for requests without a known
+# server name.
+#
+#<VirtualHost *:80>
+# ServerAdmin webmaster@dummy-host.example.com
+# DocumentRoot /www/docs/dummy-host.example.com
+# ServerName dummy-host.example.com
+# ErrorLog logs/dummy-host.example.com-error_log
+# CustomLog logs/dummy-host.example.com-access_log common
+#</VirtualHost>
+
+<IfModule mod_php5.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost 127.0.0.1:8443>
+ ServerName 127.0.0.1
+ SSLEngine On
+</VirtualHost>
diff --git a/LayoutTests/http/conf/httpd.conf b/LayoutTests/http/conf/httpd.conf
new file mode 100644
index 0000000..ec04c73
--- /dev/null
+++ b/LayoutTests/http/conf/httpd.conf
@@ -0,0 +1,739 @@
+##
+## httpd.conf -- Apache HTTP server configuration file
+##
+
+#
+# Based upon the NCSA server configuration files originally by Rob McCool.
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/> for detailed information about
+# the directives.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# After this file is processed, the server will look for and process
+# /private/etc/httpd/srm.conf and then /private/etc/httpd/access.conf
+# unless you have overridden these with ResourceConfig and/or
+# AccessConfig directives here.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/usr/local/apache" will be interpreted by the
+# server as "/usr/local/apache/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# ServerType is either inetd, or standalone. Inetd mode is only supported on
+# Unix platforms.
+#
+ServerType standalone
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+ServerRoot "/usr"
+
+#
+# The LockFile directive sets the path to the lockfile used when Apache
+# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
+# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
+# its default value. The main reason for changing it is if the logs
+# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
+# DISK. The PID of the main server process is automatically appended to
+# the filename.
+#
+LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# In the standard configuration, the server will process httpd.conf (this
+# file, specified by the -f command line option), srm.conf, and access.conf
+# in that order. The latter two files are now distributed empty, as it is
+# recommended that all directives be kept in a single file for simplicity.
+# The commented-out values below are the built-in defaults. You can have the
+# server ignore these files altogether by using "/dev/null" (for Unix) or
+# "nul" (for Win32) for the arguments to the directives.
+#
+ResourceConfig /dev/null
+AccessConfig /dev/null
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+#
+# Server-pool size regulation. Rather than making you guess how many
+# server processes you need, Apache dynamically adapts to the load it
+# sees --- that is, it tries to maintain enough server processes to
+# handle the current load, plus a few spare servers to handle transient
+# load spikes (e.g., multiple simultaneous requests from a single
+# Netscape browser).
+#
+# It does this by periodically checking how many servers are waiting
+# for a request. If there are fewer than MinSpareServers, it creates
+# a new spare. If there are more than MaxSpareServers, some of the
+# spares die off. The default values are probably OK for most sites.
+#
+MinSpareServers 1
+MaxSpareServers 5
+
+#
+# Number of servers to start initially --- should be a reasonable ballpark
+# figure.
+#
+StartServers 1
+
+#
+# Limit on total number of servers running, i.e., limit on the number
+# of clients who can simultaneously connect --- if this limit is ever
+# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
+# It is intended mainly as a brake to keep a runaway server from taking
+# the system with it as it spirals down...
+#
+MaxClients 150
+
+#
+# MaxRequestsPerChild: the number of requests each child process is
+# allowed to process before the child dies. The child will exit so
+# as to avoid problems after prolonged use when Apache (and maybe the
+# libraries it uses) leak memory or other resources. On most systems, this
+# isn't really needed, but a few (such as Solaris) do have notable leaks
+# in the libraries. For these platforms, set to something like 10000
+# or so; a setting of 0 means unlimited.
+#
+# NOTE: This value does not include keepalive requests after the initial
+# request per connection. For example, if a child process handles
+# an initial request and 10 subsequent "keptalive" requests, it
+# would only count as 1 request towards this limit.
+#
+MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Configured from the httpd command line for WebKit layout tests.
+# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
+#
+#Listen 3000
+Listen 127.0.0.1:8080
+Listen 127.0.0.1:8443
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Please read the file http://httpd.apache.org/docs/dso.html for more
+# details about the DSO mechanism and run `httpd -l' for the list of already
+# built-in (statically linked and thus always available) modules in your httpd
+# binary.
+#
+# Note: The order in which modules are loaded is important. Don't change
+# the order below without expert advice.
+#
+# Example:
+# LoadModule foo_module libexec/mod_foo.so
+#LoadModule vhost_alias_module libexec/httpd/mod_vhost_alias.so
+#LoadModule env_module libexec/httpd/mod_env.so
+LoadModule config_log_module libexec/httpd/mod_log_config.so
+#LoadModule mime_magic_module libexec/httpd/mod_mime_magic.so
+LoadModule mime_module libexec/httpd/mod_mime.so
+LoadModule negotiation_module libexec/httpd/mod_negotiation.so
+#LoadModule status_module libexec/httpd/mod_status.so
+#LoadModule info_module libexec/httpd/mod_info.so
+LoadModule includes_module libexec/httpd/mod_include.so
+#LoadModule autoindex_module libexec/httpd/mod_autoindex.so
+#LoadModule dir_module libexec/httpd/mod_dir.so
+LoadModule cgi_module libexec/httpd/mod_cgi.so
+LoadModule asis_module libexec/httpd/mod_asis.so
+LoadModule imap_module libexec/httpd/mod_imap.so
+LoadModule action_module libexec/httpd/mod_actions.so
+#LoadModule speling_module libexec/httpd/mod_speling.so
+#LoadModule userdir_module libexec/httpd/mod_userdir.so
+LoadModule alias_module libexec/httpd/mod_alias.so
+LoadModule rewrite_module libexec/httpd/mod_rewrite.so
+LoadModule access_module libexec/httpd/mod_access.so
+LoadModule auth_module libexec/httpd/mod_auth.so
+#LoadModule anon_auth_module libexec/httpd/mod_auth_anon.so
+#LoadModule dbm_auth_module libexec/httpd/mod_auth_dbm.so
+#LoadModule digest_module libexec/httpd/mod_digest.so
+#LoadModule proxy_module libexec/httpd/libproxy.so
+#LoadModule cern_meta_module libexec/httpd/mod_cern_meta.so
+#LoadModule expires_module libexec/httpd/mod_expires.so
+LoadModule headers_module libexec/httpd/mod_headers.so
+#LoadModule usertrack_module libexec/httpd/mod_usertrack.so
+#LoadModule log_forensic_module libexec/httpd/mod_log_forensic.so
+#LoadModule unique_id_module libexec/httpd/mod_unique_id.so
+#LoadModule setenvif_module libexec/httpd/mod_setenvif.so
+#LoadModule dav_module libexec/httpd/libdav.so
+LoadModule ssl_module libexec/httpd/libssl.so
+#LoadModule perl_module libexec/httpd/libperl.so
+LoadModule php4_module libexec/httpd/libphp4.so
+LoadModule hfs_apple_module libexec/httpd/mod_hfs_apple.so
+#LoadModule bonjour_module libexec/httpd/mod_bonjour.so
+
+# Reconstruction of the complete module list from all available modules
+# (static and shared ones) to achieve correct module execution order.
+# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
+ClearModuleList
+#AddModule mod_vhost_alias.c
+#AddModule mod_env.c
+AddModule mod_log_config.c
+#AddModule mod_mime_magic.c
+AddModule mod_mime.c
+AddModule mod_negotiation.c
+#AddModule mod_status.c
+#AddModule mod_info.c
+AddModule mod_include.c
+#AddModule mod_autoindex.c
+#AddModule mod_dir.c
+AddModule mod_cgi.c
+AddModule mod_asis.c
+AddModule mod_imap.c
+AddModule mod_actions.c
+#AddModule mod_speling.c
+#AddModule mod_userdir.c
+AddModule mod_alias.c
+AddModule mod_rewrite.c
+AddModule mod_access.c
+AddModule mod_auth.c
+#AddModule mod_auth_anon.c
+#AddModule mod_auth_dbm.c
+#AddModule mod_digest.c
+#AddModule mod_proxy.c
+#AddModule mod_cern_meta.c
+#AddModule mod_expires.c
+AddModule mod_headers.c
+#AddModule mod_usertrack.c
+#AddModule mod_log_forensic.c
+#AddModule mod_unique_id.c
+AddModule mod_so.c
+#AddModule mod_setenvif.c
+#AddModule mod_dav.c
+AddModule mod_ssl.c
+#AddModule mod_perl.c
+AddModule mod_php4.c
+AddModule mod_hfs_apple.c
+#AddModule mod_bonjour.c
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerName allows you to set a host name which is sent back to clients for
+# your server if it's different than the one the program would get (i.e., use
+# "www" instead of the host's real name).
+#
+# Note: You cannot just invent host names and hope they work. The name you
+# define here must be a valid DNS name for your host. If you don't understand
+# this, ask your network administrator.
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address (e.g., http://123.45.67.89/)
+# anyway, and this will make redirections work in a sensible way.
+#
+# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
+# machine always knows itself by this address. If you use Apache strictly for
+# local testing and development, you may use 127.0.0.1 as the server name.
+#
+ServerName 127.0.0.1
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#DocumentRoot "/Library/WebServer/Documents"
+
+#
+# Each directory to which Apache has access, can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+<Directory />
+#
+# This may also be "None", "All", or any combination of "Indexes",
+# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# This controls which options the .htaccess files in directories can
+# override. Can also be "All", or any combination of "Options", "FileInfo",
+# "AuthConfig", and "Limit"
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+</Directory>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for access control information.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess files from being viewed by
+# Web clients. Since .htaccess files often contain authorization
+# information, access is disallowed for security reasons. Comment
+# these lines out if you want Web visitors to see the contents of
+# .htaccess files. If you change the AccessFileName directive above,
+# be sure to make the corresponding changes here.
+#
+# Also, folks tend to use names such as .htpasswd for password
+# files, so this will protect those as well.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
+# document that was negotiated on the basis of content. This asks proxy
+# servers not to cache the document. Uncommenting the following line disables
+# this behavior, and proxies will be allowed to cache the documents.
+#
+#CacheNegotiatedDocs
+
+#
+# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
+# Apache needs to construct a self-referencing URL (a URL that refers back
+# to the server the response is coming from) it will use ServerName and
+# Port to form a "canonical" name. With this setting off, Apache will
+# use the hostname:port that the client supplied, when possible. This
+# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
+#
+UseCanonicalName On
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#<IfModule mod_mime.c>
+# TypesConfig /private/etc/httpd/mime.types
+#</IfModule>
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#ErrorLog "/tmp/layout-test-results/error_log"
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#CustomLog "/tmp/layout-test-results/access_log" common
+
+#
+# If you prefer a single logfile with access, agent, and referer information
+# (Combined Logfile Format) you can use the following directive.
+#
+#CustomLog "/tmp/layout-test-results/access_log" combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (error documents, FTP directory listings,
+# mod_status and mod_info output etc., but not CGI generated documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+<IfModule mod_alias.c>
+</IfModule>
+# End of aliases.
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Format: Redirect old-URI new-URL
+#
+
+#
+# Document types.
+#
+<IfModule mod_mime.c>
+
+ #
+ # AddLanguage allows you to specify the language of a document. You can
+ # then use content negotiation to give a browser a file in a language
+ # it can understand.
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in quite
+ # some cases the two character 'Language' abbreviation is not
+ # identical to the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. But there is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
+ # French (fr) - German (de) - Greek-Modern (el)
+ # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
+ # Portugese (pt) - Luxembourgeois* (ltz)
+ # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
+ # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
+ # Russian (ru)
+ #
+ AddLanguage da .dk
+ AddLanguage nl .nl
+ AddLanguage en .en
+ AddLanguage et .ee
+ AddLanguage fr .fr
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage he .he
+ AddCharset ISO-8859-8 .iso8859-8
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddCharset ISO-2022-JP .jis
+ AddLanguage kr .kr
+ AddCharset ISO-2022-KR .iso-kr
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddCharset ISO-8859-2 .iso-pl
+ AddLanguage pt .pt
+ AddLanguage pt-br .pt-br
+ AddLanguage ltz .lu
+ AddLanguage ca .ca
+ AddLanguage es .es
+ AddLanguage sv .sv
+ AddLanguage cs .cz .cs
+ AddLanguage ru .ru
+ AddLanguage zh-TW .zh-tw
+ AddCharset Big5 .Big5 .big5
+ AddCharset WINDOWS-1251 .cp-1251
+ AddCharset CP866 .cp866
+ AddCharset ISO-8859-5 .iso-ru
+ AddCharset KOI8-R .koi8-r
+ AddCharset UCS-2 .ucs2
+ AddCharset UCS-4 .ucs4
+ AddCharset UTF-8 .utf8
+
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ <IfModule mod_negotiation.c>
+ LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
+ </IfModule>
+
+ #
+ # AddType allows you to tweak mime.types without actually editing it, or to
+ # make certain files to be certain types.
+ #
+ AddType application/x-tar .tgz
+
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have nothing
+ # to do with the FancyIndexing customization directives above.
+ #
+ AddEncoding x-compress .Z
+ AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ #AddType application/x-compress .Z
+ #AddType application/x-gzip .gz .tgz
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers",
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action command (see below)
+ #
+ # If you want to use server side includes, or CGI outside
+ # ScriptAliased directories, uncomment the following lines.
+ #
+ # To use CGI scripts:
+ #
+ AddHandler cgi-script .cgi .pl
+
+ #
+ # To use server-parsed HTML files
+ #
+ AddType text/html .shtml
+ AddHandler server-parsed .shtml
+
+ #
+ # Uncomment the following line to enable Apache's send-asis HTTP file
+ # feature
+ #
+ AddHandler send-as-is asis
+
+ #
+ # If you wish to use server-parsed imagemap files, use
+ #
+ #AddHandler imap-file map
+
+ #
+ # To enable type maps, you might want to use
+ #
+ #AddHandler type-map var
+
+</IfModule>
+# End of document types.
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# MetaDir: specifies the name of the directory in which Apache can find
+# meta information files. These files contain additional HTTP headers
+# to include when sending the document
+#
+#MetaDir .web
+
+#
+# MetaSuffix: specifies the file name suffix for the file containing the
+# meta information.
+#
+#MetaSuffix .meta
+
+#
+# Customizable error response (Apache style)
+# these come in three flavors
+#
+# 1) plain text
+#ErrorDocument 500 "The server made a boo boo.
+# n.b. the single leading (") marks it as text, it does not get output
+#
+# 2) local redirects
+#ErrorDocument 404 /missing.html
+# to redirect to local URL /missing.html
+#ErrorDocument 404 /cgi-bin/missing_handler.pl
+# N.B.: You can redirect to a script or a document using server-side-includes.
+#
+# 3) external redirects
+#ErrorDocument 402 http://some.other-server.com/subscription_info.html
+# N.B.: Many of the environment variables associated with the original
+# request will *not* be available to such a script.
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+# ProxyRequests On
+
+# <Directory proxy:*>
+# Order deny,allow
+# Deny from all
+# Allow from .your-domain.com
+# </Directory>
+
+ #
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+ # Set to one of: Off | On | Full | Block
+ #
+# ProxyVia On
+
+ #
+ # To enable the cache as well, edit and uncomment the following lines:
+ # (no cacheing without CacheRoot)
+ #
+# CacheRoot "/private/var/run/proxy"
+# CacheSize 5
+# CacheGcInterval 4
+# CacheMaxExpire 24
+# CacheLastModifiedFactor 0.1
+# CacheDefaultExpire 1
+# NoCache a-domain.com another-domain.edu joes.garage-sale.com
+
+#</IfModule>
+# End of proxy directives.
+
+
+<IfModule mod_php4.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost 127.0.0.1:8443>
+ ServerName 127.0.0.1
+ SSLEngine On
+</VirtualHost>
diff --git a/LayoutTests/http/conf/libphp4.dll b/LayoutTests/http/conf/libphp4.dll
new file mode 100755
index 0000000..0127b7d
--- /dev/null
+++ b/LayoutTests/http/conf/libphp4.dll
Binary files differ
diff --git a/LayoutTests/http/conf/mime.types b/LayoutTests/http/conf/mime.types
new file mode 100644
index 0000000..cfb9d53
--- /dev/null
+++ b/LayoutTests/http/conf/mime.types
@@ -0,0 +1,600 @@
+# This is a comment. I love comments.
+
+# This file controls what Internet media types are sent to the client for
+# given file extension(s). Sending the correct media type to the client
+# is important so they know how to handle the content of the file.
+# Extra types can either be added here or by using an AddType directive
+# in your config files. For more information about Internet media types,
+# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
+# registry is at <http://www.iana.org/assignments/media-types/>.
+
+# MIME type Extensions
+application/activemessage
+application/andrew-inset ez
+application/applefile
+application/atom+xml atom
+application/atomicmail
+application/batch-smtp
+application/beep+xml
+application/cals-1840
+application/cnrp+xml
+application/commonground
+application/cpl+xml
+application/cybercash
+application/dca-rft
+application/dec-dx
+application/dvcs
+application/edi-consent
+application/edifact
+application/edi-x12
+application/eshop
+application/font-tdpfr
+application/http
+application/hyperstudio
+application/iges
+application/index
+application/index.cmd
+application/index.obj
+application/index.response
+application/index.vnd
+application/iotp
+application/ipp
+application/isup
+application/mac-binhex40 hqx
+application/mac-compactpro cpt
+application/macwriteii
+application/marc
+application/mathematica
+application/mathml+xml mathml
+application/msword doc
+application/news-message-id
+application/news-transmission
+application/ocsp-request
+application/ocsp-response
+application/octet-stream bin dms lha lzh exe class so dll dmg
+application/oda oda
+application/ogg ogg
+application/parityfec
+application/pdf pdf
+application/pgp-encrypted
+application/pgp-keys
+application/pgp-signature
+application/pkcs10
+application/pkcs7-mime
+application/pkcs7-signature
+application/pkix-cert
+application/pkix-crl
+application/pkixcmp
+application/postscript ai eps ps
+application/prs.alvestrand.titrax-sheet
+application/prs.cww
+application/prs.nprend
+application/prs.plucker
+application/qsig
+application/rdf+xml rdf
+application/reginfo+xml
+application/remote-printing
+application/riscos
+application/rtf
+application/sdp
+application/set-payment
+application/set-payment-initiation
+application/set-registration
+application/set-registration-initiation
+application/sgml
+application/sgml-open-catalog
+application/sieve
+application/slate
+application/smil smi smil
+application/srgs gram
+application/srgs+xml grxml
+application/timestamp-query
+application/timestamp-reply
+application/tve-trigger
+application/vemmi
+application/vnd.3gpp.pic-bw-large
+application/vnd.3gpp.pic-bw-small
+application/vnd.3gpp.pic-bw-var
+application/vnd.3gpp.sms
+application/vnd.3m.post-it-notes
+application/vnd.accpac.simply.aso
+application/vnd.accpac.simply.imp
+application/vnd.acucobol
+application/vnd.acucorp
+application/vnd.adobe.xfdf
+application/vnd.aether.imp
+application/vnd.amiga.ami
+application/vnd.anser-web-certificate-issue-initiation
+application/vnd.anser-web-funds-transfer-initiation
+application/vnd.audiograph
+application/vnd.blueice.multipass
+application/vnd.bmi
+application/vnd.businessobjects
+application/vnd.canon-cpdl
+application/vnd.canon-lips
+application/vnd.cinderella
+application/vnd.claymore
+application/vnd.commerce-battelle
+application/vnd.commonspace
+application/vnd.contact.cmsg
+application/vnd.cosmocaller
+application/vnd.criticaltools.wbs+xml
+application/vnd.ctc-posml
+application/vnd.cups-postscript
+application/vnd.cups-raster
+application/vnd.cups-raw
+application/vnd.curl
+application/vnd.cybank
+application/vnd.data-vision.rdz
+application/vnd.dna
+application/vnd.dpgraph
+application/vnd.dreamfactory
+application/vnd.dxr
+application/vnd.ecdis-update
+application/vnd.ecowin.chart
+application/vnd.ecowin.filerequest
+application/vnd.ecowin.fileupdate
+application/vnd.ecowin.series
+application/vnd.ecowin.seriesrequest
+application/vnd.ecowin.seriesupdate
+application/vnd.enliven
+application/vnd.epson.esf
+application/vnd.epson.msf
+application/vnd.epson.quickanime
+application/vnd.epson.salt
+application/vnd.epson.ssf
+application/vnd.ericsson.quickcall
+application/vnd.eudora.data
+application/vnd.fdf
+application/vnd.ffsns
+application/vnd.fints
+application/vnd.flographit
+application/vnd.framemaker
+application/vnd.fsc.weblaunch
+application/vnd.fujitsu.oasys
+application/vnd.fujitsu.oasys2
+application/vnd.fujitsu.oasys3
+application/vnd.fujitsu.oasysgp
+application/vnd.fujitsu.oasysprs
+application/vnd.fujixerox.ddd
+application/vnd.fujixerox.docuworks
+application/vnd.fujixerox.docuworks.binder
+application/vnd.fut-misnet
+application/vnd.grafeq
+application/vnd.groove-account
+application/vnd.groove-help
+application/vnd.groove-identity-message
+application/vnd.groove-injector
+application/vnd.groove-tool-message
+application/vnd.groove-tool-template
+application/vnd.groove-vcard
+application/vnd.hbci
+application/vnd.hhe.lesson-player
+application/vnd.hp-hpgl
+application/vnd.hp-hpid
+application/vnd.hp-hps
+application/vnd.hp-pcl
+application/vnd.hp-pclxl
+application/vnd.httphone
+application/vnd.hzn-3d-crossword
+application/vnd.ibm.afplinedata
+application/vnd.ibm.electronic-media
+application/vnd.ibm.minipay
+application/vnd.ibm.modcap
+application/vnd.ibm.rights-management
+application/vnd.ibm.secure-container
+application/vnd.informix-visionary
+application/vnd.intercon.formnet
+application/vnd.intertrust.digibox
+application/vnd.intertrust.nncp
+application/vnd.intu.qbo
+application/vnd.intu.qfx
+application/vnd.irepository.package+xml
+application/vnd.is-xpr
+application/vnd.japannet-directory-service
+application/vnd.japannet-jpnstore-wakeup
+application/vnd.japannet-payment-wakeup
+application/vnd.japannet-registration
+application/vnd.japannet-registration-wakeup
+application/vnd.japannet-setstore-wakeup
+application/vnd.japannet-verification
+application/vnd.japannet-verification-wakeup
+application/vnd.jisp
+application/vnd.kde.karbon
+application/vnd.kde.kchart
+application/vnd.kde.kformula
+application/vnd.kde.kivio
+application/vnd.kde.kontour
+application/vnd.kde.kpresenter
+application/vnd.kde.kspread
+application/vnd.kde.kword
+application/vnd.kenameaapp
+application/vnd.koan
+application/vnd.liberty-request+xml
+application/vnd.llamagraphics.life-balance.desktop
+application/vnd.llamagraphics.life-balance.exchange+xml
+application/vnd.lotus-1-2-3
+application/vnd.lotus-approach
+application/vnd.lotus-freelance
+application/vnd.lotus-notes
+application/vnd.lotus-organizer
+application/vnd.lotus-screencam
+application/vnd.lotus-wordpro
+application/vnd.mcd
+application/vnd.mediastation.cdkey
+application/vnd.meridian-slingshot
+application/vnd.micrografx.flo
+application/vnd.micrografx.igx
+application/vnd.mif mif
+application/vnd.minisoft-hp3000-save
+application/vnd.mitsubishi.misty-guard.trustweb
+application/vnd.mobius.daf
+application/vnd.mobius.dis
+application/vnd.mobius.mbk
+application/vnd.mobius.mqy
+application/vnd.mobius.msl
+application/vnd.mobius.plc
+application/vnd.mobius.txf
+application/vnd.mophun.application
+application/vnd.mophun.certificate
+application/vnd.motorola.flexsuite
+application/vnd.motorola.flexsuite.adsi
+application/vnd.motorola.flexsuite.fis
+application/vnd.motorola.flexsuite.gotap
+application/vnd.motorola.flexsuite.kmr
+application/vnd.motorola.flexsuite.ttc
+application/vnd.motorola.flexsuite.wem
+application/vnd.mozilla.xul+xml xul
+application/vnd.ms-artgalry
+application/vnd.ms-asf
+application/vnd.ms-excel xls
+application/vnd.ms-lrm
+application/vnd.ms-powerpoint ppt
+application/vnd.ms-project
+application/vnd.ms-tnef
+application/vnd.ms-works
+application/vnd.ms-wpl
+application/vnd.mseq
+application/vnd.msign
+application/vnd.music-niff
+application/vnd.musician
+application/vnd.netfpx
+application/vnd.noblenet-directory
+application/vnd.noblenet-sealer
+application/vnd.noblenet-web
+application/vnd.novadigm.edm
+application/vnd.novadigm.edx
+application/vnd.novadigm.ext
+application/vnd.obn
+application/vnd.osa.netdeploy
+application/vnd.palm
+application/vnd.pg.format
+application/vnd.pg.osasli
+application/vnd.powerbuilder6
+application/vnd.powerbuilder6-s
+application/vnd.powerbuilder7
+application/vnd.powerbuilder7-s
+application/vnd.powerbuilder75
+application/vnd.powerbuilder75-s
+application/vnd.previewsystems.box
+application/vnd.publishare-delta-tree
+application/vnd.pvi.ptid1
+application/vnd.pwg-multiplexed
+application/vnd.pwg-xhtml-print+xml
+application/vnd.quark.quarkxpress
+application/vnd.rapid
+application/vnd.rn-realmedia rm
+application/vnd.s3sms
+application/vnd.sealed.net
+application/vnd.seemail
+application/vnd.shana.informed.formdata
+application/vnd.shana.informed.formtemplate
+application/vnd.shana.informed.interchange
+application/vnd.shana.informed.package
+application/vnd.smaf
+application/vnd.sss-cod
+application/vnd.sss-dtf
+application/vnd.sss-ntf
+application/vnd.street-stream
+application/vnd.svd
+application/vnd.swiftview-ics
+application/vnd.triscape.mxs
+application/vnd.trueapp
+application/vnd.truedoc
+application/vnd.ufdl
+application/vnd.uplanet.alert
+application/vnd.uplanet.alert-wbxml
+application/vnd.uplanet.bearer-choice
+application/vnd.uplanet.bearer-choice-wbxml
+application/vnd.uplanet.cacheop
+application/vnd.uplanet.cacheop-wbxml
+application/vnd.uplanet.channel
+application/vnd.uplanet.channel-wbxml
+application/vnd.uplanet.list
+application/vnd.uplanet.list-wbxml
+application/vnd.uplanet.listcmd
+application/vnd.uplanet.listcmd-wbxml
+application/vnd.uplanet.signal
+application/vnd.vcx
+application/vnd.vectorworks
+application/vnd.vidsoft.vidconference
+application/vnd.visio
+application/vnd.visionary
+application/vnd.vividence.scriptfile
+application/vnd.vsf
+application/vnd.wap.sic
+application/vnd.wap.slc
+application/vnd.wap.wbxml wbxml
+application/vnd.wap.wmlc wmlc
+application/vnd.wap.wmlscriptc wmlsc
+application/vnd.webturbo
+application/vnd.wrq-hp3000-labelled
+application/vnd.wt.stf
+application/vnd.wv.csp+wbxml
+application/vnd.xara
+application/vnd.xfdl
+application/vnd.yamaha.hv-dic
+application/vnd.yamaha.hv-script
+application/vnd.yamaha.hv-voice
+application/vnd.yellowriver-custom-menu
+application/voicexml+xml vxml
+application/watcherinfo+xml
+application/whoispp-query
+application/whoispp-response
+application/wita
+application/wordperfect5.1
+application/x-bcpio bcpio
+application/x-cdlink vcd
+application/x-chess-pgn pgn
+application/x-compress
+application/x-cpio cpio
+application/x-csh csh
+application/x-director dcr dir dxr
+application/x-dvi dvi
+application/x-futuresplash spl
+application/x-gtar gtar
+application/x-gzip
+application/x-hdf hdf
+application/x-javascript js
+application/x-java-jnlp-file jnlp
+application/x-koan skp skd skt skm
+application/x-latex latex
+application/x-netcdf nc cdf
+application/x-sh sh
+application/x-shar shar
+application/x-shockwave-flash swf
+application/x-stuffit sit
+application/x-sv4cpio sv4cpio
+application/x-sv4crc sv4crc
+application/x-tar tar
+application/x-tcl tcl
+application/x-tex tex
+application/x-texinfo texinfo texi
+application/x-troff t tr roff
+application/x-troff-man man
+application/x-troff-me me
+application/x-troff-ms ms
+application/x-ustar ustar
+application/x-wais-source src
+application/x400-bp
+application/xhtml+xml xhtml xht
+application/xslt+xml xslt
+application/xml xml xsl
+application/xml-dtd dtd
+application/xml-external-parsed-entity
+application/zip zip
+audio/32kadpcm
+audio/amr
+audio/amr-wb
+audio/basic au snd
+audio/cn
+audio/dat12
+audio/dsr-es201108
+audio/dvi4
+audio/evrc
+audio/evrc0
+audio/g722
+audio/g.722.1
+audio/g723
+audio/g726-16
+audio/g726-24
+audio/g726-32
+audio/g726-40
+audio/g728
+audio/g729
+audio/g729D
+audio/g729E
+audio/gsm
+audio/gsm-efr
+audio/l8
+audio/l16
+audio/l20
+audio/l24
+audio/lpc
+audio/midi mid midi kar
+audio/mpa
+audio/mpa-robust
+audio/mp4a-latm m4a m4p
+audio/mpeg mpga mp2 mp3
+audio/parityfec
+audio/pcma
+audio/pcmu
+audio/prs.sid
+audio/qcelp
+audio/red
+audio/smv
+audio/smv0
+audio/telephone-event
+audio/tone
+audio/vdvi
+audio/vnd.3gpp.iufp
+audio/vnd.cisco.nse
+audio/vnd.cns.anp1
+audio/vnd.cns.inf1
+audio/vnd.digital-winds
+audio/vnd.everad.plj
+audio/vnd.lucent.voice
+audio/vnd.nortel.vbk
+audio/vnd.nuera.ecelp4800
+audio/vnd.nuera.ecelp7470
+audio/vnd.nuera.ecelp9600
+audio/vnd.octel.sbc
+audio/vnd.qcelp
+audio/vnd.rhetorex.32kadpcm
+audio/vnd.vmx.cvsd
+audio/x-aiff aif aiff aifc
+audio/x-alaw-basic
+audio/x-mpegurl m3u
+audio/x-pn-realaudio ram ra
+audio/x-pn-realaudio-plugin
+audio/x-wav wav
+chemical/x-pdb pdb
+chemical/x-xyz xyz
+image/bmp bmp
+image/cgm cgm
+image/g3fax
+image/gif gif
+image/ief ief
+image/jpeg jpeg jpg jpe
+image/jp2 jp2
+image/naplps
+image/pict pict pic pct
+image/png png
+image/prs.btif
+image/prs.pti
+image/svg+xml svg
+image/t38
+image/tiff tiff tif
+image/tiff-fx
+image/vnd.cns.inf2
+image/vnd.djvu djvu djv
+image/vnd.dwg
+image/vnd.dxf
+image/vnd.fastbidsheet
+image/vnd.fpx
+image/vnd.fst
+image/vnd.fujixerox.edmics-mmr
+image/vnd.fujixerox.edmics-rlc
+image/vnd.globalgraphics.pgb
+image/vnd.mix
+image/vnd.ms-modi
+image/vnd.net-fpx
+image/vnd.svf
+image/vnd.wap.wbmp wbmp
+image/vnd.xiff
+image/x-cmu-raster ras
+image/x-macpaint pntg pnt mac
+image/x-icon ico
+image/x-portable-anymap pnm
+image/x-portable-bitmap pbm
+image/x-portable-graymap pgm
+image/x-portable-pixmap ppm
+image/x-quicktime qtif qti
+image/x-rgb rgb
+image/x-xbitmap xbm
+image/x-xpixmap xpm
+image/x-xwindowdump xwd
+message/delivery-status
+message/disposition-notification
+message/external-body
+message/http
+message/news
+message/partial
+message/rfc822
+message/s-http
+message/sip
+message/sipfrag
+model/iges igs iges
+model/mesh msh mesh silo
+model/vnd.dwf
+model/vnd.flatland.3dml
+model/vnd.gdl
+model/vnd.gs-gdl
+model/vnd.gtw
+model/vnd.mts
+model/vnd.parasolid.transmit.binary
+model/vnd.parasolid.transmit.text
+model/vnd.vtu
+model/vrml wrl vrml
+multipart/alternative
+multipart/appledouble
+multipart/byteranges
+multipart/digest
+multipart/encrypted
+multipart/form-data
+multipart/header-set
+multipart/mixed
+multipart/parallel
+multipart/related
+multipart/report
+multipart/signed
+multipart/voice-message
+text/cache-manifest manifest
+text/calendar ics ifb
+text/css css
+text/directory
+text/enriched
+text/html html htm
+text/parityfec
+text/plain asc txt
+text/prs.lines.tag
+text/rfc822-headers
+text/richtext rtx
+text/rtf rtf
+text/sgml sgml sgm
+text/t140
+text/tab-separated-values tsv
+text/uri-list
+text/vnd.abc
+text/vnd.curl
+text/vnd.dmclientscript
+text/vnd.fly
+text/vnd.fmi.flexstor
+text/vnd.in3d.3dml
+text/vnd.in3d.spot
+text/vnd.iptc.nitf
+text/vnd.iptc.newsml
+text/vnd.latex-z
+text/vnd.motorola.reflex
+text/vnd.ms-mediapackage
+text/vnd.net2phone.commcenter.command
+text/vnd.sun.j2me.app-descriptor
+text/vnd.wap.si
+text/vnd.wap.sl
+text/vnd.wap.wml wml
+text/vnd.wap.wmlscript wmls
+text/x-setext etx
+text/xml
+text/xml-external-parsed-entity
+video/bmpeg
+video/bt656
+video/celb
+video/dv
+video/h261
+video/h263
+video/h263-1998
+video/h263-2000
+video/jpeg
+video/mp1s
+video/mp2p
+video/mp2t
+video/mp4 mp4
+video/mp4v-es
+video/mpv
+video/mpeg mpeg mpg mpe
+video/nv
+video/parityfec
+video/pointer
+video/quicktime qt mov
+video/smpte292m
+video/vnd.fvt
+video/vnd.motorola.video
+video/vnd.motorola.videop
+video/vnd.mpegurl mxu m4u
+video/vnd.nokia.interleaved-multimedia
+video/vnd.objectvideo
+video/vnd.vivo
+video/x-dv dv dif
+video/x-msvideo avi
+video/x-sgi-movie movie
+x-conference/x-cooltalk ice
diff --git a/LayoutTests/http/conf/webkit-httpd.pem b/LayoutTests/http/conf/webkit-httpd.pem
new file mode 100644
index 0000000..37893b8
--- /dev/null
+++ b/LayoutTests/http/conf/webkit-httpd.pem
@@ -0,0 +1,28 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCmcXbusrr8zQr8snIb0OVQibVfgv7zPjh/5xdcrKOejJzp3epA
+AF4TITeFR9vzWIwkmkcRoY+IbQNhh7kefGUYD47bvVamJMtq5cGYVs0HngT+KTMa
+NGH/G44KkFIOaz/b5d/JNKONrlqwxqXS+m6IY4l/E1Ff25ZjND5TaEvI1wIDAQAB
+AoGBAIcDv4A9h6UOBv2ZGyspNvsv2erSblGOhXJrWO4aNNemJJspIp4sLiPCbDE3
+a1po17XRWBkbPz1hgL6axDXQnoeo++ebfrvRSed+Fys4+6SvuSrPOv6PmWTBT/Wa
+GpO+tv48JUNxC/Dy8ROixBXOViuIBEFq3NfVH4HU3+RG20NhAkEA1L3RAhdfPkLI
+82luSOYE3Eq44lICb/yZi+JEihwSeZTJKdZHwYD8KVCjOtjGrOmyEyvThrcIACQz
+JLEreVh33wJBAMhJm9pzJJNkIyBgiXA66FAwbhdDzSTPx0OBjoVWoj6u7jzGvIFT
+Cn1aiTBYzzsiMCaCx+W3e6pK/DcvHSwKrgkCQHZMcxwBmSHLC2lnmD8LQWqqVnLr
+fZV+VnfVw501DQT0uoP8NvygWBg1Uf9YKepfLXnBpidEQjup5ZKivnUEv+sCQA8N
+6VcMHI2vkyxV1T7ITrnoSf4ZrIu9yl56mHnRPzSy9VlAHt8hnMI7UeB+bGUndrMO
+VXQgzHzKUhbbxbePvfECQQDTtkOuhJyKDfHCxLDcwNpi+T6OWTEfCw/cq9ZWDbA7
+yCX81pQxfZkfMIS1YFIOGHovK0rMMTraCe+iDNYtVz/L
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIIB9zCCAWACCQDjWWTeC6BQvTANBgkqhkiG9w0BAQQFADBAMQswCQYDVQQGEwJB
+VTETMBEGA1UECBMKU29tZS1TdGF0ZTEcMBoGA1UEChMTV2ViS2l0IExheW91dCBU
+ZXN0czAeFw0wNzA3MTMxMjUxMzJaFw03MTA1MTMwNjIzMTZaMEAxCzAJBgNVBAYT
+AkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMRwwGgYDVQQKExNXZWJLaXQgTGF5b3V0
+IFRlc3RzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmcXbusrr8zQr8snIb
+0OVQibVfgv7zPjh/5xdcrKOejJzp3epAAF4TITeFR9vzWIwkmkcRoY+IbQNhh7ke
+fGUYD47bvVamJMtq5cGYVs0HngT+KTMaNGH/G44KkFIOaz/b5d/JNKONrlqwxqXS
++m6IY4l/E1Ff25ZjND5TaEvI1wIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAAfbUbgD
+01O8DoZA02c1MUMbMHRPSb/qdok2pyWoCPa/BSaOIaNPePc8auPRbrS2XsVWSMft
+CTXiXmrK2Xx1+fJuZLAp0CUng4De4cDH5c8nvlocYmXo+1x53S9DfD0KPryjBRI7
+9LnJq2ysHAUawiqFXlwBag6mXawD8YjzcYat
+-----END CERTIFICATE-----
diff --git a/LayoutTests/http/tests/appcache/404-manifest-expected.txt b/LayoutTests/http/tests/appcache/404-manifest-expected.txt
new file mode 100644
index 0000000..b047077
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/404-manifest-expected.txt
@@ -0,0 +1,4 @@
+Test that subresources can be loaded if manifest is not available. Should say SUCCESS.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/404-manifest.html b/LayoutTests/http/tests/appcache/404-manifest.html
new file mode 100644
index 0000000..9b9bd30
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/404-manifest.html
@@ -0,0 +1,59 @@
+<html manifest="does-not-exist.manifest">
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function unexpectedEvent(name)
+{
+ log("FAILURE: Unexpected " + name + " event.");
+}
+
+applicationCache.addEventListener('noupdate', function() { unexpectedEvent("noupdate") }, false);
+applicationCache.addEventListener('downloading', function() { unexpectedEvent("downloading") }, false);
+applicationCache.addEventListener('progress', function() { unexpectedEvent("progress") }, false);
+applicationCache.addEventListener('updateready', function() { unexpectedEvent("updateready") }, false);
+applicationCache.addEventListener('cached', function() { unexpectedEvent("cached") }, false);
+applicationCache.addEventListener('obsolete', function() { unexpectedEvent("obsolete") }, false);
+
+function test()
+{
+ if (!gotCheckingEvent)
+ log("FAILURE: Did not get a checking event");
+ if (window.applicationCache.status)
+ log("FAILURE: Cache status is not UNCACHED, " + window.applicationCache.status);
+
+ // The manifest failed to load, so there should be no cache, and subresources should be loaded normally.
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "resources/simple.txt", false);
+ req.send();
+
+ if (req.responseText == 'Hello, World!')
+ log("SUCCESS");
+ else
+ log("FAILURE: Did not get expected response data.");
+ } catch (e) {
+ log("FAILURE: Could not load data.");
+ }
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+var gotCheckingEvent = false;
+applicationCache.addEventListener('checking', function() { gotCheckingEvent = true; }, false);
+
+applicationCache.addEventListener('error', function() { test() }, false);
+
+</script>
+<p>Test that subresources can be loaded if manifest is not available. Should say SUCCESS.</p>
+
+<div id=result></div>
+</html>
diff --git a/LayoutTests/http/tests/appcache/404-resource-expected.txt b/LayoutTests/http/tests/appcache/404-resource-expected.txt
new file mode 100644
index 0000000..a8e5dea
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/404-resource-expected.txt
@@ -0,0 +1,6 @@
+Test that a missing explicit resource makes caching fail.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/404-resource.html b/LayoutTests/http/tests/appcache/404-resource.html
new file mode 100644
index 0000000..5439b8f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/404-resource.html
@@ -0,0 +1,39 @@
+<html manifest="resources/404-resource.manifest">
+<body>
+<p>Test that a missing explicit resource makes caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function unexpectedCallback(eventName)
+{
+ log("FAIL: An unexpected " + eventName + " event was dispatched on window.applicationCache.");
+}
+
+function test()
+{
+ if (applicationCache.status == applicationCache.UNCACHED)
+ log("SUCCESS");
+ else
+ log("FAILURE: cache status is not uncached: " + applicationCache.status);
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/access-via-redirect-expected.txt b/LayoutTests/http/tests/appcache/access-via-redirect-expected.txt
new file mode 100644
index 0000000..8107c5f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/access-via-redirect-expected.txt
@@ -0,0 +1,3 @@
+This tests that the start of redirect chain doesn't get into an application cache if the end of the chain has a manifest.
+
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/access-via-redirect.php b/LayoutTests/http/tests/appcache/access-via-redirect.php
new file mode 100644
index 0000000..b0a61b0
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/access-via-redirect.php
@@ -0,0 +1,7 @@
+<?php
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('HTTP/1.1 307 Temporary Redirect');
+header('Location: resources/access-via-redirect.html');
+?>
diff --git a/LayoutTests/http/tests/appcache/auth-expected.txt b/LayoutTests/http/tests/appcache/auth-expected.txt
new file mode 100644
index 0000000..7ec3f83
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/auth-expected.txt
@@ -0,0 +1,5 @@
+Test that appcache works with authentication. Should say SUCCESS:
+
+SUCCESS
+
+
diff --git a/LayoutTests/http/tests/appcache/auth.html b/LayoutTests/http/tests/appcache/auth.html
new file mode 100644
index 0000000..27b0ba6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/auth.html
@@ -0,0 +1,28 @@
+<body>
+<p>Test that appcache works with authentication. Should say SUCCESS:</p>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+// Store authentication credentials.
+var req = new XMLHttpRequest;
+req.open("GET", "resources/auth/setup.php", false, "login", "pasword");
+req.send();
+
+var ifr = document.createElement("iframe");
+ifr.setAttribute("src", "resources/auth/iframe.php");
+document.body.appendChild(ifr);
+
+function success()
+{
+ var text = document.createElement("p");
+ text.appendChild(document.createTextNode("SUCCESS"));
+ document.body.replaceChild(text, document.getElementsByTagName("iframe")[0]);
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+</script>
+</body>
diff --git a/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back-expected.txt b/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back-expected.txt
new file mode 100644
index 0000000..0ad96dc
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back-expected.txt
@@ -0,0 +1,2 @@
+This tests that loading a page with a manifest, navigating away from the page, and then back does not cause a crash.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back.html b/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back.html
new file mode 100644
index 0000000..5b1fd9b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/crash-when-navigating-away-then-back.html
@@ -0,0 +1,27 @@
+<html>
+<script>
+function openWindow()
+{
+ window.open('resources/crash-when-navigating-away-then-back.html')
+}
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+ layoutTestController.setCanOpenWindows();
+} else {
+ document.write('<div id="manual-instructions">Click <a href="javascript:openWindow()">this link</a> twice. A window should open and close twice without crashing.</div>')
+}
+
+function closedWindow()
+{
+ if (window.layoutTestController)
+ setTimeout(openWindow, 100);
+}
+
+</script>
+<body onload="if (window.layoutTestController) openWindow()">
+<div>This tests that loading a page with a manifest, navigating away from the page, and then back does not cause a crash.</div>
+<div id="result">FAILURE - test not completed</div>
+</html>
+</div>
diff --git a/LayoutTests/http/tests/appcache/cyrillic-uri-expected.txt b/LayoutTests/http/tests/appcache/cyrillic-uri-expected.txt
new file mode 100644
index 0000000..3c3e640
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/cyrillic-uri-expected.txt
@@ -0,0 +1,13 @@
+Test that non-ASCII URIs work correctly in cache manifests.
+
+Should be a series of PASS messages, followed with DONE.
+
+PASS: resources/intercept/cached-Проверка
+PASS: resources/intercept/cached-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+PASS: resources/intercept/cached2-Проверка
+PASS: resources/intercept/cached2-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+PASS: resources/intercept/network-Проверка-PASS
+PASS: resources/intercept/network-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0-PASS
+PASS: resources/does-not-exist-Проверка
+DONE
+
diff --git a/LayoutTests/http/tests/appcache/cyrillic-uri.html b/LayoutTests/http/tests/appcache/cyrillic-uri.html
new file mode 100644
index 0000000..c86a261
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/cyrillic-uri.html
@@ -0,0 +1,82 @@
+<html manifest="resources/cyrillic-uri.manifest">
+<head>
+<meta charset="koi8-r">
+</head>
+<body>
+<p>Test that non-ASCII URIs work correctly in cache manifests.</p>
+<p>Should be a series of PASS messages, followed with DONE.</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function load(url)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", url, false);
+ req.send("");
+ return req.responseText;
+}
+
+function canLoad(url)
+{
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", url, false);
+ req.send("");
+ return true;
+ } catch (ex) {
+ return false;
+ }
+}
+
+function shouldBeLoadable(url)
+{
+ log((canLoad(url) ? "PASS: " : "FAIL: ") + url);
+}
+
+function test()
+{
+ // Path is always UTF-8.
+ shouldBeLoadable("resources/intercept/cached-ðÒÏ×ÅÒËÁ");
+ shouldBeLoadable("resources/intercept/cached-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0");
+ shouldBeLoadable("resources/intercept/cached2-ðÒÏ×ÅÒËÁ");
+ shouldBeLoadable("resources/intercept/cached2-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0");
+ shouldBeLoadable("resources/intercept/network-ðÒÏ×ÅÒËÁ-PASS");
+ shouldBeLoadable("resources/intercept/network-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0-PASS");
+ shouldBeLoadable("resources/does-not-exist-ðÒÏ×ÅÒËÁ");
+
+ // To test encodings other than UTF-8, we need to simulate form submission (for XHR, Firefox
+ // always uses UTF-8, even in query part).
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+ window.addEventListener("message", frameDone, false);
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/cyrillic-uri-form.html");
+ document.body.appendChild(ifr);
+}
+
+function frameDone(evt)
+{
+ log("DONE");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-expected.txt b/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-expected.txt
new file mode 100644
index 0000000..8e41eb6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising-expected.txt
@@ -0,0 +1,4 @@
+Test the destruction of an iframe while deferred events are being raised does not crash the system.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising.html b/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising.html
new file mode 100644
index 0000000..902d3a8
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/deferred-events-delete-while-raising.html
@@ -0,0 +1,35 @@
+<html manifest="THIS_FILE_DOES_NOT_EXIST.manifest">
+<head>
+ <script src="THIS_FILE_DOES_NOT_EXIST.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ var isParentFrame = window == window.top;
+
+ if (isParentFrame) {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+ }
+
+ window.onmessage = function() {
+ document.getElementById('result').innerHTML = "SUCCESS";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ } else {
+ window.applicationCache.onchecking = function() {
+ parent.postMessage("hello", "*");
+ parent.killChildFrame();
+ }
+ }
+
+ function killChildFrame() {
+ document.body.removeChild(document.getElementsByTagName("iframe")[0]);
+ }
+ </script>
+</head>
+<body>
+<p>Test the destruction of an iframe while deferred events are being raised does not crash the system.</p>
+<div id="result">FAILURE</div>
+<iframe src="deferred-events-delete-while-raising.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/deferred-events-expected.txt b/LayoutTests/http/tests/appcache/deferred-events-expected.txt
new file mode 100644
index 0000000..45af0af
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/deferred-events-expected.txt
@@ -0,0 +1,2 @@
+Test that AppicationCache events are deferred until after onload has been fired.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/deferred-events.html b/LayoutTests/http/tests/appcache/deferred-events.html
new file mode 100644
index 0000000..ba9cf83
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/deferred-events.html
@@ -0,0 +1,24 @@
+<html manifest="THIS_FILE_DOES_NOT_EXIST.manifest">
+<head>
+ <script type="text/javascript">
+ var onloadHasBeenCalled = false;
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+ }
+
+ window.applicationCache.onchecking = function() {
+ if (onloadHasBeenCalled)
+ document.getElementById('result').innerHTML = "SUCCESS"
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ </script>
+ <script src="THIS_FILE_DOES_NOT_EXIST.js" type="text/javascript"></script>
+</head>
+<body onload="onloadHasBeenCalled = true">
+Test that AppicationCache events are deferred until after onload has been fired.
+<div id="result">FAILURE</div>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/destroyed-frame-expected.txt b/LayoutTests/http/tests/appcache/destroyed-frame-expected.txt
new file mode 100644
index 0000000..7050859
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/destroyed-frame-expected.txt
@@ -0,0 +1,5 @@
+Test for bug 33813: Crash when using DOMApplicationCache from a destroyed frame.
+
+PASS if didn't crash.
+
+
diff --git a/LayoutTests/http/tests/appcache/destroyed-frame.html b/LayoutTests/http/tests/appcache/destroyed-frame.html
new file mode 100644
index 0000000..c1dd731
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/destroyed-frame.html
@@ -0,0 +1,52 @@
+<body onload="test()">
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=33813">bug 33813</a>: Crash when using DOMApplicationCache from a destroyed frame.</p>
+<p>PASS if didn't crash.</p>
+<iframe src="about:blank"></iframe>
+
+<script>
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
+ var s = new String("");
+ }
+}
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+var ifrCache;
+
+function test()
+{
+ ifrCache = frames[0].applicationCache;
+ document.body.removeChild(document.getElementsByTagName("iframe")[0]);
+ setTimeout(function() {
+ gc();
+ ifrCache.onchecking = function() { }
+ ifrCache.onerror = function() { }
+ ifrCache.onnoupdate = function() { }
+ ifrCache.ondownloading = function() { }
+ ifrCache.onprogress = function() { }
+ ifrCache.onupdateready = function() { }
+ ifrCache.oncached = function() { }
+ ifrCache.onobsolete = function() { }
+ ifrCache.addEventListener("error", function() { }, true);
+
+ var evt = document.createEvent("Event");
+ evt.initEvent("error", true, true);
+ ifrCache.dispatchEvent(evt);
+
+ try { ifrCache.update(); } catch (ex) { }
+ try { ifrCache.swapCache(); } catch (ex) { }
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 0);
+}
+</script>
diff --git a/LayoutTests/http/tests/appcache/detached-iframe-expected.txt b/LayoutTests/http/tests/appcache/detached-iframe-expected.txt
new file mode 100644
index 0000000..1290b75
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/detached-iframe-expected.txt
@@ -0,0 +1,3 @@
+Test that accessing a detached iframe's applicationCache window property doesn't assert. If you don't see an assert, it passed.
+
+
diff --git a/LayoutTests/http/tests/appcache/detached-iframe.html b/LayoutTests/http/tests/appcache/detached-iframe.html
new file mode 100644
index 0000000..ce6aecf
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/detached-iframe.html
@@ -0,0 +1,15 @@
+<body onload = "test()">
+<p>Test that accessing a detached iframe's applicationCache window property doesn't assert. If you don't see an assert, it passed.</p>
+<iframe src="about:blank"></iframe>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function test()
+{
+ var ifr = frames[0];
+ document.body.removeChild(document.getElementsByTagName("iframe")[0]);
+ ifr.applicationCache;
+}
+</script>
+</body>
diff --git a/LayoutTests/http/tests/appcache/different-origin-manifest-expected.txt b/LayoutTests/http/tests/appcache/different-origin-manifest-expected.txt
new file mode 100644
index 0000000..d08f58e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/different-origin-manifest-expected.txt
@@ -0,0 +1,3 @@
+Test that a different origin manifest is completely ignored.
+
+PASS
diff --git a/LayoutTests/http/tests/appcache/different-origin-manifest.html b/LayoutTests/http/tests/appcache/different-origin-manifest.html
new file mode 100644
index 0000000..b58c10a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/different-origin-manifest.html
@@ -0,0 +1,36 @@
+<html manifest="http://localhost:8000/appcache/resources/empty.manifest">
+<p>Test that a different origin manifest is completely ignored.</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+}
+
+var result = document.getElementById("result");
+var originalResult = result.innerHTML;
+
+try {
+ applicationCache.onchecking = function() { result.innerHTML += "FAIL: onchecking called. " }
+ applicationCache.onerror = function() { result.innerHTML += "FAIL: onerror called" }
+ applicationCache.onnoupdate = function() { result.innerHTML += "FAIL: onnoupdate called" }
+ applicationCache.ondownloading = function() { result.innerHTML += "FAIL: ondownloading called" }
+ applicationCache.onprogress = function() { result.innerHTML += "FAIL: onprogress called" }
+ applicationCache.onupdateready = function() { result.innerHTML += "FAIL: onupdateready called" }
+ applicationCache.oncached = function() { result.innerHTML += "FAIL: oncached called" }
+ applicationCache.onobsolete = function() { result.innerHTML += "FAIL: onobsolete called" }
+} catch (ex) {
+ result.innerHTML += "FAIL: " + ex;
+}
+function done()
+{
+ if (result.innerHTML == originalResult)
+ result.innerHTML = applicationCache.status == applicationCache.UNCACHED ? "PASS" : "FAIL: cache status in not UNCACHED";
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+setTimeout(done, 100);
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/different-scheme-expected.txt b/LayoutTests/http/tests/appcache/different-scheme-expected.txt
new file mode 100644
index 0000000..3c2462b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/different-scheme-expected.txt
@@ -0,0 +1,3 @@
+Test that application cache doesn't block loading resources with different schemes.
+
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/different-scheme.html b/LayoutTests/http/tests/appcache/different-scheme.html
new file mode 100644
index 0000000..c874097
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/different-scheme.html
@@ -0,0 +1,28 @@
+<html manifest="resources/different-scheme.manifest">
+<body>
+<p>Test that application cache doesn't block loading resources with different schemes.</p>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function test()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "javascript:parent.success(), 'PASS'");
+ document.body.appendChild(ifr);
+}
+
+function success()
+{
+ document.body.replaceChild(document.createTextNode("SUCCESS"), document.getElementsByTagName("iframe")[0]);
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.oncached = test;
+applicationCache.onnoupdate = test;
+</script>
+<body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/disabled-expected.txt b/LayoutTests/http/tests/appcache/disabled-expected.txt
new file mode 100644
index 0000000..743bc6a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/disabled-expected.txt
@@ -0,0 +1,4 @@
+Test to ensure the the window.applicationCache attribute is defined but non-functional with the feature disabled.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/disabled.html b/LayoutTests/http/tests/appcache/disabled.html
new file mode 100644
index 0000000..e89752a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/disabled.html
@@ -0,0 +1,51 @@
+<html>
+<body>
+<p>Test to ensure the the window.applicationCache attribute is defined but non-functional with the feature disabled.</p>
+<div id=result></div>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.overridePreference("WebKitOfflineWebApplicationCacheEnabled", false);
+ layoutTestController.dumpAsText();
+ }
+
+ function log(message)
+ {
+ document.getElementById("result").innerHTML += message + "<br>";
+ }
+
+ function isDefined() {
+ if (window.applicationCache)
+ return true;
+ else
+ return false;
+ }
+
+ function statusIsUncached() {
+ return applicationCache.status == 0;
+ }
+
+ function swapThrows() {
+ try {
+ applicationCache.swapCache();
+ return false;
+ } catch(e) {
+ return true;
+ }
+ }
+
+ function updateThrows() {
+ try {
+ applicationCache.swapCache();
+ return false;
+ } catch(e) {
+ return true;
+ }
+ }
+
+ if (isDefined() && statusIsUncached() && swapThrows() && updateThrows())
+ log("SUCCESS");
+ else
+ log("FAILURE");
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/dynamic-entries-no-cache-expected.txt b/LayoutTests/http/tests/appcache/dynamic-entries-no-cache-expected.txt
new file mode 100644
index 0000000..6aad145
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/dynamic-entries-no-cache-expected.txt
@@ -0,0 +1,27 @@
+Test the behavior of DOMApplicationCache methods related to dynamic entries when the context is not associated with any cache.
+
+PASS: applicationCache.items.length is 0
+PASS: applicationCache.items.item(0) is null
+PASS: applicationCache.items.item(1) is null
+PASS: applicationCache.items.item(0xffffffff) is null
+PASS: applicationCache.items.item(0xfffffffe) is null
+PASS: applicationCache.items.item(-1) is null
+PASS: applicationCache.items.item(-2) is null
+PASS: applicationCache.items[0xfffffffe] is undefined
+PASS: applicationCache.items[0xffffffff] is undefined
+PASS: applicationCache.items['0'] is undefined
+PASS: applicationCache.items[''] is undefined
+PASS: applicationCache.items[0] is undefined
+PASS: applicationCache.items[1] is undefined
+PASS: applicationCache.items[-1] is undefined
+PASS: applicationCache.items[-2] is undefined
+PASS: applicationCache.items[100] is undefined
+PASS: applicationCache.items['100'] is undefined
+PASS: applicationCache.items['foo'] is undefined
+PASS: applicationCache.items[0.1] is undefined
+PASS: hasItem raised INVALID_STATE_ERR
+PASS: add raised INVALID_STATE_ERR
+PASS: remove raised INVALID_STATE_ERR
+PASS: applicationCache.items.length is 0
+DONE
+
diff --git a/LayoutTests/http/tests/appcache/dynamic-entries-no-cache.html-disabled b/LayoutTests/http/tests/appcache/dynamic-entries-no-cache.html-disabled
new file mode 100644
index 0000000..ed6e599
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/dynamic-entries-no-cache.html-disabled
@@ -0,0 +1,119 @@
+<body>
+<p>Test the behavior of DOMApplicationCache methods related to dynamic entries when the context
+is not associated with any cache.</p>
+<div id="result"></div>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+
+function isResultCorrect(_actual, _expected)
+{
+ if (_expected === 0)
+ return _actual === _expected && (1/_actual) === (1/_expected);
+ if (_actual === _expected)
+ return true;
+ if (typeof(_expected) == "number" && isNaN(_expected))
+ return typeof(_actual) == "number" && isNaN(_actual);
+ if (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([])) {
+ log("Array comparison is not supported");
+ return false;
+ }
+ return false;
+}
+
+function shouldBe(_a, _b)
+{
+ if (typeof _a != "string" || typeof _b != "string")
+ log("WARN: shouldBe() expects string arguments");
+ var exception;
+ var _av;
+ try {
+ _av = eval(_a);
+ } catch (e) {
+ exception = e;
+ }
+ var _bv = eval(_b);
+
+ if (exception)
+ log("FAIL: " + _a + " should be " + _bv + ". Threw exception " + exception);
+ else if (isResultCorrect(_av, _bv))
+ log("PASS: " + _a + " is " + _b);
+ else if (typeof(_av) == typeof(_bv))
+ log("FAIL: " + _a + " should be " + _bv + ". Was " + stringify(_av) + ".");
+ else
+ log("FAIL: " + _a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
+}
+
+
+shouldBe("applicationCache.items.length", "0");
+shouldBe("applicationCache.items.item(0)", "null");
+shouldBe("applicationCache.items.item(1)", "null");
+shouldBe("applicationCache.items.item(0xffffffff)", "null");
+shouldBe("applicationCache.items.item(0xfffffffe)", "null");
+shouldBe("applicationCache.items.item(-1)", "null");
+shouldBe("applicationCache.items.item(-2)", "null");
+
+shouldBe("applicationCache.items[0xfffffffe]", "undefined");
+shouldBe("applicationCache.items[0xffffffff]", "undefined");
+
+// The below index access tests give different results in WebKit and Firefox 3.1b2 (undefined vs. empty string).
+shouldBe("applicationCache.items['0']", "undefined");
+shouldBe("applicationCache.items['']", "undefined");
+shouldBe("applicationCache.items[0]", "undefined");
+shouldBe("applicationCache.items[1]", "undefined");
+shouldBe("applicationCache.items[-1]", "undefined");
+shouldBe("applicationCache.items[-2]", "undefined");
+applicationCache.items[100] = "foobar";
+applicationCache.items['100'] = "foobar";
+applicationCache.items['foo'] = "bar";
+shouldBe("applicationCache.items[100]", "undefined");
+shouldBe("applicationCache.items['100']", "undefined");
+
+shouldBe("applicationCache.items['foo']", "undefined");
+shouldBe("applicationCache.items[0.1]", "undefined");
+
+try {
+ applicationCache.hasItem('foo');
+ log("FAIL: hasItem didn't raise an exception");
+} catch (ex) {
+ if (ex.code == 11)
+ log("PASS: hasItem raised INVALID_STATE_ERR");
+ else
+ log("FAIL: hasItem raised unexpected exception " + ex);
+}
+
+try {
+ applicationCache.add('foo');
+ log("FAIL: add didn't raise an exception");
+} catch (ex) {
+ if (ex.code == 11)
+ log("PASS: add raised INVALID_STATE_ERR");
+ else
+ log("FAIL: add raised unexpected exception " + ex);
+}
+
+try {
+ applicationCache.remove('bar');
+ log("FAIL: remove didn't raise an exception");
+} catch (ex) {
+ if (ex.code == 11)
+ log("PASS: remove raised INVALID_STATE_ERR");
+ else
+ log("FAIL: remove raised unexpected exception " + ex);
+}
+
+shouldBe("applicationCache.items.length", "0");
+
+
+
+log("DONE");
+
+</script>
+</head>
+</body>
diff --git a/LayoutTests/http/tests/appcache/empty-manifest-expected.txt b/LayoutTests/http/tests/appcache/empty-manifest-expected.txt
new file mode 100644
index 0000000..bba93cf
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/empty-manifest-expected.txt
@@ -0,0 +1,2 @@
+This tests that the cached event gets sent even if the manifest is empty.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/empty-manifest.html b/LayoutTests/http/tests/appcache/empty-manifest.html
new file mode 100644
index 0000000..67752e6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/empty-manifest.html
@@ -0,0 +1,23 @@
+<html manifest="resources/empty.manifest">
+
+<div>This tests that the cached event gets sent even if the manifest is empty.</div>
+<div id="result">FAILURE</div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function cached()
+{
+ document.getElementById('result').innerHTML = 'SUCCESS';
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/fail-on-update-expected.txt b/LayoutTests/http/tests/appcache/fail-on-update-expected.txt
new file mode 100644
index 0000000..cd15247
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/fail-on-update-expected.txt
@@ -0,0 +1 @@
+SUCCESS: No crash.
diff --git a/LayoutTests/http/tests/appcache/fail-on-update.html b/LayoutTests/http/tests/appcache/fail-on-update.html
new file mode 100644
index 0000000..b021fcc
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/fail-on-update.html
@@ -0,0 +1,47 @@
+<html manifest="resources/fail-on-update.php">
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function setManifestDeleted(state)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "resources/fail-on-update.php?command=" + (state ? "delete" : "reset"), false);
+ req.send(null);
+}
+
+function test()
+{
+ clearTimeout(timeoutId);
+
+ setManifestDeleted(true);
+ applicationCache.update();
+ window.location = 'data:text/html,<p>SUCCESS: No crash.</p>' +
+ '<script>' +
+ 'if (window.layoutTestController) layoutTestController.notifyDone();' +
+ '</scri' + 'pt>';
+}
+
+function resetManifest()
+{
+ if (applicationCache.status != applicationCache.UNCACHED && applicationCache.status != applicationCache.OBSOLETE) {
+ timeoutId = setTimeout(resetManifest, 100);
+ return;
+ }
+
+ setManifestDeleted(false);
+ location.reload();
+}
+
+applicationCache.addEventListener('noupdate', function() { setTimeout(test, 0) }, false);
+applicationCache.addEventListener('cached', function() { setTimeout(test, 0) }, false);
+
+// If the manifest script happened to be in a wrong state, reset it.
+var timeoutId = setTimeout(resetManifest, 100);
+
+</script>
+<p>Test for a particular incorrect assertion failure.</p>
+
+</html>
diff --git a/LayoutTests/http/tests/appcache/fallback-expected.txt b/LayoutTests/http/tests/appcache/fallback-expected.txt
new file mode 100644
index 0000000..6dc0f5a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/fallback-expected.txt
@@ -0,0 +1,6 @@
+Test application cache fallback entries.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/fallback.html b/LayoutTests/http/tests/appcache/fallback.html
new file mode 100644
index 0000000..aaf7a82
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/fallback.html
@@ -0,0 +1,171 @@
+<html manifest="resources/fallback.manifest">
+<body>
+<p>Test application cache fallback entries.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+var hadError = false;
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function setNetworkEnabled(state)
+{
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"), false);
+ req.send("");
+ } catch (ex) {
+ log("Cannot access network simulator URL");
+ hadError = true;
+ }
+}
+
+function canLoad(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send("");
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+function load(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send("");
+ return req.responseText;
+ } catch (ex) {
+ alert("Unexpected error loading " + url + ": " + ex);
+ hadError = true;
+ }
+}
+
+var testURL = "/resources/network-simulator.php?path=/appcache/resources/not-in-cache.txt";
+var nonexistentURL = "resources/does-not-exist";
+var redirectURL = "resources/fallback-redirect.php";
+
+function test()
+{
+ applicationCache.onnoupdate = function() { log("FAIL: received unexpected noupdate event") }
+ applicationCache.oncached = function() { log("FAIL: received unexpected cached event") }
+
+ setNetworkEnabled(true);
+
+ if (!canLoad(testURL) || !/not in the cache/.test(load(testURL))) {
+ log("FAIL: Cannot load an URL from fallback namespace when network is enabled");
+ hadError = true;
+ }
+
+ if (!canLoad(nonexistentURL) || load(nonexistentURL) != "Hello, World!") {
+ log("FAIL: Fallback resource wasn't used for a 404 response");
+ hadError = true;
+ }
+
+ if (!canLoad(redirectURL) || load(redirectURL) != "Hello, World!") {
+ log("FAIL: Fallback resource wasn't used for a redirect to a resource with another origin");
+ hadError = true;
+ }
+
+ test2();
+}
+
+function test2()
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", nonexistentURL);
+ req.onerror = function() {
+ log("FAIL: Fallback resource wasn't used for a 404 response (async)");
+ hadError = true;
+ test3();
+ }
+ req.onload = function() {
+ if (req.responseText != "Hello, World!") {
+ log("FAIL: Unexpected result for a 404 response (async)");
+ hadError = true;
+ }
+ test3();
+ }
+
+ req.send("");
+}
+
+function test3()
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", redirectURL);
+ req.onerror = function() {
+ log("FAIL: Fallback resource wasn't used for a redirect to a resource with another origin (async)");
+ hadError = true;
+ test4();
+ }
+ req.onload = function() {
+ if (req.responseText != "Hello, World!") {
+ log("FAIL: Unexpected result for a redirect response (async)");
+ hadError = true;
+ }
+ test4();
+ }
+
+ req.send("");
+}
+
+function test4()
+{
+ // Try loading a fallback resource as main one.
+
+ applicationCache.onnoupdate = test5;
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", nonexistentURL);
+ document.body.appendChild(ifr);
+}
+
+function test5()
+{
+ if (!/Hello, World/.test(window.frames[0].document.documentElement.innerHTML)) {
+ log("FAIL: Fallback URL was not honored for main resource");
+ hadError = true;
+ }
+ test6();
+}
+
+function test6()
+{
+ setNetworkEnabled(false);
+
+ if (!canLoad(testURL)) {
+ log("FAIL: Cannot load an URL from fallback namespace when network is disabled");
+ hadError = true;
+ } else if (load(testURL) != load("resources/simple.txt")) {
+ log("FAIL: Loading an URL from fallback namespace when network is disabled returned unexpected response");
+ hadError = true;
+ }
+
+ log(hadError ? "FAILURE" : "SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt b/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt
new file mode 100644
index 0000000..64d4de2
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/foreign-iframe-main-expected.txt
@@ -0,0 +1,10 @@
+Test for <rdar://problem/6284708> AppCache crashes in ApplicationCacheResource::addType().
+
+checking
+downloading
+progress
+progress
+progress
+cached
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/foreign-iframe-main.html b/LayoutTests/http/tests/appcache/foreign-iframe-main.html
new file mode 100644
index 0000000..a543eef
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/foreign-iframe-main.html
@@ -0,0 +1,39 @@
+<html manifest="resources/foreign-iframe.manifest"> <!-- Any manifest would do the trick. -->
+<body>
+<p>Test for <a href="rdar://problem/6284708">&lt;rdar://problem/6284708></a> AppCache crashes in ApplicationCacheResource::addType().</p>
+
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "http://localhost:8000/appcache/resources/foreign-iframe.html");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.addEventListener('checking', function() { log("checking") }, false);
+applicationCache.addEventListener('error', function() { log("error") }, false);
+applicationCache.addEventListener('downloading', function() { log("downloading") }, false);
+applicationCache.addEventListener('progress', function() { log("progress") }, false);
+applicationCache.addEventListener('updateready', function() { log("updateready") }, false);
+applicationCache.addEventListener('obsolete', function() { log("obsolete") }, false);
+
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); test() }, false);
+applicationCache.addEventListener('cached', function() { log("cached"); test() }, false);
+
+window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/idempotent-update-expected.txt b/LayoutTests/http/tests/appcache/idempotent-update-expected.txt
new file mode 100644
index 0000000..6fa942a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/idempotent-update-expected.txt
@@ -0,0 +1,6 @@
+Test what applicationCache.update() does if update is already in progess.
+
+Should say DONE, with no failures:
+
+DONE
+
diff --git a/LayoutTests/http/tests/appcache/idempotent-update.html b/LayoutTests/http/tests/appcache/idempotent-update.html
new file mode 100644
index 0000000..652369d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/idempotent-update.html
@@ -0,0 +1,56 @@
+<html manifest="resources/idempotent-update.manifest">
+<body>
+<p>Test what applicationCache.update() does if update is already in progess.</p>
+<p>Should say DONE, with no failures:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ // During update, additional update() should be no-op (the spec says that fake checking and
+ // downloading events need to be dispatched, but that's only when the update algorithm is invoked
+ // with a browsing context).
+ if (applicationCache.status != applicationCache.IDLE)
+ log("FAIL: Unexpected cache status while preparing to test: " + applicationCache.status);
+
+ var checkingCount = 0;
+ applicationCache.onchecking = function() { if (++checkingCount != 1) log("FAIL: Too many checking events received.") }
+
+ applicationCache.update();
+ applicationCache.update();
+ applicationCache.update();
+ applicationCache.update();
+ applicationCache.update();
+
+ applicationCache.onnoupdate = done;
+ applicationCache.oncached = function() { log("FAIL: received unexpected cached event") }
+}
+
+function done()
+{
+ setTimeout(function() {
+ log("DONE");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 10);
+}
+
+applicationCache.oncached = test;
+applicationCache.onnoupdate = test;
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/local-content-expected.txt b/LayoutTests/http/tests/appcache/local-content-expected.txt
new file mode 100644
index 0000000..5c1aa37
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/local-content-expected.txt
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: line 0: Not allowed to load local resource: stdio.h
+Test that documents loaded from application cache don't get access to local resources accidentally.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/local-content.html b/LayoutTests/http/tests/appcache/local-content.html
new file mode 100644
index 0000000..0787567
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/local-content.html
@@ -0,0 +1,51 @@
+<html manifest="resources/local-content.manifest">
+<body>
+<p>Test that documents loaded from application cache don't get access to local resources accidentally.</p>
+<p>Should say SUCCESS:</p>
+<div id="result"></div>
+<script type="text/javascript">
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function noupdate()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "file:///usr/include/stdio.h");
+ ifr.onload = frameCreated;
+ setTimeout(function() {
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }, 300);
+
+ document.body.appendChild(ifr);
+}
+
+function frameCreated()
+{
+ log("FAILURE: A local resource was opened in an iframe");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function reload()
+{
+ // Reload to ensure that the main document was loaded from application cache.
+ window.location.reload();
+}
+
+applicationCache.addEventListener('noupdate', noupdate, false);
+
+applicationCache.addEventListener('cached', reload, false);
+applicationCache.addEventListener('error', function() { alert("Unexpected error event") }, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/main-resource-hash-expected.txt b/LayoutTests/http/tests/appcache/main-resource-hash-expected.txt
new file mode 100644
index 0000000..50f4f71
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/main-resource-hash-expected.txt
@@ -0,0 +1,6 @@
+Test that offline applications' main resources are not affected by URL hashes.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/main-resource-hash.html b/LayoutTests/http/tests/appcache/main-resource-hash.html
new file mode 100644
index 0000000..6dbce36
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/main-resource-hash.html
@@ -0,0 +1,51 @@
+<html>
+<body>
+<p>Test that offline applications' main resources are not affected by URL hashes.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function setNetworkEnabled(state)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"), false);
+ req.send("");
+}
+
+function frameCreated()
+{
+ if (stage == 0) {
+ stage = 1;
+ setNetworkEnabled(false);
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "/resources/network-simulator.php?path=/appcache/resources/main-resource-hash-frame.html#bar");
+ document.body.appendChild(ifr);
+ } else {
+ log("SUCCESS");
+ setNetworkEnabled(true);
+ if (window.layoutTestController)
+ layoutTestController.notifyDone()
+ }
+}
+
+window.addEventListener("message", frameCreated, false);
+
+var stage = 0;
+setNetworkEnabled(true);
+var ifr = document.createElement("iframe");
+ifr.setAttribute("src", "/resources/network-simulator.php?path=/appcache/resources/main-resource-hash-frame.html#foo");
+document.body.appendChild(ifr);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/manifest-containing-itself-expected.txt b/LayoutTests/http/tests/appcache/manifest-containing-itself-expected.txt
new file mode 100644
index 0000000..77e2506
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-containing-itself-expected.txt
@@ -0,0 +1,2 @@
+This tests that a manifest can contain itself as a resource.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/manifest-containing-itself.html b/LayoutTests/http/tests/appcache/manifest-containing-itself.html
new file mode 100644
index 0000000..89a5410
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-containing-itself.html
@@ -0,0 +1,24 @@
+<html manifest="resources/manifest-containing-itself.manifest">
+
+<div>This tests that a manifest can contain itself as a resource.</div>
+<div id="result">FAILURE</div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function cached()
+{
+ document.getElementById('result').innerHTML = 'SUCCESS';
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', cached, false);
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/manifest-parsing-expected.txt b/LayoutTests/http/tests/appcache/manifest-parsing-expected.txt
new file mode 100644
index 0000000..fc15310
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-parsing-expected.txt
@@ -0,0 +1,4 @@
+Test application cache manifest parsing.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/manifest-parsing.html b/LayoutTests/http/tests/appcache/manifest-parsing.html
new file mode 100644
index 0000000..46a7fdd
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-parsing.html
@@ -0,0 +1,66 @@
+<html manifest="resources/manifest-parsing.manifest">
+<body>
+<p>Test application cache manifest parsing.</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function canLoad(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send();
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+function test()
+{
+ var hadError = false;
+
+ // Check that section name wasn't misparsed as resource URL.
+ if (canLoad("resources/UNKNOWN:")) {
+ log("Loaded 'UNKNOWN:'");
+ hadError = true;
+ }
+
+ // Load a resource that was in UNKNOWN section - in other words, that is not in cache.
+ if (canLoad("resources/not-in-cache.txt")) {
+ log("Loaded 'not-in-cache.txt'");
+ hadError = true;
+ }
+
+ // Load resources were specified with tricky whitespace.
+ if (!canLoad("resources/empty.txt")) {
+ log("Could not load 'empty.txt'");
+ hadError = true;
+ }
+ if (!canLoad("resources/simple.txt")) {
+ log("Could not load 'simple.txt'");
+ hadError = true;
+ }
+
+ log(hadError ? "FAILURE" : "SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onerror = function() { log("error") }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/manifest-redirect-2-expected.txt b/LayoutTests/http/tests/appcache/manifest-redirect-2-expected.txt
new file mode 100644
index 0000000..420e94b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-redirect-2-expected.txt
@@ -0,0 +1,6 @@
+Test that a redirect makes resource caching fail.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/manifest-redirect-2.html b/LayoutTests/http/tests/appcache/manifest-redirect-2.html
new file mode 100644
index 0000000..7c00d41
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-redirect-2.html
@@ -0,0 +1,40 @@
+<html manifest="resources/manifest-redirect-2.php">
+<body>
+<p>Test that a redirect makes resource caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/manifest-redirect-expected.txt b/LayoutTests/http/tests/appcache/manifest-redirect-expected.txt
new file mode 100644
index 0000000..420e94b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-redirect-expected.txt
@@ -0,0 +1,6 @@
+Test that a redirect makes resource caching fail.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/manifest-redirect.html b/LayoutTests/http/tests/appcache/manifest-redirect.html
new file mode 100644
index 0000000..3f75547
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-redirect.html
@@ -0,0 +1,40 @@
+<html manifest="resources/manifest-redirect.php">
+<body>
+<p>Test that a redirect makes resource caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/manifest-with-empty-file-expected.txt b/LayoutTests/http/tests/appcache/manifest-with-empty-file-expected.txt
new file mode 100644
index 0000000..3cf2ce6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-with-empty-file-expected.txt
@@ -0,0 +1,2 @@
+This tests that a manifest that contains an empty file will not crash the browser.
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/manifest-with-empty-file.html b/LayoutTests/http/tests/appcache/manifest-with-empty-file.html
new file mode 100644
index 0000000..b9ae051
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/manifest-with-empty-file.html
@@ -0,0 +1,21 @@
+<html manifest="resources/manifest-with-empty-file.manifest">
+<div>This tests that a manifest that contains an empty file will not crash the browser.</div>
+<div id="result">FAILURE</div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function cached()
+{
+ document.getElementById('result').innerHTML = 'SUCCESS';
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+
+</script>
+
+</html>
diff --git a/LayoutTests/http/tests/appcache/max-size-expected.txt b/LayoutTests/http/tests/appcache/max-size-expected.txt
new file mode 100644
index 0000000..b915156
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/max-size-expected.txt
@@ -0,0 +1,4 @@
+Cache a manifest that contains a resource that is too large to fit. The layout test controller sets a maximum size of 10KB for the application cache database file.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/max-size.html b/LayoutTests/http/tests/appcache/max-size.html
new file mode 100644
index 0000000..8f4e855
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/max-size.html
@@ -0,0 +1,28 @@
+<html manifest="resources/maxsize.manifest">
+<body>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.setAppCacheMaximumSize(10 * 1024);
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function log(message)
+ {
+ document.getElementById("result").innerHTML += message + "<br>";
+ if (window.layoutTestController) {
+ layoutTestController.setAppCacheMaximumSize(100 * 1024 * 1024);
+ layoutTestController.notifyDone();
+ }
+ }
+
+ applicationCache.onerror = function() { log("SUCCESS"); }
+ applicationCache.oncached = function() { log("FAIL: received unexpected cached event"); }
+ applicationCache.onnoupdate = function() { log("FAIL: received unexpected onnoupdate event"); }
+ applicationCache.onupdateready = function() { log("FAIL: received unexpected onupdateready event"); }
+</script>
+
+<p>Cache a manifest that contains a resource that is too large to fit. The layout test controller sets a maximum size of 10KB for the application cache database file.</p>
+<div id=result></div>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress-expected.txt b/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress-expected.txt
new file mode 100644
index 0000000..ca09f7e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress-expected.txt
@@ -0,0 +1,2 @@
+This tests that navigating away while a cache is loading does not crash.
+SUCCESS - did not crash
diff --git a/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress.html b/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress.html
new file mode 100644
index 0000000..7e7920a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/navigating-away-while-cache-attempt-in-progress.html
@@ -0,0 +1,21 @@
+<html manifest="resources/navigating-away-while-cache-attempt-in-progress.manifest">
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function navigateAway() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ else
+ window.location.href = "about:blank"
+}
+
+setTimeout(navigateAway, 1000);
+
+</script>
+<div>This tests that navigating away while a cache is loading does not crash.</div>
+<div>SUCCESS - did not crash</div>
+</html>
diff --git a/LayoutTests/http/tests/appcache/non-html-expected.txt b/LayoutTests/http/tests/appcache/non-html-expected.txt
new file mode 100644
index 0000000..7c0e8c4
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/non-html-expected.txt
@@ -0,0 +1,6 @@
+Test that non-HTML main resources work with application cache correctly.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/non-html.xhtml b/LayoutTests/http/tests/appcache/non-html.xhtml
new file mode 100644
index 0000000..d27681e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/non-html.xhtml
@@ -0,0 +1,103 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ manifest="/resources/network-simulator.php?path=/appcache/resources/non-html.manifest">
+<head><title/></head>
+<body>
+<p>Test that non-HTML main resources work with application cache correctly.</p>
+<p>Should say SUCCESS:</p>
+<div id="result"></div>
+<script type="text/javascript">
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "&lt;br/>";
+}
+
+function setNetworkEnabled(state)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"), false);
+ req.send("");
+}
+
+function createFrame()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "/resources/network-simulator.php?path=/appcache/resources/abe.png");
+ ifr.onload = frameCreated;
+ document.body.appendChild(ifr);
+}
+
+function cached()
+{
+ var hadError = false;
+
+ applicationCache.removeEventListener('noupdate', cached, false);
+ applicationCache.removeEventListener('cached', cached, false);
+
+ setNetworkEnabled(false);
+
+ // Load a resource that does not exist in the cache.
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "/resources/network-simulator.php?path=/appcache/resources/not-in-cache.txt", false);
+ req.send();
+ } catch (e) {
+ if (e.code == XMLHttpRequestException.NETWORK_ERR)
+ hadError = true;
+ }
+
+ if (!hadError) {
+ document.getElementById('result').innerHTML = "FAILURE: Did not get the right exception"
+ return;
+ }
+
+ // Load a resource that exists in the cache.
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "/resources/network-simulator.php?path=/appcache/resources/simple.txt", false);
+ req.send();
+ } catch (e) {
+ document.getElementById('result').innerHTML = "FAILURE: Could not load data from cache"
+ return;
+ }
+
+ if (req.responseText != 'Hello, World!') {
+ document.getElementById('result').innerHTML = "FAILURE: Did not get correct data from cached resource"
+ return;
+ }
+
+ createFrame();
+}
+
+function frameCreated()
+{
+ setNetworkEnabled(true);
+
+ if (frames[0].document.documentElement.innerHTML.match(/abe\.png/))
+ log("SUCCESS")
+ else
+ log("FAIL: Frame.onload was called, but the image doesn't seem to be loaded.");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function error()
+{
+ // The simulator was in a wrong state, reset it.
+ setNetworkEnabled(true);
+ window.location.reload();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', cached, false);
+
+applicationCache.addEventListener('error', error, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/offline-access-expected.txt b/LayoutTests/http/tests/appcache/offline-access-expected.txt
new file mode 100644
index 0000000..0fcc923
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/offline-access-expected.txt
@@ -0,0 +1,6 @@
+Test that offline applications work when there is no network access (simulated).
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/offline-access.html b/LayoutTests/http/tests/appcache/offline-access.html
new file mode 100644
index 0000000..45e9d4e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/offline-access.html
@@ -0,0 +1,57 @@
+<html>
+<body>
+<p>Test that offline applications work when there is no network access (simulated).</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function setNetworkEnabled(state)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"), false);
+ req.send("");
+}
+
+function createFrame()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "/resources/network-simulator.php?path=/appcache/resources/offline-access-frame.html");
+ document.body.appendChild(ifr);
+}
+
+function frameCreated()
+{
+ if (stage == 0) {
+ stage = 1;
+ setNetworkEnabled(false);
+ createFrame();
+ } else if (stage == 1) {
+ stage = 2;
+ setNetworkEnabled(true);
+ createFrame();
+ } else {
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone()
+ }
+}
+
+window.addEventListener("message", frameCreated, false);
+
+var stage = 0;
+setNetworkEnabled(true);
+createFrame();
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/online-whitelist-expected.txt b/LayoutTests/http/tests/appcache/online-whitelist-expected.txt
new file mode 100644
index 0000000..a605108
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/online-whitelist-expected.txt
@@ -0,0 +1,4 @@
+Test online whitelist functionality. Should say PASS:
+
+PASS
+
diff --git a/LayoutTests/http/tests/appcache/online-whitelist.html b/LayoutTests/http/tests/appcache/online-whitelist.html
new file mode 100644
index 0000000..f33fb6d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/online-whitelist.html
@@ -0,0 +1,77 @@
+<html manifest="resources/online-whitelist.manifest">
+<body>
+<p>Test online whitelist functionality. Should say PASS:</p>
+
+<div id="result"></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+var hadError = false;
+
+function canLoad(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send("");
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+function load(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send("");
+ return req.responseText;
+ } catch (ex) {
+ alert("Unexpected error loading " + url + ": " + ex);
+ hadError = true;
+ }
+}
+
+function test()
+{
+ if (load("resources/counter.php?cached") != load("resources/counter.php?cached")) {
+ log("FAIL: Explicit entry didn't override online whitelist.");
+ hadError = true;
+ }
+
+ if (load("resources/counter.php?uncached") == load("resources/counter.php?uncached")) {
+ log("FAIL: Online whitelist resource wasn't reloaded from network.");
+ hadError = true;
+ }
+
+ if (load("resources/counter.php?uncachedxxx") == load("resources/counter.php?uncachedxxx")) {
+ log("FAIL: Online whitelist resource wasn't reloaded from network (prefix matching).");
+ hadError = true;
+ }
+
+ if (canLoad("resources/counter.php?foobar")) {
+ log("FAIL: Uncached resource was successfully loaded.");
+ hadError = true;
+ }
+
+ log(hadError ? "FAIL" : "PASS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', test, false);
+applicationCache.addEventListener('noupdate', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/reload-expected.txt b/LayoutTests/http/tests/appcache/reload-expected.txt
new file mode 100644
index 0000000..7bfc07b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/reload-expected.txt
@@ -0,0 +1,8 @@
+Test that the manifest is picked correctly when reloading.
+
+Should say SUCCESS:
+
+Frame loaded
+Frame loaded
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/reload.html b/LayoutTests/http/tests/appcache/reload.html
new file mode 100644
index 0000000..6e2da56
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/reload.html
@@ -0,0 +1,40 @@
+<html>
+<body>
+<p>Test that the manifest is picked correctly when reloading.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+var state = 0;
+function receivedMessage(message)
+{
+ log(message);
+
+ if (state == 0) {
+ state = 1;
+ setTimeout("frames[0].location.reload()", 0);
+ } else if (state == 1) {
+ state = 2;
+ setTimeout("frames[0].test()", 0);
+ } else if (state == 2) {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+window.addEventListener("message", function(e) { receivedMessage(e.data) }, false);
+
+</script>
+<iframe src="resources/reload-iframe.html"></iframe>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/remove-cache-expected.txt b/LayoutTests/http/tests/appcache/remove-cache-expected.txt
new file mode 100644
index 0000000..9e23ba1
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/remove-cache-expected.txt
@@ -0,0 +1,10 @@
+Test that a 404 response for manifest results in cache removal.
+
+Frame 1: Manifest is still available, so a new master resource is added to the cache.
+Frame 2: Manifest loading results in 404 response, so the cache group becomes obsolete, and an obsolete event is dispatched (because the document in frame was associated with a cache in the group).
+Frame 3: Manifest is still 404 - the document is never associated with a cache.
+Frame 4: Manifest is now available, so the document gets associated with a cache in a newly created group; the obsolete cache group is not affected.
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/remove-cache.html b/LayoutTests/http/tests/appcache/remove-cache.html
new file mode 100644
index 0000000..954418c
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/remove-cache.html
@@ -0,0 +1,111 @@
+<html manifest="resources/fail-on-update.php">
+<p>Test that a 404 response for manifest results in cache removal.</p>
+<body>
+<ul>
+<li>Frame 1: Manifest is still available, so a new master resource is added to the cache.
+<li>Frame 2: Manifest loading results in 404 response, so the cache group becomes obsolete, and an obsolete event is dispatched (because the document in frame was associated with a cache in the group).
+<li>Frame 3: Manifest is still 404 - the document is never associated with a cache.
+<li>Frame 4: Manifest is now available, so the document gets associated with a cache in a newly created group; the obsolete cache group is not affected.
+</ul>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function setManifestDeleted(state)
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "resources/fail-on-update.php?command=" + (state ? "delete" : "reset"), false);
+ req.send(null);
+}
+
+function test()
+{
+ clearTimeout(timeoutId);
+
+ // The frame will be associated to a cache, and its main resource will be added to the cache.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/remove-cache-frame.html");
+ document.body.appendChild(ifr);
+ applicationCache.onnoupdate = test2;
+}
+
+function test2()
+{
+ applicationCache.onnoupdate = function() { log("Unexpected noupdate event") }
+ applicationCache.oncached = function() { log("Unexpected cached event") }
+
+ setManifestDeleted(true);
+ // The frame will be associated to a cache, but update will obsolete it.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/remove-cache-frame.html");
+ document.body.appendChild(ifr);
+ applicationCache.onobsolete = test3;
+}
+
+function test3()
+{
+ applicationCache.onchecking = function() { log("Unexpected checking event after obsolete event") }
+ applicationCache.onupdateready = function() { log("Unexpected updateready event after obsolete event") }
+ applicationCache.onerror = function() { log("Unexpected error event after obsolete event") }
+ applicationCache.onnoupdate = function() { log("Unexpected noupdate event after obsolete event") }
+ applicationCache.oncached = function() { log("Unexpected cached event after obsolete event") }
+
+ // The frame will not be associated to a cache.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/remove-cache-frame.html");
+ document.body.appendChild(ifr);
+ window.addEventListener("message", test4, false);
+}
+
+function test4()
+{
+ setManifestDeleted(false);
+
+ window.removeEventListener("message", test4, false);
+ applicationCache.onupdateready = null;
+
+ // The frame will be associated to a cache.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/remove-cache-frame-2.html");
+ document.body.appendChild(ifr);
+ window.addEventListener("message", test5, false);
+}
+
+function test5()
+{
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function resetManifest()
+{
+ if (applicationCache.status != applicationCache.UNCACHED && applicationCache.status != applicationCache.OBSOLETE) {
+ timeoutId = setTimeout(resetManifest, 100);
+ return;
+ }
+
+ setManifestDeleted(false);
+ location.reload();
+}
+
+applicationCache.onupdateready = function() { log("Unexpected updateready event") }
+applicationCache.onnoupdate = test;
+applicationCache.oncached = test;
+
+// If the manifest script happened to be in a wrong state, reset it.
+var timeoutId = setTimeout(resetManifest, 100);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt b/LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt
new file mode 100644
index 0000000..420e94b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resource-redirect-2-expected.txt
@@ -0,0 +1,6 @@
+Test that a redirect makes resource caching fail.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/resource-redirect-2.html b/LayoutTests/http/tests/appcache/resource-redirect-2.html
new file mode 100644
index 0000000..cf0d3a8
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resource-redirect-2.html
@@ -0,0 +1,40 @@
+<html manifest="resources/resource-redirect-2.manifest">
+<body>
+<p>Test that a redirect makes resource caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An unexpected event was dispatched on window.applicationCache.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resource-redirect-expected.txt b/LayoutTests/http/tests/appcache/resource-redirect-expected.txt
new file mode 100644
index 0000000..420e94b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resource-redirect-expected.txt
@@ -0,0 +1,6 @@
+Test that a redirect makes resource caching fail.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/resource-redirect.html b/LayoutTests/http/tests/appcache/resource-redirect.html
new file mode 100644
index 0000000..7fdf5f8
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resource-redirect.html
@@ -0,0 +1,40 @@
+<html manifest="resources/resource-redirect.manifest">
+<body>
+<p>Test that a redirect makes resource caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An unexpected event was dispatched on window.applicationCache.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/.htaccess b/LayoutTests/http/tests/appcache/resources/.htaccess
new file mode 100644
index 0000000..dfa433b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/.htaccess
@@ -0,0 +1,5 @@
+RewriteEngine on
+RewriteRule ^UNKNOWN_SECTION: simple.txt [L,NS]
+<Files wrong-content-type.manifest>
+ForceType text/plain
+</Files>
diff --git a/LayoutTests/http/tests/appcache/resources/404-resource.manifest b/LayoutTests/http/tests/appcache/resources/404-resource.manifest
new file mode 100644
index 0000000..b2c066d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/404-resource.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+does-not-exist.txt
diff --git a/LayoutTests/http/tests/appcache/resources/abe.png b/LayoutTests/http/tests/appcache/resources/abe.png
new file mode 100644
index 0000000..c932536
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/abe.png
Binary files differ
diff --git a/LayoutTests/http/tests/appcache/resources/access-via-redirect.html b/LayoutTests/http/tests/appcache/resources/access-via-redirect.html
new file mode 100644
index 0000000..510f841
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/access-via-redirect.html
@@ -0,0 +1,46 @@
+<html manifest="access-via-redirect.manifest">
+
+<p>This tests that the start of redirect chain doesn't get into an application cache if the end of the chain has a manifest.</p>
+<p id="result">FAILURE</p>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function canLoad(url)
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", url, false);
+ req.send("");
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+function cached()
+{
+ if (canLoad("/appcache/access-via-redirect.php")) {
+ document.getElementById('result').innerHTML = "FAILURE: Start of redirect chain is in cache."
+ return;
+ }
+
+ if (!canLoad("access-via-redirect.html")) {
+ document.getElementById('result').innerHTML = "FAILURE: Could not load main resource from cache."
+ return;
+ }
+
+ document.getElementById('result').innerHTML = "SUCCESS"
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', cached, false);
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/access-via-redirect.manifest b/LayoutTests/http/tests/appcache/resources/access-via-redirect.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/access-via-redirect.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/auth/iframe.php b/LayoutTests/http/tests/appcache/resources/auth/iframe.php
new file mode 100644
index 0000000..7e5d30d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/auth/iframe.php
@@ -0,0 +1,16 @@
+<?php
+ if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ header('WWW-Authenticate: Basic realm="WebKit AppCache Test Realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo 'Authentication canceled';
+ exit;
+ } else {
+ echo "<html manifest='manifest.php'>\n";
+ echo "<p>Subframe, should disappear.</p>\n";
+ echo "<script>\n";
+ echo " applicationCache.oncached = parent.success;\n";
+ echo " applicationCache.onnoupdate = parent.success;\n";
+ echo "</script>\n";
+ echo "</html>\n";
+ }
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/auth/manifest.php b/LayoutTests/http/tests/appcache/resources/auth/manifest.php
new file mode 100644
index 0000000..ea09957
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/auth/manifest.php
@@ -0,0 +1,12 @@
+<?php
+ if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ header('WWW-Authenticate: Basic realm="WebKit AppCache Test Realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo 'Authentication canceled';
+ exit;
+ } else {
+ header("Content-Type: text/cache-manifest");
+ echo "CACHE MANIFEST\n";
+ echo "subresource.php\n";
+ }
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/auth/setup.php b/LayoutTests/http/tests/appcache/resources/auth/setup.php
new file mode 100644
index 0000000..c0f3965
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/auth/setup.php
@@ -0,0 +1,10 @@
+<?php
+ if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ header('WWW-Authenticate: Basic realm="WebKit AppCache Test Realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo 'Authentication canceled';
+ exit;
+ } else {
+ echo "OK\n";
+ }
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/auth/subresource.php b/LayoutTests/http/tests/appcache/resources/auth/subresource.php
new file mode 100644
index 0000000..0945d53
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/auth/subresource.php
@@ -0,0 +1,10 @@
+<?php
+ if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ header('WWW-Authenticate: Basic realm="WebKit AppCache Test Realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo 'Authentication canceled';
+ exit;
+ } else {
+ echo "/* Empty subresource */";
+ }
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/counter.php b/LayoutTests/http/tests/appcache/resources/counter.php
new file mode 100644
index 0000000..7926faf
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/counter.php
@@ -0,0 +1,23 @@
+<?php
+require_once '../../resources/portabilityLayer.php';
+
+$tmpFile = sys_get_temp_dir() . "/" . "appcache_counter";
+
+function stepCounter($file)
+{
+ if (!file_exists($file)) {
+ file_put_contents($file, "0");
+ return "0";
+ }
+ $value = file_get_contents($file);
+ file_put_contents($file, ++$value);
+ return $value;
+}
+
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header("Content-Type: text/plain");
+
+print(stepCounter($tmpFile));
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.html b/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.html
new file mode 100644
index 0000000..28bbeb3
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.html
@@ -0,0 +1,22 @@
+<html manifest="crash-when-navigating-away-then-back.manifest">
+<script>
+
+function cached()
+{
+ window.close();
+ window.opener.closedWindow();
+}
+
+function noupdate()
+{
+ window.opener.document.getElementById('result').innerHTML = 'SUCCESS';
+ window.close();
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', noupdate, false);
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.manifest b/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.manifest
new file mode 100644
index 0000000..a9fb276
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/crash-when-navigating-away-then-back.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+crash-when-navigating-away-then-back.html
diff --git a/LayoutTests/http/tests/appcache/resources/cyrillic-uri-form.html b/LayoutTests/http/tests/appcache/resources/cyrillic-uri-form.html
new file mode 100644
index 0000000..a97c508
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/cyrillic-uri-form.html
@@ -0,0 +1,28 @@
+<html manifest="cyrillic-uri.manifest">
+<head>
+<meta charset="koi8-r">
+</head>
+<body>
+<form method=GET action="?">
+<input type=text name=i value="ðÒÏ×ÅÒËÁ">
+</form>
+<script>
+document.write(location);
+function test() {
+ if (location.search == "") {
+ document.forms[0].submit();
+ } else if (location.search == "?i=%F0%D2%CF%D7%C5%D2%CB%C1") {
+ document.forms[0].elements[0].value="ðÒÏ×ÅÒËÁ-2";
+ document.forms[0].submit();
+ } else if (location.search == "?i=%F0%D2%CF%D7%C5%D2%CB%C1-2") {
+ parent.postMessage("allDone", "*");
+ } else {
+ alert("Unexpected URI: " + location);
+ parent.postMessage("allDone", "*");
+ }
+}
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/cyrillic-uri.manifest b/LayoutTests/http/tests/appcache/resources/cyrillic-uri.manifest
new file mode 100644
index 0000000..574ab9e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/cyrillic-uri.manifest
@@ -0,0 +1,10 @@
+CACHE MANIFEST
+intercept/cached-Проверка
+intercept/cached2-%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0
+cyrillic-uri-form.html
+cyrillic-uri-form.html?i=Проверка
+NETWORK:
+intercept/network-Проверка
+cyrillic-uri-form.html?i=Проверка-2
+FALLBACK:
+does-not-exist-Проверка intercept/fallback-Проверка
diff --git a/LayoutTests/http/tests/appcache/resources/different-scheme.manifest b/LayoutTests/http/tests/appcache/resources/different-scheme.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/different-scheme.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/empty.manifest b/LayoutTests/http/tests/appcache/resources/empty.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/empty.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/empty.txt b/LayoutTests/http/tests/appcache/resources/empty.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/empty.txt
diff --git a/LayoutTests/http/tests/appcache/resources/fail-on-update.php b/LayoutTests/http/tests/appcache/resources/fail-on-update.php
new file mode 100644
index 0000000..b66da78
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/fail-on-update.php
@@ -0,0 +1,38 @@
+<?php
+require_once '../../resources/portabilityLayer.php';
+
+$tmpFile = sys_get_temp_dir() . "/" . "fail_on_update_state";
+
+function setState($newState, $file)
+{
+ file_put_contents($file, $newState);
+}
+
+function getState($file)
+{
+ if (!file_exists($file)) {
+ return "Uninitialized";
+ }
+ return file_get_contents($file);
+}
+
+$command = $_GET['command'];
+$state = getState($tmpFile);
+
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+
+if ($command == "reset") {
+ unlink($tmpFile);
+} else if ($command == "delete") {
+ setState("Deleted", $tmpFile);
+} else if ($state == "Uninitialized") {
+ header("Content-Type: text/cache-manifest");
+ print("CACHE MANIFEST\n");
+ print("NETWORK:\n");
+ print("fail-on-update.php?command=\n");
+} else if ($state == "Deleted") {
+ header('HTTP/1.0 404 Not Found');
+}
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/fallback-redirect.php b/LayoutTests/http/tests/appcache/resources/fallback-redirect.php
new file mode 100644
index 0000000..deb101a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/fallback-redirect.php
@@ -0,0 +1,8 @@
+<?php
+ header('HTTP/1.1 307 Temporary Redirect');
+ header('Location: http://localhost:8000/appcache/resources/simple.txt');
+
+ header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+ header("Cache-Control: no-cache, must-revalidate");
+ header("Pragma: no-cache");
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/fallback.manifest b/LayoutTests/http/tests/appcache/resources/fallback.manifest
new file mode 100644
index 0000000..7375c7d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/fallback.manifest
@@ -0,0 +1,5 @@
+CACHE MANIFEST
+FALLBACK:
+/resources/network-simulator.php? simple.txt
+fallback-redirect simple.txt
+does-not-exist simple.txt \ No newline at end of file
diff --git a/LayoutTests/http/tests/appcache/resources/foreign-iframe-subresource.js b/LayoutTests/http/tests/appcache/resources/foreign-iframe-subresource.js
new file mode 100644
index 0000000..01b2b2a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/foreign-iframe-subresource.js
@@ -0,0 +1 @@
+parent.postMessage("allDone", "*");
diff --git a/LayoutTests/http/tests/appcache/resources/foreign-iframe.html b/LayoutTests/http/tests/appcache/resources/foreign-iframe.html
new file mode 100644
index 0000000..0b008bc
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/foreign-iframe.html
@@ -0,0 +1,4 @@
+<html manifest="foreign-iframe.manifest">
+<div>Subframe</div>
+<script src="foreign-iframe-subresource.js"></script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/foreign-iframe.manifest b/LayoutTests/http/tests/appcache/resources/foreign-iframe.manifest
new file mode 100644
index 0000000..fc0c2f9
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/foreign-iframe.manifest
@@ -0,0 +1,4 @@
+CACHE MANIFEST
+simple.txt
+foreign-iframe.html
+foreign-iframe-subresource.js
diff --git a/LayoutTests/http/tests/appcache/resources/idempotent-update.manifest b/LayoutTests/http/tests/appcache/resources/idempotent-update.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/idempotent-update.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/intercept/.htaccess b/LayoutTests/http/tests/appcache/resources/intercept/.htaccess
new file mode 100644
index 0000000..bfd3b30
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/intercept/.htaccess
@@ -0,0 +1,2 @@
+RewriteEngine on
+RewriteRule ^.* /appcache/resources/print-uri.php [L,NS]
diff --git a/LayoutTests/http/tests/appcache/resources/local-content.manifest b/LayoutTests/http/tests/appcache/resources/local-content.manifest
new file mode 100644
index 0000000..d62c274
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/local-content.manifest
@@ -0,0 +1,4 @@
+CACHE MANIFEST
+/appcache/local-content.html
+NETWORK:
+file:/ # Should be ignored due to different URL scheme, but it doesn't hurt to try.
diff --git a/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.html b/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.html
new file mode 100644
index 0000000..6fc1260
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.html
@@ -0,0 +1,27 @@
+<html manifest="/appcache/resources/main-resource-hash-frame.manifest#foo">
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+applicationCache.onchecking = function() { log("checking"); }
+applicationCache.ondownloading = function() { log("downloading") }
+applicationCache.onprogress = function() { log("progress") }
+applicationCache.onupdateready = function() { log("updateready") }
+applicationCache.onobsolete = function() { log("obsolete") }
+applicationCache.oncached = function() { log("cached"); loaded(); }
+applicationCache.onnoupdate = function() { log("noupdate"); loaded(); }
+applicationCache.onerror = function() { log("error"); loaded(); }
+
+var once = 1;
+function loaded()
+{
+ if (once) {
+ once = 0;
+ parent.postMessage("loaded", "*");
+ }
+}
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.manifest b/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/main-resource-hash-frame.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/manifest-containing-itself.manifest b/LayoutTests/http/tests/appcache/resources/manifest-containing-itself.manifest
new file mode 100644
index 0000000..eb5c126
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/manifest-containing-itself.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+manifest-containing-itself.manifest
diff --git a/LayoutTests/http/tests/appcache/resources/manifest-parsing.manifest b/LayoutTests/http/tests/appcache/resources/manifest-parsing.manifest
new file mode 100644
index 0000000..db694ac
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/manifest-parsing.manifest
@@ -0,0 +1,6 @@
+CACHE MANIFEST ignored text
+ empty.txt
+
+simple.txt ignored text
+UNKNOWN_SECTION:
+not-in-cache.txt
diff --git a/LayoutTests/http/tests/appcache/resources/manifest-redirect-2.php b/LayoutTests/http/tests/appcache/resources/manifest-redirect-2.php
new file mode 100644
index 0000000..e3bc158
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/manifest-redirect-2.php
@@ -0,0 +1,7 @@
+<?php
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('HTTP/1.1 307 Temporary Redirect');
+header('Location: manifest-redirect-2.php');
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/manifest-redirect.php b/LayoutTests/http/tests/appcache/resources/manifest-redirect.php
new file mode 100644
index 0000000..e2f32eb
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/manifest-redirect.php
@@ -0,0 +1,7 @@
+<?php
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('HTTP/1.1 307 Temporary Redirect');
+header('Location: simple.manifest');
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/manifest-with-empty-file.manifest b/LayoutTests/http/tests/appcache/resources/manifest-with-empty-file.manifest
new file mode 100644
index 0000000..aab054b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/manifest-with-empty-file.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+empty.txt
diff --git a/LayoutTests/http/tests/appcache/resources/maxsize.manifest b/LayoutTests/http/tests/appcache/resources/maxsize.manifest
new file mode 100644
index 0000000..934fa6c
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/maxsize.manifest
@@ -0,0 +1,3 @@
+CACHE MANIFEST
+#v1
+abe.png
diff --git a/LayoutTests/http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest b/LayoutTests/http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest
new file mode 100644
index 0000000..10f6ddb
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/navigating-away-while-cache-attempt-in-progress.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+slow-resource.php
diff --git a/LayoutTests/http/tests/appcache/resources/non-html.manifest b/LayoutTests/http/tests/appcache/resources/non-html.manifest
new file mode 100644
index 0000000..dc8db7a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/non-html.manifest
@@ -0,0 +1,8 @@
+CACHE MANIFEST
+/appcache/non-html.xhtml
+/resources/network-simulator.php?path=/appcache/resources/simple.txt
+/resources/network-simulator.php?path=/appcache/resources/abe.png
+/resources/network-simulator.php?path=/appcache/resources/non-html.manifest
+NETWORK:
+/favicon.ico
+/resources/network-simulator.php?command=
diff --git a/LayoutTests/http/tests/appcache/resources/not-in-cache.txt b/LayoutTests/http/tests/appcache/resources/not-in-cache.txt
new file mode 100644
index 0000000..a580081
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/not-in-cache.txt
@@ -0,0 +1 @@
+This file is not in the cache and is thus not possible to load. \ No newline at end of file
diff --git a/LayoutTests/http/tests/appcache/resources/offline-access-frame.html b/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
new file mode 100644
index 0000000..68ef274
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
@@ -0,0 +1,30 @@
+<html manifest="/resources/network-simulator.php?path=/appcache/resources/offline-access.manifest">
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+applicationCache.onchecking = function() { log("checking"); }
+applicationCache.ondownloading = function() { log("downloading") }
+applicationCache.onprogress = function() { log("progress") }
+applicationCache.onupdateready = function() { log("updateready") }
+applicationCache.onobsolete = function() { log("obsolete") }
+</script>
+<script src="/resources/network-simulator.php?path=/appcache/resources/offline-access.js"></script>
+<script>
+
+applicationCache.oncached = function() { log("cached"); test() }
+applicationCache.onnoupdate = function() { log("noupdate"); test() }
+applicationCache.onerror = function() { log("error"); test() }
+
+if (applicationCache.status == applicationCache.IDLE) {
+ // Update finished while we were waiting for offline-access.js to load.
+ applicationCache.oncached = function() { log("cached") }
+ applicationCache.onnoupdate = function() { log("noupdate") }
+ applicationCache.onerror = function() { log("error") }
+ test();
+}
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/offline-access.js b/LayoutTests/http/tests/appcache/resources/offline-access.js
new file mode 100644
index 0000000..a69d73e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/offline-access.js
@@ -0,0 +1,18 @@
+function test()
+{
+ applicationCache.oncached = function() { log("cached") }
+ applicationCache.onnoupdate = function() { log("noupdate") }
+ applicationCache.onerror = function() { log("error") }
+
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "/resources/network-simulator.php?path=/appcache/resources/simple.txt", false);
+ req.send(null);
+ if (req.responseText == "Hello, World!")
+ parent.postMessage("done", "*");
+ else
+ alert("FAIL, unexpected response: " + ex);
+ } catch (ex) {
+ alert("FAIL, unexpected error: " + ex);
+ }
+}
diff --git a/LayoutTests/http/tests/appcache/resources/offline-access.manifest b/LayoutTests/http/tests/appcache/resources/offline-access.manifest
new file mode 100644
index 0000000..5142e38
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/offline-access.manifest
@@ -0,0 +1,5 @@
+CACHE MANIFEST
+/resources/network-simulator.php?path=/appcache/resources/offline-access-frame.html
+/resources/network-simulator.php?path=/appcache/resources/offline-access.manifest
+/resources/network-simulator.php?path=/appcache/resources/simple.txt
+/resources/network-simulator.php?path=/appcache/resources/offline-access.js
diff --git a/LayoutTests/http/tests/appcache/resources/online-whitelist.manifest b/LayoutTests/http/tests/appcache/resources/online-whitelist.manifest
new file mode 100644
index 0000000..892bf8d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/online-whitelist.manifest
@@ -0,0 +1,14 @@
+CACHE MANIFEST
+counter.php?cached
+
+NETWORK:
+# These are prefixes for requests we test, but they are not same origin, so they will be skipped.
+http://
+http://127
+http://127.0.0.1:8
+
+# This should be ignored, because explicit entries are checked before online whitelist
+counter.php?cached
+
+# This should work normally.
+counter.php?uncached \ No newline at end of file
diff --git a/LayoutTests/http/tests/appcache/resources/print-uri.php b/LayoutTests/http/tests/appcache/resources/print-uri.php
new file mode 100644
index 0000000..23358f1
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/print-uri.php
@@ -0,0 +1,7 @@
+<?php
+ header("Content-Type: text/javascript");
+ header("Expires: Thu, 01 Dec 2003 16:00:00 GMT\n");
+ header("Cache-Control: no-cache, must-revalidate\n");
+ header("Pragma: no-cache\n");
+ echo $_SERVER['REQUEST_URI'];
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/reload-iframe.html b/LayoutTests/http/tests/appcache/resources/reload-iframe.html
new file mode 100644
index 0000000..7575bab
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/reload-iframe.html
@@ -0,0 +1,21 @@
+<html manifest="reload-iframe.manifest">
+<body>
+<script>
+function test()
+{
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "resources/not-in-cache.txt", false);
+ req.send("");
+ parent.postMessage("FAIL: Loading an uncached resource didn't raise an exception", "*");
+ } catch (e) {
+ parent.postMessage("SUCCESS", "*");
+ }
+}
+
+applicationCache.onnoupdate = function() { parent.postMessage("Frame loaded", "*") }
+applicationCache.oncached = function() { parent.postMessage("Frame loaded", "*") }
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/reload-iframe.manifest b/LayoutTests/http/tests/appcache/resources/reload-iframe.manifest
new file mode 100644
index 0000000..668f974
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/reload-iframe.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+/appcache/resources/simple.txt
diff --git a/LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html b/LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html
new file mode 100644
index 0000000..009a8b6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html
@@ -0,0 +1,37 @@
+<html manifest="fail-on-update.php">
+<body>
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ log("cached")
+ log("status=" + applicationCache.status);
+ applicationCache.onnoupdate = null;
+
+ // Associated to a cache, so loading should fail
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "empty.txt", false);
+ req.send(null);
+ alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exception");
+ } catch (ex) {
+ }
+ log("There should be no messages below.");
+ parent.postMessage("frameDone", "*");
+}
+
+applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected onupdateready event in frame") }
+applicationCache.onerror = function() { log("error"); alert("Unexpected error event in frame") }
+applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected noupdate event in frame") }
+applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected obsolete event in frame") }
+
+applicationCache.oncached = test;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/remove-cache-frame.html b/LayoutTests/http/tests/appcache/resources/remove-cache-frame.html
new file mode 100644
index 0000000..30e8553
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/remove-cache-frame.html
@@ -0,0 +1,64 @@
+<html manifest="fail-on-update.php">
+<body>
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function onObsolete()
+{
+ log("obsolete")
+ log("status=" + applicationCache.status + " (expected 5)");
+ applicationCache.onobsolete = function() { log("obsolete") }
+ applicationCache.onupdateready = function() { log("updateready") }
+ applicationCache.onnoupdate = function() { log("noupdate") }
+ applicationCache.onnoupdate = function() { log("error") }
+
+ // We still have a cache, so loading should fail
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "empty.txt", false);
+ req.send(null);
+ alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exception");
+ } catch (ex) {
+ }
+ log("There should be no messages below.");
+}
+
+function onError()
+{
+ if (applicationCache.status != applicationCache.UNCACHED && applicationCache.status != applicationCache.OBSOLETE) {
+ timeoutId = setTimeout(onNoManifest, 100);
+ return;
+ }
+
+ log("error");
+ applicationCache.onobsolete = function() { log("obsolete") }
+ applicationCache.onupdateready = function() { log("updateready") }
+ applicationCache.onnoupdate = function() { log("noupdate") }
+ applicationCache.onnoupdate = function() { log("error") }
+
+ // Ensure that we are not associated with a cache.
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "empty.txt", false);
+ req.send(null);
+ } catch (ex) {
+ alert("FAIL: XMLHttpRequest raised an exception, " + ex);
+ }
+ log("There should be no messages below.");
+ parent.postMessage("frameDone - timeout", "*");
+}
+
+applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected updateready event in frame") }
+applicationCache.onnoupdate = function() { log("noupdate") }
+applicationCache.oncached = function() { log("cached"); alert("Unexpected cached event in frame") }
+
+applicationCache.onobsolete = onObsolete;
+applicationCache.onerror = onError;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/resource-redirect-2.manifest b/LayoutTests/http/tests/appcache/resources/resource-redirect-2.manifest
new file mode 100644
index 0000000..66cd3fe
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/resource-redirect-2.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+resource-redirect-2.php
diff --git a/LayoutTests/http/tests/appcache/resources/resource-redirect-2.php b/LayoutTests/http/tests/appcache/resources/resource-redirect-2.php
new file mode 100644
index 0000000..ac1e8f5
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/resource-redirect-2.php
@@ -0,0 +1,7 @@
+<?php
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('HTTP/1.1 307 Temporary Redirect');
+header('Location: resource-redirect-2.php');
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/resource-redirect.manifest b/LayoutTests/http/tests/appcache/resources/resource-redirect.manifest
new file mode 100644
index 0000000..e94651d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/resource-redirect.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+resource-redirect.php
diff --git a/LayoutTests/http/tests/appcache/resources/resource-redirect.php b/LayoutTests/http/tests/appcache/resources/resource-redirect.php
new file mode 100644
index 0000000..07931fb
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/resource-redirect.php
@@ -0,0 +1,7 @@
+<?php
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header('HTTP/1.1 307 Temporary Redirect');
+header('Location: simple.txt');
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/simple.manifest b/LayoutTests/http/tests/appcache/resources/simple.manifest
new file mode 100644
index 0000000..3a210f3
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/simple.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+simple.txt
diff --git a/LayoutTests/http/tests/appcache/resources/simple.txt b/LayoutTests/http/tests/appcache/resources/simple.txt
new file mode 100644
index 0000000..b45ef6f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/simple.txt
@@ -0,0 +1 @@
+Hello, World! \ No newline at end of file
diff --git a/LayoutTests/http/tests/appcache/resources/slow-resource.php b/LayoutTests/http/tests/appcache/resources/slow-resource.php
new file mode 100644
index 0000000..b720ba1
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/slow-resource.php
@@ -0,0 +1,3 @@
+<?php
+sleep(10);
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/subframe-1.html b/LayoutTests/http/tests/appcache/resources/subframe-1.html
new file mode 100644
index 0000000..629c030
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframe-1.html
@@ -0,0 +1,7 @@
+<script>
+var req = new XMLHttpRequest;
+req.open("GET", "simple.txt", false);
+req.send(null);
+if (req.responseText.length > 0)
+ parent.postMessage("allDone", "*");
+</script>
diff --git a/LayoutTests/http/tests/appcache/resources/subframe-2.html b/LayoutTests/http/tests/appcache/resources/subframe-2.html
new file mode 100644
index 0000000..9fb6c0f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframe-2.html
@@ -0,0 +1,11 @@
+<script>
+try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "simple.txt", false);
+ req.send(null);
+ alert("FAIL, unexpected response: " + req.responseText);
+} catch (ex) {
+ // Loading should fail, because simple.txt is not in cache manifest.
+ parent.postMessage("allDone", "*");
+}
+</script>
diff --git a/LayoutTests/http/tests/appcache/resources/subframe-3.html b/LayoutTests/http/tests/appcache/resources/subframe-3.html
new file mode 100644
index 0000000..b708408
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframe-3.html
@@ -0,0 +1,26 @@
+<html manifest="subframes-3.manifest">
+<script>
+function test()
+{
+ applicationCache.onnoupdate = null;
+
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "simple.txt", false);
+ req.send(null);
+ alert("FAIL, unexpected response: " + req.responseText);
+ } catch (ex) {
+ // Loading should fail, because simple.txt is not in cache manifest.
+ parent.postMessage("allDone", "*");
+ }
+}
+
+// The cache has been fully created before the iframe was inserted, and the manifest didn't change.
+applicationCache.onnoupdate = test;
+
+applicationCache.onupdateready = function() { alert("Unexpected updateready event") }
+applicationCache.oncached = function() { alert("Unexpected cached event") }
+applicationCache.onerror = function() { alert("Unexpected error event") }
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/subframe-4.html b/LayoutTests/http/tests/appcache/resources/subframe-4.html
new file mode 100644
index 0000000..da03679
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframe-4.html
@@ -0,0 +1,26 @@
+<html manifest="subframes-4.manifest">
+<script>
+function test()
+{
+ applicationCache.onnoupdate = null;
+
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "simple.txt", false);
+ req.send(null);
+ alert("FAIL, unexpected response: " + req.responseText);
+ } catch (ex) {
+ // Loading should fail, because simple.txt is not in cache manifest.
+ parent.postMessage("allDone", "*");
+ }
+}
+
+// The cache has been fully created before the iframe was inserted, and the manifest didn't change.
+applicationCache.onnoupdate = test;
+
+applicationCache.onupdateready = function() { alert("Unexpected updateready event") }
+applicationCache.oncached = function() { alert("Unexpected cached event") }
+applicationCache.onerror = function() { alert("Unexpected error event") }
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/subframes-1.manifest b/LayoutTests/http/tests/appcache/resources/subframes-1.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframes-1.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/subframes-2.manifest b/LayoutTests/http/tests/appcache/resources/subframes-2.manifest
new file mode 100644
index 0000000..645a34f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframes-2.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+subframe-2.html
diff --git a/LayoutTests/http/tests/appcache/resources/subframes-3.manifest b/LayoutTests/http/tests/appcache/resources/subframes-3.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframes-3.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/subframes-4.manifest b/LayoutTests/http/tests/appcache/resources/subframes-4.manifest
new file mode 100644
index 0000000..f4e7937
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/subframes-4.manifest
@@ -0,0 +1,2 @@
+CACHE MANIFEST
+subframe-4.html
diff --git a/LayoutTests/http/tests/appcache/resources/uncacheable-resource.php b/LayoutTests/http/tests/appcache/resources/uncacheable-resource.php
new file mode 100644
index 0000000..ddfe07d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/uncacheable-resource.php
@@ -0,0 +1,13 @@
+<?php
+# This resource won't be cached by network layer, but will be cached by appcache.
+header("Last-Modified: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, no-store");
+header("Pragma: no-cache");
+header("Content-Type: text/plain");
+
+if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] || $_SERVER['HTTP_IF_NONE_MATCH'])
+ header("HTTP/1.1 304 Not Modified");
+else
+ print("Hello, world!\n");
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/versioned-manifest.php b/LayoutTests/http/tests/appcache/resources/versioned-manifest.php
new file mode 100644
index 0000000..84a7a91
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/versioned-manifest.php
@@ -0,0 +1,37 @@
+<?php
+require_once '../../resources/portabilityLayer.php';
+
+$tmpFile = sys_get_temp_dir() . "/" . "appcache_manifest_counter";
+
+function getCount($file)
+{
+ if (!file_exists($file)) {
+ file_put_contents($file, "0");
+ return "0";
+ }
+ return file_get_contents($file);
+}
+
+function stepCounter($file)
+{
+ if (file_exists($file)) {
+ $value = getCount($file);
+ file_put_contents($file, ++$value);
+ }
+}
+
+header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
+header("Cache-Control: no-cache, must-revalidate");
+header("Pragma: no-cache");
+header("Content-Type: text/cache-manifest");
+
+if ("step" == $_GET['command'])
+ stepCounter($tmpFile);
+
+print("CACHE MANIFEST\n");
+print("# version " . getCount($tmpFile) . "\n");
+print("counter.php\n");
+print("uncacheable-resource.php\n"); // with Cache-control: no-store
+print("NETWORK:\n");
+print("versioned-manifest.php?command=\n");
+?>
diff --git a/LayoutTests/http/tests/appcache/resources/whitelist-wildcard.manifest b/LayoutTests/http/tests/appcache/resources/whitelist-wildcard.manifest
new file mode 100644
index 0000000..8f88a4a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/whitelist-wildcard.manifest
@@ -0,0 +1,3 @@
+CACHE MANIFEST
+NETWORK:
+*
diff --git a/LayoutTests/http/tests/appcache/resources/wrong-content-type.manifest b/LayoutTests/http/tests/appcache/resources/wrong-content-type.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/wrong-content-type.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/wrong-signature-2.manifest b/LayoutTests/http/tests/appcache/resources/wrong-signature-2.manifest
new file mode 100644
index 0000000..d7d3f8d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/wrong-signature-2.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST;V2
diff --git a/LayoutTests/http/tests/appcache/resources/wrong-signature.manifest b/LayoutTests/http/tests/appcache/resources/wrong-signature.manifest
new file mode 100644
index 0000000..aab49be
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/wrong-signature.manifest
@@ -0,0 +1 @@
+A CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-2.manifest b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-2.manifest
new file mode 100644
index 0000000..af16a0e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-2.manifest
@@ -0,0 +1 @@
+CACHE MANIFEST
diff --git a/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html
new file mode 100644
index 0000000..57093fa
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html
@@ -0,0 +1,36 @@
+<html manifest="xhr-foreign-resource-2.manifest">
+<body>
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cached()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // simple.txt is only listed s a resource in main frame's manifest, so loading should fail.
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "simple.txt", false);
+ req.send("");
+ log("FAIL");
+ log("applicationCache.status = " + applicationCache.status);
+ parent.postMessage("FAIL", "*");
+ } catch (ex) {
+ log("Frame OK");
+ parent.postMessage("SUCCESS", "*");
+ }
+}
+
+applicationCache.onnoupdate = cached;
+applicationCache.oncached = cached;
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource.manifest b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource.manifest
new file mode 100644
index 0000000..8cfe428
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource.manifest
@@ -0,0 +1,3 @@
+CACHE MANIFEST
+xhr-foreign-resource-frame.html
+simple.txt
diff --git a/LayoutTests/http/tests/appcache/simple-expected.txt b/LayoutTests/http/tests/appcache/simple-expected.txt
new file mode 100644
index 0000000..1c1a58c
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/simple-expected.txt
@@ -0,0 +1,2 @@
+This tests that the application cache works by first loading a file that does not exist in the cache (to verify that a cache has been associated) and then loads a file that is in the cache
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/simple.html b/LayoutTests/http/tests/appcache/simple.html
new file mode 100644
index 0000000..4342cb7
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/simple.html
@@ -0,0 +1,55 @@
+<html manifest="resources/simple.manifest">
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function cached()
+{
+ var hadError = false;
+
+ // Load a resource that does not exist in the cache.
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "resources/not-in-cache.txt", false);
+ req.send();
+ } catch (e) {
+ if (e.code == XMLHttpRequestException.NETWORK_ERR)
+ hadError = true;
+ }
+
+ if (!hadError) {
+ document.getElementById('result').innerHTML = "FAILURE: Did not get the right exception"
+ return;
+ }
+
+ // Load a resource that exists in the cache.
+ try {
+ var req = new XMLHttpRequest();
+ req.open("GET", "resources/simple.txt", false);
+ req.send();
+ } catch (e) {
+ document.getElementById('result').innerHTML = "FAILURE: Could not load data from cache"
+ return;
+ }
+
+ if (req.responseText != 'Hello, World!') {
+ document.getElementById('result').innerHTML = "FAILURE: Did not get correct data from cached resource"
+ return;
+ }
+
+ document.getElementById('result').innerHTML = "SUCCESS"
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', cached, false);
+applicationCache.addEventListener('noupdate', cached, false);
+
+</script>
+<div>This tests that the application cache works by first loading a file that does not exist in the cache (to verify that a cache has been associated) and then loads a file that is in the cache</div>
+
+<div id="result">FAILURE</div>
+</html>
diff --git a/LayoutTests/http/tests/appcache/top-frame-1-expected.txt b/LayoutTests/http/tests/appcache/top-frame-1-expected.txt
new file mode 100644
index 0000000..c7f7e37
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-1-expected.txt
@@ -0,0 +1,8 @@
+Test that a subframe without manifest doesn't pick an application cache from parent frame (as long as no relevant cache contains its resource).
+
+Techically, the check is that iframe subresources that are not in top frame cache are loaded anyway, so it can also pass if the UA fails to reject loads for cache misses.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/top-frame-1.html b/LayoutTests/http/tests/appcache/top-frame-1.html
new file mode 100644
index 0000000..9e29300
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-1.html
@@ -0,0 +1,38 @@
+<html manifest="resources/subframes-1.manifest">
+<body>
+<p>Test that a subframe without manifest doesn't pick an application cache from parent frame
+(as long as no relevant cache contains its resource).</p>
+<p>Techically, the check is that iframe subresources that are not in top frame cache are loaded
+anyway, so it can also pass if the UA fails to reject loads for cache misses.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-1.html");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.addEventListener('noupdate', function() { test() }, false);
+applicationCache.addEventListener('cached', function() { test() }, false);
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/top-frame-2-expected.txt b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt
new file mode 100644
index 0000000..6e99bb6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt
@@ -0,0 +1,7 @@
+Test that a subframe without manifest gets picked by a relevant application cache that contains its resource.
+
+Should say SUCCESS:
+
+checking
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/top-frame-2.html b/LayoutTests/http/tests/appcache/top-frame-2.html
new file mode 100644
index 0000000..c239d08
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-2.html
@@ -0,0 +1,42 @@
+<html manifest="resources/subframes-2.manifest">
+<body>
+<p>Test that a subframe without manifest gets picked by a relevant application cache that
+contains its resource.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // When a new main resource is associated with the cache, an update should be started.
+ applicationCache.onchecking = function() { log("checking") }
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-2.html");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
new file mode 100644
index 0000000..a10dbee
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt
@@ -0,0 +1,10 @@
+Test that a subframe with manifest that matches top frame manifest works correctly.
+
+In this case, the subframe resource is NOT listed in manifest explicitly.
+
+Should say SUCCESS:
+
+checking
+checking
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/top-frame-3.html b/LayoutTests/http/tests/appcache/top-frame-3.html
new file mode 100644
index 0000000..9fc9dde
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-3.html
@@ -0,0 +1,60 @@
+<html manifest="resources/subframes-3.manifest">
+<body>
+<p>Test that a subframe with manifest that matches top frame manifest works correctly.</p>
+<p>In this case, the subframe resource is NOT listed in manifest explicitly.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // When a new main resource is associated with the cache, an update should be started.
+ applicationCache.onchecking = function() { log("checking") }
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-3.html");
+ document.body.appendChild(ifr);
+}
+
+function test2()
+{
+ window.removeEventListener("message", test2, false);
+ window.addEventListener("message", test3, false);
+
+ // Add an identical frame, to test that loading its resources from appcache works.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-3.html");
+ document.body.appendChild(ifr);
+}
+
+function test3()
+{
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+window.addEventListener("message", test2, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
new file mode 100644
index 0000000..43bfd43
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt
@@ -0,0 +1,10 @@
+Test that a subframe with manifest that matches top frame manifest works correctly.
+
+In this case, the subframe resource is listed in manifest explicitly.
+
+Should say SUCCESS:
+
+checking
+checking
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/top-frame-4.html b/LayoutTests/http/tests/appcache/top-frame-4.html
new file mode 100644
index 0000000..39743b9
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-4.html
@@ -0,0 +1,60 @@
+<html manifest="resources/subframes-4.manifest">
+<body>
+<p>Test that a subframe with manifest that matches top frame manifest works correctly.</p>
+<p>In this case, the subframe resource is listed in manifest explicitly.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // When a new main resource is associated with the cache, an update should be started.
+ applicationCache.onchecking = function() { log("checking") }
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-4.html");
+ document.body.appendChild(ifr);
+}
+
+function test2()
+{
+ window.removeEventListener("message", test2, false);
+ window.addEventListener("message", test3, false);
+
+ // Add an identical frame, to test that loading its resources from appcache works.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-4.html");
+ document.body.appendChild(ifr);
+}
+
+function test3()
+{
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+window.addEventListener("message", test2, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/update-cache-expected.txt b/LayoutTests/http/tests/appcache/update-cache-expected.txt
new file mode 100644
index 0000000..a6d95d4
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/update-cache-expected.txt
@@ -0,0 +1,10 @@
+Test a simple offline application self-update process. Should print a series of messages followed with DONE:
+
+Updating cache group...
+Cache status is UPDATEREADY
+Updating cache group once more...
+Cache status is UPDATEREADY
+Associating document with the newest cache version...
+Cache status is IDLE
+DONE
+
diff --git a/LayoutTests/http/tests/appcache/update-cache.html b/LayoutTests/http/tests/appcache/update-cache.html
new file mode 100644
index 0000000..dd48b01
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/update-cache.html
@@ -0,0 +1,69 @@
+<html manifest="resources/versioned-manifest.php">
+<body>
+<p>Test a simple offline application self-update process. Should print a series of messages followed with DONE:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function modifyManifest()
+{
+ var req = new XMLHttpRequest;
+ req.open("GET", "resources/versioned-manifest.php?command=step", false);
+ req.send(false);
+}
+
+function test()
+{
+ modifyManifest();
+
+ applicationCache.oncached = function() { log("FAIL: Unexpected cached event") }
+ applicationCache.onnoupdate = function() { log("FAIL: Unexpected noupdate event") }
+ applicationCache.onupdateready = function() { setTimeout(test2, 0) }
+
+ log("Updating cache group...");
+ setTimeout("applicationCache.update()", 0);
+}
+
+function test2()
+{
+ log((applicationCache.status == applicationCache.UPDATEREADY) ? "Cache status is UPDATEREADY" : ("FAIL: Incorrect cache status, " + applicationCache.status));
+
+ modifyManifest();
+ applicationCache.onupdateready = function() { setTimeout(test3, 0) }
+
+ log("Updating cache group once more...");
+ setTimeout("applicationCache.update()", 0);
+}
+
+function test3()
+{
+ log((applicationCache.status == applicationCache.UPDATEREADY) ? "Cache status is UPDATEREADY" : ("FAIL: Incorrect cache status, " + applicationCache.status));
+
+ log("Associating document with the newest cache version...");
+ applicationCache.swapCache();
+
+ log((applicationCache.status == applicationCache.IDLE) ? "Cache status is IDLE" : ("FAIL: Incorrect cache status, " + applicationCache.status));
+
+ log("DONE");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.oncached = test;
+applicationCache.onnoupdate = test;
+applicationCache.onupdateready = function() { log("FAIL: Unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: Unexpected error event") }
+applicationCache.onobsolete = function() { log("FAIL: Unexpected obsolete event") }
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/whitelist-wildcard-expected.txt b/LayoutTests/http/tests/appcache/whitelist-wildcard-expected.txt
new file mode 100644
index 0000000..b503f12
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/whitelist-wildcard-expected.txt
@@ -0,0 +1,3 @@
+Test that online whitelist wildcard flag is implemented.
+
+SUCCESS
diff --git a/LayoutTests/http/tests/appcache/whitelist-wildcard.html b/LayoutTests/http/tests/appcache/whitelist-wildcard.html
new file mode 100644
index 0000000..01bc892
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/whitelist-wildcard.html
@@ -0,0 +1,29 @@
+<html manifest="resources/whitelist-wildcard.manifest">
+<body>
+<p>Test that online whitelist wildcard flag is implemented.</p>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function test()
+{
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "resources/empty.txt", false);
+ req.send();
+ document.body.appendChild(document.createTextNode("SUCCESS"));
+ } catch (ex) {
+ document.body.appendChild(document.createTextNode(ex));
+ }
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.oncached = test;
+applicationCache.onnoupdate = test;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/wrong-content-type-expected.txt b/LayoutTests/http/tests/appcache/wrong-content-type-expected.txt
new file mode 100644
index 0000000..d13447a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-content-type-expected.txt
@@ -0,0 +1,6 @@
+Test that a manifest served with a wrong content-type isn't treated as such.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/wrong-content-type.html b/LayoutTests/http/tests/appcache/wrong-content-type.html
new file mode 100644
index 0000000..7b3bf6c
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-content-type.html
@@ -0,0 +1,40 @@
+<html manifest="resources/wrong-content-type.manifest">
+<body>
+<p>Test that a manifest served with a wrong content-type isn't treated as such.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt b/LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt
new file mode 100644
index 0000000..c89843b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt
@@ -0,0 +1,6 @@
+Test that a manifest served with a wrong signature isn't treated as such.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/wrong-signature-2.html b/LayoutTests/http/tests/appcache/wrong-signature-2.html
new file mode 100644
index 0000000..9b26d02
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-signature-2.html
@@ -0,0 +1,40 @@
+<html manifest="resources/wrong-signature-2.manifest">
+<body>
+<p>Test that a manifest served with a wrong signature isn't treated as such.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/wrong-signature-expected.txt b/LayoutTests/http/tests/appcache/wrong-signature-expected.txt
new file mode 100644
index 0000000..c89843b
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-signature-expected.txt
@@ -0,0 +1,6 @@
+Test that a manifest served with a wrong signature isn't treated as such.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/wrong-signature.html b/LayoutTests/http/tests/appcache/wrong-signature.html
new file mode 100644
index 0000000..3b5f747
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/wrong-signature.html
@@ -0,0 +1,40 @@
+<html manifest="resources/wrong-signature.manifest">
+<body>
+<p>Test that a manifest served with a wrong signature isn't treated as such.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/xhr-foreign-resource-expected.txt b/LayoutTests/http/tests/appcache/xhr-foreign-resource-expected.txt
new file mode 100644
index 0000000..bf67172
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/xhr-foreign-resource-expected.txt
@@ -0,0 +1,6 @@
+Test that a resource marked as foreign can still be loaded via XHR.
+
+Should say SUCCESS:
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/appcache/xhr-foreign-resource.html b/LayoutTests/http/tests/appcache/xhr-foreign-resource.html
new file mode 100644
index 0000000..df08d3f
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/xhr-foreign-resource.html
@@ -0,0 +1,79 @@
+<html manifest="resources/xhr-foreign-resource.manifest">
+<body>
+<p>Test that a resource marked as foreign can still be loaded via XHR.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function createFrame1()
+{
+ applicationCache.onnoupdate = function() { log("FAIL: Unexpected noupdate event") }
+ applicationCache.oncached = function() { log("FAIL: Unexpected cached event") }
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/xhr-foreign-resource-frame.html");
+ document.body.appendChild(ifr);
+}
+
+function createFrame2()
+{
+ // A copy that doesn't have its main resource in cache manifest.
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/xhr-foreign-resource-frame.html?");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.onnoupdate = function() { createFrame1() }
+applicationCache.oncached = function() { createFrame1() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+var hadErrorFromSubframe = false;
+var subframeMessagesReceived = 0;
+function frameMessageReceived(evt)
+{
+ ++subframeMessagesReceived;
+ if (evt.data != "SUCCESS")
+ hadErrorFromSubframe = true;
+ if (subframeMessagesReceived == 1)
+ setTimeout(createFrame2, 0);
+ else if (subframeMessagesReceived == 2)
+ test();
+}
+
+function test(evt)
+{
+ if (!hadErrorFromSubframe) {
+ // The subframe has a different cache, but it is also listed as a resource in main frame's
+ // manifest, so it should be loaded successfully despite being marked as foreign now.
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "resources/xhr-foreign-resource-frame.html", false);
+ req.send("");
+ log("SUCCESS");
+ } catch (ex) {
+ log (ex);
+ }
+ } else
+ log("FAIL: subframe didn't get a correct cache");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+window.addEventListener("message", frameMessageReceived, false);
+
+</script>
+</body>
+</html>