Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2006 19:12:37 +0000 (19:12 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2006 19:12:37 +0000 (19:12 +0000)
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=6197
          Would like to use locally installed Apache for testing.

        Added two run-webkit-tests options:
          --http (--nohttp)  - whether to launch Apache (defaults to yes);
          --port - which port to listen on (defaults to 8000).

        Tests in LayoutTests/http are not run directly, and Apache is used instead.
        For example, http/tests/xmlhttprequest/post-content-type.html is loaded as
        http://127.0.0.1:8000/xmlhttprequest/post-content-type.html.

        Also added support for .shtml and .text files. Text files give an empty
        *-expected.txt, but a correct image.

        Apache only listens on the loopback interface. It writes logs to /tmp/WebKit.

        * Scripts/run-webkit-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12923 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 files changed:
LayoutTests/ChangeLog
LayoutTests/http/conf/httpd.conf [new file with mode: 0644]
LayoutTests/http/conf/mime.types [new file with mode: 0644]
LayoutTests/http/tests/incremental/.htaccess [new file with mode: 0644]
LayoutTests/http/tests/incremental/slow-utf8-text-expected.checksum [new file with mode: 0644]
LayoutTests/http/tests/incremental/slow-utf8-text-expected.png [new file with mode: 0644]
LayoutTests/http/tests/incremental/slow-utf8-text-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/incremental/slow-utf8-text.text [new file with mode: 0755]
LayoutTests/http/tests/incremental/split-hex-entities-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/incremental/split-hex-entities.html [new file with mode: 0755]
LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi [new file with mode: 0755]
LayoutTests/http/tests/xmlhttprequest/interactive-state.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/post-content-type-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/post-content-type.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/print-content-type.cgi [new file with mode: 0755]
LayoutTests/http/tests/xmlhttprequest/resources/.htaccess [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply.xml [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply2.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply2.xml [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply3.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply3.xml [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply4.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply4.xml [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/reply5.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/resources/zero-length.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/response-encoding-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/response-encoding.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync.html [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/zero-length-response.html [new file with mode: 0644]
WebKitTools/ChangeLog
WebKitTools/Scripts/run-webkit-tests

index d16c7ed..0e59b96 100644 (file)
@@ -1,3 +1,49 @@
+2006-02-21  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Darin.
+
+        - Tests to go with http://bugzilla.opendarwin.org/show_bug.cgi?id=6197
+          Would like to use locally installed Apache for testing.
+
+        * http: Added.
+        * http/conf: Added.
+        * http/conf/httpd.conf: Added.
+        * http/conf/mime.types: Added.
+        * http/tests: Added.
+        * http/tests/incremental: Added.
+        * http/tests/incremental/.htaccess: Added.
+        * http/tests/incremental/slow-utf8-text-expected.checksum: Added.
+        * http/tests/incremental/slow-utf8-text-expected.png: Added.
+        * http/tests/incremental/slow-utf8-text-expected.txt: Added.
+        * http/tests/incremental/slow-utf8-text.text: Added.
+        * http/tests/incremental/split-hex-entities-expected.txt: Added.
+        * http/tests/incremental/split-hex-entities.html: Added.
+        * http/tests/xmlhttprequest: Added.
+        * http/tests/xmlhttprequest/post-content-type-expected.txt: Added.
+        * http/tests/xmlhttprequest/post-content-type.html: Added.
+        * http/tests/xmlhttprequest/print-content-type.cgi: Added.
+        * http/tests/xmlhttprequest/resources: Added.
+        * http/tests/xmlhttprequest/resources/.htaccess: Added.
+        * http/tests/xmlhttprequest/resources/reply.txt: Added.
+        * http/tests/xmlhttprequest/resources/reply.xml: Added.
+        * http/tests/xmlhttprequest/resources/reply2.txt: Added.
+        * http/tests/xmlhttprequest/resources/reply2.xml: Added.
+        * http/tests/xmlhttprequest/resources/reply3.txt: Added.
+        * http/tests/xmlhttprequest/resources/reply3.xml: Added.
+        * http/tests/xmlhttprequest/resources/reply4.txt: Added.
+        * http/tests/xmlhttprequest/resources/reply4.xml: Added.
+        * http/tests/xmlhttprequest/resources/reply5.txt: Added.
+        * http/tests/xmlhttprequest/resources/zero-length.txt: Added.
+        * http/tests/xmlhttprequest/response-encoding-expected.txt: Added.
+        * http/tests/xmlhttprequest/response-encoding.html: Added.
+        * http/tests/xmlhttprequest/zero-length-response-expected.txt: Added.
+        * http/tests/xmlhttprequest/zero-length-response-sync-expected.txt: Added.
+        * http/tests/xmlhttprequest/zero-length-response-sync.html: Added.
+        * http/tests/xmlhttprequest/zero-length-response.html: Added.
+        * http/tests/xmlhttprequest/interactive-state-expected.txt: Added.
+        * http/tests/xmlhttprequest/interactive-state.html: Added.
+        * http/tests/xmlhttprequest/interactive-state.cgi: Added.
+
 2006-02-20  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Geoff and Darin.
diff --git a/LayoutTests/http/conf/httpd.conf b/LayoutTests/http/conf/httpd.conf
new file mode 100644 (file)
index 0000000..a2b7df0
--- /dev/null
@@ -0,0 +1,729 @@
+##
+## 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 "/private/var/run/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:8000
+
+#
+# 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.
+#
+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
+
+#
+# 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 "/tmp/WebKit/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 "/private/var/log/httpd/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
+
+    #
+    # 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-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/mime.types b/LayoutTests/http/conf/mime.types
new file mode 100644 (file)
index 0000000..6735f1b
--- /dev/null
@@ -0,0 +1,599 @@
+# 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/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/tests/incremental/.htaccess b/LayoutTests/http/tests/incremental/.htaccess
new file mode 100644 (file)
index 0000000..3d9d1ab
--- /dev/null
@@ -0,0 +1,13 @@
+<Files "slow-utf8-text.text">
+  AddType text/plain .text
+  AddHandler cgi-script .text
+  Header set Expires "Thu, 01 Dec 2003 16:00:00 GMT"
+  Header set Cache-Control "no-store, no-cache, must-revalidate"
+  Header set Pragma "no-cache"
+</Files>
+<Files "split-hex-entities.html">
+  AddHandler cgi-script .html
+  Header set Expires "Thu, 01 Dec 2003 16:00:00 GMT"
+  Header set Cache-Control "no-store, no-cache, must-revalidate"
+  Header set Pragma "no-cache"
+</Files>
diff --git a/LayoutTests/http/tests/incremental/slow-utf8-text-expected.checksum b/LayoutTests/http/tests/incremental/slow-utf8-text-expected.checksum
new file mode 100644 (file)
index 0000000..d78e225
--- /dev/null
@@ -0,0 +1 @@
+cf93f1432622cd9370456024d8b1ca8a
\ No newline at end of file
diff --git a/LayoutTests/http/tests/incremental/slow-utf8-text-expected.png b/LayoutTests/http/tests/incremental/slow-utf8-text-expected.png
new file mode 100644 (file)
index 0000000..f05ecbf
Binary files /dev/null and b/LayoutTests/http/tests/incremental/slow-utf8-text-expected.png differ
diff --git a/LayoutTests/http/tests/incremental/slow-utf8-text-expected.txt b/LayoutTests/http/tests/incremental/slow-utf8-text-expected.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/LayoutTests/http/tests/incremental/slow-utf8-text.text b/LayoutTests/http/tests/incremental/slow-utf8-text.text
new file mode 100755 (executable)
index 0000000..a636b2e
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+
+# flush the buffers after each print
+$cfh = select (STDOUT);
+$| = 1;
+
+print "Content-Type: text/plain\n\n";
+print "\xef\xbb\xbfTest for bug 5187: UTF-8 in long text files breaks at some point.\n\n";
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
+sleep 1;
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
+for ($count=1; $count<2000; $count++) {
+    print "\x65\xcc\x81";
+}
diff --git a/LayoutTests/http/tests/incremental/split-hex-entities-expected.txt b/LayoutTests/http/tests/incremental/split-hex-entities-expected.txt
new file mode 100644 (file)
index 0000000..e320e23
--- /dev/null
@@ -0,0 +1,5 @@
+Test for bug 4820: hexadecimal HTML entities split across TCP packets are not parsed correctly.
+
+Should be a blank page (except for this description).
+
+
diff --git a/LayoutTests/http/tests/incremental/split-hex-entities.html b/LayoutTests/http/tests/incremental/split-hex-entities.html
new file mode 100755 (executable)
index 0000000..d92957c
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+# flush the buffers after each print
+$cfh = select (STDOUT);
+$| = 1;
+
+print "Content-Type: text/html\n\n";
+
+print "<body>\n";
+print "<script>\n";
+print "    if (window.layoutTestController)\n";
+print "        layoutTestController.dumpAsText();\n";
+print "</script>\n";
+print "<p>Test for <a href=\"http://bugzilla.opendarwin.org/show_bug.cgi?id=4820\">bug 4820</a>: hexadecimal HTML entities split across TCP packets are not parsed correctly.</p>";
+print "<p>Should be a blank page (except for this description).</p>";
+
+for ($count=1; $count<3000; $count++) {
+    print "&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;  ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020; &#x20; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+}
+print "</body>\n";
diff --git a/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt b/LayoutTests/http/tests/xmlhttprequest/interactive-state-expected.txt
new file mode 100644 (file)
index 0000000..4ba9dda
--- /dev/null
@@ -0,0 +1,4 @@
+Test for bug 7392: GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.
+
+SUCCESS
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi b/LayoutTests/http/tests/xmlhttprequest/interactive-state.cgi
new file mode 100755 (executable)
index 0000000..5b4cf29
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+
+# flush the buffers after each print
+$cfh = select (STDOUT);
+$| = 1;
+
+print "Content-Type: text/html\n\n";
+
+for ($count=1; $count<3000; $count++) {
+    print "&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;  ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;&#x020;&#x0020;&#x0020;&#x0020;";
+    print "&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x20;&#x0020;&#x0020;&#x0020; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+    print "&#x0020;&#x0020;&#x0020; &#x20; &#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020;&#x0020; ";
+}
diff --git a/LayoutTests/http/tests/xmlhttprequest/interactive-state.html b/LayoutTests/http/tests/xmlhttprequest/interactive-state.html
new file mode 100644 (file)
index 0000000..b363d81
--- /dev/null
@@ -0,0 +1,59 @@
+<html>
+<head>
+<title>Test XmlHttpRequest onreadystatechange being called for each chunk of data</title>
+<body>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7392">bug 7392</a>:
+GMAIL: XMLHttpRequest does not correctly report "Interactive" state on receipt of load data.</p>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var console_messages = document.createElement("ol");
+    document.body.appendChild(console_messages);
+    
+    var count = 0;
+    
+    function log(message)
+    {
+        var item = document.createElement("li");
+        item.appendChild(document.createTextNode(message));
+        console_messages.appendChild(item);
+    }
+    
+    function get(url, async)
+    {
+        if (window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (ex) {
+                req = new ActiveXObject("Microsoft.XMLHTTP");
+            }
+        }
+        
+        req.onreadystatechange = processStateChange;
+        
+        req.open('GET', url, async);
+        req.send(null);
+
+        if (!async && req.status != 200)
+            throw ("HTTP request failed, status: " + req.status);
+        
+        return req;
+    }
+    
+    function processStateChange(){
+      if (req.readyState == 3)
+        ++count;
+      else if (req.readyState == 4)
+        log((count > 1) ? "SUCCESS" : "FAILURE (count = " + count + ")");
+    }
+    
+    // start async steps
+    get('interactive-state.cgi', true);
+    
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/xmlhttprequest/post-content-type-expected.txt b/LayoutTests/http/tests/xmlhttprequest/post-content-type-expected.txt
new file mode 100644 (file)
index 0000000..9d15e07
--- /dev/null
@@ -0,0 +1,6 @@
+Test for bug 3565 - posting data via XMLHttpRequest doesn't work (wrong Content-Type).
+
+Should be application/xml:
+
+application/xml
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/post-content-type.html b/LayoutTests/http/tests/xmlhttprequest/post-content-type.html
new file mode 100644 (file)
index 0000000..1984884
--- /dev/null
@@ -0,0 +1,16 @@
+<html>
+<body>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=3565">bug 3565</a>
+- posting data via XMLHttpRequest doesn't work (wrong Content-Type).</p>
+<p>Should be application/xml:</p>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    objXmlHttp = new XMLHttpRequest;
+    objXmlHttp.open("POST", "print-content-type.cgi", false);
+    objXmlHttp.send("");
+    document.write("<pre>" + objXmlHttp.responseText + "</pre>");
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/xmlhttprequest/print-content-type.cgi b/LayoutTests/http/tests/xmlhttprequest/print-content-type.cgi
new file mode 100755 (executable)
index 0000000..8f4d402
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/perl -w
+
+use CGI qw(:standard);
+my $cgi = new CGI;
+
+print "Content-type: text/plain\n\n"; 
+print "$ENV{\"CONTENT_TYPE\"}\n";
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/.htaccess b/LayoutTests/http/tests/xmlhttprequest/resources/.htaccess
new file mode 100644 (file)
index 0000000..a33e4a2
--- /dev/null
@@ -0,0 +1,9 @@
+<Files "reply2.txt">
+AddCharset windows-1251 .txt
+</Files>
+<Files "reply4.txt">
+AddCharset koi8-r .txt
+</Files>
+<Files "reply2.xml">
+AddCharset windows-1251 .xml
+</Files>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply.txt b/LayoutTests/http/tests/xmlhttprequest/resources/reply.txt
new file mode 100644 (file)
index 0000000..b043217
--- /dev/null
@@ -0,0 +1 @@
+Проверка
\ No newline at end of file
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply.xml b/LayoutTests/http/tests/xmlhttprequest/resources/reply.xml
new file mode 100644 (file)
index 0000000..8ca33e7
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<node>Ïðîâåðêà</node>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply2.txt b/LayoutTests/http/tests/xmlhttprequest/resources/reply2.txt
new file mode 100644 (file)
index 0000000..54f3d19
--- /dev/null
@@ -0,0 +1 @@
+Ïðîâåðêà
\ No newline at end of file
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply2.xml b/LayoutTests/http/tests/xmlhttprequest/resources/reply2.xml
new file mode 100644 (file)
index 0000000..ea4285e
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="koi8-r"?>
+<node>Ïðîâåðêà</node>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply3.txt b/LayoutTests/http/tests/xmlhttprequest/resources/reply3.txt
new file mode 100644 (file)
index 0000000..54f3d19
--- /dev/null
@@ -0,0 +1 @@
+Ïðîâåðêà
\ No newline at end of file
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply3.xml b/LayoutTests/http/tests/xmlhttprequest/resources/reply3.xml
new file mode 100644 (file)
index 0000000..ea4285e
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="koi8-r"?>
+<node>Ïðîâåðêà</node>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply4.txt b/LayoutTests/http/tests/xmlhttprequest/resources/reply4.txt
new file mode 100644 (file)
index 0000000..54f3d19
--- /dev/null
@@ -0,0 +1 @@
+Ïðîâåðêà
\ No newline at end of file
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply4.xml b/LayoutTests/http/tests/xmlhttprequest/resources/reply4.xml
new file mode 100644 (file)
index 0000000..e616a2b
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<node>Проверка</node>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/reply5.txt b/LayoutTests/http/tests/xmlhttprequest/resources/reply5.txt
new file mode 100644 (file)
index 0000000..5d0c968
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="koi8-r"?>
+<node>Проверка</node>
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/zero-length.txt b/LayoutTests/http/tests/xmlhttprequest/resources/zero-length.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/LayoutTests/http/tests/xmlhttprequest/response-encoding-expected.txt b/LayoutTests/http/tests/xmlhttprequest/response-encoding-expected.txt
new file mode 100644 (file)
index 0000000..d74e2ec
--- /dev/null
@@ -0,0 +1,21 @@
+Test for bug 5744 - correctly determine the encoding of XMLHttpRequest responses.
+
+Plain text, UTF-8 as default: Проверка
+Plain text, windows-1251 specified in HTTP headers: Проверка
+Plain text, windows-1251 specified in overrideMimeType: Проверка
+Plain text, koi8-r specified in HTTP headers, but overridden by windows-1251 in overrideMimeType: Проверка
+XML, UTF-8 as default: Проверка. responseText: <?xml version="1.0"?> <node>Проверка</node>
+XML, windows-1251 specified in XML declaration: Проверка. responseText: <?xml version="1.0" encoding="windows-1251"?> <node>Проверка</node>
+XML, koi8-r specified in XML declaration, but overridden by windows-1251 in HTTP headers: Проверка. responseText: <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+XML, koi8-r specified in XML declaration, but overridden by windows-1251 in overrideMimeType: Проверка. responseText: <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+XML transferred as text/plain, UTF-8 as default (ignore XML text declaration): <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+Async: Plain text, UTF-8 as default: Проверка
+Async: Plain text, windows-1251 specified in HTTP headers: Проверка
+Async: Plain text, windows-1251 specified in overrideMimeType: Проверка
+Async: Plain text, koi8-r specified in HTTP headers, but overridden by windows-1251 in overrideMimeType: Проверка
+Async: XML, UTF-8 as default: Проверка. responseText: <?xml version="1.0"?> <node>Проверка</node>
+Async: XML, windows-1251 specified in XML declaration: Проверка. responseText: <?xml version="1.0" encoding="windows-1251"?> <node>Проверка</node>
+Async: XML, koi8-r specified in XML declaration, but overridden by windows-1251 in HTTP headers: Проверка. responseText: <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+Async: XML, koi8-r specified in XML declaration, but overridden by windows-1251 in overrideMimeType: Проверка. responseText: <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+Async: XML transferred as text/plain, UTF-8 as default (ignore XML text declaration): <?xml version="1.0" encoding="koi8-r"?> <node>Проверка</node>
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/response-encoding.html b/LayoutTests/http/tests/xmlhttprequest/response-encoding.html
new file mode 100644 (file)
index 0000000..cdd808c
--- /dev/null
@@ -0,0 +1,201 @@
+<html>
+<head>
+<title>Test XmlHttpRequest response encoding handling</title>
+<meta http-equiv="content-type" content="text/html;charset=koi8-r">
+<body>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5744">bug 5744</a>
+- correctly determine the encoding of XMLHttpRequest responses.</p>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var console_messages = document.createElement("ol");
+    document.body.appendChild(console_messages);
+    
+    var asyncStep = 1;
+    
+    function log(message)
+    {
+        var item = document.createElement("li");
+        item.appendChild(document.createTextNode(message));
+        console_messages.appendChild(item);
+    }
+    
+    function get(url, async)
+    {
+        if (window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (ex) {
+                req = new ActiveXObject("Microsoft.XMLHTTP");
+            }
+        }
+        
+        if (async)
+            req.onreadystatechange = processStateChange;
+        
+        req.open('GET', url, async);
+        req.send(null);
+
+        if (!async && req.status != 200)
+            throw ("HTTP request failed, status: " + req.status);
+        
+        return req;
+    }
+
+    function getWithOverride(url, contentType, async)
+    {
+        if (window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (ex) {
+                req = new ActiveXObject("Microsoft.XMLHTTP");
+            }
+        }
+
+        if (async)
+            req.onreadystatechange = processStateChange;
+
+        req.open('GET', url, async);
+        req.overrideMimeType(contentType);
+        req.send(null);
+
+        if (!async && req.status != 200)
+            throw ("HTTP request failed, status: " + req.status);
+        
+        return req;
+    }
+    
+    function processStateChange(){
+      if (req.readyState == 4){
+        if (req.status == 200){
+           if (asyncStep == 1) {
+             asyncStep = 2;
+             log("Async: Plain text, UTF-8 as default: " + req.responseText);
+             get('resources/reply2.txt', true);
+           } else if (asyncStep == 2) {
+             asyncStep = 3;
+             log("Async: Plain text, windows-1251 specified in HTTP headers: " + req.responseText);
+             getWithOverride('resources/reply3.txt', 'text/plain; charset=windows-1251', true);
+           } else if (asyncStep == 3) {
+             asyncStep = 4;
+             log("Async: Plain text, windows-1251 specified in overrideMimeType: " + req.responseText);
+             getWithOverride('resources/reply4.txt', 'text/plain; charset=windows-1251', true);
+           } else if (asyncStep == 4) {
+             asyncStep = 5;
+             log("Async: Plain text, koi8-r specified in HTTP headers, but overridden by windows-1251 in overrideMimeType: " + req.responseText);
+             get('resources/reply4.xml', true);
+           } else if (asyncStep == 5) {
+             asyncStep = 6;
+             log("Async: XML, UTF-8 as default: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+             get('resources/reply.xml', true);
+           } else if (asyncStep == 6) {
+             asyncStep = 7;
+             log("Async: XML, windows-1251 specified in XML declaration: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+             get('resources/reply2.xml', true);
+           } else if (asyncStep == 7) {
+             asyncStep = 8;
+             log("Async: XML, koi8-r specified in XML declaration, but overridden by windows-1251 in HTTP headers: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+             getWithOverride('resources/reply3.xml', 'text/xml; charset=windows-1251', true);
+           } else if (asyncStep == 8) {
+             asyncStep = 9;
+             log("Async: XML, koi8-r specified in XML declaration, but overridden by windows-1251 in overrideMimeType: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+             get('resources/reply5.txt', true);
+           } else if (asyncStep == 9) {
+             log("Async: XML transferred as text/plain, UTF-8 as default (ignore XML text declaration): " + req.responseText);
+           }
+        } else {
+           log("Error loading URL: status " + req.status);
+        }
+      }
+    }
+
+    // sync code
+    
+    // 1
+    try {
+        req = get('resources/reply.txt', false);
+        log("Plain text, UTF-8 as default: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+
+    // 2
+    try {
+        req = get('resources/reply2.txt', false);
+        log("Plain text, windows-1251 specified in HTTP headers: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+
+    // 3
+    try {
+        req = getWithOverride('resources/reply3.txt', 'text/plain; charset=windows-1251', false);
+        log("Plain text, windows-1251 specified in overrideMimeType: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+
+    // 4
+    try {
+        req = getWithOverride('resources/reply4.txt', 'text/plain; charset=windows-1251', false);
+        log("Plain text, koi8-r specified in HTTP headers, but overridden by windows-1251 in overrideMimeType: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+        
+    // 5
+    try {
+        req = get('resources/reply4.xml', false);
+        log("XML, UTF-8 as default: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+        
+    // 6
+    try {
+        req = get('resources/reply.xml', false);
+        log("XML, windows-1251 specified in XML declaration: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+    
+    // 7
+    try {
+        req = get('resources/reply2.xml', false);
+        log("XML, koi8-r specified in XML declaration, but overridden by windows-1251 in HTTP headers: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+        
+    // 8
+    try {
+        req = getWithOverride('resources/reply3.xml', 'text/xml; charset=windows-1251', false);
+        log("XML, koi8-r specified in XML declaration, but overridden by windows-1251 in overrideMimeType: " + req.responseXML.getElementsByTagName('node')[0].childNodes[0].nodeValue + ". responseText: " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+    
+    // 9
+    try {
+        req =  get('resources/reply5.txt', false);
+        log("XML transferred as text/plain, UTF-8 as default (ignore XML text declaration): " + req.responseText);
+    } catch (ex) {
+        log("Exception: " + ex.description);
+    }
+    
+    // start async steps
+    get('resources/reply.txt', true);
+    
+//    var console = document.createElement("p");
+//    console.appendChild(console_messages);
+//    document.body.appendChild(console);
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt b/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt
new file mode 100644 (file)
index 0000000..cc37286
--- /dev/null
@@ -0,0 +1,10 @@
+Test for bug 5924 - zero-length responses to XMLHTTPRequest mishandled.
+
+after creation: Uninitialized
+after setting onreadystatechange: Uninitialized
+onreadystatechange: Loading
+after open(): Loading
+after send(): Loading
+onreadystatechange: Loaded. Status: 200
+onreadystatechange: Completed. Status: 200
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync-expected.txt b/LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync-expected.txt
new file mode 100644 (file)
index 0000000..8145efc
--- /dev/null
@@ -0,0 +1,8 @@
+Test for bug 5924 - zero-length responses to XMLHTTPRequest mishandled.
+
+after creation: Uninitialized
+after setting onreadystatechange: Uninitialized
+after open(): Loading
+after send(): Completed
+Status: 200
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync.html b/LayoutTests/http/tests/xmlhttprequest/zero-length-response-sync.html
new file mode 100644 (file)
index 0000000..8daa90e
--- /dev/null
@@ -0,0 +1,79 @@
+<html>
+<head>
+<title>Test XmlHttpRequest zero-length response handling (sync)</title>
+<body>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5924">bug 5924</a>
+- zero-length responses to XMLHTTPRequest mishandled.</p>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var console_messages = document.createElement("ol");
+    document.body.appendChild(console_messages);
+    
+    function log(message)
+    {
+        var item = document.createElement("li");
+        item.appendChild(document.createTextNode(message));
+        console_messages.appendChild(item);
+    }
+    
+    function get(url, async)
+    {
+        if (window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (ex) {
+                req = new ActiveXObject("Microsoft.XMLHTTP");
+            }
+        }
+        
+        log("after creation: " + stateName(req.readyState));
+        
+        if (async)
+            req.onreadystatechange = processStateChange;
+        
+        log("after setting onreadystatechange: " + stateName(req.readyState));
+
+        req.open('GET', url, async);
+        log("after open(): " + stateName(req.readyState));
+        req.send(null);
+        log("after send(): " + stateName(req.readyState));
+
+        if (!async && req.status != 200)
+            throw ("HTTP request failed, status: " + req.status);
+        
+        return req;
+    }
+    
+    function stateName(val) {
+      if (req.readyState == 0)
+          return "Uninitialized";
+      else if (req.readyState == 1)
+          return "Loading";
+      else if (req.readyState == 2)
+          return "Loaded";
+      else if (req.readyState == 3)
+          return "Interactive";
+      else if (req.readyState == 4)
+          return "Completed";
+      else
+        return "???";
+    }
+    
+    function processStateChange(){
+      if (req.readyState < 2)
+        log("onreadystatechange: " + stateName(req.readyState));
+      else
+        log("onreadystatechange: " + stateName(req.readyState) + ". Status: " + req.status);
+    }
+    
+    // start async steps
+    get('resources/zero-length.txt', false);
+    log("Status: " + req.status);
+</script>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/xmlhttprequest/zero-length-response.html b/LayoutTests/http/tests/xmlhttprequest/zero-length-response.html
new file mode 100644 (file)
index 0000000..bb5d4da
--- /dev/null
@@ -0,0 +1,79 @@
+<html>
+<head>
+<title>Test XmlHttpRequest zero-length response handling (async)</title>
+<body>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=5924">bug 5924</a>
+- zero-length responses to XMLHTTPRequest mishandled.</p>
+<script>
+
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var console_messages = document.createElement("ol");
+    document.body.appendChild(console_messages);
+    
+    function log(message)
+    {
+        var item = document.createElement("li");
+        item.appendChild(document.createTextNode(message));
+        console_messages.appendChild(item);
+    }
+    
+    function get(url, async)
+    {
+        if (window.XMLHttpRequest) {
+            req = new XMLHttpRequest();
+        } else {
+            try {
+                req = new ActiveXObject("Msxml2.XMLHTTP");
+            } catch (ex) {
+                req = new ActiveXObject("Microsoft.XMLHTTP");
+            }
+        }
+        
+        log("after creation: " + stateName(req.readyState));
+        
+        if (async)
+            req.onreadystatechange = processStateChange;
+        
+        log("after setting onreadystatechange: " + stateName(req.readyState));
+
+        req.open('GET', url, async);
+        log("after open(): " + stateName(req.readyState));
+        req.send(null);
+        log("after send(): " + stateName(req.readyState));
+
+        if (!async && req.status != 200)
+            throw ("HTTP request failed, status: " + req.status);
+        
+        return req;
+    }
+    
+    function stateName(val) {
+      if (req.readyState == 0)
+          return "Uninitialized";
+      else if (req.readyState == 1)
+          return "Loading";
+      else if (req.readyState == 2)
+          return "Loaded";
+      else if (req.readyState == 3)
+          return "Interactive";
+      else if (req.readyState == 4)
+          return "Completed";
+      else
+        return "???";
+    }
+    
+    function processStateChange(){
+      if (req.readyState < 2)
+        log("onreadystatechange: " + stateName(req.readyState));
+      else
+        log("onreadystatechange: " + stateName(req.readyState) + ". Status: " + req.status);
+    }
+    
+    // start async steps
+    get('resources/zero-length.txt', true);
+    
+</script>
+</body>
+</html>
index 750b396..319521f 100644 (file)
@@ -1,3 +1,25 @@
+2006-02-21  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Darin.
+
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=6197
+          Would like to use locally installed Apache for testing.
+
+        Added two run-webkit-tests options:
+          --http (--nohttp)  - whether to launch Apache (defaults to yes);
+          --port - which port to listen on (defaults to 8000).
+
+        Tests in LayoutTests/http are not run directly, and Apache is used instead.
+        For example, http/tests/xmlhttprequest/post-content-type.html is loaded as
+        http://127.0.0.1:8000/xmlhttprequest/post-content-type.html.
+
+        Also added support for .shtml and .text files. Text files give an empty 
+        *-expected.txt, but a correct image.
+
+        Apache only listens on the loopback interface. It writes logs to /tmp/WebKit.
+
+        * Scripts/run-webkit-tests:
+
 2006-02-21  Darin Adler  <darin@apple.com>
 
         Suggested by Mark Rowe.
index efa2ce5..5d8d265 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl -w
 
 # Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -40,7 +41,7 @@ use webkitdirs;
 use Time::HiRes qw(time);
 
 # Run all the tests passed in on the command line.
-# If no tests are passed, find all the .html, .xml, .xhtml (and svg) files in the test directory.
+# If no tests are passed, find all the .html, .shtml, .text, .xml, .xhtml (and svg) files in the test directory.
 
 # Run each text.
 # Compare against the existing file xxx-expected.txt.
@@ -67,6 +68,8 @@ my $quiet = '';
 my $singly = 0;
 my $report10Slowest = 0;
 my $launchSafari = 1;
+my $testHTTP = 1;
+my $httpdPort = 8000;
 my $testResultsDirectory = "/tmp/layout-test-results";
 
 GetOptions('svg' => \$testOnlySVGs, 
@@ -78,6 +81,8 @@ GetOptions('svg' => \$testOnlySVGs,
     'singly|1' => \$singly,
     'slowest' => \$report10Slowest,
     'launch-safari!' => \$launchSafari,
+    'http!' => \$testHTTP,
+    'port=i' => \$httpdPort,
     'results-directory|o=s' => \$testResultsDirectory);
 
 my $dumpToolName = "DumpRenderTree";
@@ -108,7 +113,7 @@ print "Running tests from $testDirectory\n";
 my @tests = ();
 
 my $prunePart = "\\( -name resources \\! -prune \\)";
-my $extensionPart = "-name '*.html' -or -name '*.xml' -or -name '*.xhtml'";
+my $extensionPart = "-name '*.html' -or -name '*.shtml' -or -name '*.text' -or -name '*.xml' -or -name '*.xhtml'";
 if ($testOnlySVGs) {
     $extensionPart = "-name '*.svg' -or -name '*.xml'";
 } elsif ($haveSVGSupport) { 
@@ -116,6 +121,9 @@ if ($testOnlySVGs) {
 } else {
     $prunePart .= " -or \\( -name svg \\! -prune \\)";
 }
+if (!$testHTTP) {
+    $prunePart .= " -or \\( -name http \\! -prune \\)";
+}
 my $findArguments = "$prunePart -or $extensionPart";
 
 my $foundTestName = 0;
@@ -126,9 +134,9 @@ for my $test (@ARGV) {
     if ($test =~ /^\//) {
         print "can't run test outside $testDirectory\n";
     } elsif (-f "$testDirectory/$test") {
-        if ($test !~ /\.(html|xml|xhtml|svg)$/) {
+        if ($test !~ /\.(html|shtml|text|xml|xhtml|svg)$/) {
             print "test $test does not have a supported extension\n";
-        } else {
+        } elsif ($testHTTP || $test !~ /^http\//) {
             push @tests, $test;
         }
     } elsif (-d "$testDirectory/$test") {
@@ -175,6 +183,8 @@ my $toolOpen = 0;
 my $atLineStart = 1;
 my $lastDirectory = "";
 
+my $httpdOpen = 0;
+
 printf("Testing %d test cases.\n", $#tests + 1);
 
 sub openDumpRenderTreeIfNeeded()
@@ -197,6 +207,44 @@ sub closeDumpRenderTree()
     $toolOpen = 0;
 }
 
+sub openHTTPDIfNeeded()
+{
+    return if ($httpdOpen);
+
+    mkdir "/tmp/WebKit";
+    
+    if (-f "/tmp/WebKit/httpd.pid") {
+        my $oldPid = `cat /tmp/WebKit/httpd.pid`;
+        chomp $oldPid;
+        (0 == kill 0, $oldPid) || die "\nhttpd is already running: pid $oldPid\n" . 
+            "Please try again in a few seconds if it is still shutting down after a previous run-webkit-tests invocation; or kill it manually.\n";
+    }
+    
+    my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+    my $documentRoot = "$testDirectory/http/tests";
+    my $typesConfig = "$testDirectory/http/conf/mime.types";
+    my $listen = "127.0.0.1:$httpdPort";
+
+    open2(\*HTTPDIN, \*HTTPDOUT, "/usr/sbin/httpd", 
+        "-f", "$httpdConfig",
+        "-C", "DocumentRoot \"$documentRoot\"",
+        "-C", "Listen $listen",
+        "-c", "TypesConfig \"$typesConfig\"");
+
+    sleep 1; # FIXME: need a better way to wait for Apache to bind to the port
+    $httpdOpen = 1;
+}
+
+sub closeHTTPD()
+{
+    close HTTPDIN;
+    close HTTPDOUT;
+    if (-f "/tmp/WebKit/httpd.pid") {
+        kill 15, `cat /tmp/WebKit/httpd.pid`;
+        $httpdOpen = 0;
+    }
+}
+
 sub fileNameWithNumber($$)
 {
     my ($base, $number) = @_;
@@ -210,7 +258,7 @@ for my $test (@tests) {
     openDumpRenderTreeIfNeeded();
 
     my $base = $test;
-    $base =~ s/\.(html|xml|xhtml|svg)$//;
+    $base =~ s/\.(html|shtml|text|xml|xhtml|svg)$//;
     
     if ($verbose || $singly) {
         print "running $test -> ";
@@ -231,7 +279,15 @@ for my $test (@tests) {
 
     my $startTime = time if $report10Slowest;
 
-    print OUT "$testDirectory/$test\n";
+    if ($test !~ /^http\//) {
+        print OUT "$testDirectory/$test\n";
+    } else {
+        openHTTPDIfNeeded();
+        
+        my $path = $test;
+        $path =~ s/^http\/tests\///;
+        print OUT "http://127.0.0.1:$httpdPort/$path\n";
+    }
 
     my $actual = "";
     while (<IN>) {
@@ -254,7 +310,7 @@ for my $test (@tests) {
         print "        $test -> ";
     }
 
-    my $textDumpMatches = $expected && ($actual eq $expected);
+    my $textDumpMatches = (defined $expected) && ($actual eq $expected);
     my $actualHash = "";
     my $expectedHash = "";
     my $hashMatches = "";
@@ -445,6 +501,10 @@ for my $test (@tests) {
     push @{$tests{$result}}, $test;
 }
 
+if ($httpdOpen) {
+    closeHTTPD();
+}
+
 if ($checkLeaks && !$singly && $toolOpen) {
     my $leaksFileName = fileNameWithNumber($dumpToolName, $leaksOutputFileNumber);
     $totalLeaks += countAndPrintLeaks($dumpToolName, $dumpToolPID, "$testResultsDirectory/$leaksFileName-leaks.txt");
@@ -516,7 +576,7 @@ if ($counts{match} && $counts{match} == $count) {
         print HTML "<table>\n";
         for my $test (@{$tests{mismatch}}) {
             my $base = $test;
-            $base =~ s/\.(html|xml|xhtml|svg)$//;
+            $base =~ s/\.(html|shtml|text|xml|xhtml|svg)$//;
             copy("$testDirectory/$base-expected.txt", "$testResultsDirectory/$base-expected.txt");
             print HTML "<tr>\n";            
             print HTML "<td><a href=\"$testDirectory/$test\">$base</a></td>\n";
@@ -545,7 +605,7 @@ if ($counts{match} && $counts{match} == $count) {
         print HTML "<table>\n";
         for my $test (@{$tests{fail}}) {
             my $base = $test;
-            $base =~ s/\.(html|xml|xhtml|svg)$//;
+            $base =~ s/\.(html|shtml|text|xml|xhtml|svg)$//;
             print HTML "<tr>\n";
             print HTML "<td><a href=\"$testDirectory/$test\">$base</a></td>\n";
             print HTML "</tr>\n";
@@ -558,7 +618,7 @@ if ($counts{match} && $counts{match} == $count) {
         print HTML "<table>\n";
         for my $test (@{$tests{new}}) {
             my $base = $test;
-            $base =~ s/\.(html|xml|xhtml|svg)$//;
+            $base =~ s/\.(html|shtml|text|xml|xhtml|svg)$//;
             print HTML "<tr>\n";
             print HTML "<td><a href=\"$testDirectory/$test\">$base</a></td>\n";
             print HTML "<td><a href=\"$testDirectory/$base-expected.txt\">results</a></td>\n";