Merge from Chromium at DEPS revision r198571

This commit was generated by merge_to_master.py.

Change-Id: I3a7f89ea6b8c017335bd52739166aed708cad1e5
diff --git a/Tools/Scripts/OWNERS b/Tools/Scripts/OWNERS
new file mode 100644
index 0000000..72e8ffc
--- /dev/null
+++ b/Tools/Scripts/OWNERS
@@ -0,0 +1 @@
+*
diff --git a/Tools/Scripts/build-api-tests b/Tools/Scripts/build-api-tests
deleted file mode 100755
index 09d19bf..0000000
--- a/Tools/Scripts/build-api-tests
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use File::Basename;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-my $showHelp = 0;
-my $clean = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help        Show this help message
-  --clean       Clean up the build directory
-EOF
-
-GetOptions(
-    'help' => \$showHelp,
-    'clean' => \$clean,
-);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-checkRequiredSystemConfig();
-setConfiguration();
-chdirWebKit();
-
-# Build
-
-my $result;
-if (isAppleMacWebKit()) {
-    chdir "Source/ThirdParty/gtest";
-    buildXCodeProject("xcode/gtest", $clean, XcodeOptions(), @ARGV);
-    chdir "../../../Tools/TestWebKitAPI" or die;
-    $result = buildXCodeProject("TestWebKitAPI", $clean, XcodeOptions(), @ARGV);
-} elsif (isAppleWinWebKit()) {
-    chdir "Tools/TestWebKitAPI" or die;
-    $result = buildVisualStudioProject("win/TestWebKitAPI.sln", $clean);
-} elsif (isChromium()) {
-    # Chromium build everything in one shot. No need to build anything here.
-    $result = 0;
-} else {
-    die "TestWebKitAPI is not supported on this platform.\n";
-}
-
-exit exitStatus($result);
diff --git a/Tools/Scripts/build-dumprendertree b/Tools/Scripts/build-dumprendertree
deleted file mode 100755
index 4e206f4..0000000
--- a/Tools/Scripts/build-dumprendertree
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use File::Basename;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-my $showHelp = 0;
-my $clean = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help        Show this help message
-  --clean       Clean up the build directory
-  --gtk         Build the GTK+ port
-  --qt          Build the Qt port
-  --wx          Build the wxWindows port
-  --chromium    Build the Chromium port
-  --efl         Build the EFL port
-EOF
-
-GetOptions(
-    'help' => \$showHelp,
-    'clean' => \$clean,
-);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-checkRequiredSystemConfig();
-setConfiguration();
-chdirWebKit();
-
-# Build
-chdir "Tools/DumpRenderTree" or die;
-
-my $result;
-if (isAppleMacWebKit()) {
-    $result = buildXCodeProject("DumpRenderTree", $clean, XcodeOptions(), @ARGV);
-} elsif (isAppleWinWebKit()) {
-    $result = buildVisualStudioProject("DumpRenderTree.sln", $clean);
-} elsif (isQt() || isGtk() || isWx() || isChromium() || isEfl()) {
-    # Qt, Gtk wxWindows, Chromium and EFL build everything in one shot. No need to build anything here.
-    $result = 0;
-} else {
-    die "Building not defined for this platform!\n";
-}
-
-exit exitStatus($result);
diff --git a/Tools/Scripts/build-jsc b/Tools/Scripts/build-jsc
deleted file mode 100755
index ca056f8..0000000
--- a/Tools/Scripts/build-jsc
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-use strict;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-my $coverageSupport = 0;
-my $showHelp = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help                        Show this help message
-  --[no-]coverage               Toggle code coverage support (default: $coverageSupport)
-EOF
-
-GetOptions(
-    'coverage!' => \$coverageSupport,
-    'help' => \$showHelp
-);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-checkRequiredSystemConfig();
-setConfiguration();
-chdirWebKit();
-my @options = XcodeOptions();
-my @coverageSupportOptions = ($coverageSupport) ? XcodeCoverageSupportOptions() : ();
-
-if (isQt()) {
-    checkForArgumentAndRemoveFromARGV("--qt");
-    my @projects = ("WTF", "JavaScriptCore");
-    # Pick up the --no-webkit2 option from BUILD_WEBKIT_ARGS if it is needed
-    push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'});
-    push @ARGV, "WEBKIT_CONFIG-=build_webkit2" if checkForArgumentAndRemoveFromARGV("--no-webkit2");
-    my $result = buildQMakeProjects(\@projects, 0, @ARGV);
-    exit exitStatus($result);
-} elsif (cmakeBasedPortName()) {
-    buildCMakeProjectOrExit(0, cmakeBasedPortName(), undef, "jsc", cmakeBasedPortArguments()); # This call only returns if nothing wrong happened
-    exit exitStatus(0);
-}
-
-sub buildMyProject
-{
-    my ($projectDirectory, $projectName) = @_;
-    my $result;
-    chdir $projectDirectory or die "Can't find $projectName directory to build from";
-    if (isAppleMacWebKit()) {
-        $result = system "sh", "-c", ('xcodebuild -project ' . $projectName . '.xcodeproj "$@" | grep -v setenv && exit ${PIPESTATUS[0]}'), "xcodebuild",  @options, @ARGV, @coverageSupportOptions;
-    } elsif (isAppleWinWebKit()) {
-        $result = buildVisualStudioProject("$projectName.vcproj/$projectName.sln");
-    } elsif (isGtk()) {
-        checkForArgumentAndRemoveFromARGV("--gtk");
-        $result = buildGtkProject($projectName, 0);
-    } elsif (isWx()) {
-        # Builds everything in one-shot. No need to build anything here.
-        $result = 0;
-    } else {
-        die "Building not defined for this platform!\n";
-    }
-    exit exitStatus($result) if exitStatus($result);
-    chdirWebKit();
-}
-
-buildMyProject("Source/WTF", "WTF");
-buildMyProject("Source/JavaScriptCore", "JavaScriptCore");
diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit
deleted file mode 100755
index 88948a6..0000000
--- a/Tools/Scripts/build-webkit
+++ /dev/null
@@ -1,456 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2010 moiji-mobile.com All rights reserved.
-# Copyright (C) 2011 Research In Motion Limited. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Build script wrapper for the WebKit Open Source Project.
-
-use strict;
-use File::Basename;
-use File::Find;
-use File::Spec;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use webkitperl::FeatureList qw(getFeatureOptionList);
-use POSIX;
-
-sub cMakeArgsFromFeatures();
-sub formatBuildTime($);
-sub writeCongrats();
-
-my $originalWorkingDirectory = getcwd();
-chdirWebKit();
-
-my $showHelp = 0;
-my $clean = 0;
-my $useGYP = 0;
-my $minimal = 0;
-my $installHeaders;
-my $installLibs;
-my $prefixPath;
-my $makeArgs = "";
-my $cmakeArgs = "";
-my $onlyWebKitProject = 0;
-my $noWebKit1 = 0;
-my $noWebKit2 = 0;
-my $coverageSupport = 0;
-my $startTime = time();
-
-my @features = getFeatureOptionList();
-
-# Update defaults from Qt's project file
-if (isQt()) {
-    # Take a sneek peek at the arguments, since we will need the qmake binary early
-    # on to do profile parsing. We also need to know if we're showing the help-text.
-    foreach (@ARGV) {
-        if (/^--qmake=(.*)/) {
-            setQmakeBinaryPath($1);
-        } elsif (/^--help$/) {
-            $showHelp = 1;
-        }
-    }
-
-    my %qtDefaults;
-    if ($showHelp) {
-        %qtDefaults = qtFeatureDefaults();
-    }
-
-    foreach (@features) {
-        $_->{default} = (%qtDefaults ? $qtDefaults{$_->{define}} || 0 : -1);
-    }
-}
-
-# Additional environment parameters
-push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'});
-
-# Initialize values from defaults
-foreach (@ARGV) {
-    if ($_ eq '--minimal') {
-        $minimal = 1;
-    }
-}
-
-# Initialize values from defaults
-foreach (@features) {
-    ${$_->{value}} = ($minimal ? 0 : $_->{default});
-}
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help                            Show this help message
-  --clean                           Cleanup the build directory
-  --debug                           Compile with Debug configuration
-  --release                         Compile with Release configuration
-  --sdk=<sdk>                       Use a specific Xcode SDK (iOS and Mac only)
-  --device                          Use the current iphoneos.internal SDK (iOS only)
-  --simulator                       Use the current iphonesimulator SDK (iOS only)
-  --gyp                             Use GYP-generated project files
-  --coverage                        Enable Code Coverage support (Mac only)
-
-  --blackberry                      Build the BlackBerry port on Mac/Linux
-  --chromium                        Build the Chromium port on Mac/Win/Linux
-  --chromium-android                Build the Chromium port on Android
-  --efl                             Build the EFL port
-  --gtk                             Build the GTK+ port
-  --qt                              Build the Qt port
-  --wincairo                        Build using Cairo (rather than CoreGraphics) on Windows
-  --wince                           Build the WinCE port
-
-  --inspector-frontend              Copy changes to the inspector front-end files to the build directory
-
-  --install-headers=<path>          Set installation path for the headers (Qt only)
-  --install-libs=<path>             Set installation path for the libraries (Qt only)
-
-  --prefix=<path>                   Set installation prefix to the given path (Gtk/Efl/BlackBerry only)
-  --makeargs=<arguments>            Optional Makefile flags
-  --qmakearg=<arguments>            Optional qmake flags (Qt only, e.g. --qmakearg="CONFIG+=webkit2" to build WebKit2)
-  --cmakeargs=<arguments>           Optional CMake flags (e.g. --cmakeargs="-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local")
-
-  --minimal                         No optional features, unless explicitly enabled
-
-  --only-webkit                     Build only the WebKit project
-  --no-webkit1                      Omit WebKit1 code from the build (Qt/EFL/GTK only)
-  --no-webkit2                      Omit WebKit2 code from the build
-
-EOF
-
-my %options = (
-    'help' => \$showHelp,
-    'clean' => \$clean,
-    'gyp' => \$useGYP,
-    'install-headers=s' => \$installHeaders,
-    'install-libs=s' => \$installLibs,
-    'prefix=s' => \$prefixPath,
-    'makeargs=s' => \$makeArgs,
-    'cmakeargs=s' => \$cmakeArgs,
-    'minimal' => \$minimal,
-    'only-webkit' => \$onlyWebKitProject,
-    'no-webkit1' => \$noWebKit1,
-    'no-webkit2' => \$noWebKit2,
-    'coverage' => \$coverageSupport,
-);
-
-# Build usage text and options list from features
-foreach (@features) {
-    my $opt = sprintf("%-35s", "  --[no-]$_->{option}");
-    $usage .= "$opt $_->{desc} (default: $_->{default})\n";
-    $options{"$_->{option}!"} = $_->{value};
-}
-
-GetOptions(%options);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-checkRequiredSystemConfig();
-setConfiguration();
-
-my $productDir = productDir();
-
-# Remove 0 byte sized files from productDir after slave lost for Qt buildbots.
-File::Find::find(\&unlinkZeroFiles, $productDir) if (isQt() && -e $productDir);
-
-sub unlinkZeroFiles()
-{
-    my $file = $File::Find::name;
-    # Remove 0 byte sized files, except
-    # - directories (Because they are always 0 byte sized on Windows)
-    # - .d files used for dependency tracking
-    if (! -d $file && ! -s $file && $file !~ m/\.d$/) {
-        unlink $file;
-        print "0 byte sized file removed from build directory: $file\n";
-    }
-}
-
-# Check that all the project directories are there.
-my @projects = ("Source/JavaScriptCore", "Source/WebCore", "Source/WebKit");
-
-# Build WTF as a separate static library on ports which support it.
-splice @projects, 0, 0, "Source/WTF" if isAppleMacWebKit() or isAppleWinWebKit();
-
-for my $dir (@projects) {
-    if (! -d $dir) {
-        die "Error: No $dir directory found. Please do a fresh checkout.\n";
-    }
-}
-
-if (!isQt() && !-d "WebKitLibraries") {
-    die "Error: No WebKitLibraries directory found. Please do a fresh checkout.\n";
-}
-
-# Generate the generate project files from .gyp files
-if ($useGYP) {
-    system("perl", "Tools/Scripts/generate-project-files") == 0 or die "Failed to run generate-project-files";
-}
-
-my @options = ();
-
-if (isAppleMacWebKit()) {
-    push @options, XcodeOptions();
-
-    sub option($$$)
-    {
-        my ($feature, $isEnabled, $defaultValue) = @_;
-        return "" if $defaultValue == $isEnabled;
-        return $feature . "=" . ($isEnabled ? $feature : "");
-    }
-
-    foreach (@features) {
-        my $option = option($_->{define}, ${$_->{value}}, $_->{default});
-        push @options, $option unless $option eq "";
-    }
-
-    # ANGLE must come before WebCore
-    splice @projects, 0, 0, "Source/ThirdParty/ANGLE";
-
-    # WebKit2 is only supported in SnowLeopard and later at present.
-    push @projects, ("Source/WebKit2", "Tools/MiniBrowser") if osXVersion()->{"minor"} >= 6 and !$noWebKit2;
-
-    # Build Tools needed for Apple ports
-    push @projects, ("Tools/DumpRenderTree", "Tools/WebKitTestRunner", "Source/ThirdParty/gtest", "Tools/TestWebKitAPI");
-    
-    # Copy library and header from WebKitLibraries to a findable place in the product directory.
-    (system("perl", "Tools/Scripts/copy-webkitlibraries-to-product-directory", $productDir) == 0) or die;
-} elsif (isWinCairo()) {
-    (system("perl Tools/Scripts/update-webkit-wincairo-libs") == 0) or die;
-} elsif (isAppleWinWebKit()) {
-    # Copy WebKitSupportLibrary to the correct location in WebKitLibraries so it can be found.
-    # Will fail if WebKitSupportLibrary.zip is not in source root.
-    (system("perl Tools/Scripts/update-webkit-support-libs") == 0) or die;
-} elsif (isQt()) {
-    push @options, "--install-headers=" . $installHeaders if defined($installHeaders);
-    push @options, "--install-libs=" . $installLibs if defined($installLibs);
-    push @options, "--makeargs=" . $makeArgs if $makeArgs;
-    push @options, "WEBKIT_CONFIG-=build_webkit1" if $noWebKit1;
-    push @options, "WEBKIT_CONFIG-=build_webkit2" if $noWebKit2;
-
-    if (checkForArgumentAndRemoveFromARGV("-2")) {
-        print "Note: WebKit2 is now built by default, you don't need to pass -2. Disable using --no-webkit2\n";
-    }
-
-    @options = (@ARGV, @options);
-
-    foreach (@features) {
-        if ($_->{define} && ${$_->{value}} != $_->{default}) {
-            my $define = lc($_->{define});
-            $define =~ s/^enable_//;
-            push @options, "WEBKIT_CONFIG" . (${$_->{value}} == 1 ? "+" : "-") . "=" . $define;
-        }
-    }
-}
-
-# If asked to build just the WebKit project, overwrite the projects
-# list after all of the port specific tweaks have been made to
-# build options, etc.
-@projects = ("Source/WebKit") if $onlyWebKitProject;
-
-if (isInspectorFrontend()) {
-    exit exitStatus(copyInspectorFrontendFiles());
-}
-
-my $result = 0;
-
-if (isWx()) {
-    $makeArgs .= " --port=wx";
-
-    downloadWafIfNeeded();
-    @options = split(/ /, $makeArgs);
-    @projects = ();
-    $result = buildWafProject('.', $clean, @options);
-    exit exitStatus($result) if exitStatus($result);
-}
-
-if (isChromium()) {
-    # Currently chromium does not honour the features passed to build-webkit.
-    # Until this is solved, we issue a warning about that.
-    foreach (@features) {
-        if (${$_->{value}} ne $_->{default}) {
-            print "\n";
-            print "===========================================================\n";
-            print " Chromium does not honor the features passed to build-webkit.\n";
-            print " The preferred way is to set up your overrides in ~/.gyp/include.gypi.\n";
-            print " See https://trac.webkit.org/wiki/Chromium#Buildingwithfeaturedefines\n";
-            print " on how to do that.\n";
-            print "===========================================================\n";
-            last;
-        }
-    }
-
-    @options = @ARGV;
-    # Chromium doesn't build by project directories.
-    @projects = ();
-    push @options, "--makeargs=" . $makeArgs if $makeArgs;
-    $result = buildChromium($clean, @options);
-    exit exitStatus($result) if exitStatus($result);
-}
-
-if (isEfl()) {
-    # By default we build using all of the available CPUs.
-    $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/;
-    $cmakeArgs = "-DENABLE_WEBKIT=OFF "  . $cmakeArgs if $noWebKit1;
-    $cmakeArgs = "-DENABLE_WEBKIT2=OFF " . $cmakeArgs if $noWebKit2;
-
-    # We remove CMakeCache to avoid the bots to reuse cached flags when
-    # we enable new features. This forces a reconfiguration.
-    removeCMakeCache();
-
-    buildCMakeProjectOrExit($clean, "Efl", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
-}
-
-if (isWinCE()) {
-    buildCMakeProjectOrExit($clean, "WinCE", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
-}
-
-if (isBlackBerry()) {
-    my $numberOfJobs;
-    if ($ENV{"USE_ICECC"}) {
-        $numberOfJobs = 50; # 50 is the number we choose for internal development
-    } else {
-        $numberOfJobs = numberOfCPUs();
-    }
-    $makeArgs .= ($makeArgs ? " " : "") . "-j" . $numberOfJobs if $makeArgs !~ /-j\s*\d+/;
-    $prefixPath = $ENV{"STAGE_DIR"} unless $prefixPath;
-    buildCMakeProjectOrExit($clean, "BlackBerry", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
-}
-
-if (isQt()) {
-    @projects = (); # An empty projects list will build the default projects
-    $result = buildQMakeProjects(\@projects, $clean, @options);
-    exit exitStatus($result) if exitStatus($result);
-}
-
-# Build, and abort if the build fails.
-for my $dir (@projects) {
-    chdir $dir or die;
-    $result = 0;
-
-    # For Gtk the WebKit project builds all others
-    if (isGtk() && $dir ne "Source/WebKit") {
-        chdirWebKit();
-        next;
-    }
-
-    my $project = basename($dir);
-    if (isGtk()) {
-        $result = buildGtkProject($project, $clean, $prefixPath, $makeArgs, $noWebKit1, $noWebKit2, @features);
-    } elsif (isAppleMacWebKit()) {
-        my @local_options = @options;
-        push @local_options, XcodeCoverageSupportOptions() if $coverageSupport && $project ne "ANGLE";
-        my $useGYPProject = $useGYP && ($project =~ "WebCore|JavaScriptCore");
-        my $projectPath = $useGYPProject ? "gyp/$project" : $project;
-        $projectPath = $project =~ /gtest/ ? "xcode/gtest" : $project;
-        $result = buildXCodeProject($projectPath, $clean, @local_options, @ARGV);
-    } elsif (isAppleWinWebKit()) {
-        if ($project eq "WebKit") {
-            $result = buildVisualStudioProject("win/WebKit.vcproj/WebKit.sln", $clean);
-        }
-    }
-    # Various build* calls above may change the CWD.
-    chdirWebKit();
-
-    if (exitStatus($result)) {
-        my $scriptDir = relativeScriptsDir();
-        if (usingVisualStudioExpress()) {
-            # Visual Studio Express is so lame it can't stdout build failures.
-            # So we find its logs and dump them to the console ourselves.
-            system(File::Spec->catfile($scriptDir, "print-vse-failure-logs"));
-        }
-        if (isAppleWinWebKit()) {
-            print "\n\n===== BUILD FAILED ======\n\n";
-            print "Please ensure you have run $scriptDir/update-webkit to install dependencies.\n\n";
-            my $baseProductDir = baseProductDir();
-            print "You can view build errors by checking the BuildLog.htm files located at:\n$baseProductDir/obj/<project>/<config>.\n";
-        }
-        exit exitStatus($result);
-    }
-}
-
-# Don't report the "WebKit is now built" message after a clean operation.
-exit if $clean;
-
-# Don't report congrats message if build was interrupted by the user.
-exit if ($result & 127) == SIGINT;
-
-# Explicitly chdir back to where exit will take us anyway, since the following "launcher"
-# message is relative to that directory.
-chdir $originalWorkingDirectory;
-
-# Write out congratulations message.
-writeCongrats();
-
-exit 0;
-
-sub cMakeArgsFromFeatures()
-{
-    my @args;
-    foreach (@features) {
-        my $featureName = $_->{define};
-        if ($featureName) {
-            my $featureEnabled = ${$_->{value}} ? "ON" : "OFF";
-            push @args, "-D$featureName=$featureEnabled";
-        }
-    }
-    return @args;
-}
-
-sub formatBuildTime($)
-{
-    my ($buildTime) = @_;
-
-    my $buildHours = int($buildTime / 3600);
-    my $buildMins = int(($buildTime - $buildHours * 3600) / 60);
-    my $buildSecs = $buildTime - $buildHours * 3600 - $buildMins * 60;
-
-    if ($buildHours) {
-        return sprintf("%dh:%02dm:%02ds", $buildHours, $buildMins, $buildSecs);
-    }
-    return sprintf("%02dm:%02ds", $buildMins, $buildSecs);
-}
-
-sub writeCongrats()
-{
-    my $launcherPath = launcherPath();
-    my $launcherName = launcherName();
-    my $endTime = time();
-    my $buildTime = formatBuildTime($endTime - $startTime);
-
-    print "\n";
-    print "====================================================================\n";
-    print " WebKit is now built ($buildTime). \n";
-    if (!isChromium()) {
-        print " To run $launcherName with this newly-built code, use the\n";
-        print " \"$launcherPath\" script.\n";
-    }
-    print "====================================================================\n";
-}
diff --git a/Tools/Scripts/build-webkittestrunner b/Tools/Scripts/build-webkittestrunner
deleted file mode 100755
index e5b2354..0000000
--- a/Tools/Scripts/build-webkittestrunner
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use File::Basename;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-my $showHelp = 0;
-my $clean = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help        Show this help message
-  --clean       Clean up the build directory
-EOF
-
-GetOptions(
-    'help' => \$showHelp,
-    'clean' => \$clean,
-);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-checkRequiredSystemConfig();
-setConfiguration();
-chdirWebKit();
-
-# Build
-chdir "Tools/WebKitTestRunner" or die;
-
-my $result;
-if (isAppleMacWebKit()) {
-    $result = buildXCodeProject("WebKitTestRunner", $clean, XcodeOptions(), @ARGV);
-} elsif (isAppleWinWebKit()) {
-    $result = buildVisualStudioProject("WebKitTestRunner.sln", $clean);
-} elsif (isQt() || isGtk() || isEfl()) {
-    # Qt and GTK+ build everything in one shot. No need to build anything here.
-    $result = 0;
-} else {
-    die "WebKitTestRunner is not supported on this platform.\n";
-}
-
-exit exitStatus($result);
diff --git a/Tools/Scripts/check-Xcode-source-file-types b/Tools/Scripts/check-Xcode-source-file-types
deleted file mode 100755
index 57a70b9..0000000
--- a/Tools/Scripts/check-Xcode-source-file-types
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to check that source file extensions match file types in Xcode project.pbxproj files.
-
-# TODO
-# - Add support for file types other than source code files.
-# - Can't differentiate between sourcecode.c.h and sourcecode.cpp.h.
-#   (Hint: Use gcc -x c/objective-c/c++/objective-c++ -E.  It will
-#   take time to check each header using gcc, so make it a switch.)
-
-use strict;
-
-use File::Basename;
-use File::Spec;
-use File::Temp qw(tempfile);
-use Getopt::Long;
-
-# Map of Xcode file types to file extensions.
-my %typeExtensionMap = qw(
-    sourcecode.c.c        .c
-    sourcecode.c.h        .h
-    sourcecode.c.objc     .m
-    sourcecode.cpp.h      .h
-    sourcecode.cpp.cpp    .cpp
-    sourcecode.cpp.objcpp .mm
-    sourcecode.exports    .exp
-    sourcecode.javascript .js
-    sourcecode.make       .make
-    sourcecode.mig        .defs
-    sourcecode.yacc       .y
-);
-
-# Map of file extensions to Xcode file types.
-my %extensionTypeMap = map { $typeExtensionMap{$_} => $_ } keys %typeExtensionMap;
-$extensionTypeMap{'.h'} = 'sourcecode.c.h'; # See TODO list.
-
-my $shouldFixIssues = 0;
-my $printWarnings = 1;
-my $showHelp;
-
-my $getOptionsResult = GetOptions(
-    'f|fix'          => \$shouldFixIssues,
-    'h|help'         => \$showHelp,
-    'w|warnings!'    => \$printWarnings,
-);
-
-if (scalar(@ARGV) == 0 && !$showHelp) {
-    print STDERR "ERROR: No Xcode project files (project.pbxproj) listed on command-line.\n";
-    undef $getOptionsResult;
-}
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR <<__END__;
-Usage: @{[ basename($0) ]} [options] path/to/project.pbxproj [path/to/project.pbxproj ...]
-  -f|--fix            fix mismatched types in Xcode project file
-  -h|--help           show this help message
-  -w|--[no-]warnings  show or suppress warnings (default: show warnings)
-__END__
-    exit 1;
-}
-
-for my $projectFile (@ARGV) {
-    my $issuesFound = 0;
-    my $issuesFixed = 0;
-
-    if (basename($projectFile) =~ /\.xcodeproj$/) {
-        $projectFile = File::Spec->catfile($projectFile, "project.pbxproj");
-    }
-
-    if (basename($projectFile) ne "project.pbxproj") {
-        print STDERR "WARNING: Not an Xcode project file: $projectFile\n" if $printWarnings;
-        next;
-    }
-
-    open(IN, "< $projectFile") || die "Could not open $projectFile: $!";
-
-    my ($OUT, $tempFileName);
-    if ($shouldFixIssues) {
-        ($OUT, $tempFileName) = tempfile(
-            basename($projectFile) . "-XXXXXXXX",
-            DIR => dirname($projectFile),
-            UNLINK => 0,
-        );
-
-        # Clean up temp file in case of die()
-        $SIG{__DIE__} = sub {
-            close(IN);
-            close($OUT);
-            unlink($tempFileName);
-        };
-    }
-
-    # Fast-forward to "Begin PBXFileReference section".
-    while (my $line = <IN>) {
-        print $OUT $line if $shouldFixIssues;
-        last if $line =~ m#^\Q/* Begin PBXFileReference section */\E$#;
-    }
-
-    while (my $line = <IN>) {
-        if ($line =~ m#^\Q/* End PBXFileReference section */\E$#) {
-            print $OUT $line if $shouldFixIssues;
-            last;
-        }
-
-        if ($line =~ m#^\s*[A-Z0-9]{24} /\* (.+) \*/\s+=\s+\{.*\s+explicitFileType = (sourcecode[^;]*);.*\s+path = ([^;]+);.*\};$#) {
-            my $fileName = $1;
-            my $fileType = $2;
-            my $filePath = $3;
-            my (undef, undef, $fileExtension) = map { lc($_) } fileparse(basename($filePath), qr{\.[^.]+$});
-
-            if (!exists $typeExtensionMap{$fileType}) {
-                $issuesFound++;
-                print STDERR "WARNING: Unknown file type '$fileType' for file '$filePath'.\n" if $printWarnings;
-            } elsif ($typeExtensionMap{$fileType} ne $fileExtension) {
-                $issuesFound++;
-                print STDERR "WARNING: Incorrect file type '$fileType' for file '$filePath'.\n" if $printWarnings;
-                $line =~ s/(\s+)explicitFileType( = )(sourcecode[^;]*);/$1lastKnownFileType$2$extensionTypeMap{$fileExtension};/;
-                $issuesFixed++ if $shouldFixIssues;
-            }
-        }
-
-        print $OUT $line if $shouldFixIssues;
-    }
-
-    # Output the rest of the file.
-    print $OUT <IN> if $shouldFixIssues;
-
-    close(IN);
-
-    if ($shouldFixIssues) {
-        close($OUT);
-
-        unlink($projectFile) || die "Could not delete $projectFile: $!";
-        rename($tempFileName, $projectFile) || die "Could not rename $tempFileName to $projectFile: $!";
-    }
-
-    if ($printWarnings) {
-        printf STDERR "%s issues found for $projectFile.\n", ($issuesFound ? $issuesFound : "No");
-        print STDERR "$issuesFixed issues fixed for $projectFile.\n" if $issuesFixed && $shouldFixIssues;
-        print STDERR "NOTE: Open $projectFile in Xcode to let it have its way with the file.\n" if $issuesFixed;
-        print STDERR "\n";
-    }
-}
-
-exit 0;
diff --git a/Tools/Scripts/check-for-webkit-framework-include-consistency b/Tools/Scripts/check-for-webkit-framework-include-consistency
deleted file mode 100755
index fabc692..0000000
--- a/Tools/Scripts/check-for-webkit-framework-include-consistency
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env ruby
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-
-base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
-is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES"
-
-Dir.chdir base_directory
-
-$PERMITTED_INCLUDE_TYPES = { :public => [ :public ], :private => [ :public, :private ] }
-
-$HEADER_NAMES_TO_TYPE = { }
-$HEADERS_BY_TYPE = { :public => [], :private => [] }
-
-$error_printed = false
-
-def print_error msg
-  $error_printed = true
-  STDERR.puts "ERROR: #{msg}"
-end
-
-def build_header_maps is_shallow_bundle
-  current_version_path = is_shallow_bundle ? "" : "Versions/A/"
-  all_headers = `find WebKit.framework/#{current_version_path}{,Private}Headers -type f -name '*.h'`.split
-
-  all_headers.each do |header|
-    if /\/Headers\/(.*)/.match(header)
-      $HEADER_NAMES_TO_TYPE[$1] = :public
-      $HEADERS_BY_TYPE[:public] << header
-    elsif /\/PrivateHeaders\/(.*)/.match(header)
-      $HEADER_NAMES_TO_TYPE[$1] = :private
-      $HEADERS_BY_TYPE[:private] << header
-    else
-      print_error "Unknown header type: #{header}"
-    end
-  end
-end
-
-def resolve_include(header, included_header, permitted_types)
-  # Ignore includes that aren't in the typical framework style.
-  return unless /<([^\/]+)\/(.*)>/.match(included_header)
-
-  framework, included_header_name = [$1, $2]
-
-  # Ignore includes that aren't related to other WebKit headers.
-  return unless framework =~ /^Web/
-
-  # A header of any type including a WebCore header is a recipe for disaster.
-  if framework == "WebCore"
-    print_error "#{header} included #{included_header}!"
-    return
-  end
-
-  header_type = $HEADER_NAMES_TO_TYPE[included_header_name]
-
-  if not header_type
-    print_error "#{header} included #{included_header} but I could not find a header of that name!"
-  elsif not permitted_types.member?(header_type)
-    print_error "#{header} included #{included_header} which is #{header_type}!"
-  end
-end
-
-def verify_includes(header, permitted_types)
-  File.open(header) do |file|
-    file.each_line do |line|
-      if /#(include|import) (.*)/.match(line)
-        resolve_include(header, $2, permitted_types)
-      end
-    end
-  end
-end
-
-build_header_maps is_shallow_bundle
-
-$HEADERS_BY_TYPE.each do |header_type, headers|
-  permitted_types = $PERMITTED_INCLUDE_TYPES[header_type]
-  headers.each do |header|
-    verify_includes header, permitted_types
-  end
-end
-
-exit 1 if $error_printed
diff --git a/Tools/Scripts/check-inspector-strings b/Tools/Scripts/check-inspector-strings
deleted file mode 100755
index 267c03a..0000000
--- a/Tools/Scripts/check-inspector-strings
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import codecs
-import logging
-import os
-import os.path
-import re
-import sys
-
-from webkitpy.common.checkout.scm import SCMDetector
-from webkitpy.common.system.filesystem import FileSystem
-from webkitpy.common.system.executive import Executive
-from webkitpy.common.system.logutils import configure_logging
-from webkitpy.style.checker import ProcessorBase
-from webkitpy.style.filereader import TextFileReader
-from webkitpy.style.main import change_directory
-
-_inspector_directory = "Source/WebCore/inspector/front-end"
-_devtools_directory = "Source/WebKit/chromium/src/js"
-_localized_strings = "Source/WebCore/English.lproj/localizedStrings.js"
-
-_log = logging.getLogger("check-inspector-strings")
-
-class StringsExtractor(ProcessorBase):
-    def __init__(self, patterns):
-        self._patterns = patterns
-        self.strings = []
-        for p in self._patterns:
-            self.strings.append([])
-
-    def should_process(self, file_path):
-        return file_path.endswith(".js") and (not file_path.endswith("InjectedScript.js"))
-
-    def process(self, lines, file_path, line_numbers=None):
-        for line in lines:
-            comment_start = line.find("//")
-            if comment_start != -1:
-                line = line[:comment_start]
-            index = 0
-            for pattern in self._patterns:
-                line_strings = re.findall(pattern, line)
-                for string in line_strings:
-                    self.strings[index].append(string)
-                index += 1
-
-class LocalizedStringsExtractor:
-    def __init__(self):
-        self.localized_strings = []
-
-    def process_file(self, file_path):
-        localized_strings_file = codecs.open(file_path, encoding="utf-8", mode="r")
-        try:
-            contents = localized_strings_file.read()
-            lines = contents.split("\n")
-            for line in lines:
-                match = re.match(r"localizedStrings\[\"((?:[^\"\\]|\\.)*?)\"", line)
-                if match:
-                    self.localized_strings.append(match.group(1))
-        finally:
-            localized_strings_file.close()
-
-def extract_ui_strings(str, out):
-    line_unrecognized = False
-    idx = 0
-    while idx < len(str):
-        idx = str.find("WebInspector.UIString(", idx)
-        if idx == -1:
-            break
-        idx = idx + len("WebInspector.UIString(")
-        balance = 1
-        item_recognized = False
-        while idx < len(str):
-            if str[idx] == ')':
-                balance = balance - 1
-                if balance == 0:
-                    break
-            elif str[idx] == '(':
-                balance = balance + 1
-            elif balance == 1:
-                if str[idx] == ',':
-                    break
-                elif str[idx] == '"':
-                    str_idx = idx + 1
-                    while str_idx < len(str):
-                        if str[str_idx] == '\\':
-                            str_idx = str_idx + 1
-                        elif str[str_idx] == '"':
-                            out.add(str[idx + 1 : str_idx])
-                            idx = str_idx
-                            item_recognized = True
-                            break
-                        str_idx = str_idx + 1
-            idx = idx + 1
-        if not item_recognized:
-            line_unrecognized = True
-    if line_unrecognized:
-        _log.info("Unrecognized: %s" % str)
-
-if __name__ == "__main__":
-    configure_logging()
-
-    cwd = os.path.abspath(os.curdir)
-    filesystem = FileSystem()
-    scm = SCMDetector(filesystem, Executive()).detect_scm_system(cwd)
-
-    if scm is None:
-        _log.error("WebKit checkout not found: You must run this script "
-                   "from within a WebKit checkout.")
-        sys.exit(1)
-
-    checkout_root = scm.checkout_root
-    _log.debug("WebKit checkout found with root: %s" % checkout_root)
-    change_directory(filesystem, checkout_root=checkout_root, paths=None)
-
-    strings_extractor = StringsExtractor([r"(WebInspector\.UIString\(.*)", r"\"((?:[^\"\\]|\\.)*?)\""])
-    file_reader = TextFileReader(filesystem, strings_extractor)
-    file_reader.process_paths([_inspector_directory, _devtools_directory])
-    localized_strings_extractor = LocalizedStringsExtractor()
-    localized_strings_extractor.process_file(_localized_strings)
-    raw_ui_strings = frozenset(strings_extractor.strings[0])
-    ui_strings = set()
-    for s in raw_ui_strings:
-        extract_ui_strings(s, ui_strings)
-    strings = frozenset(strings_extractor.strings[1])
-    localized_strings = frozenset(localized_strings_extractor.localized_strings)
-
-    new_strings = ui_strings - localized_strings
-    for s in new_strings:
-        _log.info("New: \"%s\"" % (s))
-    old_strings = localized_strings - ui_strings
-    suspicious_strings = strings & old_strings
-    for s in suspicious_strings:
-        _log.info("Suspicious: \"%s\"" % (s))
-    unused_strings = old_strings - strings
-    for s in unused_strings:
-        _log.info("Unused: \"%s\"" % (s))
-
-    localized_strings_duplicates = {}
-    for s in localized_strings_extractor.localized_strings:
-        if s in localized_strings_duplicates:
-            _log.info("Duplicate: \"%s\"" % (s))
-        else:
-            localized_strings_duplicates.setdefault(s)
diff --git a/Tools/Scripts/copy-webkitlibraries-to-product-directory b/Tools/Scripts/copy-webkitlibraries-to-product-directory
deleted file mode 100755
index 67a1e3b..0000000
--- a/Tools/Scripts/copy-webkitlibraries-to-product-directory
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2008, 2010, 2011, 2012 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $productDir = shift @ARGV;
-$productDir = $ENV{BUILT_PRODUCTS_DIR} if !$productDir;
-
-chdirWebKit();
-
-my @librariesToCopy = (
-    "libWebKitSystemInterfaceLion.a",
-    "libWebKitSystemInterfaceMountainLion.a",
-    "libWebCoreSQLite3.a",
-);
-
-my $ranlib = `xcrun -find ranlib`;
-chomp $ranlib;
-foreach my $libName (@librariesToCopy) {
-    my $srcLib = "WebKitLibraries/" . $libName;
-    my $lib = "$productDir/" . $libName;
-    if (!-e $lib || -M $lib > -M $srcLib) {
-        print "Updating $lib\n";
-        system "ditto", $srcLib, $lib;
-        system $ranlib, $lib;
-    }
-}
-
-# FIXME: This code should be abstracted to not be copy/paste.
-my $srcHeader = "WebKitLibraries/WebKitSystemInterface.h";
-my $header = "$productDir/usr/local/include/WebKitSystemInterface.h";
-if (!-e $header || -M $header > -M $srcHeader) {
-    print "Updating $header\n";
-    system "mkdir", "-p", "$productDir/usr/local/include";
-    system "ditto", $srcHeader, $header;
-}
-
-my $srcHeaderDir = "WebKitLibraries/WebCoreSQLite3";
-my $headerDir = "$productDir/WebCoreSQLite3";
-if (!-e $headerDir || -M $headerDir > -M $srcHeaderDir) {
-    print "Updating $headerDir\n";
-    system "ditto", $srcHeaderDir, $headerDir;
-}
diff --git a/Tools/Scripts/create-exports b/Tools/Scripts/create-exports
deleted file mode 100755
index c645d55..0000000
--- a/Tools/Scripts/create-exports
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/perl -w
-
-while (<>) {
-    print "$1\n" if /^\s*\"(.+)\", referenced from:$/;
-}
diff --git a/Tools/Scripts/debug-minibrowser b/Tools/Scripts/debug-minibrowser
deleted file mode 100755
index 052912d..0000000
--- a/Tools/Scripts/debug-minibrowser
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "debug" script for debugging the WebKit2 MiniBrowser.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded(INCLUDE_OPTIONS_FOR_DEBUGGING);
-
-setConfiguration();
-
-exit exitStatus(debugMiniBrowser());
diff --git a/Tools/Scripts/debug-safari b/Tools/Scripts/debug-safari
deleted file mode 100755
index 99273e0..0000000
--- a/Tools/Scripts/debug-safari
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run Safari in the platform's debugger for the WebKit Open Source Project.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded(INCLUDE_OPTIONS_FOR_DEBUGGING);
-
-setConfiguration();
-
-exit exitStatus(debugSafari());
diff --git a/Tools/Scripts/ensure-valid-python b/Tools/Scripts/ensure-valid-python
index b361641..c225dae 100755
--- a/Tools/Scripts/ensure-valid-python
+++ b/Tools/Scripts/ensure-valid-python
@@ -31,7 +31,6 @@
 use Getopt::Long;
 
 use lib $FindBin::Bin;
-use webkitdirs;
 use VCSUtils;
 
 sub checkPythonVersion()
diff --git a/Tools/Scripts/export-w3c-performance-wg-tests b/Tools/Scripts/export-w3c-performance-wg-tests
index 1a41d44..3b98a42 100755
--- a/Tools/Scripts/export-w3c-performance-wg-tests
+++ b/Tools/Scripts/export-w3c-performance-wg-tests
@@ -54,7 +54,7 @@
         ('localhost:8000', 'www.w3c-test.org'),   # This is the alternate host for cross-server requests.
         ('127.0.0.1:8000', 'w3c-test.org'),       # This is the primary test server.
         ('w3c/webperf', 'webperf/tests'),         # We prepend /w3c to all of our paths.
-        ('/w3c/resources/testharness', '/resources/testharness'),
+        ('/w3c/resources/', '/resources/'),
         ('\n', '\r\n'),                           # Convert from *NIX format.
 ]
 
diff --git a/Tools/Scripts/extract-localizable-strings b/Tools/Scripts/extract-localizable-strings
deleted file mode 100755
index 88f3684..0000000
--- a/Tools/Scripts/extract-localizable-strings
+++ /dev/null
@@ -1,392 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This script is like the genstrings tool (minus most of the options) with these differences.
-#
-#    1) It uses the names UI_STRING and UI_STRING_WITH_KEY for the macros, rather than the macros
-#       from NSBundle.h, and doesn't support tables (although they would be easy to add).
-#    2) It supports UTF-8 in key strings (and hence uses "" strings rather than @"" strings;
-#       @"" strings only reliably support ASCII since they are decoded based on the system encoding
-#       at runtime, so give different results on US and Japanese systems for example).
-#    3) It looks for strings that are not marked for localization, using both macro names that are
-#       known to be used for debugging in Intrigue source code and an exceptions file.
-#    4) It finds the files to work on rather than taking them as parameters, and also uses a
-#       hardcoded location for both the output file and the exceptions file.
-#       It would have been nice to use the project to find the source files, but it's too hard to
-#       locate source files after parsing a .pbxproj file.
-
-# The exceptions file has a list of strings in quotes, filenames, and filename/string pairs separated by :.
-
-use strict;
-
-sub UnescapeHexSequence($);
-
-my %isDebugMacro = ( ASSERT_WITH_MESSAGE => 1, LOG_ERROR => 1, ERROR => 1, NSURL_ERROR => 1, FATAL => 1, LOG => 1, LOG_WARNING => 1, UI_STRING_LOCALIZE_LATER => 1, UI_STRING_LOCALIZE_LATER_KEY => 1, LPCTSTR_UI_STRING_LOCALIZE_LATER => 1, UNLOCALIZED_STRING => 1, UNLOCALIZED_LPCTSTR => 1, dprintf => 1, NSException => 1, NSLog => 1, printf => 1 );
-
-@ARGV >= 2 or die "Usage: extract-localizable-strings <exceptions file> <file to update> [ directory... ]\nDid you mean to run update-webkit-localizable-strings instead?\n";
-
-my $exceptionsFile = shift @ARGV;
--f $exceptionsFile or die "Couldn't find exceptions file $exceptionsFile\n" unless $exceptionsFile eq "-";
-
-my $fileToUpdate = shift @ARGV;
--f $fileToUpdate or die "Couldn't find file to update $fileToUpdate\n";
-
-my $warnAboutUnlocalizedStrings = $exceptionsFile ne "-";
-
-my @directories = ();
-my @directoriesToSkip = ();
-if (@ARGV < 1) {
-    push(@directories, ".");
-} else {
-    for my $dir (@ARGV) {
-        if ($dir =~ /^-(.*)$/) {
-            push @directoriesToSkip, $1;
-        } else {
-            push @directories, $dir;
-        }
-    }
-}
-
-my $sawError = 0;
-
-my $localizedCount = 0;
-my $keyCollisionCount = 0;
-my $notLocalizedCount = 0;
-my $NSLocalizeCount = 0;
-
-my %exception;
-my %usedException;
-
-if ($exceptionsFile ne "-" && open EXCEPTIONS, $exceptionsFile) {
-    while (<EXCEPTIONS>) {
-        chomp;
-        if (/^"([^\\"]|\\.)*"$/ or /^[-_\/\w\s.]+.(h|m|mm|c|cpp)$/ or /^[-_\/\w\s.]+.(h|m|mm|c|cpp):"([^\\"]|\\.)*"$/) {
-            if ($exception{$_}) {
-                print "$exceptionsFile:$.:exception for $_ appears twice\n";
-                print "$exceptionsFile:$exception{$_}:first appearance\n";
-            } else {
-                $exception{$_} = $.;
-            }
-        } else {
-            print "$exceptionsFile:$.:syntax error\n";
-        }
-    }
-    close EXCEPTIONS;
-}
-
-my $quotedDirectoriesString = '"' . join('" "', @directories) . '"';
-for my $dir (@directoriesToSkip) {
-    $quotedDirectoriesString .= ' -path "' . $dir . '" -prune -o';
-}
-
-my @files = ( split "\n", `find $quotedDirectoriesString \\( -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.c" -o -name "*.cpp" \\)` );
-
-for my $file (sort @files) {
-    next if $file =~ /\/\w+LocalizableStrings\w*\.h$/ || $file =~ /\/LocalizedStrings\.h$/;
-
-    $file =~ s-^./--;
-
-    open SOURCE, $file or die "can't open $file\n";
-    
-    my $inComment = 0;
-    
-    my $expected = "";
-    my $macroLine;
-    my $macro;
-    my $UIString;
-    my $key;
-    my $comment;
-    
-    my $string;
-    my $stringLine;
-    my $nestingLevel;
-    
-    my $previousToken = "";
-
-    while (<SOURCE>) {
-        chomp;
-        
-        # Handle continued multi-line comment.
-        if ($inComment) {
-            next unless s-.*\*/--;
-            $inComment = 0;
-        }
-    
-        # Handle all the tokens in the line.
-        while (s-^\s*([#\w]+|/\*|//|[^#\w/'"()\[\],]+|.)--) {
-            my $token = $1;
-            
-            if ($token eq "\"") {
-                if ($expected and $expected ne "a quoted string") {
-                    print "$file:$.:ERROR:found a quoted string but expected $expected\n";
-                    $sawError = 1;
-                    $expected = "";
-                }
-                if (s-^(([^\\$token]|\\.)*?)$token--) {
-                    if (!defined $string) {
-                        $stringLine = $.;
-                        $string = $1;
-                    } else {
-                        $string .= $1;
-                    }
-                } else {
-                    print "$file:$.:ERROR:mismatched quotes\n";
-                    $sawError = 1;
-                    $_ = "";
-                }
-                next;
-            }
-            
-            if (defined $string) {
-handleString:
-                if ($expected) {
-                    if (!defined $UIString) {
-                        # FIXME: Validate UTF-8 here?
-                        $UIString = $string;
-                        $expected = ",";
-                    } elsif (($macro =~ /(WEB_)?UI_STRING_KEY(_INTERNAL)?$/) and !defined $key) {
-                        # FIXME: Validate UTF-8 here?
-                        $key = $string;
-                        $expected = ",";
-                    } elsif (!defined $comment) {
-                        # FIXME: Validate UTF-8 here?
-                        $comment = $string;
-                        $expected = ")";
-                    }
-                } else {
-                    if (defined $nestingLevel) {
-                        # In a debug macro, no need to localize.
-                    } elsif ($previousToken eq "#include" or $previousToken eq "#import") {
-                        # File name, no need to localize.
-                    } elsif ($previousToken eq "extern" and $string eq "C") {
-                        # extern "C", no need to localize.
-                    } elsif ($string eq "") {
-                        # Empty string can sometimes be localized, but we need not complain if not.
-                    } elsif ($exception{$file}) {
-                        $usedException{$file} = 1;
-                    } elsif ($exception{"\"$string\""}) {
-                        $usedException{"\"$string\""} = 1;
-                    } elsif ($exception{"$file:\"$string\""}) {
-                        $usedException{"$file:\"$string\""} = 1;
-                    } else {
-                        print "$file:$stringLine:\"$string\" is not marked for localization\n" if $warnAboutUnlocalizedStrings;
-                        $notLocalizedCount++;
-                    }
-                }
-                $string = undef;
-                last if !defined $token;
-            }
-            
-            $previousToken = $token;
-
-            if ($token =~ /^NSLocalized/ && $token !~ /NSLocalizedDescriptionKey/ && $token !~ /NSLocalizedStringFromTableInBundle/ && $token !~ /NSLocalizedFileSizeDescription/) {
-                print "$file:$.:ERROR:found a use of an NSLocalized macro ($token); not supported\n";
-                $nestingLevel = 0 if !defined $nestingLevel;
-                $sawError = 1;
-                $NSLocalizeCount++;
-            } elsif ($token eq "/*") {
-                if (!s-^.*?\*/--) {
-                    $_ = ""; # If the comment doesn't end, discard the result of the line and set flag
-                    $inComment = 1;
-                }
-            } elsif ($token eq "//") {
-                $_ = ""; # Discard the rest of the line
-            } elsif ($token eq "'") {
-                if (!s-([^\\]|\\.)'--) { #' <-- that single quote makes the Project Builder editor less confused
-                    print "$file:$.:ERROR:mismatched single quote\n";
-                    $sawError = 1;
-                    $_ = "";
-                }
-            } else {
-                if ($expected and $expected ne $token) {
-                    print "$file:$.:ERROR:found $token but expected $expected\n";
-                    $sawError = 1;
-                    $expected = "";
-                }
-                if ($token =~ /(WEB_)?UI_STRING(_KEY)?(_INTERNAL)?$/) {
-                    $expected = "(";
-                    $macro = $token;
-                    $UIString = undef;
-                    $key = undef;
-                    $comment = undef;
-                    $macroLine = $.;
-                } elsif ($token eq "(" or $token eq "[") {
-                    ++$nestingLevel if defined $nestingLevel;
-                    $expected = "a quoted string" if $expected;
-                } elsif ($token eq ",") {
-                    $expected = "a quoted string" if $expected;
-                } elsif ($token eq ")" or $token eq "]") {
-                    $nestingLevel = undef if defined $nestingLevel && !--$nestingLevel;
-                    if ($expected) {
-                        $key = $UIString if !defined $key;
-                        HandleUIString($UIString, $key, $comment, $file, $macroLine);
-                        $macro = "";
-                        $expected = "";
-                        $localizedCount++;
-                    }
-                } elsif ($isDebugMacro{$token}) {
-                    $nestingLevel = 0 if !defined $nestingLevel;
-                }
-            }
-        }
-            
-    }
-    
-    goto handleString if defined $string;
-    
-    if ($expected) {
-        print "$file:ERROR:reached end of file but expected $expected\n";
-        $sawError = 1;
-    }
-    
-    close SOURCE;
-}
-
-# Unescapes C language hexadecimal escape sequences.
-sub UnescapeHexSequence($)
-{
-    my ($originalStr) = @_;
-
-    my $escapedStr = $originalStr;
-    my $unescapedStr = "";
-
-    for (;;) {
-        if ($escapedStr =~ s-^\\x([[:xdigit:]]+)--) {
-            if (256 <= hex($1)) {
-                print "Hexadecimal escape sequence out of range: \\x$1\n";
-                return undef;
-            }
-            $unescapedStr .= pack("H*", $1);
-        } elsif ($escapedStr =~ s-^(.)--) {
-            $unescapedStr .= $1;
-        } else {
-            return $unescapedStr;
-        }
-    }
-}
-
-my %stringByKey;
-my %commentByKey;
-my %fileByKey;
-my %lineByKey;
-
-sub HandleUIString
-{
-    my ($string, $key, $comment, $file, $line) = @_;
-
-    my $bad = 0;
-    $string = UnescapeHexSequence($string);
-    if (!defined($string)) {
-        print "$file:$line:ERROR:string has an illegal hexadecimal escape sequence\n";
-        $bad = 1;
-    }
-    $key = UnescapeHexSequence($key);
-    if (!defined($key)) {
-        print "$file:$line:ERROR:key has an illegal hexadecimal escape sequence\n";
-        $bad = 1;
-    }
-    $comment = UnescapeHexSequence($comment);
-    if (!defined($comment)) {
-        print "$file:$line:ERROR:comment has an illegal hexadecimal escape sequence\n";
-        $bad = 1;
-    }
-    if (grep { $_ == 0xFFFD } unpack "U*", $string) {
-        print "$file:$line:ERROR:string for translation has illegal UTF-8 -- most likely a problem with the Text Encoding of the source file\n";
-        $bad = 1;
-    }
-    if ($string ne $key && grep { $_ == 0xFFFD } unpack "U*", $key) {
-        print "$file:$line:ERROR:key has illegal UTF-8 -- most likely a problem with the Text Encoding of the source file\n";
-        $bad = 1;
-    }
-    if (grep { $_ == 0xFFFD } unpack "U*", $comment) {
-        print "$file:$line:ERROR:comment for translation has illegal UTF-8 -- most likely a problem with the Text Encoding of the source file\n";
-        $bad = 1;
-    }
-    if ($bad) {
-        $sawError = 1;
-        return;
-    }
-    
-    if ($stringByKey{$key} && $stringByKey{$key} ne $string) {
-        print "$file:$line:encountered the same key, \"$key\", twice, with different strings\n";
-        print "$fileByKey{$key}:$lineByKey{$key}:previous occurrence\n";
-        $keyCollisionCount++;
-        return;
-    }
-    if ($commentByKey{$key} && $commentByKey{$key} ne $comment) {
-        print "$file:$line:encountered the same key, \"$key\", twice, with different comments\n";
-        print "$fileByKey{$key}:$lineByKey{$key}:previous occurrence\n";
-        $keyCollisionCount++;
-        return;
-    }
-
-    $fileByKey{$key} = $file;
-    $lineByKey{$key} = $line;
-    $stringByKey{$key} = $string;
-    $commentByKey{$key} = $comment;
-}
-
-print "\n" if $sawError || $notLocalizedCount || $NSLocalizeCount;
-
-my @unusedExceptions = sort grep { !$usedException{$_} } keys %exception;
-if (@unusedExceptions) {
-    for my $unused (@unusedExceptions) {
-        print "$exceptionsFile:$exception{$unused}:exception $unused not used\n";
-    }
-    print "\n";
-}
-
-print "$localizedCount localizable strings\n" if $localizedCount;
-print "$keyCollisionCount key collisions\n" if $keyCollisionCount;
-print "$notLocalizedCount strings not marked for localization\n" if $notLocalizedCount;
-print "$NSLocalizeCount uses of NSLocalize\n" if $NSLocalizeCount;
-print scalar(@unusedExceptions), " unused exceptions\n" if @unusedExceptions;
-
-if ($sawError) {
-    print "\nErrors encountered. Exiting without writing to $fileToUpdate.\n";
-    exit 1;
-}
-
-my $localizedStrings = "";
-
-for my $key (sort keys %commentByKey) {
-    $localizedStrings .= "/* $commentByKey{$key} */\n\"$key\" = \"$stringByKey{$key}\";\n\n";
-}
-
-# Write out the strings file in UTF-16 with a BOM.
-utf8::decode($localizedStrings) if $^V ge v5.8;
-my $output = pack "n*", (0xFEFF, unpack "U*", $localizedStrings);
-
-if (-e "$fileToUpdate") {
-    open STRINGS, ">", "$fileToUpdate" or die;
-    print STRINGS $output;
-    close STRINGS;
-} else {
-    print "$fileToUpdate does not exist\n";
-    exit 1;
-}
diff --git a/Tools/Scripts/filter-build-webkit b/Tools/Scripts/filter-build-webkit
deleted file mode 100755
index 97a7327..0000000
--- a/Tools/Scripts/filter-build-webkit
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2011 Apple Inc. All rights reserved.
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-# 
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Filters the output of build-webkit into a more human-readable format.
-
-use strict;
-use warnings;
-
-use CGI qw(escapeHTML);
-use File::Basename;
-use FindBin;
-use lib $FindBin::Bin;
-use Getopt::Long;
-use VCSUtils;
-
-use constant {
-    STYLE_PLAIN => 0,
-    STYLE_HEADER => 1,
-    STYLE_SUCCESS => 2,
-    STYLE_ALERT => 3,
-
-    HTML_HEADER =><<HTMLHEADER,
-<html>
-    <head>
-        <title>Build Log</title>
-        <style>
-            body { font-family: Monaco, monospace; font-size: 10px; color: #666; line-height: 1.5em; }
-            h2 { margin: 1.5em 0 0 0; font-size: 1.0em; font-weight: bold; color: blue; }
-            p { margin: 0; padding-left: 1.5em; border-left: 3px solid #fff; }
-            p.alert { border-left-color: red; color: red; margin: 1.5em 0 0 0; }
-            p.alert + p { margin: 1.5em 0 0 0; }
-            p.alert + p.alert { margin: 0; }
-            p.success { color: green; }
-        </style>
-    </head>
-    <body>
-HTMLHEADER
-
-    HTML_FOOTER =><<HTMLFOOTER,
-    </body>
-</html>
-HTMLFOOTER
-};
-
-sub printLine($$);
-sub setLogfileOption($$);
-sub setOutputFormatOption($$);
-sub usageAndExit();
-
-# Defined in VCSUtils.
-sub possiblyColored($$);
-
-my $showHelp;
-my $outputPath = "&STDOUT";
-my $outputFormat = "text";
-my $useColor = -t STDOUT;
-my $unfilteredOutputPath = "build.log";
-my $logUnfilteredOutput;
-
-sub usageAndExit()
-{
-    print STDERR <<__END__;
-Usage: @{[ basename($0) ]} [options] buildlog1 [buildlog2 ...]
-       build-webkit | @{[ basename($0) ]} [options]
-  -h|--help     Show this help message
-Output Options:
-  -o|--output   Path for output (default: STDOUT)
-  -f|--format   Output format (default: $outputFormat)
-                  text: Plain text
-                  html: Standalone HTML document
-  --[no-]color  ANSI color output for text (default: on, if -o is STDOUT)
-Unfiltered Logging Options:
-  -l|--log      Save unfiltered output to file (see --log-file)
-  --logfile     Path to save unfiltered output (implies --log, default: $unfilteredOutputPath)
-__END__
-    exit 1;
-}
-
-my $getOptionsResult = GetOptions(
-    'h|help'                => \$showHelp,
-    'o|output=s'            => \$outputPath,
-    'f|format=s'            => \&setOutputFormatOption,
-    'color!'                => \$useColor,
-    'l|log'                 => \$logUnfilteredOutput,
-    'logfile=s'             => \&setLogfileOption,
-);
-
-if (-t STDIN || $showHelp || !$getOptionsResult) {
-    usageAndExit();
-}
-
-open(OUTPUT_HANDLE, ">$outputPath") or die "Failed to open $outputPath : $!";
-if ($logUnfilteredOutput) {
-    open(UNFILTERED_OUTPUT_HANDLE, ">$unfilteredOutputPath") or die "Failed to open $unfilteredOutputPath : $!";
-}
-
-print OUTPUT_HANDLE HTML_HEADER if ($outputFormat eq "html");
-
-my $buildFinished;
-my $buildFailed = 0;
-while (my $line = <>) {
-    print UNFILTERED_OUTPUT_HANDLE $line if $logUnfilteredOutput;
-
-    chomp($line);
-
-    next if $line =~ /^\s*$/;
-    next if $line =~ /^Build settings from command line:/;
-    next if $line =~ /make: Nothing to be done for `all'\./;
-    next if $line =~ /^JavaScriptCore\/create_hash_table/;
-    next if $line =~ /JavaScriptCore.framework\/PrivateHeaders\/create_hash_table/;
-    next if $line =~ /^JavaScriptCore\/pcre\/dftables/;
-    next if $line =~ /^Creating hashtable for /;
-    next if $line =~ /^Wrote output to /;
-    next if $line =~ /^(touch|perl|cat|rm -f|bison|flex|python|\/usr\/bin\/g\+\+|gperf|echo|sed|if \[ \-f|WebCore\/generate-export-file) /;
-    next if $line =~ /^UNDOCUMENTED: /;
-    next if $line =~ /libtool.*has no symbols/;
-    next if $line =~ /^# Lower case all the values, as CSS values are case-insensitive$/;
-    next if $line =~ /^if sort /;
-    next if $line =~ /^    /;
-    next if $line =~ /^printf /;
-    next if $line =~ /^offlineasm: Nothing changed/;
-    next if $line =~ /^Showing first/;
-
-    if ($line =~ /^={10}/) {
-        printLine($line, STYLE_SUCCESS);
-        $buildFinished = 1;
-    } elsif ($line =~ /^===/) {
-        printLine($line, STYLE_HEADER);
-    } elsif ($line =~ /Checking Dependencies|Check dependencies/) {
-        printLine($line, STYLE_PLAIN);
-    } elsif ($line =~ /\*\* BUILD SUCCEEDED \*\*/) {
-        printLine("Build Succeeded", STYLE_SUCCESS);
-    } elsif ($line =~ /^(PhaseScriptExecution|CompileC|Distributed-CompileC|Ld|PBXCp|CpResource|CopyPNGFile|CopyTiffFile|CpHeader|Processing|ProcessInfoPlistFile|ProcessPCH|ProcessPCH\+\+|Touch|Libtool|CopyStringsFile|Mig|CreateUniversalBinary|Analyze|ProcessProductPackaging|CodeSign|SymLink|Updating|CompileXIB|StripNIB|CopyPlistFile|GenerateDSYMFile) ("[^"]+"|\S+)?/) {
-        my ($command, $path) = ($1, basename($2));
-        $path =~ s/"//g;
-        printLine("$command $path", STYLE_PLAIN);
-    } elsif ($line =~ /^\/\S+?(strip|WebCoreExportFileGenerator) .*?(\/|\> )(\S+)/) {
-        my ($command, $path) = (basename($1), basename($3));
-        printLine("$command $path", STYLE_PLAIN);
-    } elsif ($line =~ /^offlineasm\: /) {
-        printLine($line, STYLE_PLAIN);
-    } elsif ($line =~ /^Generating message.*(header|receiver) for (\S+)\.\.\./) {
-        my ($command, $path) = ($1, basename($2));
-        printLine("Generating message $command $path", STYLE_PLAIN);
-    } elsif ($line =~ /^(\S+\/cc).*?(\S+)\.(out|exp)/) {
-        my ($command, $path) = (basename($1), basename($2));
-        printLine("$command $path", STYLE_PLAIN);
-    } else {
-        # This only gets hit if stderr is redirected to stdout.
-        if ($line =~ /\*\* BUILD FAILED \*\*/) {
-            $buildFailed = 1;
-        }
-        printLine($line, $buildFinished ? STYLE_SUCCESS : STYLE_ALERT);
-    }
-}
-
-print OUTPUT_HANDLE HTML_FOOTER if ($outputFormat eq "html");
-
-close(OUTPUT_HANDLE);
-close(UNFILTERED_OUTPUT_HANDLE) if ($logUnfilteredOutput);
-
-exit $buildFailed;
-
-sub printLine($$)
-{
-    my ($line, $style) = @_;
-
-    if ($outputFormat eq "html") {
-        $line = escapeHTML($line);
-        if    ($style == STYLE_HEADER)  { print OUTPUT_HANDLE "<h2>$line</h2>"; }
-        elsif ($style == STYLE_SUCCESS) { print OUTPUT_HANDLE "<p class=\"success\">$line</p>"; }
-        elsif ($style == STYLE_ALERT)   { print OUTPUT_HANDLE "<p class=\"alert\">$line</p>"; }
-        else                            { print OUTPUT_HANDLE "<p>$line</p>"; }
-    } else {
-        if ($useColor) {
-            my $colors = "reset";
-            if ($style == STYLE_HEADER)  { $colors = "blue"; }
-            if ($style == STYLE_SUCCESS) { $colors = "green"; }
-            if ($style == STYLE_ALERT)   { $colors = "red"; }
-            print OUTPUT_HANDLE possiblyColored($colors, $line);
-        } else {
-            print OUTPUT_HANDLE $line;
-        }
-    }
-    print OUTPUT_HANDLE "\n";
-}
-
-sub setLogfileOption($$)
-{
-    my ($opt, $value) = @_;
-    $unfilteredOutputPath = $value;
-    $logUnfilteredOutput = 1;
-}
-
-sub setOutputFormatOption($$)
-{
-    my ($opt, $value) = @_;
-    $value = lc($value);
-    if ($value ne "html" && $value ne "text") {
-        die "The $opt option must be either \"html\" or \"text\"";
-    }
-    $outputFormat = $value;
-}
diff --git a/Tools/Scripts/generate-coverage-data b/Tools/Scripts/generate-coverage-data
deleted file mode 100755
index 9365932..0000000
--- a/Tools/Scripts/generate-coverage-data
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) 2007 Holger Hans Peter Freyther.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simple script to build, run and visualize coverage information
-
-use strict;
-use File::Basename;
-use File::Spec;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-# Generate a name for our results
-my $svnVersion = determineCurrentSVNRevision();
-my @timeData = localtime(time);
-my $resultName = $svnVersion . "-" . join('_', @timeData);
-my @otherOptions = ();
-
-# Move to the source directory
-# Delete old gcov files
-# Compile WebKit and run the tests
-# Generate the coverage graph...
-# Upload
-
-$ENV{'WEBKIT_COVERAGE_BUILD'} = 1;
-chdirWebKit();
-
-# Clean-up old files
-print "Cleaning up\n";
-system("if [ -d WebKitBuild ]; then find WebKitBuild -name '*.gcda' -delete; fi;") == 0 or die;
-
-
-print "Building and testing\n";
-system("Tools/Scripts/build-webkit", "--coverage", @ARGV) == 0 or die;
-system "Tools/Scripts/new-run-webkit-tests", "--no-show-results";
-system "Tools/Scripts/run-javascriptcore-tests", "--coverage", @ARGV;
-
-# Collect the data and generate a report
-print "Collecting coverage data\n";
-system("Tools/CodeCoverage/run-generate-coverage-data", $resultName,  "WebKitBuild/Coverage") == 0 or die;
-system("Tools/CodeCoverage/regenerate-coverage-display", "WebKitBuild/Coverage", "WebKitBuild/Coverage/html") == 0 or die;
-
-print "Done\n";
diff --git a/Tools/Scripts/generate-qt-inspector-resource b/Tools/Scripts/generate-qt-inspector-resource
deleted file mode 100755
index 0a8301b..0000000
--- a/Tools/Scripts/generate-qt-inspector-resource
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (C) 2008 Holger Hans Peter Freyther
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Regenerate WebCore/inspector/front-end/WebKit.qrc from the content of WebCore/inspector/front-end/
-
-sub addFiles(@)
-{
-    my @files = @_;
-
-    foreach $file (@files) {
-        $file =~ s,Source/WebCore/inspector/front-end/,,;
-        print WEBKIT_QRC "    <file>".$file . "</file>\n";
-    }
-}
-
-# Setup
-open(WEBKIT_QRC, ">Source/WebCore/inspector/front-end/WebKit.qrc") or die;
-print WEBKIT_QRC '<!DOCTYPE RCC><RCC version="1.0">'."\n";
-print WEBKIT_QRC '<qresource prefix="/webkit/inspector">'."\n";
-
-
-# Directory with html and js files and the images
-addFiles(<Source/WebCore/inspector/front-end/*.{*html,js,css,svg}>);
-addFiles(<Source/WebCore/inspector/front-end/Images/*>);
-
-print WEBKIT_QRC "</qresource>\n";
-print WEBKIT_QRC "</RCC>\n";
-close(WEBKIT_QRC);
diff --git a/Tools/Scripts/generate-win32-export-forwards b/Tools/Scripts/generate-win32-export-forwards
deleted file mode 100755
index a160abb..0000000
--- a/Tools/Scripts/generate-win32-export-forwards
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-
-#Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Library General Public
-#License as published by the Free Software Foundation; either
-#version 2 of the License, or (at your option) any later version.
-
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#Library General Public License for more details.
-
-#You should have received a copy of the GNU Library General Public License
-#along with this library; see the file COPYING.LIB.  If not, write to
-#the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-#Boston, MA 02110-1301, USA.
-
-# Extract /EXPORT: linker directives from static library and write it into a
-# separate file as linker pragmas.
-# Usage: generate-win32-export-forwards \path\to\static\library.lib outputfile.cpp
-# Then compile outputfile.cpp into the final .dll and link the static library
-# into the dll.
-
-import subprocess
-import sys
-import re
-
-def exportForwardsForLibrary(library):
-    dumpBin = subprocess.Popen("dumpbin /directives " + library, stdout=subprocess.PIPE, universal_newlines=True)
-
-    output = dumpBin.communicate()[0]
-    return output
-
-libraries = sys.argv[1 : -1]
-outputFileName = sys.argv[-1]
-
-exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)")
-symbols = set()
-
-for lib in libraries:
-    for line in exportForwardsForLibrary(lib).splitlines():
-        match = exportedSymbolRegexp.match(line)
-        if match:
-            symbols.add(match.group("symbol"))
-
-print("Forwarding %s symbols from %s" % (len(symbols), " ".join(libraries)))
-
-exportFile = open(outputFileName, "w")
-for symbol in symbols:
-    exportFile.write("#pragma comment(linker, \"%s\")\n" % symbol);
-exportFile.close()
diff --git a/Tools/Scripts/git-add-reviewer b/Tools/Scripts/git-add-reviewer
deleted file mode 100755
index 16bb06b..0000000
--- a/Tools/Scripts/git-add-reviewer
+++ /dev/null
@@ -1,387 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Copyright (C) 2011 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use warnings;
-
-use File::Basename;
-use File::Temp ();
-use Getopt::Long;
-use POSIX;
-
-my $defaultReviewer = "NOBODY";
-
-sub addReviewer(\%);
-sub addReviewerToChangeLog($$$);
-sub addReviewerToCommitMessage($$$);
-sub changeLogsForCommit($);
-sub checkout($);
-sub cherryPick(\%);
-sub commit(;$);
-sub getConfigValue($);
-sub fail(;$);
-sub head();
-sub interactive();
-sub isAncestor($$);
-sub nonInteractive();
-sub rebaseOntoHead($$);
-sub requireCleanWorkTree();
-sub resetToCommit($);
-sub toCommit($);
-sub usage();
-sub writeCommitMessageToFile($);
-
-
-my $interactive = 0;
-my $showHelp = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName -i|--interactive upstream
-       $programName commit-ish reviewer
-
-Adds a reviewer to a git commit in a repository with WebKit-style commit logs
-and ChangeLogs.
-
-When run in interactive mode, `upstream` specifies the commit after which
-reviewers should be added.
-
-When run in non-interactive mode, `commit-ish` specifies the commit to which
-the `reviewer` will be added.
-
-Options:
-  -h|--help          Display this message
-  -i|--interactive   Interactive mode
-EOF
-
-my $getOptionsResult = GetOptions(
-    'h|help' => \$showHelp,
-    'i|interactive' => \$interactive,
-);
-
-usage() if !$getOptionsResult || $showHelp;
-
-requireCleanWorkTree();
-$interactive ? interactive() : nonInteractive();
-exit;
-
-sub interactive()
-{
-    @ARGV == 1 or usage();
-
-    my $upstream = toCommit($ARGV[0]);
-    my $head = head();
-
-    isAncestor($upstream, $head) or die "$ARGV[0] is not an ancestor of HEAD.";
-
-    my @revlist = `git rev-list --reverse --pretty=oneline $upstream..`;
-    @revlist or die "Couldn't determine revisions";
-
-    my $tempFile = new File::Temp(UNLINK => 1);
-    foreach my $line (@revlist) {
-        print $tempFile "$defaultReviewer : $line";
-    }
-
-    print $tempFile <<EOF;
-
-# Change 'NOBODY' to the reviewer for each commit
-#
-# If any line starts with "rs" followed by one or more spaces, then the phrase
-# "Reviewed by" is changed to "Rubber-stamped by" in the ChangeLog(s)/commit
-# message for that commit.
-#
-# Commits may be reordered
-# Omitted commits will be lost
-EOF
-
-    close $tempFile;
-
-    my $editor = $ENV{GIT_EDITOR} || getConfigValue("core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
-    my $result = system "$editor \"" . $tempFile->filename . "\"";
-    !$result or die "Error spawning editor.";
-
-    my @todo = ();
-    open TEMPFILE, '<', $tempFile->filename or die "Error opening temp file.";
-    foreach my $line (<TEMPFILE>) {
-        next if $line =~ /^#/;
-        $line =~ /^(rs\s+)?(.*)\s+:\s+([0-9a-fA-F]+)/ or next;
-        push @todo, {rubberstamp => defined $1 && length $1, reviewer => $2, commit => $3};
-    }
-    close TEMPFILE;
-    @todo or die "No revisions specified.";
-
-    foreach my $item (@todo) {
-        $item->{changeLogs} = changeLogsForCommit($item->{commit});
-    }
-
-    $result = system "git", "checkout", $upstream;
-    !$result or die "Error checking out $ARGV[0].";
-
-    my $success = 1;
-    foreach my $item (@todo) {
-        $success = cherryPick(%{$item});
-        $success or last;
-        $success = addReviewer(%{$item});
-        $success or last;
-        $success = commit();
-        $success or last;
-    }
-
-    unless ($success) {
-        resetToCommit($head);
-        exit 1;
-    }
-
-    $result = system "git", "branch", "-f", $head;
-    !$result or die "Error updating $head.";
-    $result = system "git", "checkout", $head;
-    exit WEXITSTATUS($result);
-}
-
-sub nonInteractive()
-{
-    @ARGV == 2 or usage();
-
-    my $commit = toCommit($ARGV[0]);
-    my $reviewer = $ARGV[1];
-    my $head = head();
-    my $headCommit = toCommit($head);
-
-    isAncestor($commit, $head) or die "$ARGV[1] is not an ancestor of HEAD.";
-
-    my %item = (
-        reviewer => $reviewer,
-        commit => $commit,
-    );
-
-    $item{changeLogs} = changeLogsForCommit($commit);
-    $item{changeLogs} or die;
-
-    unless ((($commit eq $headCommit) or checkout($commit))
-            # FIXME: We need to use $ENV{GIT_DIR}/.git/MERGE_MSG
-            && writeCommitMessageToFile(".git/MERGE_MSG")
-            && addReviewer(%item)
-            && commit(1)
-            && (($commit eq $headCommit) or rebaseOntoHead($commit, $head))) {
-        resetToCommit($head);
-        exit 1;
-    }
-}
-
-sub usage()
-{
-    print STDERR $usage;
-    exit 1;
-}
-
-sub requireCleanWorkTree()
-{
-    my $result = system "git rev-parse --verify HEAD > /dev/null";
-    $result ||= system qw(git update-index --refresh);
-    $result ||= system qw(git diff-files --quiet);
-    $result ||= system qw(git diff-index --cached --quiet HEAD --);
-    !$result or die "Working tree is dirty"
-}
-
-sub fail(;$)
-{
-    my ($message) = @_;
-    print STDERR $message, "\n" if defined $message;
-    return 0;
-}
-
-sub cherryPick(\%)
-{
-    my ($item) = @_;
-
-    my $result = system "git cherry-pick -n $item->{commit} > /dev/null";
-    !$result or return fail("Failed to cherry-pick $item->{commit}");
-
-    return 1;
-}
-
-sub addReviewer(\%)
-{
-    my ($item) = @_;
-
-    return 1 if $item->{reviewer} eq $defaultReviewer;
-
-    foreach my $log (@{$item->{changeLogs}}) {
-        addReviewerToChangeLog($item->{reviewer}, $item->{rubberstamp}, $log) or return fail();
-    }
-
-    addReviewerToCommitMessage($item->{reviewer}, $item->{rubberstamp}, ".git/MERGE_MSG") or return fail();
-
-    return 1;
-}
-
-sub commit(;$)
-{
-    my ($amend) = @_;
-
-    my @command = qw(git commit -F .git/MERGE_MSG);
-    push @command, "--amend" if $amend;
-    my $result = system @command;
-    !$result or return fail("Failed to commit revision");
-
-    return 1;
-}
-
-sub addReviewerToChangeLog($$$)
-{
-    my ($reviewer, $rubberstamp, $log) = @_;
-
-    return addReviewerToFile($reviewer, $rubberstamp, $log, 0);
-}
-
-sub addReviewerToCommitMessage($$$)
-{
-    my ($reviewer, $rubberstamp, $log) = @_;
-
-    return addReviewerToFile($reviewer, $rubberstamp, $log, 1);
-}
-
-sub addReviewerToFile
-{
-    my ($reviewer, $rubberstamp, $log, $isCommitMessage) = @_;
-
-    my $tempFile = new File::Temp(UNLINK => 1);
-
-    open LOG, "<", $log or return fail("Couldn't open $log.");
-
-    my $finished = 0;
-    foreach my $line (<LOG>) {
-        if (!$finished && $line =~ /NOBODY \(OOPS!\)/) {
-            $line =~ s/NOBODY \(OOPS!\)/$reviewer/;
-            $line =~ s/Reviewed/Rubber-stamped/ if $rubberstamp;
-            $finished = 1 unless $isCommitMessage;
-        }
-
-        print $tempFile $line;
-    }
-
-    close $tempFile;
-    close LOG or return fail("Couldn't close $log");
-
-    my $result = system "mv", $tempFile->filename, $log;
-    !$result or return fail("Failed to rename $tempFile to $log");
-
-    unless ($isCommitMessage) {
-        my $result = system "git", "add", $log;
-        !$result or return fail("Failed to git add");
-    }
-
-    return 1;
-}
-
-sub head()
-{
-    my $head = `git symbolic-ref HEAD`;
-    $head =~ /^refs\/heads\/(.*)$/ or die "Couldn't determine current branch.";
-    $head = $1;
-
-    return $head;
-}
-
-sub isAncestor($$)
-{
-    my ($ancestor, $descendant) = @_;
-
-    chomp(my $mergeBase = `git merge-base $ancestor $descendant`);
-    return $mergeBase eq $ancestor;
-}
-
-sub toCommit($)
-{
-    my ($arg) = @_;
-
-    chomp(my $commit = `git rev-parse $arg`);
-    return $commit;
-}
-
-sub changeLogsForCommit($)
-{
-    my ($commit) = @_;
-
-    my @files = `git diff -r --name-status $commit^ $commit`;
-    @files or return fail("Couldn't determine changed files for $commit.");
-
-    my @changeLogs = map { /^[ACMR]\s*(.*)/; $1 } grep { /^[ACMR].*[^-]ChangeLog/ } @files;
-    return \@changeLogs;
-}
-
-sub resetToCommit($)
-{
-    my ($commit) = @_;
-
-    my $result = system "git", "checkout", "-f", $commit;
-    !$result or return fail("Error checking out $commit.");
-
-    return 1;
-}
-
-sub writeCommitMessageToFile($)
-{
-    my ($file) = @_;
-
-    open FILE, ">", $file or return fail("Couldn't open $file.");
-    open MESSAGE, "-|", qw(git rev-list --max-count=1 --pretty=format:%B HEAD) or return fail("Error running git rev-list.");
-    my $commitLine = <MESSAGE>;
-    foreach my $line (<MESSAGE>) {
-        print FILE $line;
-    }
-    close MESSAGE;
-    close FILE or return fail("Couldn't close $file.");
-
-    return 1;
-}
-
-sub rebaseOntoHead($$)
-{
-    my ($upstream, $branch) = @_;
-
-    my $result = system qw(git rebase --onto HEAD), $upstream, $branch;
-    !$result or return fail("Couldn't rebase.");
-
-    return 1;
-}
-
-sub checkout($)
-{
-    my ($commit) = @_;
-
-    my $result = system "git", "checkout", $commit;
-    !$result or return fail("Error checking out $commit.");
-
-    return 1;
-}
-
-sub getConfigValue($)
-{
-    my ($variable) = @_;
-
-    chomp(my $value = `git config --get "$variable"`);
-
-    return $value;
-}
diff --git a/Tools/Scripts/import-w3c-performance-wg-tests b/Tools/Scripts/import-w3c-performance-wg-tests
index caddde7..7423dc8 100755
--- a/Tools/Scripts/import-w3c-performance-wg-tests
+++ b/Tools/Scripts/import-w3c-performance-wg-tests
@@ -53,16 +53,18 @@
     sys.exit(1)
 os.makedirs(destination_directory)
 
-directories_to_copy = ['approved', 'resources']
+directories_to_copy = ['approved', 'resources', 'submission']
 directories_to_ignore = ['html5']                 # These are just duplicates of the sibling directory 'html'.
 replacements = [
         ('www.w3c-test.org', 'localhost:8000'),   # This is the alternate host for cross-server requests.
         ('w3c-test.org', '127.0.0.1:8000'),       # This is the primary test server.
         ('webperf/tests', 'w3c/webperf'),         # We prepend /w3c to all of our paths.
-        ('/resources/testharness', '/w3c/resources/testharness'),
+        ('"/resources/', '"/w3c/resources/'),
         ('+ "(" + reloadTime[time] + ")"', ''),   # Remove dynamic values from the output. We'll still see PASS.
         ('+ "(" + startingTime[time] + ")"', ''),
-        ('\r\n', '\n'),                           # Convert to *NIX format.
+        ('+ expectedStartTime', ''),
+        ('+ expectedDuration', ''),
+        ('\t', '        '),                       # Convert tabs to spaces.
 ]
 
 for directory_to_copy in directories_to_copy:
@@ -78,7 +80,8 @@
             with open(os.path.join(source_directory, root, filename), 'r') as in_file:
                 with open(os.path.join(destination_directory, root, filename), 'w') as out_file:
                     for line in in_file:
-                        for to_find, replace_with in replacements:
-                            line = line.replace(to_find, replace_with)
-                        assert 'w3c-test.org' not in line, 'Imported test must not depend on live site. Bad line: "%s"' % line
+                        if filename.endswith(('.htm', '.html', '.css', '.js', '.php')):
+                            for to_find, replace_with in replacements:
+                                line = line.replace(to_find, replace_with).rstrip() + '\n'
+                            assert 'w3c-test.org' not in line, 'Imported test must not depend on live site. Bad line: "%s"' % line
                         out_file.write(line)
diff --git a/Tools/Scripts/make-gypi b/Tools/Scripts/make-gypi
deleted file mode 100755
index cebac27..0000000
--- a/Tools/Scripts/make-gypi
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import re
-import sys
-
-GYPI_TEMPLATE = """{
-    'variables': {
-        '%s': [
-%s
-        ]
-    }
-}""" 
-
-def find_source_code():
-    source_code_regexp = re.compile(r'\.(cpp|h|m|mm)$')
-
-    collected_files = []
-    for directory_path, directory_names, file_names in os.walk('.'):
-        for file_name in file_names:
-            if source_code_regexp.search(file_name):
-                relative_path = os.path.join(directory_path, file_name)
-                collected_files.append(os.path.relpath(relative_path, '.'))
-
-    return collected_files
-
-def build_file_line(file_name, indent):
-    return indent +  "'%s'," % file_name
-
-def build_file_list(source_code, indent):
-    return '\n'.join([build_file_line(file_name, indent) for file_name in sorted(source_code)])
-
-def build_gypi(project):
-    key = project.lower() + '_files'
-    value = build_file_list(find_source_code(), '    ' * 3)
-    return GYPI_TEMPLATE % (key, value)
-
-def main():
-    if len(sys.argv) < 2:
-        print 'Usage: %s project_name' % sys.argv[0]
-        return
-    print build_gypi(sys.argv[1])
-
-if __name__ == "__main__":
-    main()
diff --git a/Tools/Scripts/make-new-script-test b/Tools/Scripts/make-new-script-test
deleted file mode 100755
index 59fbfa3..0000000
--- a/Tools/Scripts/make-new-script-test
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2011 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to create a new HTML file for a monolithic test using js-test machinery.
-
-use strict;
-
-use FindBin;
-use lib $FindBin::Bin;
-
-use File::Basename;
-use Getopt::Long;
-use webkitdirs;
-
-sub makePathToSharedSources;
-sub openTestInEditor;
-sub writeTestFile;
-
-my $showHelp;
-
-my $result = GetOptions(
-    "help"       => \$showHelp,
-);
-
-if (!$result || $showHelp || !scalar(@ARGV) || $ARGV[0] !~ m/\.html$/) {
-    print STDERR "Usage: " . basename($0) . " [-h|--help] pathname\n";
-    print STDERR "\nExamples:\n";
-    print STDERR "    " . basename($0) . " new-test.html (will create the test in current directory)\n";
-    print STDERR "    " . basename($0) . " fast/loader/new-test.html (a relative path is always from LayoutTests directory)\n";
-    print STDERR "    " . basename($0) . " /Volumes/Data/WebKit/LayoutTests/fast/loader/new-test.html\n";
-    exit 1;
-}
-
-my $providedPath = $ARGV[0];
-
-my $testAbsolutePath;
-
-# If only a file name is provided, create the test in current directory.
-$testAbsolutePath = File::Spec->rel2abs($providedPath) if (!(File::Spec->splitpath($providedPath))[1]);
-
-# Otherwise, it's either absolute, or relative to LayoutTests directory.
-chdirWebKit();
-chdir "LayoutTests";
-$testAbsolutePath = File::Spec->rel2abs($providedPath) if (!$testAbsolutePath);
-
-writeTestFile();
-
-print "$testAbsolutePath\n";
-openTestInEditor();
-
-exit 0;
-
-sub makePathToSharedSources
-{
-    my $layoutTestsPath = getcwd();
-    $testAbsolutePath =~ m/^$layoutTestsPath/ or die "Path $testAbsolutePath is not in LayoutTests directory.\n";
-    my $isHTTPTest = $testAbsolutePath =~ m/^$layoutTestsPath\/http/;
-    if ($isHTTPTest) {
-        return "/js-test-resources";
-    } else {
-        return File::Spec->abs2rel("fast/js/resources/", dirname($testAbsolutePath));
-    }
-}
-
-sub writeTestFile
-{
-    die "Test $testAbsolutePath already exists.\n" if (-e $testAbsolutePath);
-
-    my $pathToSharedSources = makePathToSharedSources();
-
-    open TEST, ">", ${testAbsolutePath} or die "Cannot create test file at $testAbsolutePath.\n";
-    print TEST << "EOF";
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="$pathToSharedSources/js-test-pre.js"></script>
-</head>
-<body>
-<script>
-
-description("TEST DESCRIPTION HERE");
-
-// Your test script here. Feel free to modify surrounding HTML code if necessary.
-
-</script>
-<script src="$pathToSharedSources/js-test-post.js"></script>
-</body>
-</html>
-EOF
-    close TEST;
-}
-
-sub openTestInEditor()
-{
-    my $editor = $ENV{EDITOR};
-    exec ($editor, $testAbsolutePath) if ($editor);
-}
diff --git a/Tools/Scripts/make-script-test-wrappers b/Tools/Scripts/make-script-test-wrappers
deleted file mode 100755
index 74284bf..0000000
--- a/Tools/Scripts/make-script-test-wrappers
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to generate HTML wrappers for JavaScript tests from templates
-
-use strict;
-
-use FindBin;
-use lib $FindBin::Bin;
-
-use File::Basename;
-use File::Find;
-use Getopt::Long;
-use webkitdirs;
-
-sub directoryFilter;
-sub findTemplateFiles(@);
-
-my $showHelp;
-
-my $result = GetOptions(
-    "help"       => \$showHelp,
-);
-
-if (!$result || $showHelp) {
-    print STDERR basename($0) . " [-h|--help]\n";
-    exit 1;
-}
-
-setConfiguration();
-my $productDir = productDir();
-
-chdirWebKit();
-
-my @templates = findTemplateFiles(@ARGV);
-
-for my $tfile (@templates) {
-
-    my $tpath = $tfile;
-    my $templateDirectory;
-    my $templateRelativePath;
-    if ($tpath =~ s:/(script-tests)/TEMPLATE.html$::) {
-        $templateDirectory = $1;
-        $templateRelativePath = $1 . "/TEMPLATE.html";
-    } else {
-        print "Inappropriate position of a template: ${tpath}\n";
-        next;
-    }
-
-    print "${tpath}\n";
-
-    chdirWebKit();
-    chdir($tpath);
-
-    my @files;
-    my $fileFilter = sub {
-        push @files, $File::Find::name if substr($_, -3) eq ".js";
-    };
-    find({ preprocess => \&directoryFilter, wanted => $fileFilter }, $templateDirectory);
-
-    open TEMPLATE, "<${templateRelativePath}";
-    my $template = do { local $/; <TEMPLATE> };
-    close TEMPLATE;
-
-    my $templateNegative = $template;
-    if (-e "${templateDirectory}/TEMPLATE-n.html") {
-        open TEMPLATE, "<${templateDirectory}/TEMPLATE-n.html";
-        $templateNegative = do { local $/; <TEMPLATE> };
-        close TEMPLATE;
-    }
-
-    for my $file (@files) {
-        my $html = $file;
-        $html =~ s:${templateDirectory}/(.*)\.js:$1.html:;
-        next if -f "$html-disabled";
-
-        system("cat ${file} | tr '\\0' ' ' | grep -q 'successfullyParsed ='");
-        if ($? != 0) {
-            `echo "" >> "${file}"`;
-            `echo "var successfullyParsed = true;" >> "${file}"`;
-        }
-        
-        print "    ${html}\n";
-        open HTML, ">$html";
-        my $output = ($file =~ /-n\.js/) ? $templateNegative : $template;
-        $output =~ s:YOUR_JS_FILE_HERE:$file:;
-        print HTML $output;
-        
-        close HTML;
-    }
-}
-
-exit 0;
-
-sub directoryFilter
-{
-    return () if basename($File::Find::dir) eq ".svn";
-    return @_;
-}
-
-sub findTemplateFiles(@) {
-    my @templateFiles;
-
-    my $fileFilter = sub {
-        push @templateFiles, $File::Find::name if $_ eq "TEMPLATE.html";
-    };
-
-    find({ preprocess => \&directoryFilter, wanted => $fileFilter }, "LayoutTests/fast/js");
-
-    return @templateFiles;
-}
diff --git a/Tools/Scripts/webkitpy/common/config/irc.py b/Tools/Scripts/move-layout-tests
old mode 100644
new mode 100755
similarity index 87%
rename from Tools/Scripts/webkitpy/common/config/irc.py
rename to Tools/Scripts/move-layout-tests
index 950c573..5cee8c4
--- a/Tools/Scripts/webkitpy/common/config/irc.py
+++ b/Tools/Scripts/move-layout-tests
@@ -1,4 +1,5 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
+#!/usr/bin/env python
+# Copyright (C) 2013 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -26,6 +27,8 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-server="irc.freenode.net"
-port=6667
-channel="#webkit"
+import sys
+
+from webkitpy.layout_tests import layout_tests_mover
+
+sys.exit(layout_tests_mover.main(sys.argv[1:]))
diff --git a/Tools/Scripts/new-run-webkit-tests b/Tools/Scripts/new-run-webkit-tests
deleted file mode 100755
index 6b1a98b..0000000
--- a/Tools/Scripts/new-run-webkit-tests
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
-from webkitpy.common import multiprocessing_bootstrap
-
-multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py')
diff --git a/Tools/Scripts/num-cpus b/Tools/Scripts/num-cpus
deleted file mode 100755
index 8a8c97f..0000000
--- a/Tools/Scripts/num-cpus
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-print numberOfCPUs() . "\n";
diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests
deleted file mode 100755
index aa4e484..0000000
--- a/Tools/Scripts/old-run-webkit-tests
+++ /dev/null
@@ -1,2885 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
-# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
-# Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 Andras Becsi (becsi.andras@stud.u-szeged.hu), University of Szeged
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run the WebKit Open Source Project layout tests.
-
-# Run all the tests passed in on the command line.
-# If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .xhtmlmp, .pl, .php (and svg) files in the test directory.
-
-# Run each text.
-# Compare against the existing file xxx-expected.txt.
-# If there is a mismatch, generate xxx-actual.txt and xxx-diffs.txt.
-
-# At the end, report:
-#   the number of tests that got the expected results
-#   the number of tests that ran, but did not get the expected results
-#   the number of tests that failed to run
-#   the number of tests that were run but had no expected results to compare against
-
-use strict;
-use warnings;
-
-use CGI;
-use Config;
-use Cwd;
-use Data::Dumper;
-use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-use File::Basename;
-use File::Copy;
-use File::Find;
-use File::Path;
-use File::Spec;
-use File::Spec::Functions;
-use File::Temp;
-use FindBin;
-use Getopt::Long;
-use IPC::Open2;
-use IPC::Open3;
-use MIME::Base64;
-use Time::HiRes qw(time usleep);
-
-use List::Util 'shuffle';
-
-use lib $FindBin::Bin;
-use webkitperl::features;
-use webkitperl::httpd;
-use webkitdirs;
-use VCSUtils;
-use POSIX;
-
-sub buildPlatformResultHierarchy();
-sub buildPlatformTestHierarchy(@);
-sub captureSavedCrashLog($$);
-sub checkPythonVersion();
-sub closeCygpaths();
-sub closeDumpTool();
-sub closeWebSocketServer();
-sub configureAndOpenHTTPDIfNeeded();
-sub countAndPrintLeaks($$$);
-sub countFinishedTest($$$$);
-sub deleteExpectedAndActualResults($);
-sub dumpToolDidCrash();
-sub epiloguesAndPrologues($$);
-sub expectedDirectoryForTest($;$;$);
-sub fileNameWithNumber($$);
-sub findNewestFileMatchingGlob($);
-sub htmlForResultsSection(\@$&);
-sub isTextOnlyTest($);
-sub launchWithEnv(\@\%);
-sub resolveAndMakeTestResultsDirectory();
-sub numericcmp($$);
-sub openDiffTool();
-sub buildDumpTool($);
-sub openDumpTool();
-sub parseLeaksandPrintUniqueLeaks();
-sub openWebSocketServerIfNeeded();
-sub pathcmp($$);
-sub printFailureMessageForTest($$);
-sub processIgnoreTests($$);
-sub processSkippedFileEntry($$$);
-sub readChecksumFromPng($);
-sub readFromDumpToolWithTimer(**);
-sub readSkippedFiles($);
-sub recordActualResultsAndDiff($$);
-sub sampleDumpTool();
-sub setFileHandleNonBlocking(*$);
-sub setUpWindowsCrashLogSaving();
-sub slowestcmp($$);
-sub splitpath($);
-sub startsWith($$);
-sub stopRunningTestsEarlyIfNeeded();
-sub stripExtension($);
-sub stripMetrics($$);
-sub testCrashedOrTimedOut($$$$$$);
-sub toCygwinPath($);
-sub toURL($);
-sub toWindowsPath($);
-sub validateSkippedArg($$;$);
-sub writeToFile($$);
-
-# Argument handling
-my $addPlatformExceptions = 0;
-my @additionalPlatformDirectories = ();
-my $complexText = 0;
-my $exitAfterNFailures = 0;
-my $exitAfterNCrashesOrTimeouts = 0;
-my $generateNewResults = isAppleMacWebKit() ? 1 : 0;
-my $guardMalloc = '';
-# FIXME: Dynamic HTTP-port configuration in this file is wrong.  The various
-# apache config files in LayoutTests/http/config govern the port numbers.
-# Dynamic configuration as-written will also cause random failures in
-# an IPv6 environment.  See https://bugs.webkit.org/show_bug.cgi?id=37104.
-my $httpdPort = 8000;
-my $httpdSSLPort = 8443;
-my $ignoreMetrics = 0;
-my $webSocketPort = 8880;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecurePort = 9323;
-my @ignoreTests;
-my $iterations = 1;
-my $launchSafari = 1;
-my $mergeDepth;
-my $pixelTests = '';
-my $platform;
-my $quiet = '';
-my $randomizeTests = 0;
-my $repeatEach = 1;
-my $report10Slowest = 0;
-my $resetResults = 0;
-my $reverseTests = 0;
-my $root;
-my $runSample = 1;
-my $shouldCheckLeaks = 0;
-my $showHelp = 0;
-my $stripEditingCallbacks;
-my $testHTTP = 1;
-my $testWebSocket = 1;
-my $testMedia = 1;
-my $tmpDir = "/tmp";
-my $testResultsDirectory = File::Spec->catdir($tmpDir, "layout-test-results");
-my $testsPerDumpTool = 1000;
-my $threaded = 0;
-my $gcBetweenTests = 0;
-# DumpRenderTree has an internal timeout of 30 seconds, so this must be > 30.
-my $timeoutSeconds = 35;
-my $tolerance = 0;
-my $treatSkipped = "default";
-my $useRemoteLinksToTests = 0;
-my $useValgrind = 0;
-my $verbose = 0;
-my $shouldWaitForHTTPD = 0;
-my $useWebKitTestRunner = 0;
-my $noBuildDumpTool = 0;
-
-# These arguments are ignored, but exist for compatibility with new-run-webkit-tests.
-my $builderName = '';
-my $buildNumber = '';
-my $masterName = '';
-my $testResultsServer = '';
-
-my @leaksFilenames;
-
-if (isWindows()) {
-    print "This script has to be run under Cygwin to function correctly.\n";
-    exit 1;
-}
-
-# Default to --no-http for wx for now.
-$testHTTP = 0 if (isWx());
-
-my $perlInterpreter = "perl";
-
-my $expectedTag = "expected";
-my $mismatchTag = "mismatch";
-my $refTag = "ref";
-my $notrefTag = "notref";
-my $actualTag = "actual";
-my $prettyDiffTag = "pretty-diff";
-my $diffsTag = "diffs";
-my $errorTag = "stderr";
-my $crashLogTag = "crash-log";
-
-my $windowsCrashLogFilePrefix = "CrashLog";
-
-# These are defined here instead of closer to where they are used so that they
-# will always be accessible from the END block that uses them, even if the user
-# presses Ctrl-C before Perl has finished evaluating this whole file.
-my $windowsPostMortemDebuggerKey = "/HKLM/SOFTWARE/Microsoft/Windows NT/CurrentVersion/AeDebug";
-my %previousWindowsPostMortemDebuggerValues;
-
-my $realPlatform;
-
-my @macPlatforms = ("mac-leopard", "mac-snowleopard", "mac-lion", "mac");
-my @winPlatforms = ("win-xp", "win-vista", "win-7sp0", "win");
-
-if (isAppleMacWebKit()) {
-    if (isSnowLeopard()) {
-        $platform = "mac-snowleopard";
-        $tolerance = 0.1;
-    } elsif (isLion()) {
-        $platform = "mac-lion";
-        $tolerance = 0.1;
-    } else {
-        $platform = "mac";
-    }
-} elsif (isQt()) {
-    $platform = "qt";
-} elsif (isGtk()) {
-    $platform = "gtk";
-} elsif (isWx()) {
-    $platform = "wx";
-} elsif (isWinCairo()) {
-    $platform = "wincairo";
-} elsif (isCygwin() || isWindows()) {
-    if (isWindowsXP()) {
-        $platform = "win-xp";
-    } elsif (isWindowsVista()) {
-        $platform = "win-vista";
-    } elsif (isWindows7SP0()) {
-        $platform = "win-7sp0";
-    } else {
-        $platform = "win";
-    }
-}
-
-if (isQt() || isAppleWinWebKit()) {
-    my $testfontPath = $ENV{"WEBKIT_TESTFONTS"};
-    if (!$testfontPath || !-d "$testfontPath") {
-        print "The WEBKIT_TESTFONTS environment variable is not defined or not set properly\n";
-        print "You must set it before running the tests.\n";
-        print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
-        exit 1;
-    }
-}
-
-if (!defined($platform)) {
-    print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
-    $platform = "undefined";
-}
-
-if (!checkPythonVersion()) {
-    print "WARNING: Your platform does not have Python 2.5+, which is required to run websocket server, so disabling websocket/tests.\n";
-    $testWebSocket = 0;
-}
-
-my $programName = basename($0);
-my $launchSafariDefault = $launchSafari ? "launch" : "do not launch";
-my $httpDefault = $testHTTP ? "run" : "do not run";
-my $sampleDefault = $runSample ? "run" : "do not run";
-
-my $usage = <<EOF;
-Usage: $programName [options] [testdir|testpath ...]
-  --add-platform-exceptions       Put new results for non-platform-specific failing tests into the platform-specific results directory
-  --additional-platform-directory path/to/directory
-                                  Look in the specified directory before looking in any of the default platform-specific directories
-  --complex-text                  Use the complex text code path for all text (Mac OS X and Windows only)
-  -c|--configuration config       Set DumpRenderTree build configuration
-  --gc-between-tests              Force garbage collection between each test
-  -g|--guard-malloc               Enable Guard Malloc
-  --exit-after-n-failures N       Exit after the first N failures (includes crashes) instead of running all tests
-  --exit-after-n-crashes-or-timeouts N
-                                  Exit after the first N crashes instead of running all tests
-  -h|--help                       Show this help message
-  --[no-]http                     Run (or do not run) http tests (default: $httpDefault)
-  --[no-]wait-for-httpd           Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: $shouldWaitForHTTPD) 
-  -i|--ignore-tests               Comma-separated list of directories or tests to ignore
-  --iterations n                  Number of times to run the set of tests (e.g. ABCABCABC)
-  --[no-]launch-safari            Launch (or do not launch) Safari to display test results (default: $launchSafariDefault)
-  --[no-]show-results             Same as --[no-]launch-safari
-  -l|--leaks                      Enable leaks checking
-  --[no-]new-test-results         Generate results for new tests
-  --nthly n                       Restart DumpRenderTree every n tests (default: $testsPerDumpTool)
-  -p|--pixel-tests                Enable pixel tests
-  --tolerance t                   Ignore image differences less than this percentage (default: $tolerance)
-  --platform                      Override the detected platform to use for tests and results (default: $platform)
-  --port                          Web server port to use with http tests
-  -q|--quiet                      Less verbose output
-  --reset-results                 Reset ALL results (including pixel tests if --pixel-tests is set)
-  -o|--results-directory          Output results directory (default: $testResultsDirectory)
-  --random                        Run the tests in a random order
-  --repeat-each n                 Number of times to run each test (e.g. AAABBBCCC)
-  --reverse                       Run the tests in reverse alphabetical order
-  --root                          Path to root tools build
-  --[no-]sample-on-timeout        Run sample on timeout (default: $sampleDefault) (Mac OS X only)
-  -1|--singly                     Isolate each test case run (implies --nthly 1 --verbose)
-  --skipped=[default|ignore|only] Specifies how to treat the Skipped file
-                                     default: Tests/directories listed in the Skipped file are not tested
-                                     ignore:  The Skipped file is ignored
-                                     only:    Only those tests/directories listed in the Skipped file will be run
-  --slowest                       Report the 10 slowest tests
-  --ignore-metrics                Ignore metrics in tests
-  --[no-]strip-editing-callbacks  Remove editing callbacks from expected results
-  -t|--threaded                   Run a concurrent JavaScript thead with each test
-  --timeout t                     Sets the number of seconds before a test times out (default: $timeoutSeconds)
-  --valgrind                      Run DumpRenderTree inside valgrind (Qt/Linux only)
-  -v|--verbose                    More verbose output (overrides --quiet)
-  -m|--merge-leak-depth arg       Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg.  Defaults to 5.
-  --use-remote-links-to-tests     Link to test files within the SVN repository in the results.
-  -2|--webkit-test-runner         Use WebKitTestRunner rather than DumpRenderTree.
-EOF
-
-setConfiguration();
-
-my $getOptionsResult = GetOptions(
-    'add-platform-exceptions' => \$addPlatformExceptions,
-    'additional-platform-directory=s' => \@additionalPlatformDirectories,
-    'complex-text' => \$complexText,
-    'exit-after-n-failures=i' => \$exitAfterNFailures,
-    'exit-after-n-crashes-or-timeouts=i' => \$exitAfterNCrashesOrTimeouts,
-    'gc-between-tests' => \$gcBetweenTests,
-    'guard-malloc|g' => \$guardMalloc,
-    'help|h' => \$showHelp,
-    'http!' => \$testHTTP,
-    'wait-for-httpd!' => \$shouldWaitForHTTPD,
-    'ignore-metrics!' => \$ignoreMetrics,
-    'ignore-tests|i=s' => \@ignoreTests,
-    'iterations=i' => \$iterations,
-    'launch-safari!' => \$launchSafari,
-    'leaks|l' => \$shouldCheckLeaks,
-    'merge-leak-depth|m:5' => \$mergeDepth,
-    'new-test-results!' => \$generateNewResults,
-    'no-build' => \$noBuildDumpTool,
-    'nthly=i' => \$testsPerDumpTool,
-    'pixel-tests|p' => \$pixelTests,
-    'platform=s' => \$platform,
-    'port=i' => \$httpdPort,
-    'quiet|q' => \$quiet,
-    'random' => \$randomizeTests,
-    'repeat-each=i' => \$repeatEach,
-    'reset-results' => \$resetResults,
-    'results-directory|o=s' => \$testResultsDirectory,
-    'reverse' => \$reverseTests,
-    'root=s' => \$root,
-    'sample-on-timeout!' => \$runSample,
-    'show-results!' => \$launchSafari,
-    'singly|1' => sub { $testsPerDumpTool = 1; },
-    'skipped=s' => \&validateSkippedArg,
-    'slowest' => \$report10Slowest,
-    'strip-editing-callbacks!' => \$stripEditingCallbacks,
-    'threaded|t' => \$threaded,
-    'timeout=i' => \$timeoutSeconds,
-    'tolerance=f' => \$tolerance,
-    'use-remote-links-to-tests' => \$useRemoteLinksToTests,
-    'valgrind' => \$useValgrind,
-    'verbose|v' => \$verbose,
-    'webkit-test-runner|2' => \$useWebKitTestRunner,
-    # These arguments are ignored (but are used by new-run-webkit-tests).
-    'builder-name=s' => \$builderName,
-    'build-number=s' => \$buildNumber,
-    'master-name=s' => \$masterName,
-    'test-results-server=s' => \$testResultsServer,
-);
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR $usage;
-    exit 1;
-}
-
-if ($useWebKitTestRunner) {
-    if (isAppleMacWebKit()) {
-        $realPlatform = $platform;
-        $platform = "mac-wk2";
-    } elsif (isAppleWinWebKit()) {
-        $stripEditingCallbacks = 0 unless defined $stripEditingCallbacks;
-        $realPlatform = $platform;
-        $platform = "win-wk2";
-    } elsif (isQt()) {
-        $realPlatform = $platform;
-        $platform = "qt-5.0-wk2";
-    } elsif (isGtk()) {
-        $realPlatform = $platform;
-        $platform = "gtk-wk2";
-    }
-}
-
-$timeoutSeconds *= 10 if $guardMalloc;
-
-$stripEditingCallbacks = isCygwin() unless defined $stripEditingCallbacks;
-
-my $ignoreSkipped = $treatSkipped eq "ignore";
-my $skippedOnly = $treatSkipped eq "only";
-
-my $configuration = configuration();
-
-# We need an environment variable to be able to enable the feature per-slave
-$shouldWaitForHTTPD = $ENV{"WEBKIT_WAIT_FOR_HTTPD"} unless ($shouldWaitForHTTPD);
-$verbose = 1 if $testsPerDumpTool == 1;
-
-if ($shouldCheckLeaks && $testsPerDumpTool > 1000) {
-    print STDERR "\nWARNING: Running more than 1000 tests at a time with MallocStackLogging enabled may cause a crash.\n\n";
-}
-
-# Generating remote links causes a lot of unnecessary spew on GTK build bot
-$useRemoteLinksToTests = 0 if isGtk();
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-my $productDir = productDir();
-$productDir .= "/bin" if isQt();
-$productDir .= "/Programs" if isGtk();
-
-# Save the current directory before chaging it via chdirWebKit
-my $currentDir = cwd();
-chdirWebKit();
-
-if (!defined($root) && !$noBuildDumpTool) {
-    # FIXME: We build both DumpRenderTree and WebKitTestRunner for
-    # WebKitTestRunner runs because DumpRenderTree still includes
-    # the DumpRenderTreeSupport module and the TestNetscapePlugin.
-    # These two projects should be factored out into their own
-    # projects.
-    buildDumpTool("DumpRenderTree");
-    buildDumpTool("WebKitTestRunner") if $useWebKitTestRunner;
-}
-
-my $dumpToolName = $useWebKitTestRunner ? "WebKitTestRunner" : "DumpRenderTree";
-
-if (isAppleWinWebKit()) {
-    $dumpToolName .= "_debug" if configurationForVisualStudio() eq "Debug_All";
-    $dumpToolName .= "_debug" if configurationForVisualStudio() eq "Debug_Cairo_CFLite";
-    $dumpToolName .= $Config{_exe};
-}
-my $dumpTool = File::Spec->catfile($productDir, $dumpToolName);
-die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool;
-
-my $imageDiffTool = "$productDir/ImageDiff";
-$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() eq "Debug_All";
-$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() eq "Debug_Cairo_CFLite";
-die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
-
-checkFrameworks() unless isCygwin();
-
-if (isAppleMacWebKit()) {
-    push @INC, $productDir;
-    require DumpRenderTreeSupport;
-}
-
-my $layoutTestsName = "LayoutTests";
-my $testDirectory = File::Spec->rel2abs($layoutTestsName);
-my $expectedDirectory = $testDirectory;
-my $platformBaseDirectory = catdir($testDirectory, "platform");
-my $platformTestDirectory = catdir($platformBaseDirectory, $platform);
-my @platformResultHierarchy = buildPlatformResultHierarchy();
-my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy);
-
-$expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
-
-$testResultsDirectory = File::Spec->catfile($currentDir, $testResultsDirectory);
-# $testResultsDirectory must be empty before testing.
-rmtree $testResultsDirectory;
-my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
-
-if (isAppleMacWebKit()) {
-    print STDERR "Compiling Java tests\n";
-    my $javaTestsDirectory = catdir($testDirectory, "java");
-
-    if (system("/usr/bin/make", "-C", "$javaTestsDirectory")) {
-        exit 1;
-    }
-} elsif (isCygwin()) {
-    setUpWindowsCrashLogSaving();
-}
-
-print "Running tests from $testDirectory\n";
-if ($pixelTests) {
-    print "Enabling pixel tests with a tolerance of $tolerance%\n";
-    if (isDarwin()) {
-        if (!$useWebKitTestRunner) {
-            print "WARNING: Temporarily changing the main display color profile:\n";
-            print "\tThe colors on your screen will change for the duration of the testing.\n";
-            print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
-        }
-
-        if (isPerianInstalled()) {
-            print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
-            print "\tYou should avoid generating new pixel results in this environment.\n";
-            print "\tSee https://bugs.webkit.org/show_bug.cgi?id=22615 for details.\n";
-        }
-    }
-}
-
-system "ln", "-s", $testDirectory, "/tmp/LayoutTests" unless -x "/tmp/LayoutTests";
-
-my %ignoredFiles = ( "results.html" => 1 );
-my %ignoredDirectories = map { $_ => 1 } qw(platform);
-my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources script-tests);
-my %supportedFileExtensions = map { $_ => 1 } qw(htm html shtml xml xhtml xhtmlmp pl php mht);
-
-if (!checkWebCoreFeatureSupport("MathML", 0)) {
-    $ignoredDirectories{'mathml'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("MHTML", 0)) {
-    $ignoredDirectories{'mhtml'} = 1;
-}
-
-# FIXME: We should fix webkitperl/features.pm:hasFeature() to do the correct feature detection for Cygwin.
-if (checkWebCoreFeatureSupport("SVG", 0)) {
-    $supportedFileExtensions{'svg'} = 1;
-} elsif (isCygwin()) {
-    $supportedFileExtensions{'svg'} = 1;
-} else {
-    $ignoredLocalDirectories{'svg'} = 1;
-}
-
-if (!$testHTTP) {
-    $ignoredDirectories{'http'} = 1;
-    $ignoredDirectories{'websocket'} = 1;
-} elsif (!hasHTTPD()) {
-    print "\nNo httpd found. Cannot run http tests.\nPlease use --no-http if you do not want to run http tests.\n";
-    exit 1;
-}
-
-if (!$testWebSocket) {
-    $ignoredDirectories{'websocket'} = 1;
-}
-
-if (!$testMedia) {
-    $ignoredDirectories{'media'} = 1;
-    $ignoredDirectories{'http/tests/media'} = 1;
-}
-
-my $supportedFeaturesResult = "";
-
-if (isCygwin()) {
-    # Collect supported features list
-    my $supportedFeaturesCommand = "\"$dumpTool\" --print-supported-features 2>&1";
-    $supportedFeaturesResult = `$supportedFeaturesCommand 2>&1`;
-}
-
-my $hasAcceleratedCompositing = 0;
-my $has3DRendering = 0;
-
-if (isCygwin()) {
-    $hasAcceleratedCompositing = $supportedFeaturesResult =~ /AcceleratedCompositing/;
-    $has3DRendering = $supportedFeaturesResult =~ /3DRendering/;
-} else {
-    $hasAcceleratedCompositing = checkWebCoreFeatureSupport("Accelerated Compositing", 0);
-    $has3DRendering = checkWebCoreFeatureSupport("3D Rendering", 0);
-}
-
-if (!$hasAcceleratedCompositing) {
-    $ignoredDirectories{'compositing'} = 1;
-
-    # This test has slightly different floating-point rounding when accelerated
-    # compositing is enabled.
-    $ignoredFiles{'svg/custom/use-on-symbol-inside-pattern.svg'} = 1;
-
-    # This test has an iframe that is put in a layer only in compositing mode.
-    $ignoredFiles{'media/media-document-audio-repaint.html'} = 1;
-
-    if (isAppleWebKit()) {
-        # In Apple's ports, the default controls for <video> contain a "full
-        # screen" button only if accelerated compositing is enabled.
-        $ignoredFiles{'media/controls-after-reload.html'} = 1;
-        $ignoredFiles{'media/controls-drag-timebar.html'} = 1;
-        $ignoredFiles{'media/controls-strict.html'} = 1;
-        $ignoredFiles{'media/controls-styling.html'} = 1;
-        $ignoredFiles{'media/controls-without-preload.html'} = 1;
-        $ignoredFiles{'media/video-controls-rendering.html'} = 1;
-        $ignoredFiles{'media/video-display-toggle.html'} = 1;
-        $ignoredFiles{'media/video-no-audio.html'} = 1;
-    }
-
-    # Here we're using !$hasAcceleratedCompositing as a proxy for "is a headless XP machine" (like
-    # our test slaves). Headless XP machines can neither support accelerated compositing nor pass
-    # this test, so skipping the test here is expedient, if a little sloppy. See
-    # <http://webkit.org/b/48333>.
-    $ignoredFiles{'platform/win/plugins/npn-invalidate-rect-invalidates-window.html'} = 1 if isAppleWinWebKit();
-}
-
-if (!$has3DRendering) {
-    $ignoredDirectories{'animations/3d'} = 1;
-    $ignoredDirectories{'transforms/3d'} = 1;
-
-    # These tests use the -webkit-transform-3d media query.
-    $ignoredFiles{'fast/media/mq-transform-02.html'} = 1;
-    $ignoredFiles{'fast/media/mq-transform-03.html'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
-    $ignoredDirectories{'fast/canvas/webgl'} = 1;
-    $ignoredDirectories{'compositing/webgl'} = 1;
-    $ignoredDirectories{'http/tests/canvas/webgl'} = 1;
-}
-
-if (isAppleMacWebKit() && $platform ne "mac-wk2" && osXVersion()->{minor} >= 6 && architecture() =~ /x86_64/) {
-    # This test relies on executing JavaScript during NPP_Destroy, which isn't supported with
-    # out-of-process plugins in WebKit1. See <http://webkit.org/b/58077>.
-    $ignoredFiles{'plugins/npp-set-window-called-during-destruction.html'} = 1;
-}
-
-processIgnoreTests(join(',', @ignoreTests), "ignore-tests") if @ignoreTests;
-if (!$ignoreSkipped) {
-    if (!$skippedOnly || @ARGV == 0) {
-        readSkippedFiles("");
-    } else {
-        # Since readSkippedFiles() appends to @ARGV, we must use a foreach
-        # loop so that we only iterate over the original argument list.
-        foreach my $argnum (0 .. $#ARGV) {
-            readSkippedFiles(shift @ARGV);
-        }
-    }
-}
-
-my @tests = findTestsToRun();
-
-die "no tests to run\n" if !@tests;
-
-my %counts;
-my %tests;
-my %imagesPresent;
-my %imageDifferences;
-my %durations;
-my $count = 0;
-my $leaksOutputFileNumber = 1;
-my $totalLeaks = 0;
-my $stoppedRunningEarlyMessage;
-
-my @toolArgs = ();
-push @toolArgs, "--pixel-tests" if $pixelTests;
-push @toolArgs, "--threaded" if $threaded;
-push @toolArgs, "--complex-text" if $complexText;
-push @toolArgs, "--gc-between-tests" if $gcBetweenTests;
-push @toolArgs, "-";
-
-my @diffToolArgs = ();
-push @diffToolArgs, "--tolerance", $tolerance;
-
-$| = 1;
-
-my $dumpToolPID;
-my $isDumpToolOpen = 0;
-my $dumpToolCrashed = 0;
-my $imageDiffToolPID;
-my $isDiffToolOpen = 0;
-
-my $atLineStart = 1;
-my $lastDirectory = "";
-
-my $isHttpdOpen = 0;
-my $isWebSocketServerOpen = 0;
-my $webSocketServerPidFile = 0;
-my $failedToStartWebSocketServer = 0;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecureServerPID = 0;
-
-sub catch_pipe { $dumpToolCrashed = 1; }
-$SIG{"PIPE"} = "catch_pipe";
-
-print "Testing ", scalar @tests, " test cases";
-print " $iterations times" if ($iterations > 1);
-print ", repeating each test $repeatEach times" if ($repeatEach > 1);
-print ".\n";
-
-my $overallStartTime = time;
-
-my %expectedResultPaths;
-
-my @originalTests = @tests;
-# Add individual test repetitions
-if ($repeatEach > 1) {
-    @tests = ();
-    foreach my $test (@originalTests) {
-        for (my $i = 0; $i < $repeatEach; $i++) {
-            push(@tests, $test);
-        }
-    }
-}
-# Add test set repetitions
-for (my $i = 1; $i < $iterations; $i++) {
-    push(@tests, @originalTests);
-}
-
-my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
-open my $tests_run_fh, '>', "$absTestResultsDirectory/tests_run.txt" or die $!;
-
-for my $test (@tests) {
-    my $newDumpTool = not $isDumpToolOpen;
-    openDumpTool();
-
-    my $base = stripExtension($test);
-    my $expectedExtension = ".txt";
-    
-    my $dir = $base;
-    $dir =~ s|/[^/]+$||;
-
-    if ($newDumpTool || $dir ne $lastDirectory) {
-        foreach my $logue (epiloguesAndPrologues($newDumpTool ? "" : $lastDirectory, $dir)) {
-            if (isCygwin()) {
-                $logue = toWindowsPath($logue);
-            } else {
-                $logue = canonpath($logue);
-            }
-            if ($verbose) {
-                print "running epilogue or prologue $logue\n";
-            }
-            print OUT "$logue\n";
-            # Throw away output from DumpRenderTree.
-            # Once for the test output and once for pixel results (empty)
-            while (<IN>) {
-                last if /#EOF/;
-            }
-            while (<IN>) {
-                last if /#EOF/;
-            }
-        }
-    }
-
-    if ($verbose) {
-        print "running $test -> ";
-        $atLineStart = 0;
-    } elsif (!$quiet) {
-        if ($dir ne $lastDirectory) {
-            print "\n" unless $atLineStart;
-            print "$dir ";
-        }
-        print ".";
-        $atLineStart = 0;
-    }
-
-    $lastDirectory = $dir;
-
-    my $result;
-
-    my $startTime = time if $report10Slowest;
-
-    print $tests_run_fh "$test\n";
-
-    # Try to read expected hash file for pixel tests
-    my $suffixPixelTest = "";
-    if ($pixelTests) {
-        # ' is the separator between arguments.
-        $suffixPixelTest = "'--pixel-test";
-        if (!$resetResults) {
-            my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-            if (my $expectedHash = readChecksumFromPng(File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.png"))) {
-                # Format expected hash into a suffix string that is appended to the path / URL passed to DRT.
-                $suffixPixelTest = "'--pixel-test'$expectedHash";
-            }
-        }
-    }
-
-    if ($test =~ /^http\//) {
-        configureAndOpenHTTPDIfNeeded();
-        if ($test =~ /^http\/tests\/websocket\//) {
-            if ($test =~ /^websocket\/tests\/local\//) {
-                my $testPath = "$testDirectory/$test";
-                if (isCygwin()) {
-                    $testPath = toWindowsPath($testPath);
-                } else {
-                    $testPath = canonpath($testPath);
-                }
-                print OUT "$testPath\n";
-            } else {
-                if (openWebSocketServerIfNeeded()) {
-                    my $path = canonpath($test);
-                    if ($test =~ /^http\/tests\/websocket\/tests\/ssl\//) {
-                        # wss is disabled until all platforms support pyOpenSSL.
-                        print STDERR "Error: wss is disabled until all platforms support pyOpenSSL.";
-                    } else {
-                        $path =~ s/^http\/tests\///;
-                        print OUT "http://127.0.0.1:$httpdPort/$path\n";
-                    }
-                } else {
-                    # We failed to launch the WebSocket server.  Display a useful error message rather than attempting
-                    # to run tests that expect the server to be available.
-                    my $errorMessagePath = "$testDirectory/http/tests/websocket/resources/server-failed-to-start.html";
-                    $errorMessagePath = isCygwin() ? toWindowsPath($errorMessagePath) : canonpath($errorMessagePath);
-                    print OUT "$errorMessagePath\n";
-                }
-            }
-        } elsif ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\//) {
-            my $path = canonpath($test);
-            $path =~ s/^http\/tests\///;
-            print OUT "http://127.0.0.1:$httpdPort/$path$suffixPixelTest\n";
-        } elsif ($test =~ /^http\/tests\/ssl\//) {
-            my $path = canonpath($test);
-            $path =~ s/^http\/tests\///;
-            print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixPixelTest\n";
-        } else {
-            my $testPath = "$testDirectory/$test";
-            if (isCygwin()) {
-                $testPath = toWindowsPath($testPath);
-            } else {
-                $testPath = canonpath($testPath);
-            }
-            print OUT "$testPath$suffixPixelTest\n";
-        }
-    } else {
-        my $testPath = "$testDirectory/$test";
-        if (isCygwin()) {
-            $testPath = toWindowsPath($testPath);
-        } else {
-            $testPath = canonpath($testPath);
-        }
-        print OUT "$testPath$suffixPixelTest\n" if defined $testPath;
-    }
-
-    # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
-    # Each block is terminated by a #EOF on a line by itself.
-    # The first block is the output of the test (in text, RenderTree or other formats).
-    # The second block is for optional pixel data in PNG format, and may be empty if
-    # pixel tests are not being run, or the test does not dump pixels (e.g. text tests).
-    my $readResults = readFromDumpToolWithTimer(IN, ERROR);
-
-    my $actual = $readResults->{output};
-    my $error = $readResults->{error};
-
-    $expectedExtension = $readResults->{extension};
-    my $expectedFileName = "$base-$expectedTag.$expectedExtension";
-
-    my $isText = isTextOnlyTest($actual);
-
-    my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension);
-    $expectedResultPaths{$base} = File::Spec->catfile($expectedDir, $expectedFileName);
-
-    unless ($readResults->{status} eq "success") {
-        my $crashed = $readResults->{status} eq "crashed";
-        my $webProcessCrashed = $readResults->{status} eq "webProcessCrashed";
-        testCrashedOrTimedOut($test, $base, $crashed, $webProcessCrashed, $actual, $error);
-        countFinishedTest($test, $base, $webProcessCrashed ? "webProcessCrash" : $crashed ? "crash" : "timedout", 0);
-        last if stopRunningTestsEarlyIfNeeded();
-        next;
-    }
-
-    $durations{$test} = time - $startTime if $report10Slowest;
-
-    my $expected;
-
-    if (!$resetResults && open EXPECTED, "<", $expectedResultPaths{$base}) {
-        $expected = "";
-        while (<EXPECTED>) {
-            next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/;
-            $expected .= $_;
-        }
-        close EXPECTED;
-    }
-
-    if ($ignoreMetrics && !$isText && defined $expected) {
-        ($actual, $expected) = stripMetrics($actual, $expected);
-    }
-
-    if ($shouldCheckLeaks && $testsPerDumpTool == 1) {
-        print "        $test -> ";
-    }
-
-    my $actualPNG = "";
-    my $diffPNG = "";
-    my $diffPercentage = 0;
-    my $diffResult = "passed";
-
-    my $actualHash = "";
-    my $expectedHash = "";
-    my $actualPNGSize = 0;
-
-    while (<IN>) {
-        last if /#EOF/;
-        if (/ActualHash: ([a-f0-9]{32})/) {
-            $actualHash = $1;
-        } elsif (/ExpectedHash: ([a-f0-9]{32})/) {
-            $expectedHash = $1;
-        } elsif (/Content-Length: (\d+)\s*/) {
-            $actualPNGSize = $1;
-            read(IN, $actualPNG, $actualPNGSize);
-        }
-    }
-
-    if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) {
-        if ($actualHash eq "" && $expectedHash eq "") {
-            printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!");
-        } elsif ($actualHash eq "") {
-            printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!");
-        } elsif ($expectedHash eq "") {
-            printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!");
-        }
-    }
-
-    if ($actualPNGSize > 0) {
-        my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-        my $expectedPNGPath = File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.png");
-
-        if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) {
-            if (-f $expectedPNGPath) {
-                my $expectedPNGSize = -s $expectedPNGPath;
-                my $expectedPNG = "";
-                open EXPECTEDPNG, $expectedPNGPath;
-                read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize);
-
-                openDiffTool();
-                print DIFFOUT "Content-Length: $actualPNGSize\n";
-                print DIFFOUT $actualPNG;
-
-                print DIFFOUT "Content-Length: $expectedPNGSize\n";
-                print DIFFOUT $expectedPNG;
-
-                while (<DIFFIN>) {
-                    last if /^error/ || /^diff:/;
-                    if (/Content-Length: (\d+)\s*/) {
-                        read(DIFFIN, $diffPNG, $1);
-                    }
-                }
-
-                if (/^diff: (.+)% (passed|failed)/) {
-                    $diffPercentage = $1 + 0;
-                    $imageDifferences{$base} = $diffPercentage;
-                    $diffResult = $2;
-                }
-                
-                if (!$diffPercentage) {
-                    printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)");
-                }
-            } elsif ($verbose) {
-                printFailureMessageForTest($test, "WARNING: expected image is missing!");
-            }
-        }
-
-        if ($resetResults || !-f $expectedPNGPath) {
-            if (!$addPlatformExceptions) {
-                mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir;
-                writeToFile($expectedPNGPath, $actualPNG);
-            } else {
-                mkpath catfile($platformTestDirectory, dirname($base));
-                writeToFile("$platformTestDirectory/$base-$expectedTag.png", $actualPNG);
-            }
-        }
-    }
-
-    if (dumpToolDidCrash()) {
-        $result = "crash";
-        testCrashedOrTimedOut($test, $base, 1, 0, $actual, $error);
-    } elsif (!defined $expected) {
-        if ($verbose) {
-            print "new " . ($resetResults ? "result" : "test");
-        }
-        $result = "new";
-
-        if ($generateNewResults || $resetResults) {
-            if (!$addPlatformExceptions) {
-                mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir;
-                writeToFile("$expectedDir/$expectedFileName", $actual);
-            } else {
-                mkpath catfile($platformTestDirectory, dirname($base));
-                writeToFile("$platformTestDirectory/$expectedFileName", $actual);
-            }
-        }
-        deleteExpectedAndActualResults($base);
-        recordActualResultsAndDiff($base, $actual);
-        if (!$resetResults) {
-            # Always print the file name for new tests, as they will probably need some manual inspection.
-            # in verbose mode we already printed the test case, so no need to do it again.
-            unless ($verbose) {
-                print "\n" unless $atLineStart;
-                print "$test -> ";
-            }
-            my $resultsDir = catdir($expectedDir, dirname($base));
-            if (!$verbose) {
-                print "new";
-            }
-            if ($generateNewResults) {
-                print " (results generated in $resultsDir)";
-            }
-            print "\n" unless $atLineStart;
-            $atLineStart = 1;
-        }
-    } elsif ($actual eq $expected && $diffResult eq "passed") {
-        if ($verbose) {
-            print "succeeded\n";
-            $atLineStart = 1;
-        }
-        $result = "match";
-        deleteExpectedAndActualResults($base);
-    } else {
-        $result = "mismatch";
-
-        my $pixelTestFailed = $pixelTests && $diffPNG && $diffPNG ne "";
-        my $testFailed = $actual ne $expected;
-
-        my $message = !$testFailed ? "pixel test failed" : "failed";
-
-        if (($testFailed || $pixelTestFailed) && $addPlatformExceptions) {
-            my $testBase = catfile($testDirectory, $base);
-            my $expectedBase = catfile($expectedDir, $base);
-            my $testIsMaximallyPlatformSpecific = $testBase =~ m|^\Q$platformTestDirectory\E/|;
-            my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|;
-            if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) {
-                mkpath catfile($platformTestDirectory, dirname($base));
-                if ($testFailed) {
-                    my $expectedFile = catfile($platformTestDirectory, "$expectedFileName");
-                    writeToFile("$expectedFile", $actual);
-                }
-                if ($pixelTestFailed) {
-                    my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.png");
-                    writeToFile("$expectedFile", $actualPNG);
-                }
-                $message .= " (results generated in $platformTestDirectory)";
-            }
-        }
-
-        printFailureMessageForTest($test, $message);
-
-        my $dir = "$testResultsDirectory/$base";
-        $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
-        my $testName = $1;
-        mkpath $dir;
-
-        deleteExpectedAndActualResults($base);
-        recordActualResultsAndDiff($base, $actual);
-
-        if ($pixelTestFailed) {
-            $imagesPresent{$base} = 1;
-
-            writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG);
-            writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG);
-
-            my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-            copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png");
-
-            open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die;
-            print DIFFHTML "<html>\n";
-            print DIFFHTML "<head>\n";
-            print DIFFHTML "<title>$base Image Compare</title>\n";
-            print DIFFHTML "<script language=\"Javascript\" type=\"text/javascript\">\n";
-            print DIFFHTML "var currentImage = 0;\n";
-            print DIFFHTML "var imageNames = new Array(\"Actual\", \"Expected\");\n";
-            print DIFFHTML "var imagePaths = new Array(\"$testName-$actualTag.png\", \"$testName-$expectedTag.png\");\n";
-            if (-f "$testDirectory/$base-w3c.png") {
-                copy("$testDirectory/$base-w3c.png", "$testResultsDirectory/$base-w3c.png");
-                print DIFFHTML "imageNames.push(\"W3C\");\n";
-                print DIFFHTML "imagePaths.push(\"$testName-w3c.png\");\n";
-            }
-            print DIFFHTML "function animateImage() {\n";
-            print DIFFHTML "    var image = document.getElementById(\"animatedImage\");\n";
-            print DIFFHTML "    var imageText = document.getElementById(\"imageText\");\n";
-            print DIFFHTML "    image.src = imagePaths[currentImage];\n";
-            print DIFFHTML "    imageText.innerHTML = imageNames[currentImage] + \" Image\";\n";
-            print DIFFHTML "    currentImage = (currentImage + 1) % imageNames.length;\n";
-            print DIFFHTML "    setTimeout('animateImage()',2000);\n";
-            print DIFFHTML "}\n";
-            print DIFFHTML "</script>\n";
-            print DIFFHTML "</head>\n";
-            print DIFFHTML "<body onLoad=\"animateImage();\">\n";
-            print DIFFHTML "<table>\n";
-            if ($diffPercentage) {
-                print DIFFHTML "<tr>\n";
-                print DIFFHTML "<td>Difference between images: <a href=\"$testName-$diffsTag.png\">$diffPercentage%</a></td>\n";
-                print DIFFHTML "</tr>\n";
-            }
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">test file</a></td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td id=\"imageText\" style=\"text-weight: bold;\">Actual Image</td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "<tr>\n";
-            print DIFFHTML "<td><img src=\"$testName-$actualTag.png\" id=\"animatedImage\"></td>\n";
-            print DIFFHTML "</tr>\n";
-            print DIFFHTML "</table>\n";
-            print DIFFHTML "</body>\n";
-            print DIFFHTML "</html>\n";
-        }
-    }
-
-    if ($error) {
-        my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base));
-        mkpath $dir;
-        
-        writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error);
-        
-        $counts{error}++;
-        push @{$tests{error}}, $test;
-    }
-
-    countFinishedTest($test, $base, $result, $isText);
-    last if stopRunningTestsEarlyIfNeeded();
-}
-
-close($tests_run_fh);
-
-my $totalTestingTime = time - $overallStartTime;
-my $waitTime = getWaitTime();
-if ($waitTime > 0.1) {
-    my $normalizedTestingTime = $totalTestingTime - $waitTime;
-    printf "\n%0.2fs HTTPD waiting time\n", $waitTime . "";
-    printf "%0.2fs normalized testing time", $normalizedTestingTime . "";
-}
-printf "\n%0.2fs total testing time\n", $totalTestingTime . "";
-
-!$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
-
-$isHttpdOpen = !closeHTTPD();
-closeWebSocketServer();
-
-# Because multiple instances of this script are running concurrently we cannot 
-# safely delete this symlink.
-# system "rm /tmp/LayoutTests";
-
-# FIXME: Do we really want to check the image-comparison tool for leaks every time?
-if ($isDiffToolOpen && $shouldCheckLeaks) {
-    $totalLeaks += countAndPrintLeaks("ImageDiff", $imageDiffToolPID, "$testResultsDirectory/ImageDiff-leaks.txt");
-}
-
-if ($totalLeaks) {
-    if ($mergeDepth) {
-        parseLeaksandPrintUniqueLeaks();
-    } else { 
-        print "\nWARNING: $totalLeaks total leaks found!\n";
-        print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
-    }
-}
-
-close IN;
-close OUT;
-close ERROR;
-
-if ($report10Slowest) {
-    print "\n\nThe 10 slowest tests:\n\n";
-    my $count = 0;
-    for my $test (sort slowestcmp keys %durations) {
-        printf "%0.2f secs: %s\n", $durations{$test}, $test;
-        last if ++$count == 10;
-    }
-}
-
-print "\n";
-
-if ($skippedOnly && $counts{"match"}) {
-    print "The following tests are in the Skipped file (" . File::Spec->abs2rel("$platformTestDirectory/Skipped", $testDirectory) . "), but succeeded:\n";
-    foreach my $test (@{$tests{"match"}}) {
-        print "  $test\n";
-    }
-}
-
-if ($resetResults || ($counts{match} && $counts{match} == $count)) {
-    print "all $count test cases succeeded\n";
-    unlink $testResults;
-    exit;
-}
-
-printResults();
-
-mkpath $testResultsDirectory;
-
-open HTML, ">", $testResults or die "Failed to open $testResults. $!";
-print HTML <<EOF;
-<html>
-<head>
-<title>Layout Test Results</title>
-<style>
-.stopped-running-early-message {
-    border: 3px solid #d00;
-    font-weight: bold;
-}
-</style>
-</head>
-</body>
-EOF
-
-if ($ignoreMetrics) {
-    print HTML "<h4>Tested with metrics ignored.</h4>";
-}
-
-if ($stoppedRunningEarlyMessage) {
-    print HTML "<p class='stopped-running-early-message'>$stoppedRunningEarlyMessage</p>";
-}
-
-print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest);
-print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{webProcessCrash}}, "Tests that caused the Web process to crash", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest);
-
-print HTML "<p>httpd access log: <a href=\"access_log.txt\">access_log.txt</a></p>\n";
-print HTML "<p>httpd error log: <a href=\"error_log.txt\">error_log.txt</a></p>\n";
-
-print HTML "</body>\n";
-print HTML "</html>\n";
-close HTML;
-
-my @configurationArgs = argumentsForConfiguration();
-
-if (isGtk()) {
-  push(@configurationArgs, '-2') if $useWebKitTestRunner;
-  system "Tools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isQt()) {
-  if (getQtVersion() lt "5.0") {
-    unshift @configurationArgs, qw(-style windows);
-    unshift @configurationArgs, qw(-graphicssystem raster);
-  }
-  if (isCygwin()) {
-    $testResults = "/" . toWindowsPath($testResults);
-    $testResults =~ s/\\/\//g;
-  }
-  push(@configurationArgs, '-2') if $useWebKitTestRunner;
-  system "Tools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isCygwin()) {
-  system "cygstart", $testResults if $launchSafari;
-} elsif (isWindows()) {
-  system "start", $testResults if $launchSafari;
-} else {
-  system "Tools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari;
-}
-
-closeCygpaths() if isCygwin();
-
-exit 1;
-
-sub countAndPrintLeaks($$$)
-{
-    my ($dumpToolName, $dumpToolPID, $leaksFilePath) = @_;
-
-    print "\n" unless $atLineStart;
-    $atLineStart = 1;
-
-    # We are excluding the following reported leaks so they don't get in our way when looking for WebKit leaks:
-    # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
-    # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
-    # fixed, it will be listed here until the bot has been updated with the newer frameworks.
-
-    my @typesToExclude = (
-    );
-
-    my @callStacksToExclude = (
-        "Flash_EnforceLocalSecurity", # leaks in Flash plug-in code, rdar://problem/4449747
-        "ScanFromString", # <http://code.google.com/p/angleproject/issues/detail?id=249> leak in ANGLE
-    );
-
-    if (isSnowLeopard()) {
-        push @callStacksToExclude, (
-            "readMakerNoteProps", # <rdar://problem/7156432> leak in ImageIO
-            "QTKitMovieControllerView completeUISetup", # <rdar://problem/7155156> leak in QTKit
-            "getVMInitArgs", # <rdar://problem/7714444> leak in Java
-            "Java_java_lang_System_initProperties", # <rdar://problem/7714465> leak in Java
-            "glrCompExecuteKernel", # <rdar://problem/7815391> leak in graphics driver while using OpenGL
-            "NSNumberFormatter getObjectValue:forString:errorDescription:", # <rdar://problem/7149350> Leak in NSNumberFormatter
-        );
-    }
-
-    if (isLion()) {
-        push @callStacksToExclude, (
-            "FigByteFlumeCustomURLCreateWithURL", # <rdar://problem/10461926> leak in CoreMedia
-            "PDFPage\\(PDFPageInternal\\) pageLayoutIfAvail", # <rdar://problem/10462055> leak in PDFKit
-            "SecTransformExecute", # <rdar://problem/10470667> leak in Security.framework
-            "_NSCopyStyleRefForFocusRingStyleClip", # <rdar://problem/10462031> leak in AppKit
-        );
-    }
-
-    my $leaksTool = sourceDir() . "/Tools/Scripts/run-leaks";
-    my $excludeString = "--exclude-callstack '" . (join "' --exclude-callstack '", @callStacksToExclude) . "'";
-    $excludeString .= " --exclude-type '" . (join "' --exclude-type '", @typesToExclude) . "'" if @typesToExclude;
-
-    print " ? checking for leaks in $dumpToolName\n";
-    my $leaksOutput = `$leaksTool $excludeString $dumpToolPID`;
-    my ($count, $bytes) = $leaksOutput =~ /Process $dumpToolPID: (\d+) leaks? for (\d+) total/;
-    my ($excluded) = $leaksOutput =~ /(\d+) leaks? excluded/;
-
-    my $adjustedCount = $count;
-    $adjustedCount -= $excluded if $excluded;
-
-    if (!$adjustedCount) {
-        print " - no leaks found\n";
-        unlink $leaksFilePath;
-        return 0;
-    } else {
-        my $dir = $leaksFilePath;
-        $dir =~ s|/[^/]+$|| or die;
-        mkpath $dir;
-
-        if ($excluded) {
-            print " + $adjustedCount leaks ($bytes bytes including $excluded excluded leaks) were found, details in $leaksFilePath\n";
-        } else {
-            print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n";
-        }
-
-        writeToFile($leaksFilePath, $leaksOutput);
-        
-        push @leaksFilenames, $leaksFilePath;
-    }
-
-    return $adjustedCount;
-}
-
-sub writeToFile($$)
-{
-    my ($filePath, $contents) = @_;
-    open NEWFILE, ">", "$filePath" or die "Could not create $filePath. $!\n";
-    print NEWFILE $contents;
-    close NEWFILE;
-}
-
-# Break up a path into the directory (with slash) and base name.
-sub splitpath($)
-{
-    my ($path) = @_;
-
-    my $pathSeparator = "/";
-    my $dirname = dirname($path) . $pathSeparator;
-    $dirname = "" if $dirname eq "." . $pathSeparator;
-
-    return ($dirname, basename($path));
-}
-
-# Sort first by directory, then by file, so all paths in one directory are grouped
-# rather than being interspersed with items from subdirectories.
-# Use numericcmp to sort directory and filenames to make order logical.
-sub pathcmp($$)
-{
-    my ($patha, $pathb) = @_;
-
-    my ($dira, $namea) = splitpath($patha);
-    my ($dirb, $nameb) = splitpath($pathb);
-
-    return numericcmp($dira, $dirb) if $dira ne $dirb;
-    return numericcmp($namea, $nameb);
-}
-
-# Sort numeric parts of strings as numbers, other parts as strings.
-# Makes 1.33 come after 1.3, which is cool.
-sub numericcmp($$)
-{
-    my ($aa, $bb) = @_;
-
-    my @a = split /(\d+)/, $aa;
-    my @b = split /(\d+)/, $bb;
-
-    # Compare one chunk at a time.
-    # Each chunk is either all numeric digits, or all not numeric digits.
-    while (@a && @b) {
-        my $a = shift @a;
-        my $b = shift @b;
-        
-        # Use numeric comparison if chunks are non-equal numbers.
-        return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
-
-        # Use string comparison if chunks are any other kind of non-equal string.
-        return $a cmp $b if $a ne $b;
-    }
-    
-    # One of the two is now empty; compare lengths for result in this case.
-    return @a <=> @b;
-}
-
-# Sort slowest tests first.
-sub slowestcmp($$)
-{
-    my ($testa, $testb) = @_;
-
-    my $dura = $durations{$testa};
-    my $durb = $durations{$testb};
-    return $durb <=> $dura if $dura != $durb;
-    return pathcmp($testa, $testb);
-}
-
-sub launchWithEnv(\@\%)
-{
-    my ($args, $env) = @_;
-
-    # Dump the current environment as perl code and then put it in quotes so it is one parameter.
-    my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]);
-    $environmentDumper->Indent(0);
-    $environmentDumper->Purity(1);
-    my $allEnvVars = $environmentDumper->Dump();
-    unshift @{$args}, "\"$allEnvVars\"";
-
-    my $execScript = File::Spec->catfile(sourceDir(), qw(Tools Scripts execAppWithEnv));
-    unshift @{$args}, $perlInterpreter, $execScript;
-    return @{$args};
-}
-
-sub resolveAndMakeTestResultsDirectory()
-{
-    my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
-    mkpath $absTestResultsDirectory;
-    return $absTestResultsDirectory;
-}
-
-sub openDiffTool()
-{
-    return if $isDiffToolOpen;
-    return if !$pixelTests;
-
-    my %CLEAN_ENV;
-    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
-    $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n";
-    $isDiffToolOpen = 1;
-}
-
-sub buildDumpTool($)
-{
-    my ($dumpToolName) = @_;
-
-    my $dumpToolBuildScript =  "build-" . lc($dumpToolName);
-    print STDERR "Running $dumpToolBuildScript\n";
-
-    local *DEVNULL;
-    my ($childIn, $childOut, $childErr);
-    if ($quiet) {
-        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
-        $childOut = ">&DEVNULL";
-        $childErr = ">&DEVNULL";
-    } else {
-        # When not quiet, let the child use our stdout/stderr.
-        $childOut = ">&STDOUT";
-        $childErr = ">&STDERR";
-    }
-
-    my @args = argumentsForConfiguration();
-    my $buildProcess = open3($childIn, $childOut, $childErr, $perlInterpreter, File::Spec->catfile(qw(Tools Scripts), $dumpToolBuildScript), @args) or die "Failed to run build-dumprendertree";
-    close($childIn);
-    waitpid $buildProcess, 0;
-    my $buildResult = $?;
-    close($childOut);
-    close($childErr);
-
-    close DEVNULL if ($quiet);
-
-    if ($buildResult) {
-        print STDERR "Compiling $dumpToolName failed!\n";
-        exit exitStatus($buildResult);
-    }
-}
-
-sub openDumpTool()
-{
-    return if $isDumpToolOpen;
-
-    if ($verbose && $testsPerDumpTool != 1) {
-        print "| Opening DumpTool |\n";
-    }
-
-    my %CLEAN_ENV;
-
-    # Generic environment variables
-    if (defined $ENV{'WEBKIT_TESTFONTS'}) {
-        $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'};
-    }
-
-    # unique temporary directory for each DumpRendertree - needed for running more DumpRenderTree in parallel
-    $CLEAN_ENV{DUMPRENDERTREE_TEMP} = File::Temp::tempdir('DumpRenderTree-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-    $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
-    $CLEAN_ENV{LOCAL_RESOURCE_ROOT} = $testDirectory; # Used by layoutTestConstroller.pathToLocalResource()
-
-    # Platform spesifics
-    if (isLinux()) {
-        if (defined $ENV{'DISPLAY'}) {
-            $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'};
-        } else {
-            $CLEAN_ENV{DISPLAY} = ":1";
-        }
-        if (defined $ENV{'XAUTHORITY'}) {
-            $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'};
-        }
-
-        $CLEAN_ENV{HOME} = $ENV{'HOME'};
-        $CLEAN_ENV{LANG} = $ENV{'LANG'};
-
-        if (defined $ENV{'LD_LIBRARY_PATH'}) {
-            $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'};
-        }
-        if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) {
-            $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
-        }
-    } elsif (isDarwin()) {
-        if (defined $ENV{'DYLD_LIBRARY_PATH'}) {
-            $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'};
-        }
-        if (defined $ENV{'HOME'}) {
-            $CLEAN_ENV{HOME} = $ENV{'HOME'};
-        }
-
-        $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-        $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-    } elsif (isCygwin()) {
-        $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
-        $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
-        $CLEAN_ENV{_NT_SYMBOL_PATH} = $ENV{_NT_SYMBOL_PATH};
-    }
-
-    # Port specifics
-    if (isGtk()) {
-        $CLEAN_ENV{LIBOVERLAY_SCROLLBAR} = "0";
-        $CLEAN_ENV{GTK_MODULES} = "gail";
-        $CLEAN_ENV{WEBKIT_INSPECTOR_PATH} = "$productDir/resources/inspector";
-
-        if ($useWebKitTestRunner) {
-            my $injectedBundlePath = productDir() . "/Libraries/.libs/libTestRunnerInjectedBundle";
-            $CLEAN_ENV{TEST_RUNNER_INJECTED_BUNDLE_FILENAME} = $injectedBundlePath;
-            my $testPluginPath = productDir() . "/TestNetscapePlugin/.libs";
-            $CLEAN_ENV{TEST_RUNNER_TEST_PLUGIN_PATH} = $testPluginPath;
-        }
-    }
-
-    if (isQt()) {
-        $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins";
-        $CLEAN_ENV{QT_DRT_WEBVIEW_MODE} = $ENV{"QT_DRT_WEBVIEW_MODE"};
-    }
-    
-    my @args = ($dumpTool, @toolArgs);
-    if (isAppleMacWebKit()) { 
-        unshift @args, "arch", "-" . architecture();             
-    }
-
-    if ($useValgrind) {
-        unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors";
-    } 
-
-    if ($useWebKitTestRunner) {
-        # Make WebKitTestRunner use a similar timeout. We don't use the exact same timeout to avoid
-        # race conditions.
-        push @args, "--timeout", $timeoutSeconds - 5;
-    }
-
-    $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
-
-    $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n";
-    $isDumpToolOpen = 1;
-    $dumpToolCrashed = 0;
-}
-
-sub closeDumpTool()
-{
-    return if !$isDumpToolOpen;
-
-    if ($verbose && $testsPerDumpTool != 1) {
-        print "| Closing DumpTool |\n";
-    }
-
-    close IN;
-    close OUT;
-    waitpid $dumpToolPID, 0;
-    
-    # check for WebCore counter leaks.
-    if ($shouldCheckLeaks) {
-        while (<ERROR>) {
-            print;
-        }
-    }
-    close ERROR;
-    $isDumpToolOpen = 0;
-}
-
-sub dumpToolDidCrash()
-{
-    return 1 if $dumpToolCrashed;
-    return 0 unless $isDumpToolOpen;
-    my $pid = waitpid(-1, WNOHANG);
-    return 1 if ($pid == $dumpToolPID);
-
-    # On Mac OS X, crashing may be significantly delayed by crash reporter.
-    return 0 unless isAppleMacWebKit();
-
-    return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
-}
-
-sub configureAndOpenHTTPDIfNeeded()
-{
-    return if $isHttpdOpen;
-    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
-    my $listen = "127.0.0.1:$httpdPort";
-    my @args = (
-        "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
-        "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
-        "-C", "Listen $listen"
-    );
-
-    my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
-    @args = (@defaultArgs, @args);
-
-    waitForHTTPDLock() if $shouldWaitForHTTPD;
-    $isHttpdOpen = openHTTPD(@args);
-}
-
-sub checkPythonVersion()
-{
-    # we have not chdir to sourceDir yet.
-    system $perlInterpreter, File::Spec->catfile(sourceDir(), qw(Tools Scripts ensure-valid-python)), "--check-only";
-    return exitStatus($?) == 0;
-}
-
-sub openWebSocketServerIfNeeded()
-{
-    return 1 if $isWebSocketServerOpen;
-    return 0 if $failedToStartWebSocketServer;
-
-    my $webSocketHandlerDir = "$testDirectory";
-    my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
-    $webSocketServerPidFile = "$absTestResultsDirectory/websocket.pid";
-
-    my @args = (
-        "Tools/Scripts/new-run-webkit-websocketserver",
-        "--server", "start",
-        "--port", "$webSocketPort",
-        "--root", "$webSocketHandlerDir",
-        "--output-dir", "$absTestResultsDirectory",
-        "--pidfile", "$webSocketServerPidFile"
-    );
-    system "/usr/bin/python", @args;
-
-    $isWebSocketServerOpen = 1;
-    return 1;
-}
-
-sub closeWebSocketServer()
-{
-    return if !$isWebSocketServerOpen;
-
-    my @args = (
-        "Tools/Scripts/new-run-webkit-websocketserver",
-        "--server", "stop",
-        "--pidfile", "$webSocketServerPidFile"
-    );
-    system "/usr/bin/python", @args;
-    unlink "$webSocketServerPidFile";
-
-    # wss is disabled until all platforms support pyOpenSSL.
-    $isWebSocketServerOpen = 0;
-}
-
-sub fileNameWithNumber($$)
-{
-    my ($base, $number) = @_;
-    return "$base$number" if ($number > 1);
-    return $base;
-}
-
-sub processIgnoreTests($$)
-{
-    my @ignoreList = split(/\s*,\s*/, shift);
-    my $listName = shift;
-
-    my $disabledSuffix = "-disabled";
-
-    my $addIgnoredDirectories = sub {
-        return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
-        $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)} = 1;
-        return @_;
-    };
-    foreach my $item (@ignoreList) {
-        my $path = catfile($testDirectory, $item); 
-        if (-d $path) {
-            $ignoredDirectories{$item} = 1;
-            find({ preprocess => $addIgnoredDirectories, wanted => sub {} }, $path);
-        }
-        elsif (-f $path) {
-            $ignoredFiles{$item} = 1;
-        } elsif (-f $path . $disabledSuffix) {
-            # The test is disabled, so do nothing.
-        } else {
-            print "$listName list contained '$item', but no file of that name could be found\n";
-        }
-    }
-}
-
-sub stripExtension($)
-{
-    my ($test) = @_;
-
-    $test =~ s/\.[a-zA-Z]+$//;
-    return $test;
-}
-
-sub isTextOnlyTest($)
-{
-    my ($actual) = @_;
-    my $isText;
-    if ($actual =~ /^layer at/ms) {
-        $isText = 0;
-    } else {
-        $isText = 1;
-    }
-    return $isText;
-}
-
-sub expectedDirectoryForTest($;$;$)
-{
-    my ($base, $isText, $expectedExtension) = @_;
-
-    my @directories = @platformResultHierarchy;
-
-    my @extraPlatforms = ();
-    if (isAppleWinWebKit()) {
-        push @extraPlatforms, "mac-wk2" if $platform eq "win-wk2";
-        push @extraPlatforms, qw(mac-lion mac);
-    }
-  
-    push @directories, map { catdir($platformBaseDirectory, $_) } @extraPlatforms;
-    push @directories, $expectedDirectory;
-
-    # If we already have expected results, just return their location.
-    foreach my $directory (@directories) {
-        return $directory if -f File::Spec->catfile($directory, "$base-$expectedTag.$expectedExtension");
-    }
-
-    # For cross-platform tests, text-only results should go in the cross-platform directory,
-    # while render tree dumps should go in the least-specific platform directory.
-    return $isText ? $expectedDirectory : $platformResultHierarchy[$#platformResultHierarchy];
-}
-
-sub countFinishedTest($$$$)
-{
-    my ($test, $base, $result, $isText) = @_;
-
-    if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) {
-        if ($shouldCheckLeaks) {
-            my $fileName;
-            if ($testsPerDumpTool == 1) {
-                $fileName = File::Spec->catfile($testResultsDirectory, "$base-leaks.txt");
-            } else {
-                $fileName = File::Spec->catfile($testResultsDirectory, fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt");
-            }
-            my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName);
-            $totalLeaks += $leakCount;
-            $leaksOutputFileNumber++ if ($leakCount);
-        }
-
-        closeDumpTool();
-    }
-    
-    $count++;
-    $counts{$result}++;
-    push @{$tests{$result}}, $test;
-}
-
-sub testCrashedOrTimedOut($$$$$$)
-{
-    my ($test, $base, $didCrash, $webProcessCrashed, $actual, $error) = @_;
-
-    printFailureMessageForTest($test, $webProcessCrashed ? "Web process crashed" : $didCrash ? "crashed" : "timed out");
-
-    sampleDumpTool() unless $didCrash || $webProcessCrashed;
-
-    my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base));
-    mkpath $dir;
-
-    deleteExpectedAndActualResults($base);
-
-    if (defined($error) && length($error)) {
-        writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error);
-    }
-
-    recordActualResultsAndDiff($base, $actual);
-
-    # There's no point in killing the dump tool when it's crashed. And it will kill itself when the
-    # web process crashes.
-    kill 9, $dumpToolPID unless $didCrash || $webProcessCrashed;
-
-    closeDumpTool();
-
-    captureSavedCrashLog($base, $webProcessCrashed) if $didCrash || $webProcessCrashed;
-
-    return unless isCygwin() && !$didCrash && $base =~ /^http/;
-    # On Cygwin, http tests timing out can be a symptom of a non-responsive httpd.
-    # If we timed out running an http test, try restarting httpd.
-    $isHttpdOpen = !closeHTTPD();
-    configureAndOpenHTTPDIfNeeded();
-}
-
-sub captureSavedCrashLog($$)
-{
-    my ($base, $webProcessCrashed) = @_;
-
-    my $crashLog;
-
-    my $glob;
-    if (isCygwin()) {
-        $glob = File::Spec->catfile($testResultsDirectory, $windowsCrashLogFilePrefix . "*.txt");
-    } elsif (isAppleMacWebKit()) {
-        $glob = File::Spec->catfile("~", "Library", "Logs", "DiagnosticReports", ($webProcessCrashed ? "WebProcess" : $dumpToolName) . "_*.crash");
-
-        # Even though the dump tool has exited, CrashReporter might still be running. We need to
-        # wait for it to exit to ensure it has saved its crash log to disk. For simplicitly, we'll
-        # assume that the ReportCrash process with the highest PID is the one we want.
-        if (my @reportCrashPIDs = sort map { /^\s*(\d+)/; $1 } grep { /ReportCrash/ } `/bin/ps x`) {
-            my $reportCrashPID = $reportCrashPIDs[$#reportCrashPIDs];
-            # We use kill instead of waitpid because ReportCrash is not one of our child processes.
-            usleep(250000) while kill(0, $reportCrashPID) > 0;
-        }
-    }
-
-    return unless $glob;
-
-    # We assume that the newest crash log in matching the glob is the one that corresponds to the crash that just occurred.
-    if (my $newestCrashLog = findNewestFileMatchingGlob($glob)) {
-        # The crash log must have been created after this script started running.
-        $crashLog = $newestCrashLog if -M $newestCrashLog < 0;
-    }
-
-    return unless $crashLog;
-
-    move($crashLog, File::Spec->catfile($testResultsDirectory, "$base-$crashLogTag.txt"));
-}
-
-sub findNewestFileMatchingGlob($)
-{
-    my ($glob) = @_;
-
-    my @paths = glob $glob;
-    return unless scalar(@paths);
-
-    my @pathsAndTimes = map { [$_, -M $_] } @paths;
-    @pathsAndTimes = sort { $b->[1] <=> $a->[1] } @pathsAndTimes;
-    return $pathsAndTimes[$#pathsAndTimes]->[0];
-}
-
-sub printFailureMessageForTest($$)
-{
-    my ($test, $description) = @_;
-
-    unless ($verbose) {
-        print "\n" unless $atLineStart;
-        print "$test -> ";
-    }
-    print "$description\n";
-    $atLineStart = 1;
-}
-
-my %cygpaths = ();
-
-sub openCygpathIfNeeded($)
-{
-    my ($options) = @_;
-
-    return unless isCygwin();
-    return $cygpaths{$options} if $cygpaths{$options} && $cygpaths{$options}->{"open"};
-
-    local (*CYGPATHIN, *CYGPATHOUT);
-    my $pid = open2(\*CYGPATHIN, \*CYGPATHOUT, "cygpath -f - $options");
-    my $cygpath =  {
-        "pid" => $pid,
-        "in" => *CYGPATHIN,
-        "out" => *CYGPATHOUT,
-        "open" => 1
-    };
-
-    $cygpaths{$options} = $cygpath;
-
-    return $cygpath;
-}
-
-sub closeCygpaths()
-{
-    return unless isCygwin();
-
-    foreach my $cygpath (values(%cygpaths)) {
-        close $cygpath->{"in"};
-        close $cygpath->{"out"};
-        waitpid($cygpath->{"pid"}, 0);
-        $cygpath->{"open"} = 0;
-
-    }
-}
-
-sub convertPathUsingCygpath($$)
-{
-    my ($path, $options) = @_;
-
-    # cygpath -f (at least in Cygwin 1.7) converts spaces into newlines. We remove spaces here and
-    # add them back in after conversion to work around this.
-    my $spaceSubstitute = "__NOTASPACE__";
-    $path =~ s/ /\Q$spaceSubstitute\E/g;
-
-    my $cygpath = openCygpathIfNeeded($options);
-    local *inFH = $cygpath->{"in"};
-    local *outFH = $cygpath->{"out"};
-    print outFH $path . "\n";
-    my $convertedPath = <inFH>;
-    chomp($convertedPath) if defined $convertedPath;
-
-    $convertedPath =~ s/\Q$spaceSubstitute\E/ /g;
-    return $convertedPath;
-}
-
-sub toCygwinPath($)
-{
-    my ($path) = @_;
-    return unless isCygwin();
-
-    return convertPathUsingCygpath($path, "-u");
-}
-
-sub toWindowsPath($)
-{
-    my ($path) = @_;
-    return unless isCygwin();
-
-    return convertPathUsingCygpath($path, "-w");
-}
-
-sub toURL($)
-{
-    my ($path) = @_;
-
-    if ($useRemoteLinksToTests) {
-        my $relativePath = File::Spec->abs2rel($path, $testDirectory);
-
-        # If the file is below the test directory then convert it into a link to the file in SVN
-        if ($relativePath !~ /^\.\.\//) {
-            my $revision = svnRevisionForDirectory($testDirectory);
-            my $svnPath = pathRelativeToSVNRepositoryRootForPath($path);
-            return "http://trac.webkit.org/export/$revision/$svnPath";
-        }
-    }
-
-    return $path unless isCygwin();
-
-    return "file:///" . convertPathUsingCygpath($path, "-m");
-}
-
-sub validateSkippedArg($$;$)
-{
-    my ($option, $value, $value2) = @_;
-    my %validSkippedValues = map { $_ => 1 } qw(default ignore only);
-    $value = lc($value);
-    die "Invalid argument '" . $value . "' for option $option" unless $validSkippedValues{$value};
-    $treatSkipped = $value;
-}
-
-sub htmlForResultsSection(\@$&)
-{
-    my ($tests, $description, $linkGetter) = @_;
-
-    my @html = ();
-    return join("\n", @html) unless @{$tests};
-
-    push @html, "<p>$description:</p>";
-    push @html, "<table>";
-    foreach my $test (@{$tests}) {
-        push @html, "<tr>";
-        push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
-        foreach my $link (@{&{$linkGetter}($test)}) {
-            push @html, "<td>";
-            push @html, "<a href=\"$link->{href}\">$link->{text}</a>" if -f File::Spec->catfile($testResultsDirectory, $link->{href});
-            push @html, "</td>";
-        }
-        push @html, "</tr>";
-    }
-    push @html, "</table>";
-
-    return join("\n", @html);
-}
-
-sub linksForExpectedAndActualResults($)
-{
-    my ($base) = @_;
-
-    my @links = ();
-
-    return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt";
-    
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
-    push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" };
-    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" };
-    push @links, { href => "$base-$diffsTag.txt", text => "diff" };
-    push @links, { href => "$base-$prettyDiffTag.html", text => "pretty diff" };
-
-    return \@links;
-}
-
-sub linksForMismatchTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    push @links, @{linksForExpectedAndActualResults($base)};
-    return \@links unless $pixelTests && $imagesPresent{$base};
-
-    push @links, { href => "$base-$expectedTag.png", text => "expected image" };
-    push @links, { href => "$base-$diffsTag.html", text => "image diffs" };
-    push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" };
-
-    return \@links;
-}
-
-sub crashLocation($)
-{
-    my ($base) = @_;
-
-    my $crashLogFile = File::Spec->catfile($testResultsDirectory, "$base-$crashLogTag.txt");
-
-    if (isCygwin()) {
-        # We're looking for the following text:
-        #
-        # FOLLOWUP_IP:
-        # module!function+offset [file:line]
-        #
-        # The second contains the function that crashed (or the function that ended up jumping to a bad
-        # address, as in the case of a null function pointer).
-
-        open LOG, "<", $crashLogFile or return;
-        while (my $line = <LOG>) {
-            last if $line =~ /^FOLLOWUP_IP:/;
-        }
-        my $desiredLine = <LOG>;
-        close LOG;
-
-        return unless $desiredLine;
-
-        # Just take everything up to the first space (which is where the file/line information should
-        # start).
-        $desiredLine =~ /^(\S+)/;
-        return $1;
-    }
-
-    if (isAppleMacWebKit()) {
-        # We're looking for the following text:
-        #
-        # Thread M Crashed:
-        # N   module                              address function + offset (file:line)
-        #
-        # Some lines might have a module of "???" if we've jumped to a bad address. We should skip
-        # past those.
-
-        open LOG, "<", $crashLogFile or return;
-        while (my $line = <LOG>) {
-            last if $line =~ /^Thread \d+ Crashed:/;
-        }
-        my $location;
-        while (my $line = <LOG>) {
-            $line =~ /^\d+\s+(\S+)\s+\S+ (.* \+ \d+)/ or next;
-            my $module = $1;
-            my $functionAndOffset = $2;
-            next if $module eq "???";
-            $location = "$module: $functionAndOffset";
-            last;
-        }
-        close LOG;
-        return $location;
-    }
-}
-
-sub linksForErrorTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    my $crashLogText = "crash log";
-    if (my $crashLocation = crashLocation($base)) {
-        $crashLogText .= " (<code>" . CGI::escapeHTML($crashLocation) . "</code>)";
-    }
-
-    push @links, @{linksForExpectedAndActualResults($base)};
-    push @links, { href => "$base-$errorTag.txt", text => "stderr" };
-    push @links, { href => "$base-$crashLogTag.txt", text => $crashLogText };
-
-    return \@links;
-}
-
-sub linksForNewTest
-{
-    my ($test) = @_;
-
-    my @links = ();
-
-    my $base = stripExtension($test);
-
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
-    push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
-    if ($pixelTests && $imagesPresent{$base}) {
-        push @links, { href => "$base-$expectedTag.png", text => "image" };
-    }
-
-    return \@links;
-}
-
-sub deleteExpectedAndActualResults($)
-{
-    my ($base) = @_;
-
-    unlink "$testResultsDirectory/$base-$actualTag.txt";
-    unlink "$testResultsDirectory/$base-$diffsTag.txt";
-    unlink "$testResultsDirectory/$base-$errorTag.txt";
-    unlink "$testResultsDirectory/$base-$crashLogTag.txt";
-}
-
-sub recordActualResultsAndDiff($$)
-{
-    my ($base, $actualResults) = @_;
-
-    return unless defined($actualResults) && length($actualResults);
-
-    my $expectedResultPath = $expectedResultPaths{$base};
-    my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-    my $actualResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$actualTag$expectedResultExtension");
-    my $copiedExpectedResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$expectedTag$expectedResultExtension");
-
-    mkpath(dirname($actualResultsPath));
-    writeToFile("$actualResultsPath", $actualResults);
-
-    # We don't need diff and pretty diff for tests without expected file.
-    if ( !-f $expectedResultPath) {
-        return;
-    }
-
-    copy("$expectedResultPath", "$copiedExpectedResultsPath");
-
-    my $diffOuputBasePath = File::Spec->catfile($testResultsDirectory, $base);
-    my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
-    system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\"";
-
-    my $prettyDiffOutputPath = "$diffOuputBasePath-$prettyDiffTag.html";
-    my $prettyPatchPath = "Websites/bugs.webkit.org/PrettyPatch/";
-    my $prettifyPath = "$prettyPatchPath/prettify.rb";
-    system "ruby -I \"$prettyPatchPath\" \"$prettifyPath\" \"$diffOutputPath\" > \"$prettyDiffOutputPath\"";
-}
-
-sub buildPlatformResultHierarchy()
-{
-    mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory");
-
-    my @platforms;
-    
-    my $isMac = $platform =~ /^mac/;
-    my $isWin = $platform =~ /^win/;
-    if ($isMac || $isWin) {
-        my $effectivePlatform = $platform;
-        if ($platform eq "mac-wk2" || $platform eq "win-wk2") {
-            push @platforms, $platform;
-            $effectivePlatform = $realPlatform;
-        }
-
-        my @platformList = $isMac ? @macPlatforms : @winPlatforms;
-        my $i;
-        for ($i = 0; $i < @platformList; $i++) {
-            last if $platformList[$i] eq $effectivePlatform;
-        }
-        for (; $i < @platformList; $i++) {
-            push @platforms, $platformList[$i];
-        }
-
-        if ($platform eq "wincairo") {
-            @platforms = $platform;
-        }
-    } elsif ($platform =~ /^qt/) {
-        if ($platform eq "qt-5.0-wk2" || getQtVersion() eq "5.0" && $useWebKitTestRunner) {
-            push @platforms, "qt-5.0-wk2";
-        }
-        elsif ($platform eq "qt-5.0-wk1" || getQtVersion() eq "5.0" && !$useWebKitTestRunner) {
-            push @platforms, "qt-5.0-wk1"
-        }
-
-        if (isARM() || $platform eq "qt-arm") {
-            push @platforms, "qt-arm";
-        }
-
-        if (isDarwin() || $platform eq "qt-mac") {
-            push @platforms, "qt-mac";
-        }
-        elsif (isWindows() || isCygwin() || $platform eq "qt-win") {
-            push @platforms, "qt-win";
-        }
-        elsif (isLinux() || $platform eq "qt-linux") {
-            push @platforms, "qt-linux";
-        }
-
-        if (getQtVersion() eq "4.8" || $platform eq "qt-4.8") {
-            push @platforms, "qt-4.8";
-        }
-        elsif (getQtVersion() eq "5.0" || $platform eq "qt-5.0") {
-            push @platforms, "qt-5.0";
-        }
-
-        push @platforms, "qt";
-    } elsif ($platform =~ /^gtk-/) {
-        push @platforms, $platform;
-        push @platforms, "gtk";
-    } else {
-        @platforms = $platform;
-    }
-
-    my @hierarchy;
-    for (my $i = 0; $i < @platforms; $i++) {
-        my $scoped = catdir($platformBaseDirectory, $platforms[$i]);
-        push(@hierarchy, $scoped) if (-d $scoped);
-    }
-    
-    unshift @hierarchy, grep { -d $_ } @additionalPlatformDirectories;
-
-    return @hierarchy;
-}
-
-sub buildPlatformTestHierarchy(@)
-{
-    my (@platformHierarchy) = @_;
-
-    my @result;
-    if ($platform =~ /^qt/) {
-        for (my $i = 0; $i < @platformHierarchy; ++$i) {
-           push @result, $platformHierarchy[$i];
-        }
-    } else {
-        my $wk2Platform;
-        for (my $i = 0; $i < @platformHierarchy; ++$i) {
-            if ($platformHierarchy[$i] =~ /-wk2/) {
-                $wk2Platform = splice @platformHierarchy, $i, 1;
-                last;
-            }
-        }
-
-       push @result, $platformHierarchy[0];
-       push @result, $wk2Platform if defined $wk2Platform;
-       push @result, $platformHierarchy[$#platformHierarchy] if @platformHierarchy >= 2;
-    }
-
-    if ($verbose) {
-        my @searchPaths;
-        foreach my $searchPath (@result) {
-            my ($dir, $name) = splitpath($searchPath);
-            push @searchPaths, $name;
-        }
-        my $searchPathHierarchy = join(' -> ', @searchPaths);
-        print "Baseline search path: $searchPathHierarchy\n";
-    }
-
-    return @result;
-}
-
-sub epiloguesAndPrologues($$)
-{
-    my ($lastDirectory, $directory) = @_;
-    my @lastComponents = split('/', $lastDirectory);
-    my @components = split('/', $directory);
-
-    while (@lastComponents) {
-        if (!defined($components[0]) || $lastComponents[0] ne $components[0]) {
-            last;
-        }
-        shift @components;
-        shift @lastComponents;
-    }
-
-    my @result;
-    my $leaving = $lastDirectory;
-    foreach (@lastComponents) {
-        my $epilogue = $leaving . "/resources/run-webkit-tests-epilogue.html";
-        foreach (@platformResultHierarchy) {
-            push @result, catdir($_, $epilogue) if (stat(catdir($_, $epilogue)));
-        }
-        push @result, catdir($testDirectory, $epilogue) if (stat(catdir($testDirectory, $epilogue)));
-        $leaving =~ s|(^\|/)[^/]+$||;
-    }
-
-    my $entering = $leaving;
-    foreach (@components) {
-        $entering .= '/' . $_;
-        my $prologue = $entering . "/resources/run-webkit-tests-prologue.html";
-        push @result, catdir($testDirectory, $prologue) if (stat(catdir($testDirectory, $prologue)));
-        foreach (reverse @platformResultHierarchy) {
-            push @result, catdir($_, $prologue) if (stat(catdir($_, $prologue)));
-        }
-    }
-    return @result;
-}
-    
-sub parseLeaksandPrintUniqueLeaks()
-{
-    return unless @leaksFilenames;
-
-    my $mergedFilenames = join " ", @leaksFilenames;
-    my $parseMallocHistoryTool = sourceDir() . "/Tools/Scripts/parse-malloc-history";
-    
-    open MERGED_LEAKS, "cat $mergedFilenames | $parseMallocHistoryTool --merge-depth $mergeDepth  - |" ;
-    my @leakLines = <MERGED_LEAKS>;
-    close MERGED_LEAKS;
-    
-    my $uniqueLeakCount = 0;
-    my $totalBytes;
-    foreach my $line (@leakLines) {
-        ++$uniqueLeakCount if ($line =~ /^(\d*)\scalls/);
-        $totalBytes = $1 if $line =~ /^total\:\s(.*)\s\(/;
-    }
-    
-    print "\nWARNING: $totalLeaks total leaks found for a total of $totalBytes!\n";
-    print "WARNING: $uniqueLeakCount unique leaks found!\n";
-    print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
-    
-}
-
-sub extensionForMimeType($)
-{
-    my ($mimeType) = @_;
-
-    if ($mimeType eq "application/x-webarchive") {
-        return "webarchive";
-    } elsif ($mimeType eq "application/pdf") {
-        return "pdf";
-    } elsif ($mimeType eq "audio/wav") {
-        return "wav";
-    }
-    return "txt";
-}
-
-# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts.
-sub readFromDumpToolWithTimer(**)
-{
-    my ($fhIn, $fhError) = @_;
-
-    setFileHandleNonBlocking($fhIn, 1);
-    setFileHandleNonBlocking($fhError, 1);
-
-    my $maximumSecondsWithoutOutput = $timeoutSeconds;
-    my $microsecondsToWaitBeforeReadingAgain = 1000;
-
-    my $timeOfLastSuccessfulRead = time;
-
-    my @output = ();
-    my @error = ();
-    my $status = "success";
-    my $mimeType = "text/plain";
-    my $encoding = "";
-    # We don't have a very good way to know when the "headers" stop
-    # and the content starts, so we use this as a hack:
-    my $haveSeenContentType = 0;
-    my $haveSeenContentTransferEncoding = 0;
-    my $haveSeenEofIn = 0;
-    my $haveSeenEofError = 0;
-
-    while (1) {
-        if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) {
-            $status = dumpToolDidCrash() ? "crashed" : "timedOut";
-            last;
-        }
-
-        # Once we've seen the EOF, we must not read anymore.
-        my $lineIn = readline($fhIn) unless $haveSeenEofIn;
-        my $lineError = readline($fhError) unless $haveSeenEofError;
-        if (!defined($lineIn) && !defined($lineError)) {
-            last if ($haveSeenEofIn && $haveSeenEofError);
-
-            if ($! != EAGAIN) {
-                $status = "crashed";
-                last;
-            }
-
-            # No data ready
-            usleep($microsecondsToWaitBeforeReadingAgain);
-            next;
-        }
-
-        $timeOfLastSuccessfulRead = time;
-
-        if (defined($lineIn)) {
-            if (!$haveSeenContentType && $lineIn =~ /^Content-Type: (\S+)$/) {
-                $mimeType = $1;
-                $haveSeenContentType = 1;
-            } elsif (!$haveSeenContentTransferEncoding && $lineIn =~ /^Content-Transfer-Encoding: (\S+)$/) {
-                $encoding = $1;
-                $haveSeenContentTransferEncoding = 1;
-            } elsif ($lineIn =~ /^DumpMalloc|^DumpJSHeap: (\S+)$/) {
-                    # Ignored. Only used in performance tests.
-            } elsif ($lineIn =~ /(.*)#EOF$/) {
-                if ($1 ne "") {
-                    push @output, $1;
-                }
-                $haveSeenEofIn = 1;
-            } else {
-                push @output, $lineIn;
-            }
-        }
-        if (defined($lineError)) {
-            if ($lineError =~ /#CRASHED - WebProcess/) {
-                $status = "webProcessCrashed";
-                last;
-            }
-            if ($lineError =~ /#CRASHED/) {
-                $status = "crashed";
-                last;
-            }
-            if ($lineError =~ /#EOF/) {
-                $haveSeenEofError = 1;
-            } else {
-                push @error, $lineError;
-            }
-        }
-    }
-
-    setFileHandleNonBlocking($fhIn, 0);
-    setFileHandleNonBlocking($fhError, 0);
-    my $joined_output = join("", @output);
-    if ($encoding eq "base64") {
-        $joined_output = decode_base64($joined_output);
-    }
-    return {
-        output => $joined_output,
-        error => join("", @error),
-        status => $status,
-        mimeType => $mimeType,
-        extension => extensionForMimeType($mimeType)
-    };
-}
-
-sub setFileHandleNonBlocking(*$)
-{
-    my ($fh, $nonBlocking) = @_;
-
-    my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags";
-
-    if ($nonBlocking) {
-        $flags |= O_NONBLOCK;
-    } else {
-        $flags &= ~O_NONBLOCK;
-    }
-
-    fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags";
-
-    return 1;
-}
-
-sub sampleDumpTool()
-{
-    return unless isAppleMacWebKit();
-    return unless $runSample;
-
-    my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree";
-    -d $outputDirectory or mkdir $outputDirectory;
-
-    my $outputFile = "$outputDirectory/HangReport.txt";
-    system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile;
-}
-
-sub stripMetrics($$)
-{
-    my ($actual, $expected) = @_;
-
-    foreach my $result ($actual, $expected) {
-        $result =~ s/at \(-?[0-9]+,-?[0-9]+\) *//g;
-        $result =~ s/size -?[0-9]+x-?[0-9]+ *//g;
-        $result =~ s/text run width -?[0-9]+: //g;
-        $result =~ s/text run width -?[0-9]+ [a-zA-Z ]+: //g;
-        $result =~ s/RenderButton {BUTTON} .*/RenderButton {BUTTON}/g;
-        $result =~ s/RenderImage {INPUT} .*/RenderImage {INPUT}/g;
-        $result =~ s/RenderBlock {INPUT} .*/RenderBlock {INPUT}/g;
-        $result =~ s/RenderTextControl {INPUT} .*/RenderTextControl {INPUT}/g;
-        $result =~ s/\([0-9]+px/px/g;
-        $result =~ s/ *" *\n +" */ /g;
-        $result =~ s/" +$/"/g;
-        $result =~ s/- /-/g;
-        $result =~ s/\n( *)"\s+/\n$1"/g;
-        $result =~ s/\s+"\n/"\n/g;
-        $result =~ s/scrollWidth [0-9]+/scrollWidth/g;
-        $result =~ s/scrollHeight [0-9]+/scrollHeight/g;
-        $result =~ s/scrollX [0-9]+/scrollX/g;
-        $result =~ s/scrollY [0-9]+/scrollY/g;
-        $result =~ s/scrolled to [0-9]+,[0-9]+/scrolled/g;
-    }
-
-    return ($actual, $expected);
-}
-
-sub fileShouldBeIgnored
-{
-    my ($filePath) = @_;
-    foreach my $ignoredDir (keys %ignoredDirectories) {
-        if ($filePath =~ m/^$ignoredDir/) {
-            return 1;
-        }
-    }
-    return 0;
-}
-
-sub readSkippedFiles($)
-{
-    my ($constraintPath) = @_;
-
-    my @skippedFileDirectories = @platformTestHierarchy;
-
-    # Because nearly all of the skipped tests for WebKit 2 on Mac are due to
-    # cross-platform issues, the Windows and Qt ports use the Mac skipped list
-    # additionally to their own to avoid maintaining separate lists.
-    push(@skippedFileDirectories, catdir($platformBaseDirectory, "wk2")) if ($platform eq "win-wk2" || $platform eq "qt-5.0-wk2" || $platform eq "mac-wk2" || $platform eq "gtk-wk2");
-
-    if ($verbose) {
-        foreach my $skippedPath (@skippedFileDirectories) {
-            print "Using Skipped file: $skippedPath\n";
-        }
-    }
-
-    foreach my $level (@skippedFileDirectories) {
-        # If a Skipped file exists in the directory, use that and ignore the TestExpectations file,
-        # but if it doesn't, treat every entry in the TestExpectations file as if it should be Skipped.
-        if (open SKIPPED, "<", "$level/Skipped") {
-            if ($verbose) {
-                my ($dir, $name) = splitpath($level);
-                print "Skipped tests in $name:\n";
-            }
-
-            while (<SKIPPED>) {
-                my $skipped = $_;
-                chomp $skipped;
-                $skipped =~ s/^[ \n\r]+//;
-                $skipped =~ s/[ \n\r]+$//;
-                if ($skipped && $skipped !~ /^#/) {
-                    processSkippedFileEntry($skipped, "Skipped", $constraintPath);
-                }
-            }
-            close SKIPPED;
-        } elsif (open EXPECTATIONS, "<", "$level/TestExpectations") {
-            if ($verbose) {
-                my ($dir, $name) = splitpath($level);
-                print "Skipping tests from $name:\n";
-            }
-            LINE: while (<EXPECTATIONS>) {
-                my $line = $_;
-                chomp $line;
-                $line =~ s/^[ \n\r]+//;
-                $line =~ s/[ \n\r]+$//;
-                $line =~ s/#.*$//;
-
-                # This logic roughly mirrors the logic in test_expectations.py _tokenize_line() but we
-                # don't bother to look at any of the modifiers or expectations and just skip everything.
-
-                my $state = "start";
-                my $skipped = "";
-                TOKEN: foreach my $token (split(/\s+/, $line)) {
-                    if (startsWith($token, "BUG") || startsWith($token, "//")) {
-                        # Ignore any lines with the old-style syntax.
-                        next LINE;
-                    }
-                    if (startsWith($token, "webkit.org/b/") || startsWith($token, "Bug(")) {
-                        # Skip over bug identifiers; note that we don't bother looking for
-                        # Chromium or V8 URLs since ORWT doesn't work with Chromium.
-                        next TOKEN;
-                    } elsif ($token eq "[") {
-                        if ($state eq 'start') {
-                            $state = 'configuration';
-                        }
-                    } elsif ($token eq "]") {
-                        if ($state eq 'configuration') {
-                            $state = 'name';
-                        }
-                    } elsif (($state eq "name") || ($state eq "start")) {
-                        $skipped = $token;
-                        # Skip over the rest of the line.
-                        last TOKEN;
-                    }
-                }
-                if ($skipped) {
-                    processSkippedFileEntry($skipped, "TestExpectations", $constraintPath);
-                }
-            }
-            close EXPECTATIONS;
-        }
-    }
-}
-
-sub processSkippedFileEntry($$$)
-{
-    my ($skipped, $listname, $constraintPath) = @_;
-
-    if ($skippedOnly) {
-        if (!fileShouldBeIgnored($skipped)) {
-            if (!$constraintPath) {
-                # Always add $skipped since no constraint path was specified on the command line.
-                push(@ARGV, $skipped);
-            } elsif ($skipped =~ /^($constraintPath)/ || ("LayoutTests/".$skipped) =~ /^($constraintPath)/ ) {
-                # Add $skipped only if it matches the current path constraint, e.g.,
-                # "--skipped=only dir1" with "dir1/file1.html" on the skipped list or
-                # "--skipped=only LayoutTests/dir1" with "dir1/file1.html" on the skipped list
-                push(@ARGV, $skipped);
-            } elsif ($constraintPath =~ /^("LayoutTests\/".$skipped)/ || $constraintPath =~ /^($skipped)/) {
-                # Add current path constraint if it is more specific than the skip list entry,
-                # e.g., "--skipped=only dir1/dir2/dir3" with "dir1" on the skipped list or
-                # e.g., "--skipped=only LayoutTests/dir1/dir2/dir3" with "dir1" on the skipped list.
-                push(@ARGV, $constraintPath);
-            }
-        } elsif ($verbose) {
-            print "    $skipped\n";
-        }
-    } else {
-        if ($verbose) {
-            print "    $skipped\n";
-        }
-        processIgnoreTests($skipped, $listname);
-    }
-}
-
-sub startsWith($$)
-{
-    my ($string, $substring) = @_;
-    return index($string, $substring) == 0;
-}
-
-sub readChecksumFromPng($)
-{
-    my ($path) = @_;
-    my $data;
-    if (open(PNGFILE, $path) && read(PNGFILE, $data, 2048) && $data =~ /tEXtchecksum\0([a-fA-F0-9]{32})/) {
-        return $1;
-    }
-}
-
-my @testsFound;
-
-sub isUsedInReftest($)
-{
-    my $filename = $_[0];
-    my @extensions = ('html','shtml','xml','xhtml','htm','php','svg','mht','pl');
-    my $extensionsJoined = join("|", @extensions);
-    my $suffixExtensionExpression = "-($expectedTag|$refTag|$notrefTag)(-$mismatchTag)?\\.(".$extensionsJoined.")\$";
-    my $prefixExtensionExpression = "^($refTag|$notrefTag)-";
-    if ($filename =~ /$suffixExtensionExpression/ || $filename =~ /$prefixExtensionExpression/) {
-        return 1;
-    }
-    my $base = stripExtension($filename);
-
-    foreach my $extension (@extensions) {
-        if (-f "$base-$expectedTag.$extension" || 
-            -f "$base-$refTag.$extension" || -f "$base-$notrefTag.$extension" ||
-            -f "$base-$expectedTag-$mismatchTag.$extension" ||
-            -f "$refTag-$base.$extension" || -f "$notrefTag-$base.$extension") {
-            return 1;
-        }
-    }
-    return 0;
-}
-
-sub directoryFilter
-{
-    return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
-    return () if exists $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)};
-    return @_;
-}
-
-sub fileFilter
-{
-    my $filename = $_;
-    if ($filename =~ /\.([^.]+)$/) {
-        my $extension = $1;
-        if (exists $supportedFileExtensions{$extension} && !isUsedInReftest($filename)) {
-            my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testDirectory);
-            push @testsFound, $path if !exists $ignoredFiles{$path};
-        }
-    }
-}
-
-sub findTestsToRun
-{
-    my @testsToRun = ();
-
-    for my $test (@ARGV) {
-        $test =~ s/^(\Q$layoutTestsName\E|\Q$testDirectory\E)\///;
-        my $fullPath = catfile($testDirectory, $test);
-        if (file_name_is_absolute($test)) {
-            print "can't run test $test outside $testDirectory\n";
-        } elsif (-f $fullPath && !isUsedInReftest($fullPath)) {
-            my ($filename, $pathname, $fileExtension) = fileparse($test, qr{\.[^.]+$});
-            if (!exists $supportedFileExtensions{substr($fileExtension, 1)}) {
-                print "test $test does not have a supported extension\n";
-            } elsif ($testHTTP || $pathname !~ /^http\//) {
-                push @testsToRun, $test;
-            }
-        } elsif (-d $fullPath) {
-            @testsFound = ();
-            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $fullPath);
-            for my $level (@platformTestHierarchy) {
-                my $platformPath = catfile($level, $test);
-                find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $platformPath) if (-d $platformPath);
-            }
-            push @testsToRun, sort pathcmp @testsFound;
-            @testsFound = ();
-        } else {
-            print "test $test not found\n";
-        }
-    }
-
-    if (!scalar @ARGV) {
-        @testsFound = ();
-        find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testDirectory);
-        for my $level (@platformTestHierarchy) {
-            find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $level);
-        }
-        push @testsToRun, sort pathcmp @testsFound;
-        @testsFound = ();
-
-        # We need to minimize the time when Apache and WebSocketServer is locked by tests
-        # so run them last if no explicit order was specified in the argument list.
-        my @httpTests;
-        my @websocketTests;
-        my @otherTests;
-        foreach my $test (@testsToRun) {
-            if ($test =~ /^http\//) {
-                push(@httpTests, $test);
-            } elsif ($test =~ /^websocket\//) {
-                push(@websocketTests, $test);
-            } else {
-                push(@otherTests, $test);
-            }
-        }
-        @testsToRun = (@otherTests, @httpTests, @websocketTests);
-    }
-
-    # Reverse the tests
-    @testsToRun = reverse @testsToRun if $reverseTests;
-
-    # Shuffle the array
-    @testsToRun = shuffle(@testsToRun) if $randomizeTests;
-
-    return @testsToRun;
-}
-
-sub printResults
-{
-    my %text = (
-        match => "succeeded",
-        mismatch => "had incorrect layout",
-        new => "were new",
-        timedout => "timed out",
-        crash => "crashed",
-        webProcessCrash => "Web process crashed",
-        error => "had stderr output"
-    );
-
-    for my $type ("match", "mismatch", "new", "timedout", "crash", "webProcessCrash", "error") {
-        my $typeCount = $counts{$type};
-        next unless $typeCount;
-        my $typeText = $text{$type};
-        my $message;
-        if ($typeCount == 1) {
-            $typeText =~ s/were/was/;
-            $message = sprintf "1 test case %s\n", $typeText;
-        } else {
-            $message = sprintf "%d test cases %s\n", $typeCount, $typeText;
-        }
-        $message =~ s-\(0%\)-(<1%)-;
-        print $message;
-    }
-}
-
-sub stopRunningTestsEarlyIfNeeded()
-{
-    # --reset-results does not check pass vs. fail, so exitAfterNFailures makes no sense with --reset-results.
-    return 0 if $resetResults;
-
-    my $passCount = $counts{match} || 0; # $counts{match} will be undefined if we've not yet passed a test (e.g. the first test fails).
-    my $newCount = $counts{new} || 0;
-    my $failureCount = $count - $passCount - $newCount; # "Failure" here includes timeouts, crashes, etc.
-    if ($exitAfterNFailures && $failureCount >= $exitAfterNFailures) {
-        $stoppedRunningEarlyMessage = "Exiting early after $failureCount failures. $count tests run.";
-        print "\n", $stoppedRunningEarlyMessage;
-        closeDumpTool();
-        return 1;
-    }
-
-    my $crashCount = $counts{crash} || 0;
-    my $webProcessCrashCount = $counts{webProcessCrash} || 0;
-    my $timeoutCount = $counts{timedout} || 0;
-    if ($exitAfterNCrashesOrTimeouts && $crashCount + $webProcessCrashCount + $timeoutCount >= $exitAfterNCrashesOrTimeouts) {
-        $stoppedRunningEarlyMessage = "Exiting early after $crashCount crashes, $webProcessCrashCount web process crashes, and $timeoutCount timeouts. $count tests run.";
-        print "\n", $stoppedRunningEarlyMessage;
-        closeDumpTool();
-        return 1;
-    }
-
-    return 0;
-}
-
-# Store this at global scope so it won't be GCed (and thus unlinked) until the program exits.
-my $debuggerTempDirectory;
-
-sub createDebuggerCommandFile()
-{
-    return unless isCygwin();
-
-    my @commands = (
-        '.logopen /t "' . toWindowsPath($testResultsDirectory) . "\\" . $windowsCrashLogFilePrefix . '.txt"',
-        '.srcpath "' . toWindowsPath(sourceDir()) . '"',
-        '!analyze -vv',
-        '~*kpn',
-        'q',
-    );
-
-    $debuggerTempDirectory = File::Temp->newdir;
-
-    my $commandFile = File::Spec->catfile($debuggerTempDirectory, "debugger-commands.txt");
-    unless (open COMMANDS, '>', $commandFile) {
-        print "Failed to open $commandFile. Crash logs will not be saved.\n";
-        return;
-    }
-    print COMMANDS join("\n", @commands), "\n";
-    unless (close COMMANDS) {
-        print "Failed to write to $commandFile. Crash logs will not be saved.\n";
-        return;
-    }
-
-    return $commandFile;
-}
-
-sub setUpWindowsCrashLogSaving()
-{
-    return unless isCygwin();
-
-    unless (defined $ENV{_NT_SYMBOL_PATH}) {
-        print "The _NT_SYMBOL_PATH environment variable is not set. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
-        return;
-    }
-
-    my $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{PROGRAMFILES}), "Debugging Tools for Windows (x86)", "ntsd.exe");
-    unless (-f $ntsdPath) {
-        $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{ProgramW6432}), "Debugging Tools for Windows (x64)", "ntsd.exe");
-        unless (-f $ntsdPath) {
-            $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{SYSTEMROOT}), "system32", "ntsd.exe");
-            unless (-f $ntsdPath) {
-                print STDERR "Can't find ntsd.exe. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
-                return;
-            }
-        }
-    }
-
-    # If we used -c (instead of -cf) we could pass the commands directly on the command line. But
-    # when the commands include multiple quoted paths (e.g., for .logopen and .srcpath), Windows
-    # fails to invoke the post-mortem debugger at all (perhaps due to a bug in Windows's command
-    # line parsing). So we save the commands to a file instead and tell the debugger to execute them
-    # using -cf.
-    my $commandFile = createDebuggerCommandFile() or return;
-
-    my @options = (
-        '-p %ld',
-        '-e %ld',
-        '-g',
-        '-lines',
-        '-cf "' . toWindowsPath($commandFile) . '"',
-    );
-
-    my %values = (
-        Debugger => '"' . toWindowsPath($ntsdPath) . '" ' . join(' ', @options),
-        Auto => 1
-    );
-
-    foreach my $value (keys %values) {
-        $previousWindowsPostMortemDebuggerValues{$value} = readRegistryString("$windowsPostMortemDebuggerKey/$value");
-        next if writeRegistryString("$windowsPostMortemDebuggerKey/$value", $values{$value});
-
-        print "Failed to set \"$windowsPostMortemDebuggerKey/$value\". Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
-        return;
-    }
-
-    print "Crash logs will be saved to $testResultsDirectory.\n";
-}
-
-END {
-    return unless isCygwin();
-
-    foreach my $value (keys %previousWindowsPostMortemDebuggerValues) {
-        next if writeRegistryString("$windowsPostMortemDebuggerKey/$value", $previousWindowsPostMortemDebuggerValues{$value});
-        print "Failed to restore \"$windowsPostMortemDebuggerKey/$value\" to its previous value \"$previousWindowsPostMortemDebuggerValues{$value}\"\n.";
-    }
-}
diff --git a/Tools/Scripts/parallelcl b/Tools/Scripts/parallelcl
deleted file mode 100755
index 8a46365..0000000
--- a/Tools/Scripts/parallelcl
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use File::Basename;
-use File::Spec;
-use File::Temp;
-use POSIX;
-
-sub makeJob(\@$);
-sub forkAndCompileFiles(\@$);
-sub Exec($);
-sub waitForChild(\@);
-sub cleanup(\@);
-
-my $debug = 0;
-
-chomp(my $clexe = `cygpath -u '$ENV{'VS80COMNTOOLS'}/../../VC/bin/cl.exe'`);
-
-if ($debug) {
-    print STDERR "Received " . @ARGV . " arguments:\n";
-    foreach my $arg (@ARGV) {
-        print STDERR "$arg\n";
-    }
-}
-
-my $commandFile;
-foreach my $arg (@ARGV) {
-    if ($arg =~ /^[\/-](E|EP|P)$/) {
-        print STDERR "The invoking process wants preprocessed source, so let's hand off this whole command to the real cl.exe\n" if $debug;
-        Exec("\"$clexe\" \"" . join('" "', @ARGV) . "\"");
-    } elsif ($arg =~ /^@(.*)$/) {
-        chomp($commandFile = `cygpath -u '$1'`);
-    }
-}
-
-die "No command file specified!" unless $commandFile;
-die "Couldn't find $commandFile!" unless -f $commandFile;
-
-my @sources;
-
-open(COMMAND, '<:raw:encoding(UTF16-LE):crlf:utf8', $commandFile) or die "Couldn't open $commandFile!";
-
-# The first line of the command file contains all the options to cl.exe plus the first (possibly quoted) filename
-my $firstLine = <COMMAND>;
-$firstLine =~ s/\r?\n$//;
-
-# To find the start of the first filename, look for either the last space on the line.
-# If the filename is quoted, the last character on the line will be a quote, so look for the quote before that.
-my $firstFileIndex;
-print STDERR "Last character of first line = '" . substr($firstLine, -1, 1) . "'\n" if $debug;
-if (substr($firstLine, -1, 1) eq '"') {
-    print STDERR "First file is quoted\n" if $debug;
-    $firstFileIndex = rindex($firstLine, '"', length($firstLine) - 2);
-} else {
-    print STDERR "First file is NOT quoted\n" if $debug;
-    $firstFileIndex = rindex($firstLine, ' ') + 1;
-}
-
-my $options = substr($firstLine, 0, $firstFileIndex) . join(' ', @ARGV[1 .. $#ARGV]);
-my $possibleFirstFile = substr($firstLine, $firstFileIndex);
-if ($possibleFirstFile =~ /\.(cpp|c)/) {
-    push(@sources, $possibleFirstFile);
-} else {
-    $options .= " $possibleFirstFile";
-}
-
-print STDERR "######## Found options $options ##########\n" if $debug;
-print STDERR "####### Found first source file $sources[0] ########\n" if @sources && $debug;
-
-# The rest of the lines of the command file just contain source files, one per line
-while (my $source = <COMMAND>) {
-    chomp($source);
-    $source =~ s/^\s+//;
-    $source =~ s/\s+$//;
-    push(@sources, $source) if length($source);
-}
-close(COMMAND);
-
-my $numSources = @sources;
-exit unless $numSources > 0;
-
-my $numJobs;
-if ($options =~ s/-j\s*([0-9]+)//) {
-    $numJobs = $1;
-} else {
-    chomp($numJobs = `num-cpus`);
-}
-
-print STDERR "\n\n####### COMPILING $numSources FILES USING AT MOST $numJobs PARALLEL INSTANCES OF cl.exe ###########\n\n";# if $debug;
-
-# Magic determination of job size
-# The hope is that by splitting the source files up into 2*$numJobs pieces, we
-# won't suffer too much if one job finishes much more quickly than another.
-# However, we don't want to split it up too much due to cl.exe overhead, so set
-# the minimum job size to 5.
-my $jobSize = POSIX::ceil($numSources / (2 * $numJobs));
-$jobSize = $jobSize < 5 ? 5 : $jobSize;
-
-print STDERR "######## jobSize = $jobSize ##########\n" if $debug;
-
-# Sort the source files randomly so that we don't end up with big clumps of large files (aka SVG)
-sub fisher_yates_shuffle(\@)
-{
-    my ($array) = @_;
-    for (my $i = @{$array}; --$i; ) {
-        my $j = int(rand($i+1));
-        next if $i == $j;
-        @{$array}[$i,$j] = @{$array}[$j,$i];
-    }
-}
-
-fisher_yates_shuffle(@sources);    # permutes @array in place
-
-my @children;
-my @tmpFiles;
-my $status = 0;
-while (@sources) {
-    while (@sources && @children < $numJobs) {
-        my $pid;
-        my $tmpFile;
-        my $job = makeJob(@sources, $jobSize);
-        ($pid, $tmpFile) = forkAndCompileFiles(@{$job}, $options);
-
-        print STDERR "####### Spawned child with PID $pid and tmpFile $tmpFile ##########\n" if $debug;
-        push(@children, $pid);
-        push(@tmpFiles, $tmpFile);
-    }
-
-    $status |= waitForChild(@children);
-}
-
-while (@children) {
-    $status |= waitForChild(@children);
-}
-cleanup(@tmpFiles);
-
-exit WEXITSTATUS($status);
-
-
-sub makeJob(\@$)
-{
-    my ($files, $jobSize) = @_;
-
-    my @job;
-    if (@{$files} > ($jobSize * 1.5)) {
-        @job = splice(@{$files}, -$jobSize);
-    } else {
-        # Compile all the remaining files in this job to avoid having a small job later
-        @job = splice(@{$files});
-    }
-
-    return \@job;
-}
-
-sub forkAndCompileFiles(\@$)
-{
-    print STDERR "######## forkAndCompileFiles()\n" if $debug;
-    my ($files, $options) = @_;
-
-    if ($debug) {
-        foreach my $file (@{$files}) {
-            print STDERR "######## $file\n";
-        }
-    }
-
-    my (undef, $tmpFile) = File::Temp::tempfile('clcommandXXXXX', DIR => File::Spec->tmpdir, OPEN => 0);
-
-    my $pid = fork();
-    die "Fork failed" unless defined($pid);
-
-    unless ($pid) {
-        # Child process
-        open(TMP, '>:raw:encoding(UTF16-LE):crlf:utf8', $tmpFile) or die "Couldn't open $tmpFile";
-        print TMP "$options\n";
-        foreach my $file (@{$files}) {
-            print TMP "$file\n";
-        }
-        close(TMP);
-        
-        chomp(my $winTmpFile = `cygpath -m $tmpFile`);
-        Exec "\"$clexe\" \@\"$winTmpFile\"";
-    } else {
-        return ($pid, $tmpFile);
-    }
-}
-
-sub Exec($)
-{
-    my ($command) = @_;
-
-    print STDERR "Exec($command)\n" if $debug;
-
-    exec($command);
-}
-
-sub waitForChild(\@)
-{
-    my ($children) = @_;
-
-    return unless @{$children};
-
-    my $deceased = wait();
-    my $status = $?;
-    print STDERR "######## Child with PID $deceased finished ###########\n" if $debug;
-    for (my $i = 0; $i < @{$children}; $i++) {
-        if ($children->[$i] == $deceased) {
-            splice(@{$children}, $i, 1);
-            last;
-        }
-    }
-
-    return $status;
-}
-
-sub cleanup(\@)
-{
-    my ($tmpFiles) = @_;
-
-    foreach my $file (@{$tmpFiles}) {
-        unlink $file;
-    }
-}
diff --git a/Tools/Scripts/pdevenv b/Tools/Scripts/pdevenv
deleted file mode 100755
index 4643728..0000000
--- a/Tools/Scripts/pdevenv
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use warnings;
-
-use File::Temp qw/tempfile/;
-use FindBin;
-
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my ($fh, $path) = tempfile(UNLINK => 0, SUFFIX => '.cmd') or die;
-
-chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`);
-chomp(my $scriptsPath = `cygpath -w "$FindBin::Bin"`);
-
-my $vsToolsVar;
-if ($ENV{'VS80COMNTOOLS'}) {
-    $vsToolsVar = "VS80COMNTOOLS";
-} elsif ($ENV{'VS90COMNTOOLS'}) {
-    $vsToolsVar = "VS90COMNTOOLS";
-} else {
-    print "*************************************************************\n";
-    print "Cannot find Visual Studio tools dir.\n";
-    print "Please ensure that \$VS80COMNTOOLS or \$VS90COMNTOOLS\n";
-    print "is set to a valid location.\n";
-    print "*************************************************************\n";
-    die;
-}
-
-print $fh "\@echo off\n\n";
-print $fh "call \"\%" . $vsToolsVar . "\%\\vsvars32.bat\"\n\n";
-print $fh "set PATH=$vcBin;$scriptsPath;\%PATH\%\n\n";
-
-print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", @ARGV) . ") ELSE ";
-print $fh "VCExpress.exe /useenv " . join(" ", @ARGV) . "\n";
-
-
-close $fh;
-
-chmod 0755, $path;
-
-chomp($path = `cygpath -w -s '$path'`);
-
-exec("cmd /c \"call $path\"");
diff --git a/Tools/Scripts/prepare-ChangeLog b/Tools/Scripts/prepare-ChangeLog
deleted file mode 100755
index f551540..0000000
--- a/Tools/Scripts/prepare-ChangeLog
+++ /dev/null
@@ -1,1992 +0,0 @@
-#!/usr/bin/perl -w
-# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2  -*-
-
-#
-#  Copyright (C) 2000, 2001 Eazel, Inc.
-#  Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Apple Inc.  All rights reserved.
-#  Copyright (C) 2009 Torch Mobile, Inc.
-#  Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
-#
-#  prepare-ChangeLog is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public
-#  License as published by the Free Software Foundation; either
-#  version 2 of the License, or (at your option) any later version.
-#
-#  prepare-ChangeLog is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public
-#  License along with this program; if not, write to the Free
-#  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-
-# Perl script to create a ChangeLog entry with names of files
-# and functions from a diff.
-#
-# Darin Adler <darin@bentspoon.com>, started 20 April 2000
-# Java support added by Maciej Stachowiak <mjs@eazel.com>
-# Objective-C, C++ and Objective-C++ support added by Maciej Stachowiak <mjs@apple.com>
-# Git support added by Adam Roben <aroben@apple.com>
-# --git-index flag added by Joe Mason <joe.mason@torchmobile.com>
-
-
-#
-# TODO:
-#   List functions that have been removed too.
-#   Decide what a good logical order is for the changed files
-#     other than a normal text "sort" (top level first?)
-#     (group directories?) (.h before .c?)
-#   Handle yacc source files too (other languages?).
-#   Help merge when there are ChangeLog conflicts or if there's
-#     already a partly written ChangeLog entry.
-#   Add command line option to put the ChangeLog into a separate file.
-#   Add SVN version numbers for commit (can't do that until
-#     the changes are checked in, though).
-#   Work around diff stupidity where deleting a function that starts
-#     with a comment makes diff think that the following function
-#     has been changed (if the following function starts with a comment
-#     with the same first line, such as /**)
-#   Work around diff stupidity where deleting an entire function and
-#     the blank lines before it makes diff think you've changed the
-#     previous function.
-
-use strict;
-use warnings;
-
-use File::Basename;
-use File::Spec;
-use FindBin;
-use Getopt::Long;
-use lib $FindBin::Bin;
-use POSIX qw(strftime);
-use VCSUtils;
-
-sub changeLogDate($);
-sub changeLogEmailAddressFromArgs($$);
-sub changeLogNameFromArgs($$);
-sub createPatchCommand($$$$);
-sub decodeEntities($);
-sub determinePropertyChanges($$$);
-sub diffCommand($$$$);
-sub diffFromToString($$$);
-sub diffHeaderFormat();
-sub extractLineRange($);
-sub fetchBugDescriptionFromURL($$);
-sub findChangeLogs($);
-sub findOriginalFileFromSvn($);
-sub generateFileList(\%$$$);
-sub generateFunctionLists($$$$$);
-sub generateNewChangeLogs($$$$$$$$$$$);
-sub getLatestChangeLogs($);
-sub get_function_line_ranges($$);
-sub get_function_line_ranges_for_cpp($$);
-sub get_function_line_ranges_for_java($$);
-sub get_function_line_ranges_for_javascript($$);
-sub get_function_line_ranges_for_perl($$);
-sub get_selector_line_ranges_for_css($$);
-sub isAddedStatus($);
-sub isConflictStatus($$$);
-sub isModifiedStatus($);
-sub isUnmodifiedStatus($);
-sub main();
-sub method_decl_to_selector($);
-sub normalizeLineEndings($$);
-sub openChangeLogs($);
-sub pluralizeAndList($$@);
-sub printDiff($$$$);
-sub processPaths(\@);
-sub propertyChangeDescription($);
-sub resolveConflictedChangeLogs($);
-sub reviewerAndDescriptionForGitCommit($$);
-sub statusCommand($$$$);
-sub statusDescription($$$$);
-sub testListForChangeLog(@);
-
-### Constant variables.
-# Project time zone for Cupertino, CA, US
-use constant ChangeLogTimeZone => "PST8PDT";
-use constant SVN => "svn";
-use constant GIT => "git";
-use constant SupportedTestExtensions => {map { $_ => 1 } qw(html shtml svg xml xhtml pl php)};
-
-exit(main());
-
-sub main()
-{
-    my $bugDescription;
-    my $bugNumber;
-    my $name;
-    my $emailAddress;
-    my $mergeBase = 0;
-    my $gitCommit = 0;
-    my $gitIndex = "";
-    my $gitReviewer = "";
-    my $openChangeLogs = 0;
-    my $writeChangeLogs = 1;
-    my $showHelp = 0;
-    my $spewDiff = $ENV{"PREPARE_CHANGELOG_DIFF"};
-    my $updateChangeLogs = 1;
-    my $parseOptionsResult =
-        GetOptions("diff|d!" => \$spewDiff,
-                   "bug|b:i" => \$bugNumber,
-                   "description:s" => \$bugDescription,
-                   "name:s" => \$name,
-                   "email:s" => \$emailAddress,
-                   "merge-base:s" => \$mergeBase,
-                   "git-commit|g:s" => \$gitCommit,
-                   "git-index" => \$gitIndex,
-                   "git-reviewer:s" => \$gitReviewer,
-                   "help|h!" => \$showHelp,
-                   "open|o!" => \$openChangeLogs,
-                   "write!" => \$writeChangeLogs,
-                   "update!" => \$updateChangeLogs);
-    if (!$parseOptionsResult || $showHelp) {
-        print STDERR basename($0) . " [-b|--bug=<bugid>] [-d|--diff] [-h|--help] [-o|--open] [-g|--git-commit=<committish>] [--git-reviewer=<name>] [svndir1 [svndir2 ...]]\n";
-        print STDERR "  -b|--bug        Fill in the ChangeLog bug information from the given bug.\n";
-        print STDERR "  --description   One-line description that matches the bug title.\n";
-        print STDERR "  -d|--diff       Spew diff to stdout when running\n";
-        print STDERR "  --merge-base    Populate the ChangeLogs with the diff to this branch\n";
-        print STDERR "  -g|--git-commit Populate the ChangeLogs from the specified git commit\n";
-        print STDERR "  --git-index     Populate the ChangeLogs from the git index only\n";
-        print STDERR "  --git-reviewer  When populating the ChangeLogs from a git commit claim that the spcified name reviewed the change.\n";
-        print STDERR "                  This option is useful when the git commit lacks a Signed-Off-By: line\n";
-        print STDERR "  -h|--help       Show this help message\n";
-        print STDERR "  -o|--open       Open ChangeLogs in an editor when done\n";
-        print STDERR "  --[no-]update   Update ChangeLogs from svn before adding entry (default: update)\n";
-        print STDERR "  --[no-]write    Write ChangeLogs to disk (otherwise send new entries to stdout) (default: write)\n";
-        print STDERR "  --email=        Specify the email address to be used in the patch\n";
-        return 1;
-    }
-
-    die "--git-commit and --git-index are incompatible." if ($gitIndex && $gitCommit);
-
-    isSVN() || isGit() || die "Couldn't determine your version control system.";
-
-    my %paths = processPaths(@ARGV);
-
-    # Find the list of modified files
-    my ($changedFiles, $conflictFiles, $functionLists, $addedRegressionTests) = generateFileList(%paths, $gitCommit, $gitIndex, $mergeBase);
-
-    if (!@$changedFiles && !@$conflictFiles && !keys %$functionLists) {
-        print STDERR "  No changes found.\n";
-        return 1;
-    }
-
-    if (@$conflictFiles) {
-        print STDERR "  The following files have conflicts. Run prepare-ChangeLog again after fixing the conflicts:\n";
-        print STDERR join("\n", @$conflictFiles), "\n";
-        return 1;
-    }
-
-    generateFunctionLists($changedFiles, $functionLists, $gitCommit, $gitIndex, $mergeBase);
-
-    # Get some parameters for the ChangeLog we are about to write.
-    $name = changeLogNameFromArgs($name, $gitCommit);
-    $emailAddress = changeLogEmailAddressFromArgs($emailAddress, $gitCommit);
-
-    print STDERR "  Change author: $name <$emailAddress>.\n";
-
-    # Remove trailing parenthesized notes from user name (bit of hack).
-    $name =~ s/\(.*?\)\s*$//g;
-
-    my $bugURL;
-    if ($bugNumber) {
-        $bugURL = "https://bugs.webkit.org/show_bug.cgi?id=$bugNumber";
-    }
-
-    if ($bugNumber && !$bugDescription) {
-        $bugDescription = fetchBugDescriptionFromURL($bugURL, $bugNumber);
-    }
-
-    my ($filesInChangeLog, $prefixes) = findChangeLogs($functionLists);
-
-    # Get the latest ChangeLog files from svn.
-    my $changeLogs = getLatestChangeLogs($prefixes);
-
-    if (@$changeLogs && $updateChangeLogs && isSVN()) {
-        resolveConflictedChangeLogs($changeLogs);
-    }
-
-    generateNewChangeLogs($prefixes, $filesInChangeLog, $addedRegressionTests, $functionLists, $bugURL, $bugDescription, $name, $emailAddress, $gitReviewer, $gitCommit, $writeChangeLogs);
-
-    if ($writeChangeLogs) {
-        print STDERR "-- Please remember to include a detailed description in your ChangeLog entry. --\n-- See <http://webkit.org/coding/contributing.html> for more info --\n";
-    }
-
-    # Write out another diff.
-    if ($spewDiff && @$changedFiles) {
-        printDiff($changedFiles, $gitCommit, $gitIndex, $mergeBase);
-    }
-
-    # Open ChangeLogs.
-    if ($openChangeLogs && @$changeLogs) {
-        openChangeLogs($changeLogs);
-    }
-    return 0;
-}
-
-sub generateFunctionLists($$$$$)
-{
-    my ($changedFiles, $functionLists, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    my %changed_line_ranges;
-    if (@$changedFiles) {
-        # For each file, build a list of modified lines.
-        # Use line numbers from the "after" side of each diff.
-        print STDERR "  Reviewing diff to determine which lines changed.\n";
-        my $file;
-        open DIFF, "-|", diffCommand($changedFiles, $gitCommit, $gitIndex, $mergeBase) or die "The diff failed: $!.\n";
-        while (<DIFF>) {
-            $file = makeFilePathRelative($1) if $_ =~ diffHeaderFormat();
-            if (defined $file) {
-                my ($start, $end) = extractLineRange($_);
-                if ($start >= 0 && $end >= 0) {
-                    push @{$changed_line_ranges{$file}}, [ $start, $end ];
-                } elsif (/DO_NOT_COMMIT/) {
-                    print STDERR "WARNING: file $file contains the string DO_NOT_COMMIT, line $.\n";
-                }
-            }
-        }
-        close DIFF;
-    }
-
-    # For each source file, convert line range to function list.
-    if (%changed_line_ranges) {
-        print STDERR "  Extracting affected function names from source files.\n";
-        foreach my $file (keys %changed_line_ranges) {
-            # Find all the functions in the file.
-            open SOURCE, $file or next;
-            my @function_ranges = get_function_line_ranges(\*SOURCE, $file);
-            close SOURCE;
-
-            # Find all the modified functions.
-            my @functions;
-            my %saw_function;
-            my @change_ranges = (@{$changed_line_ranges{$file}}, []);
-            my @change_range = (0, 0);
-            FUNCTION: foreach my $function_range_ref (@function_ranges) {
-                my @function_range = @$function_range_ref;
-
-                # FIXME: This is a hack. If the function name is empty, skip it.
-                # The cpp, python, javascript, perl, css and java parsers
-                # are not perfectly implemented and sometimes function names cannot be retrieved
-                # correctly. As you can see in get_function_line_ranges_XXXX(), those parsers
-                # are not intended to implement real parsers but intended to just retrieve function names
-                # for most practical syntaxes.
-                next unless $function_range[2];
-
-                # Advance to successive change ranges.
-                for (;; @change_range = @{shift @change_ranges}) {
-                    last FUNCTION unless @change_range;
-
-                    # If past this function, move on to the next one.
-                    next FUNCTION if $change_range[0] > $function_range[1];
-
-                    # If an overlap with this function range, record the function name.
-                    if ($change_range[1] >= $function_range[0]
-                        and $change_range[0] <= $function_range[1]) {
-                        if (!$saw_function{$function_range[2]}) {
-                            $saw_function{$function_range[2]} = 1;
-                            push @functions, $function_range[2];
-                        }
-                        next FUNCTION;
-                    }
-                }
-            }
-
-            # Format the list of functions now.
-            if (@functions) {
-                $functionLists->{$file} = "" if !defined $functionLists->{$file};
-                $functionLists->{$file} .= "\n        (" . join("):\n        (", @functions) . "):";
-            }
-        }
-    }
-}
-
-sub changeLogDate($)
-{
-    my ($timeZone) = @_;
-    my $savedTimeZone = $ENV{'TZ'};
-    # Set TZ temporarily so that localtime() is in that time zone
-    $ENV{'TZ'} = $timeZone;
-    my $date = strftime("%Y-%m-%d", localtime());
-    if (defined $savedTimeZone) {
-         $ENV{'TZ'} = $savedTimeZone;
-    } else {
-         delete $ENV{'TZ'};
-    }
-    return $date;
-}
-
-sub changeLogNameFromArgs($$)
-{
-    my ($nameFromArgs, $gitCommit) = @_;
-    # Silently allow --git-commit to win, we could warn if $nameFromArgs is defined.
-    my $command = GIT . ' log --max-count=1 --pretty="format:%an" "' . $gitCommit . '"';
-    return `$command` if $gitCommit;
-
-    return $nameFromArgs || changeLogName();
-}
-
-sub changeLogEmailAddressFromArgs($$)
-{
-    my ($emailAddressFromArgs, $gitCommit) = @_;
-    # Silently allow --git-commit to win, we could warn if $emailAddressFromArgs is defined.
-    my $command = GIT . ' log --max-count=1 --pretty="format:%ae" "' . $gitCommit . '"';
-    return `$command` if $gitCommit;
-
-    return $emailAddressFromArgs || changeLogEmailAddress();
-}
-
-sub fetchBugDescriptionFromURL($$)
-{
-    my ($bugURL, $bugNumber) = @_;
-
-    my $bugXMLURL = "$bugURL&ctype=xml&excludefield=attachmentdata";
-    # Perl has no built in XML processing, so we'll fetch and parse with curl and grep
-    # Pass --insecure because some cygwin installs have no certs we don't
-    # care about validating that bugs.webkit.org is who it says it is here.
-    my $descriptionLine = `curl --insecure --silent "$bugXMLURL" | grep short_desc`;
-    if ($descriptionLine !~ /<short_desc>(.*)<\/short_desc>/) {
-        # Maybe the reason the above did not work is because the curl that is installed doesn't
-        # support ssl at all.
-        if (`curl --version | grep ^Protocols` !~ /\bhttps\b/) {
-            print STDERR "  Could not get description for bug $bugNumber.\n";
-            print STDERR "  It looks like your version of curl does not support ssl.\n";
-            print STDERR "  If you are using macports, this can be fixed with sudo port install curl +ssl.\n";
-        } else {
-            print STDERR "  Bug $bugNumber has no bug description. Maybe you set wrong bug ID?\n";
-            print STDERR "  The bug URL: $bugXMLURL\n";
-        }
-        exit 1;
-    }
-    my $bugDescription = decodeEntities($1);
-    print STDERR "  Description from bug $bugNumber:\n    \"$bugDescription\".\n";
-    return $bugDescription;
-}
-
-sub findChangeLogs($)
-{
-    my ($functionLists) = @_;
-
-    # Find the change logs.
-    my %has_log;
-    my %filesInChangeLog;
-    foreach my $file (sort keys %$functionLists) {
-        my $prefix = $file;
-        my $has_log = 0;
-        while ($prefix) {
-            $prefix =~ s-/[^/]+/?$-/- or $prefix = "";
-            $has_log = $has_log{$prefix};
-            if (!defined $has_log) {
-                $has_log = -f "${prefix}ChangeLog";
-                $has_log{$prefix} = $has_log;
-            }
-            last if $has_log;
-        }
-        if (!$has_log) {
-            print STDERR "No ChangeLog found for $file.\n";
-        } else {
-            push @{$filesInChangeLog{$prefix}}, $file;
-        }
-    }
-
-    # Build the list of ChangeLog prefixes in the correct project order
-    my @prefixes;
-    my %prefixesSort;
-    foreach my $prefix (keys %filesInChangeLog) {
-        my $prefixDir = substr($prefix, 0, length($prefix) - 1); # strip trailing /
-        my $sortKey = lc $prefix;
-        $sortKey = "top level" unless length $sortKey;
-
-        if ($prefixDir eq "top level") {
-            $sortKey = "";
-        } elsif ($prefixDir eq "Tools") {
-            $sortKey = "-, just after top level";
-        } elsif ($prefixDir eq "WebBrowser") {
-            $sortKey = lc "WebKit, WebBrowser after";
-        } elsif ($prefixDir eq "Source/WebCore") {
-            $sortKey = lc "WebFoundation, WebCore after";
-        } elsif ($prefixDir eq "LayoutTests") {
-            $sortKey = lc "~, LayoutTests last";
-        }
-
-        $prefixesSort{$sortKey} = $prefix;
-    }
-    foreach my $prefixSort (sort keys %prefixesSort) {
-        push @prefixes, $prefixesSort{$prefixSort};
-    }
-    return (\%filesInChangeLog, \@prefixes);
-}
-
-sub getLatestChangeLogs($)
-{
-    my ($prefixes) = @_;
-
-    my @changeLogs = ();
-    foreach my $prefix (@$prefixes) {
-        push @changeLogs, File::Spec->catfile($prefix || ".", changeLogFileName());
-    }
-    return \@changeLogs;
-}
-
-sub resolveConflictedChangeLogs($)
-{
-    my ($changeLogs) = @_;
-
-    print STDERR "  Running 'svn update' to update ChangeLog files.\n";
-    open ERRORS, "-|", SVN, "update", @$changeLogs
-        or die "The svn update of ChangeLog files failed: $!.\n";
-    my @conflictedChangeLogs;
-    while (my $line = <ERRORS>) {
-        print STDERR "    ", $line;
-        push @conflictedChangeLogs, $1 if $line =~ m/^C\s+(.+?)[\r\n]*$/;
-    }
-    close ERRORS;
-
-    return if !@conflictedChangeLogs;
-
-    print STDERR "  Attempting to merge conflicted ChangeLogs.\n";
-    my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
-    open RESOLVE, "-|", $resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs
-        or die "Could not open resolve-ChangeLogs script: $!.\n";
-    print STDERR "    $_" while <RESOLVE>;
-    close RESOLVE;
-}
-
-sub generateNewChangeLogs($$$$$$$$$$$)
-{
-    my ($prefixes, $filesInChangeLog, $addedRegressionTests, $functionLists, $bugURL, $bugDescription, $name, $emailAddress, $gitReviewer, $gitCommit, $writeChangeLogs) = @_;
-
-    # Generate new ChangeLog entries and (optionally) write out new ChangeLog files.
-    foreach my $prefix (@$prefixes) {
-        my $endl = "\n";
-        my @old_change_log;
-
-        if ($writeChangeLogs) {
-            my $changeLogPath = File::Spec->catfile($prefix || ".", changeLogFileName());
-            print STDERR "  Editing the ${changeLogPath} file.\n";
-            open OLD_CHANGE_LOG, ${changeLogPath} or die "Could not open ${changeLogPath} file: $!.\n";
-            # It's less efficient to read the whole thing into memory than it would be
-            # to read it while we prepend to it later, but I like doing this part first.
-            @old_change_log = <OLD_CHANGE_LOG>;
-            close OLD_CHANGE_LOG;
-            # We want to match the ChangeLog's line endings in case it doesn't match
-            # the native line endings for this version of perl.
-            if ($old_change_log[0] =~ /(\r?\n)$/g) {
-                $endl = "$1";
-            }
-            open CHANGE_LOG, "> ${changeLogPath}" or die "Could not write ${changeLogPath}\n.";
-        } else {
-            open CHANGE_LOG, ">-" or die "Could not write to STDOUT\n.";
-            print substr($prefix, 0, length($prefix) - 1) . ":\n\n" unless (scalar @$prefixes) == 1;
-        }
-
-        my $date = changeLogDate(ChangeLogTimeZone);
-        print CHANGE_LOG normalizeLineEndings("$date  $name  <$emailAddress>\n\n", $endl);
-
-        my ($reviewer, $description) = reviewerAndDescriptionForGitCommit($gitCommit, $gitReviewer) if $gitCommit;
-        $reviewer = "NOBODY (OO" . "PS!)" if !$reviewer;
-
-        print CHANGE_LOG normalizeLineEndings($description . "\n", $endl) if $description;
-
-        $bugDescription = "Need a short description (OOPS!).\n        Need the bug URL (OOPS!)." unless $bugDescription;
-        print CHANGE_LOG normalizeLineEndings("        $bugDescription\n", $endl) if $bugDescription;
-        print CHANGE_LOG normalizeLineEndings("        $bugURL\n", $endl) if $bugURL;
-        print CHANGE_LOG normalizeLineEndings("\n", $endl);
-
-        print CHANGE_LOG normalizeLineEndings("        Reviewed by $reviewer.\n\n", $endl);
-
-        if ($prefix =~ m/WebCore/ || `pwd` =~ m/WebCore/) {
-            if (@$addedRegressionTests) {
-                print CHANGE_LOG normalizeLineEndings(testListForChangeLog(sort @$addedRegressionTests), $endl);
-            } else {
-                print CHANGE_LOG normalizeLineEndings("        No new tests (OOPS!).\n\n", $endl);
-            }
-        }
-
-        foreach my $file (sort @{$filesInChangeLog->{$prefix}}) {
-            my $file_stem = substr $file, length $prefix;
-            print CHANGE_LOG normalizeLineEndings("        * $file_stem:$functionLists->{$file}\n", $endl);
-        }
-
-        if ($writeChangeLogs) {
-            print CHANGE_LOG normalizeLineEndings("\n", $endl), @old_change_log;
-        } else {
-            print CHANGE_LOG "\n";
-        }
-
-        close CHANGE_LOG;
-    }
-}
-
-sub printDiff($$$$)
-{
-    my ($changedFiles, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    print STDERR "  Running diff to help you write the ChangeLog entries.\n";
-    local $/ = undef; # local slurp mode
-    my $changedFilesString = "'" . join("' '", @$changedFiles) . "'";
-    open DIFF, "-|", createPatchCommand($changedFilesString, $gitCommit, $gitIndex, $mergeBase) or die "The diff failed: $!.\n";
-    print <DIFF>;
-    close DIFF;
-}
-
-sub openChangeLogs($)
-{
-    my ($changeLogs) = @_;
-
-    print STDERR "  Opening the edited ChangeLog files.\n";
-    my $editor = $ENV{CHANGE_LOG_EDITOR} || $ENV{VISUAL} || $ENV{EDITOR};
-    if ($editor) {
-        system ((split ' ', $editor), @$changeLogs);
-    } else {
-        $editor = $ENV{CHANGE_LOG_EDIT_APPLICATION};
-        if ($editor) {
-            system "open", "-a", $editor, @$changeLogs;
-        } else {
-            system "open", "-e", @$changeLogs;
-        }
-    }
-}
-
-sub get_function_line_ranges($$)
-{
-    my ($file_handle, $file_name) = @_;
-
-    # Try to determine the source language based on the file extension.
-
-    return get_function_line_ranges_for_cpp($file_handle, $file_name) if $file_name =~ /\.(c|cpp|m|mm|h)$/;
-    return get_function_line_ranges_for_java($file_handle, $file_name) if $file_name =~ /\.java$/;
-    return get_function_line_ranges_for_javascript($file_handle, $file_name) if $file_name =~ /\.js$/;
-    return get_selector_line_ranges_for_css($file_handle, $file_name) if $file_name =~ /\.css$/;
-    return get_function_line_ranges_for_perl($file_handle, $file_name) if $file_name =~ /\.p[lm]$/;
-    return get_function_line_ranges_for_python($file_handle, $file_name) if $file_name =~ /\.py$/ or $file_name =~ /master\.cfg$/;
-
-    # Try to determine the source language based on the script interpreter.
-
-    my $first_line = <$file_handle>;
-    seek($file_handle, 0, 0);
-
-    return () unless $first_line =~ m|^#!(?:/usr/bin/env\s+)?(\S+)|;
-    my $interpreter = $1;
-
-    return get_function_line_ranges_for_perl($file_handle, $file_name) if $interpreter =~ /perl$/;
-    return get_function_line_ranges_for_python($file_handle, $file_name) if $interpreter =~ /python$/;
-
-    return ();
-}
-
-
-sub method_decl_to_selector($)
-{
-    (my $method_decl) = @_;
-
-    $_ = $method_decl;
-
-    if ((my $comment_stripped) = m-([^/]*)(//|/*).*-) {
-        $_ = $comment_stripped;
-    }
-
-    s/,\s*...//;
-
-    if (/:/) {
-        my @components = split /:/;
-        pop @components if (scalar @components > 1);
-        $_ = (join ':', map {s/.*[^[:word:]]//; scalar $_;} @components) . ':';
-    } else {
-        s/\s*$//;
-        s/.*[^[:word:]]//;
-    }
-
-    return $_;
-}
-
-
-
-# Read a file and get all the line ranges of the things that look like C functions.
-# A function name is the last word before an open parenthesis before the outer
-# level open brace. A function starts at the first character after the last close
-# brace or semicolon before the function name and ends at the close brace.
-# Comment handling is simple-minded but will work for all but pathological cases.
-#
-# Result is a list of triples: [ start_line, end_line, function_name ].
-
-sub get_function_line_ranges_for_cpp($$)
-{
-    my ($file_handle, $file_name) = @_;
-
-    my @ranges;
-
-    my $in_comment = 0;
-    my $in_macro = 0;
-    my $in_method_declaration = 0;
-    my $in_parentheses = 0;
-    my $in_braces = 0;
-    my $in_toplevel_array_brace = 0;
-    my $brace_start = 0;
-    my $brace_end = 0;
-    my $namespace_start = -1;
-    my $skip_til_brace_or_semicolon = 0;
-    my $equal_observed = 0;
-
-    my $word = "";
-    my $interface_name = "";
-
-    my $potential_method_char = "";
-    my $potential_method_spec = "";
-
-    my $potential_start = 0;
-    my $potential_name = "";
-
-    my $start = 0;
-    my $name = "";
-
-    my $next_word_could_be_namespace = 0;
-    my $potential_namespace = "";
-    my @namespaces;
-
-    while (<$file_handle>) {
-        # Handle continued multi-line comment.
-        if ($in_comment) {
-            next unless s-.*\*/--;
-            $in_comment = 0;
-        }
-
-        # Handle continued macro.
-        if ($in_macro) {
-            $in_macro = 0 unless /\\$/;
-            next;
-        }
-
-        # Handle start of macro (or any preprocessor directive).
-        if (/^\s*\#/) {
-            $in_macro = 1 if /^([^\\]|\\.)*\\$/;
-            next;
-        }
-
-        # Handle comments and quoted text.
-        while (m-(/\*|//|\'|\")-) { # \' and \" keep emacs perl mode happy
-            my $match = $1;
-            if ($match eq "/*") {
-                if (!s-/\*.*?\*/--) {
-                    s-/\*.*--;
-                    $in_comment = 1;
-                }
-            } elsif ($match eq "//") {
-                s-//.*--;
-            } else { # ' or "
-                if (!s-$match([^\\]|\\.)*?$match--) {
-                    warn "mismatched quotes at line $. in $file_name\n";
-                    s-$match.*--;
-                }
-            }
-        }
-
-
-        # continued method declaration
-        if ($in_method_declaration) {
-              my $original = $_;
-              my $method_cont = $_;
-
-              chomp $method_cont;
-              $method_cont =~ s/[;\{].*//;
-              $potential_method_spec = "${potential_method_spec} ${method_cont}";
-
-              $_ = $original;
-              if (/;/) {
-                  $potential_start = 0;
-                  $potential_method_spec = "";
-                  $potential_method_char = "";
-                  $in_method_declaration = 0;
-                  s/^[^;\{]*//;
-              } elsif (/{/) {
-                  my $selector = method_decl_to_selector ($potential_method_spec);
-                  $potential_name = "${potential_method_char}\[${interface_name} ${selector}\]";
-
-                  $potential_method_spec = "";
-                  $potential_method_char = "";
-                  $in_method_declaration = 0;
-
-                  $_ = $original;
-                  s/^[^;{]*//;
-              } elsif (/\@end/) {
-                  $in_method_declaration = 0;
-                  $interface_name = "";
-                  $_ = $original;
-              } else {
-                  next;
-              }
-        }
-
-
-        # start of method declaration
-        if ((my $method_char, my $method_spec) = m&^([-+])([^0-9;][^;]*);?$&) {
-            my $original = $_;
-
-            if ($interface_name) {
-                chomp $method_spec;
-                $method_spec =~ s/\{.*//;
-
-                $potential_method_char = $method_char;
-                $potential_method_spec = $method_spec;
-                $potential_start = $.;
-                $in_method_declaration = 1;
-            } else { 
-                warn "declaring a method but don't have interface on line $. in $file_name\n";
-            }
-            $_ = $original;
-            if (/\{/) {
-              my $selector = method_decl_to_selector ($potential_method_spec);
-              $potential_name = "${potential_method_char}\[${interface_name} ${selector}\]";
-
-              $potential_method_spec = "";
-              $potential_method_char = "";
-              $in_method_declaration = 0;
-              $_ = $original;
-              s/^[^{]*//;
-            } elsif (/\@end/) {
-              $in_method_declaration = 0;
-              $interface_name = "";
-              $_ = $original;
-            } else {
-              next;
-            }
-        }
-
-
-        # Find function, interface and method names.
-        while (m&((?:[[:word:]]+::)*operator(?:[ \t]*\(\)|[^()]*)|[[:word:]:~]+|[(){}:;=])|\@(?:implementation|interface|protocol)\s+(\w+)[^{]*&g) {
-            # Skip an array definition at the top level.
-            # e.g. static int arr[] = { 1, 2, 3 };
-            if ($1) {
-                if ($1 eq "=" and !$in_parentheses and !$in_braces) {
-                    $equal_observed = 1;
-                } elsif ($1 eq "{" and $equal_observed) {
-                    # This '{' is the beginning of an array definition, not the beginning of a method.
-                    $in_toplevel_array_brace = 1;
-                    $in_braces++;
-                    $equal_observed = 0;
-                    next;
-                } elsif ($1 !~ /[ \t]/) {
-                    $equal_observed = 0;
-                }
-            }
-
-            # interface name
-            if ($2) {
-                $interface_name = $2;
-                next;
-            }
-
-            # Open parenthesis.
-            if ($1 eq "(") {
-                $potential_name = $word unless $in_parentheses || $skip_til_brace_or_semicolon;
-                $in_parentheses++;
-                next;
-            }
-
-            # Close parenthesis.
-            if ($1 eq ")") {
-                $in_parentheses--;
-                next;
-            }
-
-            # C++ constructor initializers
-            if ($1 eq ":") {
-                  $skip_til_brace_or_semicolon = 1 unless ($in_parentheses || $in_braces);
-            }
-
-            # Open brace.
-            if ($1 eq "{") {
-                $skip_til_brace_or_semicolon = 0;
-
-                if (!$in_braces) {
-                    if ($namespace_start >= 0 and $namespace_start < $potential_start) {
-                        push @ranges, [ $namespace_start . "", $potential_start - 1, $name ];
-                    }
-
-                    if ($potential_namespace) {
-                        push @namespaces, $potential_namespace;
-                        $potential_namespace = "";
-                        $name = $namespaces[-1];
-                        $namespace_start = $. + 1;
-                        next;
-                    }
-
-                    # Promote potential name to real function name at the
-                    # start of the outer level set of braces (function body?).
-                    if ($potential_start) {
-                        $start = $potential_start;
-                        $name = $potential_name;
-                        if (@namespaces && $name && (length($name) < 2 || substr($name,1,1) ne "[")) {
-                            $name = join ('::', @namespaces, $name);
-                        }
-                    }
-                }
-
-                $in_method_declaration = 0;
-
-                $brace_start = $. if (!$in_braces);
-                $in_braces++;
-                next;
-            }
-
-            # Close brace.
-            if ($1 eq "}") {
-                if (!$in_braces && @namespaces) {
-                    if ($namespace_start >= 0 and $namespace_start < $.) {
-                        push @ranges, [ $namespace_start . "", $. - 1, $name ];
-                    }
-
-                    pop @namespaces;
-                    if (@namespaces) {
-                        $name = $namespaces[-1];
-                        $namespace_start = $. + 1;
-                    } else {
-                        $name = "";
-                        $namespace_start = -1;
-                    }
-                    next;
-                }
-
-                $in_braces--;
-                $brace_end = $. if (!$in_braces);
-
-                # End of an outer level set of braces.
-                # This could be a function body.
-                if (!$in_braces and $name) {
-                    # This is the end of an array definition at the top level, not the end of a method.
-                    if ($in_toplevel_array_brace) {
-                        $in_toplevel_array_brace = 0;
-                        next;
-                    }
-
-                    push @ranges, [ $start, $., $name ];
-                    if (@namespaces) {
-                        $name = $namespaces[-1];
-                        $namespace_start = $. + 1;
-                    } else {
-                        $name = "";
-                        $namespace_start = -1;
-                    }
-                }
-
-                $potential_start = 0;
-                $potential_name = "";
-                next;
-            }
-
-            # Semicolon.
-            if ($1 eq ";") {
-                $skip_til_brace_or_semicolon = 0;
-                $potential_start = 0;
-                $potential_name = "";
-                $in_method_declaration = 0;
-                next;
-            }
-
-            # Ignore "const" method qualifier.
-            if ($1 eq "const") {
-                next;
-            }
-
-            if ($1 eq "namespace" || $1 eq "class" || $1 eq "struct") {
-                $next_word_could_be_namespace = 1;
-                next;
-            }
-
-            # Word.
-            $word = $1;
-            if (!$skip_til_brace_or_semicolon) {
-                if ($next_word_could_be_namespace) {
-                    $potential_namespace = $word;
-                    $next_word_could_be_namespace = 0;
-                } elsif ($potential_namespace) {
-                    $potential_namespace = "";
-                }
-
-                if (!$in_parentheses) {
-                    $potential_start = 0;
-                    $potential_name = "";
-                }
-                if (!$potential_start) {
-                    $potential_start = $.;
-                    $potential_name = "";
-                }
-            }
-        }
-    }
-
-    warn "missing close braces in $file_name (probable start at $brace_start)\n" if ($in_braces > 0);
-    warn "too many close braces in $file_name (probable start at $brace_end)\n" if ($in_braces < 0);
-
-    warn "mismatched parentheses in $file_name\n" if $in_parentheses;
-
-    return @ranges;
-}
-
-
-
-# Read a file and get all the line ranges of the things that look like Java
-# classes, interfaces and methods.
-#
-# A class or interface name is the word that immediately follows
-# `class' or `interface' when followed by an open curly brace and not
-# a semicolon. It can appear at the top level, or inside another class
-# or interface block, but not inside a function block
-#
-# A class or interface starts at the first character after the first close
-# brace or after the function name and ends at the close brace.
-#
-# A function name is the last word before an open parenthesis before
-# an open brace rather than a semicolon. It can appear at top level or
-# inside a class or interface block, but not inside a function block.
-#
-# A function starts at the first character after the first close
-# brace or after the function name and ends at the close brace.
-#
-# Comment handling is simple-minded but will work for all but pathological cases.
-#
-# Result is a list of triples: [ start_line, end_line, function_name ].
-
-sub get_function_line_ranges_for_java($$)
-{
-    my ($file_handle, $file_name) = @_;
-
-    my @current_scopes;
-
-    my @ranges;
-
-    my $in_comment = 0;
-    my $in_macro = 0;
-    my $in_parentheses = 0;
-    my $in_braces = 0;
-    my $in_non_block_braces = 0;
-    my $class_or_interface_just_seen = 0;
-    my $in_class_declaration = 0;
-
-    my $word = "";
-
-    my $potential_start = 0;
-    my $potential_name = "";
-    my $potential_name_is_class_or_interface = 0;
-
-    my $start = 0;
-    my $name = "";
-    my $current_name_is_class_or_interface = 0;
-
-    while (<$file_handle>) {
-        # Handle continued multi-line comment.
-        if ($in_comment) {
-            next unless s-.*\*/--;
-            $in_comment = 0;
-        }
-
-        # Handle continued macro.
-        if ($in_macro) {
-            $in_macro = 0 unless /\\$/;
-            next;
-        }
-
-        # Handle start of macro (or any preprocessor directive).
-        if (/^\s*\#/) {
-            $in_macro = 1 if /^([^\\]|\\.)*\\$/;
-            next;
-        }
-
-        # Handle comments and quoted text.
-        while (m-(/\*|//|\'|\")-) { # \' and \" keep emacs perl mode happy
-            my $match = $1;
-            if ($match eq "/*") {
-                if (!s-/\*.*?\*/--) {
-                    s-/\*.*--;
-                    $in_comment = 1;
-                }
-            } elsif ($match eq "//") {
-                s-//.*--;
-            } else { # ' or "
-                if (!s-$match([^\\]|\\.)*?$match--) {
-                    warn "mismatched quotes at line $. in $file_name\n";
-                    s-$match.*--;
-                }
-            }
-        }
-
-        # Find function names.
-        while (m-(\w+|[(){};])-g) {
-            # Open parenthesis.
-            if ($1 eq "(") {
-                if (!$in_parentheses) {
-                    $potential_name = $word;
-                    $potential_name_is_class_or_interface = 0;
-                }
-                $in_parentheses++;
-                next;
-            }
-
-            # Close parenthesis.
-            if ($1 eq ")") {
-                $in_parentheses--;
-                next;
-            }
-
-            # Open brace.
-            if ($1 eq "{") {
-                $in_class_declaration = 0;
-
-                # Promote potential name to real function name at the
-                # start of the outer level set of braces (function/class/interface body?).
-                if (!$in_non_block_braces
-                    and (!$in_braces or $current_name_is_class_or_interface)
-                    and $potential_start) {
-                    if ($name) {
-                          push @ranges, [ $start, ($. - 1),
-                                          join ('.', @current_scopes) ];
-                    }
-
-
-                    $current_name_is_class_or_interface = $potential_name_is_class_or_interface;
-
-                    $start = $potential_start;
-                    $name = $potential_name;
-
-                    push (@current_scopes, $name);
-                } else {
-                    $in_non_block_braces++;
-                }
-
-                $potential_name = "";
-                $potential_start = 0;
-
-                $in_braces++;
-                next;
-            }
-
-            # Close brace.
-            if ($1 eq "}") {
-                $in_braces--;
-
-                # End of an outer level set of braces.
-                # This could be a function body.
-                if (!$in_non_block_braces) {
-                    if ($name) {
-                        push @ranges, [ $start, $.,
-                                        join ('.', @current_scopes) ];
-
-                        pop (@current_scopes);
-
-                        if (@current_scopes) {
-                            $current_name_is_class_or_interface = 1;
-
-                            $start = $. + 1;
-                            $name =  $current_scopes[$#current_scopes-1];
-                        } else {
-                            $current_name_is_class_or_interface = 0;
-                            $start = 0;
-                            $name =  "";
-                        }
-                    }
-                } else {
-                    $in_non_block_braces-- if $in_non_block_braces;
-                }
-
-                $potential_start = 0;
-                $potential_name = "";
-                next;
-            }
-
-            # Semicolon.
-            if ($1 eq ";") {
-                $potential_start = 0;
-                $potential_name = "";
-                next;
-            }
-
-            if ($1 eq "class") {
-                $in_class_declaration = 1;
-            }
-            if ($1 eq "class" or (!$in_class_declaration and $1 eq "interface")) {
-                $class_or_interface_just_seen = 1;
-                next;
-            }
-
-            # Word.
-            $word = $1;
-            if (!$in_parentheses) {
-                if ($class_or_interface_just_seen) {
-                    $potential_name = $word;
-                    $potential_start = $.;
-                    $class_or_interface_just_seen = 0;
-                    $potential_name_is_class_or_interface = 1;
-                    next;
-                }
-            }
-            if (!$potential_start) {
-                $potential_start = $.;
-                $potential_name = "";
-            }
-            $class_or_interface_just_seen = 0;
-        }
-    }
-
-    warn "mismatched braces in $file_name\n" if $in_braces;
-    warn "mismatched parentheses in $file_name\n" if $in_parentheses;
-
-    return @ranges;
-}
-
-
-
-# Read a file and get all the line ranges of the things that look like
-# JavaScript functions.
-#
-# A function name is the word that immediately follows `function' when
-# followed by an open curly brace. It can appear at the top level, or
-# inside other functions.
-#
-# An anonymous function name is the identifier chain immediately before
-# an assignment with the equals operator or object notation that has a
-# value starting with `function' followed by an open curly brace.
-#
-# A getter or setter name is the word that immediately follows `get' or
-# `set' when followed by an open curly brace .
-#
-# Comment handling is simple-minded but will work for all but pathological cases.
-#
-# Result is a list of triples: [ start_line, end_line, function_name ].
-
-sub get_function_line_ranges_for_javascript($$)
-{
-    my ($fileHandle, $fileName) = @_;
-
-    my @currentScopes;
-    my @currentIdentifiers;
-    my @currentFunctionNames;
-    my @currentFunctionDepths;
-    my @currentFunctionStartLines;
-
-    my @ranges;
-
-    my $inComment = 0;
-    my $inQuotedText = "";
-    my $parenthesesDepth = 0;
-    my $bracesDepth = 0;
-
-    my $functionJustSeen = 0;
-    my $getterJustSeen = 0;
-    my $setterJustSeen = 0;
-    my $assignmentJustSeen = 0;
-
-    my $word = "";
-
-    while (<$fileHandle>) {
-        # Handle continued multi-line comment.
-        if ($inComment) {
-            next unless s-.*\*/--;
-            $inComment = 0;
-        }
-
-        # Handle continued quoted text.
-        if ($inQuotedText ne "") {
-            next if /\\$/;
-            s-([^\\]|\\.)*?$inQuotedText--;
-            $inQuotedText = "";
-        }
-
-        # Handle comments and quoted text.
-        while (m-(/\*|//|\'|\")-) { # \' and \" keep emacs perl mode happy
-            my $match = $1;
-            if ($match eq '/*') {
-                if (!s-/\*.*?\*/--) {
-                    s-/\*.*--;
-                    $inComment = 1;
-                }
-            } elsif ($match eq '//') {
-                s-//.*--;
-            } else { # ' or "
-                if (!s-$match([^\\]|\\.)*?$match-string_appeared_here-) {
-                    $inQuotedText = $match if /\\$/;
-                    warn "mismatched quotes at line $. in $fileName\n" if $inQuotedText eq "";
-                    s-$match.*--;
-                }
-            }
-        }
-
-        # Find function names.
-        while (m-(\w+|[(){}=:;,])-g) {
-            # Open parenthesis.
-            if ($1 eq '(') {
-                $parenthesesDepth++;
-                next;
-            }
-
-            # Close parenthesis.
-            if ($1 eq ')') {
-                $parenthesesDepth--;
-                next;
-            }
-
-            # Open brace.
-            if ($1 eq '{') {
-                push(@currentScopes, join(".", @currentIdentifiers));
-                @currentIdentifiers = ();
-
-                $bracesDepth++;
-                next;
-            }
-
-            # Close brace.
-            if ($1 eq '}') {
-                $bracesDepth--;
-
-                if (@currentFunctionDepths and $bracesDepth == $currentFunctionDepths[$#currentFunctionDepths]) {
-                    pop(@currentFunctionDepths);
-
-                    my $currentFunction = pop(@currentFunctionNames);
-                    my $start = pop(@currentFunctionStartLines);
-
-                    push(@ranges, [$start, $., $currentFunction]);
-                }
-
-                pop(@currentScopes);
-                @currentIdentifiers = ();
-
-                next;
-            }
-
-            # Semicolon or comma.
-            if ($1 eq ';' or $1 eq ',') {
-                @currentIdentifiers = ();
-                next;
-            }
-
-            # Function.
-            if ($1 eq 'function') {
-                $functionJustSeen = 1;
-
-                if ($assignmentJustSeen) {
-                    my $currentFunction = join('.', (@currentScopes, @currentIdentifiers));
-                    $currentFunction =~ s/\.{2,}/\./g; # Removes consecutive periods.
-
-                    push(@currentFunctionNames, $currentFunction);
-                    push(@currentFunctionDepths, $bracesDepth);
-                    push(@currentFunctionStartLines, $.);
-                }
-
-                next;
-            }
-
-            # Getter prefix.
-            if ($1 eq 'get') {
-                $getterJustSeen = 1;
-                next;
-            }
-
-            # Setter prefix.
-            if ($1 eq 'set') {
-                $setterJustSeen = 1;
-                next;
-            }
-
-            # Assignment operator.
-            if ($1 eq '=' or $1 eq ':') {
-                $assignmentJustSeen = 1;
-                next;
-            }
-
-            next if $parenthesesDepth;
-
-            # Word.
-            $word = $1;
-            $word = "get $word" if $getterJustSeen;
-            $word = "set $word" if $setterJustSeen;
-
-            if (($functionJustSeen and !$assignmentJustSeen) or $getterJustSeen or $setterJustSeen) {
-                push(@currentIdentifiers, $word);
-
-                my $currentFunction = join('.', (@currentScopes, @currentIdentifiers));
-                $currentFunction =~ s/\.{2,}/\./g; # Removes consecutive periods.
-
-                push(@currentFunctionNames, $currentFunction);
-                push(@currentFunctionDepths, $bracesDepth);
-                push(@currentFunctionStartLines, $.);
-            } elsif ($word ne 'if' and $word ne 'for' and $word ne 'do' and $word ne 'while' and $word ne 'which' and $word ne 'var') {
-                push(@currentIdentifiers, $word);
-            }
-
-            $functionJustSeen = 0;
-            $getterJustSeen = 0;
-            $setterJustSeen = 0;
-            $assignmentJustSeen = 0;
-        }
-    }
-
-    warn "mismatched braces in $fileName\n" if $bracesDepth;
-    warn "mismatched parentheses in $fileName\n" if $parenthesesDepth;
-
-    return @ranges;
-}
-
-# Read a file and get all the line ranges of the things that look like Perl functions. Functions
-# start on a line that starts with "sub ", and end on the first line starting with "}" thereafter.
-#
-# Result is a list of triples: [ start_line, end_line, function ].
-
-sub get_function_line_ranges_for_perl($$)
-{
-    my ($fileHandle, $fileName) = @_;
-
-    my @ranges;
-
-    my $currentFunction = "";
-    my $start = 0;
-    my $hereDocumentIdentifier = "";
-
-    while (<$fileHandle>) {
-        chomp;
-        if (!$hereDocumentIdentifier) {
-            if (/^sub\s+([\w_][\w\d_]*)/) {
-                # Skip over forward declarations, which don't contain a brace and end with a semicolon.
-                next if /;\s*$/;
-
-                if ($currentFunction) {
-                    warn "nested functions found at top-level at $fileName:$.\n";
-                    next;
-                }
-                $currentFunction = $1;
-                $start = $.;
-            }
-            if (/<<\s*[\"\']?([\w_][\w_\d]*)/) {
-                # Enter here-document.
-                $hereDocumentIdentifier = $1;
-            }
-            if (index($_, "}") == 0) {
-                next unless $start;
-                push(@ranges, [$start, $., $currentFunction]);
-                $currentFunction = "";
-                $start = 0;
-            }
-        } elsif ($_ eq $hereDocumentIdentifier) {
-            # Escape from here-document.
-            $hereDocumentIdentifier = "";
-        }
-    }
-
-    return @ranges;
-}
-
-# Read a file and get all the line ranges of the things that look like Python classes, methods, or functions.
-#
-# FIXME: Maybe we should use Python's ast module to do the parsing for us?
-#
-# Result is a list of triples: [ start_line, end_line, function ].
-
-sub get_function_line_ranges_for_python($$)
-{
-    my ($fileHandle, $fileName) = @_;
-
-    my @ranges;
-
-    my @scopeStack = ({ line => 0, indent => -1, name => undef });
-    my $lastLine = 0;
-    until ($lastLine) {
-        $_ = <$fileHandle>;
-        unless ($_) {
-            # To pop out all popped scopes, run the loop once more after
-            # we encountered the end of the file.
-            $_ = "pass\n";
-            $.++;
-            $lastLine = 1;
-        }
-        chomp;
-        next unless /^(\s*)([^#].*)$/;
-
-        my $indent = length $1;
-        my $rest = $2;
-        my $scope = $scopeStack[-1];
-
-        if ($indent <= $scope->{indent}) {
-            # Find all the scopes that we have just exited.
-            my $i = 0;
-            for (; $i < @scopeStack; ++$i) {
-                last if $indent <= $scopeStack[$i]->{indent};
-            }
-            my @poppedScopes = splice @scopeStack, $i;
-
-            # For each scope that was just exited, add a range that goes from the start of that
-            # scope to the start of the next nested scope, or to the line just before this one for
-            # the innermost scope.
-            for ($i = 0; $i < @poppedScopes; ++$i) {
-                my $lineAfterEnd = $i + 1 == @poppedScopes ? $. : $poppedScopes[$i + 1]->{line};
-                push @ranges, [$poppedScopes[$i]->{line}, $lineAfterEnd - 1, $poppedScopes[$i]->{name}];
-            }
-            @scopeStack or warn "Popped off last scope at $fileName:$.\n";
-
-            # Set the now-current scope to start at the current line. Any lines within this scope
-            # before this point should already have been added to @ranges.
-            $scope = $scopeStack[-1];
-            $scope->{line} = $.;
-        }
-
-        next unless $rest =~ /(?:class|def)\s+(\w+)/;
-        my $name = $1;
-        my $fullName = $scope->{name} ? join('.', $scope->{name}, $name) : $name;
-        push @scopeStack, { line => $., indent => $indent, name => $fullName };
-
-        if ($scope->{indent} >= 0) {
-            push @ranges, [$scope->{line}, $. - 1, $scope->{name}];
-        }
-    }
-
-    return @ranges;
-}
-
-# Read a file and get all the line ranges of the things that look like CSS selectors.  A selector is
-# anything before an opening brace on a line. A selector starts at the line containing the opening
-# brace and ends at the closing brace.
-#
-# Result is a list of triples: [ start_line, end_line, selector ].
-
-sub get_selector_line_ranges_for_css($$)
-{
-    my ($fileHandle, $fileName) = @_;
-
-    my @ranges;
-
-    my $currentSelector = "";
-    my $start = 0;
-    my $inComment = 0;
-    my $inBrace = 0;
-
-    while (<$fileHandle>) {
-        foreach my $token (split m-(\{|\}|/\*|\*/)-, $_) {
-            if ($token eq "{") {
-                if (!$inComment) {
-                    warn "mismatched brace found in $fileName\n" if $inBrace;
-                    $inBrace = 1;
-                }
-            } elsif ($token eq "}") {
-                if (!$inComment) {
-                    warn "mismatched brace found in $fileName\n" if !$inBrace;
-                    $inBrace = 0;
-                    push(@ranges, [$start, $., $currentSelector]);
-                    $currentSelector = "";
-                    $start = 0;
-                }
-            } elsif ($token eq "/*") {
-                $inComment = 1;
-            } elsif ($token eq "*/") {
-                warn "mismatched comment found in $fileName\n" if !$inComment;
-                $inComment = 0;
-            } else {
-                if (!$inComment and !$inBrace and $token !~ /^[\s\t]*$/) {
-                    $token =~ s/^[\s\t]*|[\s\t]*$//g;
-                    $currentSelector = $token;
-                    $start = $.;
-                }
-            }
-        }
-    }
-
-    return @ranges;
-}
-
-sub processPaths(\@)
-{
-    my ($paths) = @_;
-    return ("." => 1) if (!@{$paths});
-
-    my %result = ();
-
-    for my $file (@{$paths}) {
-        die "can't handle absolute paths like \"$file\"\n" if File::Spec->file_name_is_absolute($file);
-        die "can't handle empty string path\n" if $file eq "";
-        die "can't handle path with single quote in the name like \"$file\"\n" if $file =~ /'/; # ' (keep Xcode syntax highlighting happy)
-
-        my $untouchedFile = $file;
-
-        $file = canonicalizePath($file);
-
-        die "can't handle paths with .. like \"$untouchedFile\"\n" if $file =~ m|/\.\./|;
-
-        $result{$file} = 1;
-    }
-
-    return ("." => 1) if ($result{"."});
-
-    # Remove any paths that also have a parent listed.
-    for my $path (keys %result) {
-        for (my $parent = dirname($path); $parent ne '.'; $parent = dirname($parent)) {
-            if ($result{$parent}) {
-                delete $result{$path};
-                last;
-            }
-        }
-    }
-
-    return %result;
-}
-
-sub diffFromToString($$$)
-{
-    my ($gitCommit, $gitIndex, $mergeBase) = @_;
-
-    return "" if isSVN();
-    return $gitCommit if $gitCommit =~ m/.+\.\..+/;
-    return "\"$gitCommit^\" \"$gitCommit\"" if $gitCommit;
-    return "--cached" if $gitIndex;
-    return $mergeBase if $mergeBase;
-    return "HEAD" if isGit();
-}
-
-sub diffCommand($$$$)
-{
-    my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    my $command;
-    if (isSVN()) {
-        my @escapedPaths = map(escapeSubversionPath($_), @$paths);
-        my $escapedPathsString = "'" . join("' '", @escapedPaths) . "'";
-        $command = SVN . " diff --diff-cmd diff -x -N $escapedPathsString";
-    } elsif (isGit()) {
-        my $pathsString = "'" . join("' '", @$paths) . "'"; 
-        $command = GIT . " diff --no-ext-diff -U0 " . diffFromToString($gitCommit, $gitIndex, $mergeBase);
-        $command .= " -- $pathsString" unless $gitCommit or $mergeBase;
-    }
-
-    return $command;
-}
-
-sub statusCommand($$$$)
-{
-    my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    my $command;
-    if (isSVN()) {
-        my @escapedFiles = map(escapeSubversionPath($_), keys %$paths);
-        my $escapedFilesString = "'" . join("' '", @escapedFiles) . "'";
-        $command = SVN . " stat $escapedFilesString";
-    } elsif (isGit()) {
-        my $filesString = '"' . join('" "', keys %$paths) . '"';
-        $command = GIT . " diff -r --name-status -M -C " . diffFromToString($gitCommit, $gitIndex, $mergeBase);
-        $command .= " -- $filesString" unless $gitCommit;
-    }
-
-    return "$command 2>&1";
-}
-
-sub createPatchCommand($$$$)
-{
-    my ($changedFilesString, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    my $command;
-    if (isSVN()) {
-        $command = "'$FindBin::Bin/svn-create-patch' $changedFilesString";
-    } elsif (isGit()) {
-        $command = GIT . " diff -M -C " . diffFromToString($gitCommit, $gitIndex, $mergeBase);
-        $command .= " -- $changedFilesString" unless $gitCommit;
-    }
-
-    return $command;
-}
-
-sub diffHeaderFormat()
-{
-    return qr/^Index: (\S+)[\r\n]*$/ if isSVN();
-    return qr/^diff --git a\/.+ b\/(.+)$/ if isGit();
-}
-
-sub findOriginalFileFromSvn($)
-{
-    my ($file) = @_;
-    my $baseUrl;
-    open INFO, SVN . " info . |" or die;
-    while (<INFO>) {
-        if (/^URL: (.+?)[\r\n]*$/) {
-            $baseUrl = $1;
-        }
-    }
-    close INFO;
-    my $sourceFile;
-    my $escapedFile = escapeSubversionPath($file);
-    open INFO, SVN . " info '$escapedFile' |" or die;
-    while (<INFO>) {
-        if (/^Copied From URL: (.+?)[\r\n]*$/) {
-            $sourceFile = File::Spec->abs2rel($1, $baseUrl);
-        }
-    }
-    close INFO;
-    return $sourceFile;
-}
-
-sub determinePropertyChanges($$$)
-{
-    my ($file, $isAdd, $original) = @_;
-
-    my $escapedFile = escapeSubversionPath($file);
-    my %changes;
-    if ($isAdd) {
-        my %addedProperties;
-        my %removedProperties;
-        open PROPLIST, SVN . " proplist '$escapedFile' |" or die;
-        while (<PROPLIST>) {
-            $addedProperties{$1} = 1 if /^  (.+?)[\r\n]*$/ && $1 ne 'svn:mergeinfo';
-        }
-        close PROPLIST;
-        if ($original) {
-            my $escapedOriginal = escapeSubversionPath($original);
-            open PROPLIST, SVN . " proplist '$escapedOriginal' |" or die;
-            while (<PROPLIST>) {
-                next unless /^  (.+?)[\r\n]*$/;
-                my $property = $1;
-                if (exists $addedProperties{$property}) {
-                    delete $addedProperties{$1};
-                } else {
-                    $removedProperties{$1} = 1;
-                }
-            }
-        }
-        $changes{"A"} = [sort keys %addedProperties] if %addedProperties;
-        $changes{"D"} = [sort keys %removedProperties] if %removedProperties;
-    } else {
-        open DIFF, SVN . " diff '$escapedFile' |" or die;
-        while (<DIFF>) {
-            if (/^Property changes on:/) {
-                while (<DIFF>) {
-                    my $operation;
-                    my $property;
-                    if (/^Added: (\S*)/) {
-                        $operation = "A";
-                        $property = $1;
-                    } elsif (/^Modified: (\S*)/) {
-                        $operation = "M";
-                        $property = $1;
-                    } elsif (/^Deleted: (\S*)/) {
-                        $operation = "D";
-                        $property = $1;
-                    } elsif (/^Name: (\S*)/) {
-                        # Older versions of svn just say "Name" instead of the type
-                        # of property change.
-                        $operation = "C";
-                        $property = $1;
-                    }
-                    if ($operation) {
-                        $changes{$operation} = [] unless exists $changes{$operation};
-                        push @{$changes{$operation}}, $property;
-                    }
-                }
-            }
-        }
-        close DIFF;
-    }
-    return \%changes;
-}
-
-sub pluralizeAndList($$@)
-{
-    my ($singular, $plural, @items) = @_;
-
-    return if @items == 0;
-    return "$singular $items[0]" if @items == 1;
-    return "$plural " . join(", ", @items[0 .. $#items - 1]) . " and " . $items[-1];
-}
-
-sub generateFileList(\%$$$)
-{
-    my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_;
-
-    my @changedFiles;
-    my @conflictFiles;
-    my %functionLists;
-    my @addedRegressionTests;
-    print STDERR "  Running status to find changed, added, or removed files.\n";
-    open STAT, "-|", statusCommand($paths, $gitCommit, $gitIndex, $mergeBase) or die "The status failed: $!.\n";
-    while (<STAT>) {
-        my $status;
-        my $propertyStatus;
-        my $propertyChanges;
-        my $original;
-        my $file;
-
-        if (isSVN()) {
-            my $matches;
-            if (isSVNVersion16OrNewer()) {
-                $matches = /^([ ACDMR])([ CM]).{5} (.+?)[\r\n]*$/;
-                $status = $1;
-                $propertyStatus = $2;
-                $file = $3;
-            } else {
-                $matches = /^([ ACDMR])([ CM]).{4} (.+?)[\r\n]*$/;
-                $status = $1;
-                $propertyStatus = $2;
-                $file = $3;
-            }
-            if ($matches) {
-                $file = normalizePath($file);
-                $original = findOriginalFileFromSvn($file) if substr($_, 3, 1) eq "+";
-                my $isAdd = isAddedStatus($status);
-                $propertyChanges = determinePropertyChanges($file, $isAdd, $original) if isModifiedStatus($propertyStatus) || $isAdd;
-            } else {
-                print;  # error output from svn stat
-            }
-        } elsif (isGit()) {
-            if (/^([ADM])\t(.+)$/) {
-                $status = $1;
-                $propertyStatus = " ";  # git doesn't have properties
-                $file = normalizePath($2);
-            } elsif (/^([CR])[0-9]{1,3}\t([^\t]+)\t([^\t\n]+)$/) { # for example: R90%    newfile    oldfile
-                $status = $1;
-                $propertyStatus = " ";
-                $original = normalizePath($2);
-                $file = normalizePath($3);
-            } else {
-                print;  # error output from git diff
-            }
-        }
-
-        next if !$status || isUnmodifiedStatus($status) && isUnmodifiedStatus($propertyStatus);
-
-        $file = makeFilePathRelative($file);
-
-        if (isModifiedStatus($status) || isAddedStatus($status) || isModifiedStatus($propertyStatus)) {
-            my @components = File::Spec->splitdir($file);
-            if ($components[0] eq "LayoutTests") {
-                push @addedRegressionTests, $file
-                    if isAddedStatus($status)
-                       && $file =~ /\.([a-zA-Z]+)$/
-                       && SupportedTestExtensions->{lc($1)}
-                       && $file !~ /-expected(-mismatch)?\.html$/
-                       && !scalar(grep(/^resources$/i, @components))
-                       && !scalar(grep(/^script-tests$/i, @components));
-            }
-            push @changedFiles, $file if $components[$#components] ne changeLogFileName();
-        } elsif (isConflictStatus($status, $gitCommit, $gitIndex) || isConflictStatus($propertyStatus, $gitCommit, $gitIndex)) {
-            push @conflictFiles, $file;
-        }
-        if (basename($file) ne changeLogFileName()) {
-            my $description = statusDescription($status, $propertyStatus, $original, $propertyChanges);
-            $functionLists{$file} = $description if defined $description;
-        }
-    }
-    close STAT;
-    return (\@changedFiles, \@conflictFiles, \%functionLists, \@addedRegressionTests);
-}
-
-sub isUnmodifiedStatus($)
-{
-    my ($status) = @_;
-
-    my %statusCodes = (
-        " " => 1,
-    );
-
-    return $statusCodes{$status};
-}
-
-sub isModifiedStatus($)
-{
-    my ($status) = @_;
-
-    my %statusCodes = (
-        "M" => 1,
-    );
-
-    return $statusCodes{$status};
-}
-
-sub isAddedStatus($)
-{
-    my ($status) = @_;
-
-    my %statusCodes = (
-        "A" => 1,
-        "C" => isGit(),
-        "R" => 1,
-    );
-
-    return $statusCodes{$status};
-}
-
-sub isConflictStatus($$$)
-{
-    my ($status, $gitCommit, $gitIndex) = @_;
-
-    my %svn = (
-        "C" => 1,
-    );
-
-    my %git = (
-        "U" => 1,
-    );
-
-    return 0 if ($gitCommit || $gitIndex); # an existing commit or staged change cannot have conflicts
-    return $svn{$status} if isSVN();
-    return $git{$status} if isGit();
-}
-
-sub statusDescription($$$$)
-{
-    my ($status, $propertyStatus, $original, $propertyChanges) = @_;
-
-    my $propertyDescription = defined $propertyChanges ? propertyChangeDescription($propertyChanges) : "";
-
-    my %svn = (
-        "A" => defined $original ? " Copied from \%s." : " Added.",
-        "D" => " Removed.",
-        "M" => "",
-        "R" => defined $original ? " Replaced with \%s." : " Replaced.",
-        " " => "",
-    );
-
-    my %git = %svn;
-    $git{"A"} = " Added.";
-    $git{"C"} = " Copied from \%s.";
-    $git{"R"} = " Renamed from \%s.";
-
-    my $description;
-    $description = sprintf($svn{$status}, $original) if isSVN() && exists $svn{$status};
-    $description = sprintf($git{$status}, $original) if isGit() && exists $git{$status};
-    return unless defined $description;
-
-    $description .= $propertyDescription unless isAddedStatus($status);
-    return $description;
-}
-
-sub propertyChangeDescription($)
-{
-    my ($propertyChanges) = @_;
-
-    my %operations = (
-        "A" => "Added",
-        "M" => "Modified",
-        "D" => "Removed",
-        "C" => "Changed",
-    );
-
-    my $description = "";
-    while (my ($operation, $properties) = each %$propertyChanges) {
-        my $word = $operations{$operation};
-        my $list = pluralizeAndList("property", "properties", @$properties);
-        $description .= " $word $list.";
-    }
-    return $description;
-}
-
-sub extractLineRange($)
-{
-    my ($string) = @_;
-
-    my ($start, $end) = (-1, -1);
-
-    if (isSVN() && $string =~ /^\d+(,\d+)?[acd](\d+)(,(\d+))?/) {
-        $start = $2;
-        $end = $4 || $2;
-    } elsif (isGit() && $string =~ /^@@ -\d+(,\d+)? \+(\d+)(,(\d+))? @@/) {
-        $start = $2;
-        $end = defined($4) ? $4 + $2 - 1 : $2;
-    }
-
-    return ($start, $end);
-}
-
-sub testListForChangeLog(@)
-{
-    my (@tests) = @_;
-
-    return "" unless @tests;
-
-    my $leadString = "        Test" . (@tests == 1 ? "" : "s") . ": ";
-    my $list = $leadString;
-    foreach my $i (0..$#tests) {
-        $list .= " " x length($leadString) if $i;
-        my $test = $tests[$i];
-        $test =~ s/^LayoutTests\///;
-        $list .= "$test\n";
-    }
-    $list .= "\n";
-
-    return $list;
-}
-
-sub reviewerAndDescriptionForGitCommit($$)
-{
-    my ($commit, $gitReviewer) = @_;
-
-    my $description = '';
-    my $reviewer;
-
-    my @args = qw(rev-list --pretty);
-    push @args, '-1' if $commit !~ m/.+\.\..+/;
-    my $gitLog;
-    {
-        local $/ = undef;
-        open(GITLOG, "-|", GIT, @args, $commit) || die;
-        $gitLog = <GITLOG>;
-        close(GITLOG);
-    }
-
-    my @commitLogs = split(/^[Cc]ommit [a-f0-9]{40}/m, $gitLog);
-    shift @commitLogs; # Remove initial blank commit log
-    my $commitLogCount = 0;
-    foreach my $commitLog (@commitLogs) {
-        $description .= "\n" if $commitLogCount;
-        $commitLogCount++;
-        my $inHeader = 1;
-        my $commitLogIndent; 
-        my @lines = split(/\n/, $commitLog);
-        shift @lines; # Remove initial blank line
-        foreach my $line (@lines) {
-            if ($inHeader) {
-                if (!$line) {
-                    $inHeader = 0;
-                }
-                next;
-            } elsif ($line =~ /[Ss]igned-[Oo]ff-[Bb]y: (.+)/) {
-                if (!$reviewer) {
-                    $reviewer = $1;
-                } else {
-                    $reviewer .= ", " . $1;
-                }
-            } elsif ($line =~ /^\s*$/) {
-                $description = $description . "\n";
-            } else {
-                if (!defined($commitLogIndent)) {
-                    # Let the first line with non-white space determine
-                    # the global indent.
-                    $line =~ /^(\s*)\S/;
-                    $commitLogIndent = length($1);
-                }
-                # Strip at most the indent to preserve relative indents.
-                $line =~ s/^\s{0,$commitLogIndent}//;
-                $description = $description . (" " x 8) . $line . "\n";
-            }
-        }
-    }
-    if (!$reviewer) {
-      $reviewer = $gitReviewer;
-    }
-
-    return ($reviewer, $description);
-}
-
-sub normalizeLineEndings($$)
-{
-    my ($string, $endl) = @_;
-    $string =~ s/\r?\n/$endl/g;
-    return $string;
-}
-
-sub decodeEntities($)
-{
-    my ($text) = @_;
-    $text =~ s/\&lt;/</g;
-    $text =~ s/\&gt;/>/g;
-    $text =~ s/\&quot;/\"/g;
-    $text =~ s/\&apos;/\'/g;
-    $text =~ s/\&amp;/\&/g;
-    return $text;
-}
diff --git a/Tools/Scripts/print-msvc-project-dependencies b/Tools/Scripts/print-msvc-project-dependencies
deleted file mode 100755
index dbc8402..0000000
--- a/Tools/Scripts/print-msvc-project-dependencies
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2008 Apple Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use File::Basename;
-
-sub printDependencyTree($);
-
-my $basename = basename($0);
-@ARGV or die "Usage: $basename sln1 [sln2 sln3...]";
-
-foreach my $sln (@ARGV) {
-    printDependencyTree($sln);
-}
-
-exit;
-
-sub printDependencyTree($)
-{
-    my ($sln) = @_;
-
-    unless (-f $sln) {
-        warn "Warning: Can't find $sln; skipping\n";
-        return;
-    }
-
-    unless (open SLN, "<", $sln) {
-        warn "Warning: Can't open $sln; skipping\n";
-        return;
-    }
-
-    my %projectsByUUID = ();
-    my $currentProject;
-
-    my $state = "initial";
-    foreach my $line (<SLN>) {
-        if ($state eq "initial") {
-            if ($line =~ /^Project\([^\)]+\) = "([^"]+)", "[^"]+", "([^"]+)"\r?$/) {
-                my $name = $1;
-                my $uuid = $2;
-                if (exists $projectsByUUID{$uuid}) {
-                    warn "Warning: Project $name appears more than once in $sln; using first definition\n";
-                    next;
-                }
-                $currentProject = {
-                    name => $name,
-                    uuid => $uuid,
-                    dependencies => {},
-                };
-                $projectsByUUID{$uuid} = $currentProject;
-
-                $state = "inProject";
-            }
-
-            next;
-        }
-
-        if ($state eq "inProject") {
-            defined($currentProject) or die;
-
-            if ($line =~ /^\s*ProjectSection\(ProjectDependencies\) = postProject\r?$/) {
-                $state = "inDependencies";
-            } elsif ($line =~ /^EndProject\r?$/) {
-                $currentProject = undef;
-                $state = "initial";
-            }
-
-            next;
-        }
-
-        if ($state eq "inDependencies") {
-            defined($currentProject) or die;
-
-            if ($line =~ /^\s*({[^}]+}) = ({[^}]+})\r?$/) {
-                my $uuid1 = $1;
-                my $uuid2 = $2;
-                if (exists $currentProject->{dependencies}->{$uuid1}) {
-                    warn "Warning: UUID $uuid1 listed more than once as dependency of project ", $currentProject->{name}, "\n";
-                    next;
-                }
-
-                $uuid1 eq $uuid2 or warn "Warning: UUIDs in depedency section of project ", $currentProject->{name}, " don't match: $uuid1 $uuid2; using first UUID\n";
-
-                $currentProject->{dependencies}->{$uuid1} = 1;
-            } elsif ($line =~ /^\s*EndProjectSection\r?$/) {
-                $state = "inProject";
-            }
-
-            next;
-        }
-    }
-
-    close SLN or warn "Warning: Can't close $sln\n";
-
-    my %projectsNotDependedUpon = %projectsByUUID;
-    CANDIDATE: foreach my $candidateUUID (keys %projectsByUUID) {
-        foreach my $projectUUID (keys %projectsByUUID) {
-            next if $candidateUUID eq $projectUUID;
-            foreach my $dependencyUUID (keys %{$projectsByUUID{$projectUUID}->{dependencies}}) {
-                if ($candidateUUID eq $dependencyUUID) {
-                    delete $projectsNotDependedUpon{$candidateUUID};
-                    next CANDIDATE;
-                }
-            }
-        }
-    }
-
-    foreach my $project (values %projectsNotDependedUpon) {
-        printProjectAndDependencies($project, 0, \%projectsByUUID);
-    }
-}
-
-sub printProjectAndDependencies
-{
-    my ($project, $indentLevel, $projectsByUUID) = @_;
-
-    print " " x $indentLevel, $project->{name}, "\n";
-    foreach my $dependencyUUID (keys %{$project->{dependencies}}) {
-        printProjectAndDependencies($projectsByUUID->{$dependencyUUID}, $indentLevel + 1, $projectsByUUID);
-    }
-}
diff --git a/Tools/Scripts/print-vse-failure-logs b/Tools/Scripts/print-vse-failure-logs
deleted file mode 100755
index 7580465..0000000
--- a/Tools/Scripts/print-vse-failure-logs
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# This is a very simple script designed to crawl the build directory
-# for visual studio express build logs and print them to stdout.
-
-from __future__ import with_statement
-
-import codecs
-import os
-import re
-
-from webkitpy.common.checkout import scm
-from webkitpy.common.system.executive import Executive
-from webkitpy.thirdparty import BeautifulSoup
-
-
-class PrintVisualStudioExpressLogs(object):
-    def __init__(self):
-        self._executive = Executive()
-
-    def _find_buildlogs(self, build_directory):
-        build_log_paths = []
-        for dirpath, dirnames, filenames in os.walk(build_directory):
-            for file_name in filenames:
-                if file_name == "BuildLog.htm":
-                    file_path = os.path.join(dirpath, file_name)
-                    build_log_paths.append(file_path)
-        return build_log_paths
-
-    def _build_order(self):
-        """Returns a list of project names in the order in which they are built."""
-        script_path = os.path.join(self._scripts_directory(), "print-msvc-project-dependencies")
-        sln_path = os.path.join(scm.find_checkout_root(), "WebKit", "win", "WebKit.vcproj", "WebKit.sln")
-        lines = self._executive.run_command([script_path, sln_path]).splitlines()
-        order = [line.strip() for line in lines if line.find("Folder") == -1]
-        order.reverse()
-        return order
-
-    def _sort_buildlogs(self, log_paths):
-        build_order = self._build_order()
-        def sort_key(log_path):
-            project_name = os.path.basename(os.path.dirname(os.path.dirname(log_path)))
-            try:
-                index = build_order.index(project_name)
-            except ValueError:
-                # If the project isn't in the list, sort it after all items that
-                # are in the list.
-                index = len(build_order)
-            # Sort first by build order, then by project name
-            return (index, project_name)
-        return sorted(log_paths, key=sort_key)
-
-    def _obj_directory(self):
-        build_directory_script_path = os.path.join(self._scripts_directory(), "webkit-build-directory")
-        # FIXME: ports/webkit.py should provide the build directory in a nice API.
-        # NOTE: The windows VSE build does not seem to use different directories
-        # for Debug and Release.
-        build_directory = self._executive.run_command([build_directory_script_path, "--top-level"]).rstrip()
-        return os.path.join(build_directory, "obj")
-
-    def _scripts_directory(self):
-        return os.path.dirname(__file__)
-
-    def _relevant_text(self, log):
-        soup = BeautifulSoup.BeautifulSoup(log)
-        # The Output Window table is where the useful output starts in the build log.
-        output_window_table = soup.find(text=re.compile("Output Window")).findParent("table")
-        result = []
-        for table in [output_window_table] + output_window_table.findNextSiblings("table"):
-            result.extend([text.replace("&nbsp;", "") for text in table.findAll(text=True)])
-            result.append("\n")
-        return "".join(result)
-
-    def main(self):
-        build_log_paths = self._sort_buildlogs(self._find_buildlogs(self._obj_directory()))
-
-        print "Found %s Visual Studio Express Build Logs:\n%s" % (len(build_log_paths), "\n".join(build_log_paths))
-
-        for build_log_path in build_log_paths:
-            print "%s:\n" % build_log_path
-            with codecs.open(build_log_path, "r", "utf-16") as build_log:
-                print self._relevant_text(build_log)
-
-
-if __name__ == '__main__':
-    PrintVisualStudioExpressLogs().main()
diff --git a/Tools/Scripts/resolve-ChangeLogs b/Tools/Scripts/resolve-ChangeLogs
deleted file mode 100755
index 2206828..0000000
--- a/Tools/Scripts/resolve-ChangeLogs
+++ /dev/null
@@ -1,496 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007, 2008, 2009 Apple Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Merge and resolve ChangeLog conflicts for svn and git repositories
-
-use strict;
-
-use FindBin;
-use lib $FindBin::Bin;
-
-use File::Basename;
-use File::Copy;
-use File::Path;
-use File::Spec;
-use Getopt::Long;
-use POSIX;
-use VCSUtils;
-
-sub canonicalRelativePath($);
-sub conflictFiles($);
-sub findChangeLog($);
-sub findUnmergedChangeLogs();
-sub fixMergedChangeLogs($;@);
-sub fixOneMergedChangeLog($);
-sub hasGitUnmergedFiles();
-sub isInGitFilterBranch();
-sub parseFixMerged($$;$);
-sub removeChangeLogArguments($);
-sub resolveChangeLog($);
-sub resolveConflict($);
-sub showStatus($;$);
-sub usageAndExit();
-
-my $isGit = isGit();
-my $isSVN = isSVN();
-
-my $SVN = "svn";
-my $GIT = "git";
-
-my $fixMerged;
-my $gitRebaseContinue = 0;
-my $mergeDriver = 0;
-my $printWarnings = 1;
-my $showHelp;
-
-sub usageAndExit()
-{
-    print STDERR <<__END__;
-Usage: @{[ basename($0) ]} [options] [path/to/ChangeLog] [path/to/another/ChangeLog ...]
-  -c|--[no-]continue               run "git rebase --continue" after fixing ChangeLog
-                                   entries (default: --no-continue)
-  -f|--fix-merged [revision-range] fix git-merged ChangeLog entries; if a revision-range
-                                   is specified, run git filter-branch on the range
-  -m|--merge-driver %O %A %B       act as a git merge-driver on files %O %A %B
-  -h|--help                        show this help message
-  -w|--[no-]warnings               show or suppress warnings (default: show warnings)
-__END__
-    exit 1;
-}
-
-my $getOptionsResult = GetOptions(
-    'c|continue!'     => \$gitRebaseContinue,
-    'f|fix-merged:s'  => \&parseFixMerged,
-    'm|merge-driver!' => \$mergeDriver,
-    'h|help'          => \$showHelp,
-    'w|warnings!'     => \$printWarnings,
-);
-
-if (!$getOptionsResult || $showHelp) {
-    usageAndExit();
-}
-
-my $relativePath = isInGitFilterBranch() ? '.' : chdirReturningRelativePath(determineVCSRoot());
-
-my @changeLogFiles = removeChangeLogArguments($relativePath);
-
-if (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
-    @changeLogFiles = findUnmergedChangeLogs();
-}
-
-if (!$mergeDriver && scalar(@ARGV) > 0) {
-    print STDERR "ERROR: Files listed on command-line that are not ChangeLogs.\n";
-    undef $getOptionsResult;
-} elsif (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
-    print STDERR "ERROR: No ChangeLog files listed on command-line or found unmerged.\n";
-    undef $getOptionsResult;
-} elsif ($gitRebaseContinue && !$isGit) {
-    print STDERR "ERROR: --continue may only be used with a git repository\n";
-    undef $getOptionsResult;
-} elsif (defined $fixMerged && !$isGit) {
-    print STDERR "ERROR: --fix-merged may only be used with a git repository\n";
-    undef $getOptionsResult;
-} elsif ($mergeDriver && !$isGit) {
-    print STDERR "ERROR: --merge-driver may only be used with a git repository\n";
-    undef $getOptionsResult;
-} elsif ($mergeDriver && scalar(@ARGV) < 3) {
-    print STDERR "ERROR: --merge-driver expects %O %A %B as arguments\n";
-    undef $getOptionsResult;
-}
-
-if (!$getOptionsResult) {
-    usageAndExit();
-}
-
-if (defined $fixMerged && length($fixMerged) > 0) {
-    my $commitRange = $fixMerged;
-    $commitRange = $commitRange . "..HEAD" if index($commitRange, "..") < 0;
-    fixMergedChangeLogs($commitRange, @changeLogFiles);
-} elsif ($mergeDriver) {
-    my ($base, $theirs, $ours) = @ARGV;
-    if (mergeChangeLogs($ours, $base, $theirs)) {
-        unlink($ours);
-        copy($theirs, $ours) or die $!;
-    } else {
-        exec qw(git merge-file -L THEIRS -L BASE -L OURS), $theirs, $base, $ours;
-    }
-} elsif (@changeLogFiles) {
-    for my $file (@changeLogFiles) {
-        if (defined $fixMerged) {
-            fixOneMergedChangeLog($file);
-        } else {
-            resolveChangeLog($file);
-        }
-    }
-} else {
-    print STDERR "ERROR: Unknown combination of switches and arguments.\n";
-    usageAndExit();
-}
-
-if ($gitRebaseContinue) {
-    if (hasGitUnmergedFiles()) {
-        print "Unmerged files; skipping '$GIT rebase --continue'.\n";
-    } else {
-        print "Running '$GIT rebase --continue'...\n";
-        print `$GIT rebase --continue`;
-    }
-}
-
-exit 0;
-
-sub canonicalRelativePath($)
-{
-    my ($originalPath) = @_;
-    my $absolutePath = Cwd::abs_path($originalPath);
-    return File::Spec->abs2rel($absolutePath, Cwd::getcwd());
-}
-
-sub conflictFiles($)
-{
-    my ($file) = @_;
-    my $fileMine;
-    my $fileOlder;
-    my $fileNewer;
-
-    if (-e $file && -e "$file.orig" && -e "$file.rej") {
-        return ("$file.rej", "$file.orig", $file);
-    }
-
-    if ($isSVN) {
-        my $escapedFile = escapeSubversionPath($file);
-        open STAT, "-|", $SVN, "status", $escapedFile or die $!;
-        my $status = <STAT>;
-        close STAT;
-        if (!$status || $status !~ m/^C\s+/) {
-            print STDERR "WARNING: ${file} is not in a conflicted state.\n" if $printWarnings;
-            return ();
-        }
-
-        $fileMine = "${file}.mine" if -e "${file}.mine";
-
-        my $currentRevision;
-        open INFO, "-|", $SVN, "info", $escapedFile or die $!;
-        while (my $line = <INFO>) {
-            if ($line =~ m/^Revision: ([0-9]+)/) {
-                $currentRevision = $1;
-                { local $/ = undef; <INFO>; }  # Consume rest of input.
-            }
-        }
-        close INFO;
-        $fileNewer = "${file}.r${currentRevision}" if -e "${file}.r${currentRevision}";
-
-        my @matchingFiles = grep { $_ ne $fileNewer } glob("${file}.r[0-9][0-9]*");
-        if (scalar(@matchingFiles) > 1) {
-            print STDERR "WARNING: Too many conflict files exist for ${file}!\n" if $printWarnings;
-        } else {
-            $fileOlder = shift @matchingFiles;
-        }
-    } elsif ($isGit) {
-        my $gitPrefix = `$GIT rev-parse --show-prefix`;
-        chomp $gitPrefix;
-        open GIT, "-|", $GIT, "ls-files", "--unmerged", $file or die $!;
-        while (my $line = <GIT>) {
-            my ($mode, $hash, $stage, $fileName) = split(' ', $line);
-            my $outputFile;
-            if ($stage == 1) {
-                $fileOlder = "${file}.BASE.$$";
-                $outputFile = $fileOlder;
-            } elsif ($stage == 2) {
-                $fileNewer = "${file}.LOCAL.$$";
-                $outputFile = $fileNewer;
-            } elsif ($stage == 3) {
-                $fileMine = "${file}.REMOTE.$$";
-                $outputFile = $fileMine;
-            } else {
-                die "Unknown file stage: $stage";
-            }
-            system("$GIT cat-file blob :${stage}:${gitPrefix}${file} > $outputFile");
-            die $! if WEXITSTATUS($?);
-        }
-        close GIT or die $!;
-    } else {
-        die "Unknown version control system";
-    }
-
-    if (!$fileMine && !$fileOlder && !$fileNewer) {
-        print STDERR "WARNING: ${file} does not need merging.\n" if $printWarnings;
-    } elsif (!$fileMine || !$fileOlder || !$fileNewer) {
-        print STDERR "WARNING: ${file} is missing some conflict files.\n" if $printWarnings;
-    }
-
-    return ($fileMine, $fileOlder, $fileNewer);
-}
-
-sub findChangeLog($)
-{
-    my $changeLogFileName = changeLogFileName();
-    return $_[0] if basename($_[0]) eq $changeLogFileName;
-
-    my $file = File::Spec->catfile($_[0], $changeLogFileName);
-    return $file if -d $_[0] and -e $file;
-
-    return undef;
-}
-
-sub findUnmergedChangeLogs()
-{
-    my $statCommand = "";
-
-    if ($isSVN) {
-        $statCommand = "$SVN stat | grep '^C'";
-    } elsif ($isGit) {
-        $statCommand = "$GIT diff -r --name-status --diff-filter=U -C -C -M";
-    } else {
-        return ();
-    }
-
-    my @results = ();
-    open STAT, "-|", $statCommand or die "The status failed: $!.\n";
-    while (<STAT>) {
-        if ($isSVN) {
-            my $matches;
-            my $file;
-            if (isSVNVersion16OrNewer()) {
-                $matches = /^([C]).{6} (.+?)[\r\n]*$/;
-                $file = $2;
-            } else {
-                $matches = /^([C]).{5} (.+?)[\r\n]*$/;
-                $file = $2;
-            }
-            if ($matches) {
-                $file = findChangeLog(normalizePath($file));
-                push @results, $file if $file;
-            } else {
-                print;  # error output from svn stat
-            }
-        } elsif ($isGit) {
-            if (/^([U])\t(.+)$/) {
-                my $file = findChangeLog(normalizePath($2));
-                push @results, $file if $file;
-            } else {
-                print;  # error output from git diff
-            }
-        }
-    }
-    close STAT;
-
-    return @results;
-}
-
-sub fixMergedChangeLogs($;@)
-{
-    my $revisionRange = shift;
-    my @changedFiles = @_;
-
-    if (scalar(@changedFiles) < 1) {
-        # Read in list of files changed in $revisionRange
-        open GIT, "-|", $GIT, "diff", "--name-only", $revisionRange or die $!;
-        push @changedFiles, <GIT>;
-        close GIT or die $!;
-        die "No changed files in $revisionRange" if scalar(@changedFiles) < 1;
-        chomp @changedFiles;
-    }
-
-    my @changeLogs = grep { defined $_ } map { findChangeLog($_) } @changedFiles;
-    die "No changed ChangeLog files in $revisionRange" if scalar(@changeLogs) < 1;
-
-    system("$GIT filter-branch --tree-filter 'PREVIOUS_COMMIT=\`$GIT rev-parse \$GIT_COMMIT^\` && MAPPED_PREVIOUS_COMMIT=\`map \$PREVIOUS_COMMIT\` \"$0\" -f \"" . join('" "', @changeLogs) . "\"' $revisionRange");
-
-    # On success, remove the backup refs directory
-    if (WEXITSTATUS($?) == 0) {
-        rmtree(qw(.git/refs/original));
-    }
-}
-
-sub fixOneMergedChangeLog($)
-{
-    my $file = shift;
-    my $patch;
-
-    # Read in patch for incorrectly merged ChangeLog entry
-    {
-        local $/ = undef;
-        open GIT, "-|", $GIT, "diff", ($ENV{GIT_COMMIT} || "HEAD") . "^", $file or die $!;
-        $patch = <GIT>;
-        close GIT or die $!;
-    }
-
-    # Always checkout the previous commit's copy of the ChangeLog
-    system($GIT, "checkout", $ENV{MAPPED_PREVIOUS_COMMIT} || "HEAD^", $file);
-    die $! if WEXITSTATUS($?);
-
-    # The patch must have 0 or more lines of context, then 1 or more lines
-    # of additions, and then 1 or more lines of context.  If not, we skip it.
-    if ($patch =~ /\n@@ -(\d+),(\d+) \+(\d+),(\d+) @@\n( .*\n)*((\+.*\n)+)( .*\n)+$/m) {
-        # Copy the header from the original patch.
-        my $newPatch = substr($patch, 0, index($patch, "@@ -${1},${2} +${3},${4} @@"));
-
-        # Generate a new set of line numbers and patch lengths.  Our new
-        # patch will start with the lines for the fixed ChangeLog entry,
-        # then have 3 lines of context from the top of the current file to
-        # make the patch apply cleanly.
-        $newPatch .= "@@ -1,3 +1," . ($4 - $2 + 3) . " @@\n";
-
-        # We assume that top few lines of the ChangeLog entry are actually
-        # at the bottom of the list of added lines (due to the way the patch
-        # algorithm works), so we simply search through the lines until we
-        # find the date line, then move the rest of the lines to the top.
-        my @patchLines = map { $_ . "\n" } split(/\n/, $6);
-        foreach my $i (0 .. $#patchLines) {
-            if ($patchLines[$i] =~ /^\+\d{4}-\d{2}-\d{2}  /) {
-                unshift(@patchLines, splice(@patchLines, $i, scalar(@patchLines) - $i));
-                last;
-            }
-        }
-
-        $newPatch .= join("", @patchLines);
-
-        # Add 3 lines of context to the end
-        open FILE, "<", $file or die $!;
-        for (my $i = 0; $i < 3; $i++) {
-            $newPatch .= " " . <FILE>;
-        }
-        close FILE;
-
-        # Apply the new patch
-        open(PATCH, "| patch -p1 $file > " . File::Spec->devnull()) or die $!;
-        print PATCH $newPatch;
-        close(PATCH) or die $!;
-
-        # Run "git add" on the fixed ChangeLog file
-        system($GIT, "add", $file);
-        die $! if WEXITSTATUS($?);
-
-        showStatus($file, 1);
-    } elsif ($patch) {
-        # Restore the current copy of the ChangeLog file since we can't repatch it
-        system($GIT, "checkout", $ENV{GIT_COMMIT} || "HEAD", $file);
-        die $! if WEXITSTATUS($?);
-        print STDERR "WARNING: Last change to ${file} could not be fixed and re-merged.\n" if $printWarnings;
-    }
-}
-
-sub hasGitUnmergedFiles()
-{
-    my $output = `$GIT ls-files --unmerged`;
-    return $output ne "";
-}
-
-sub isInGitFilterBranch()
-{
-    return exists $ENV{MAPPED_PREVIOUS_COMMIT} && $ENV{MAPPED_PREVIOUS_COMMIT};
-}
-
-sub parseFixMerged($$;$)
-{
-    my ($switchName, $key, $value) = @_;
-    if (defined $key) {
-        if (defined findChangeLog($key)) {
-            unshift(@ARGV, $key);
-            $fixMerged = "";
-        } else {
-            $fixMerged = $key;
-        }
-    } else {
-        $fixMerged = "";
-    }
-}
-
-sub removeChangeLogArguments($)
-{
-    my ($baseDir) = @_;
-    my @results = ();
-
-    for (my $i = 0; $i < scalar(@ARGV); ) {
-        my $file = findChangeLog(canonicalRelativePath(File::Spec->catfile($baseDir, $ARGV[$i])));
-        if (defined $file) {
-            splice(@ARGV, $i, 1);
-            push @results, $file;
-        } else {
-            $i++;
-        }
-    }
-
-    return @results;
-}
-
-sub resolveChangeLog($)
-{
-    my ($file) = @_;
-
-    my ($fileMine, $fileOlder, $fileNewer) = conflictFiles($file);
-
-    return unless $fileMine && $fileOlder && $fileNewer;
-
-    if (mergeChangeLogs($fileMine, $fileOlder, $fileNewer)) {
-        if ($file ne $fileNewer) {
-            unlink($file);
-            rename($fileNewer, $file) or die $!;
-        }
-        unlink($fileMine, $fileOlder);
-        resolveConflict($file);
-        showStatus($file, 1);
-    } else {
-        showStatus($file);
-        print STDERR "WARNING: ${file} could not be merged using fuzz level 3.\n" if $printWarnings;
-        unlink($fileMine, $fileOlder, $fileNewer) if $isGit;
-    }
-}
-
-sub resolveConflict($)
-{
-    my ($file) = @_;
-
-    if ($isSVN) {
-        my $escapedFile = escapeSubversionPath($file);
-        system($SVN, "resolved", $escapedFile);
-        die $! if WEXITSTATUS($?);
-    } elsif ($isGit) {
-        system($GIT, "add", $file);
-        die $! if WEXITSTATUS($?);
-    } else {
-        die "Unknown version control system";
-    }
-}
-
-sub showStatus($;$)
-{
-    my ($file, $isConflictResolved) = @_;
-
-    if ($isSVN) {
-        my $escapedFile = escapeSubversionPath($file);
-        system($SVN, "status", $escapedFile);
-    } elsif ($isGit) {
-        my @args = qw(--name-status);
-        unshift @args, qw(--cached) if $isConflictResolved;
-        system($GIT, "diff", @args, $file);
-    } else {
-        die "Unknown version control system";
-    }
-}
-
diff --git a/Tools/Scripts/roll-over-ChangeLogs b/Tools/Scripts/roll-over-ChangeLogs
deleted file mode 100755
index 7e6d32f..0000000
--- a/Tools/Scripts/roll-over-ChangeLogs
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env ruby
-
-# Copyright (C) 2009 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-
-
-require 'date'
-
-CHANGELOG_SIZE_THRESHOLD = 750 * 1024
-
-scripts_directory = File.dirname(__FILE__)
-base_directory = File.expand_path(ARGV[0] || `perl -I#{scripts_directory} -Mwebkitdirs -e 'print sourceDir();'`)
-
-date_suffix = Date.today.strftime("-%Y-%m-%d")
-
-Dir.chdir base_directory
-`find . -type f -name 'ChangeLog'`.split.each do |path|
-    next unless File.stat(path).size > CHANGELOG_SIZE_THRESHOLD
-
-    old_path = "#{path}#{date_suffix}"
-    puts "Moving #{path} to #{old_path}..."
-    system "git", "mv", path, old_path
-    File.open path, "w" do |file|
-        file.write "== Rolled over to ChangeLog#{date_suffix} ==\n"
-    end
-    system "git", "add", path
-end
diff --git a/Tools/Scripts/run-api-tests b/Tools/Scripts/run-api-tests
deleted file mode 100755
index 18eb17c..0000000
--- a/Tools/Scripts/run-api-tests
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use warnings;
-
-use File::Basename;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use IPC::Open3;
-use lib $FindBin::Bin;
-use webkitdirs;
-use VCSUtils;
-
-sub buildTestTool();
-sub dumpTestsBySuite(\@);
-sub listAllTests();
-sub runTest($$$);
-sub runTestsBySuite(\@$);
-sub prepareEnvironmentForRunningTestTool();
-sub testToolPath();
-
-# Defined in VCSUtils.
-sub possiblyColored($$);
-
-# Timeout for individual test, in sec
-my $timeout = 10;
-
-my $showHelp = 0;
-my $verbose = 0;
-my $dumpTests = 0;
-my $build = 1;
-my $root;
-my $buildDefault = $build ? "build" : "do not build";
-my @testsFailed;
-my @testsTimedOut;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [suite or test prefixes]
-  --help                Show this help message
-  -v|--verbose          Verbose output
-  -d|--dump-tests       Dump the names of testcases without running them
-  --[no-]build          Build (or do not build) unit tests prior to running (default: $buildDefault)
-  --root=               Path to the pre-built root containing TestWebKitAPI
-  --chromium            Run the Chromium port on Mac/Win/Linux
-EOF
-
-GetOptions(
-    'help' => \$showHelp,
-    'verbose|v' => \$verbose,
-    'dump|d' => \$dumpTests,
-    'build!' => \$build,
-    'root=s' => \$root
-);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-setConfiguration();
-
-# When running TestWebKitAPI for Chromium on Android, defer to the test runner in
-# Chromium as we can't execute the binary locally.
-if (isChromiumAndroid()) {
-    my @runTestCommand = ('build/android/run_tests.py', '--verbose', '--webkit', '--exit_code', '--out-directory', sourceDir() . '/out', '-s', 'TestWebKitAPI');
-    if (configuration() eq "Release") {
-        push @runTestCommand, '--release';
-    }
-
-    chdir(sourceDir() . '/Source/WebKit/chromium') or die $!;
-    exit exitStatus(system(@runTestCommand));
-}
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-
-buildTestTool() if $build && !defined($root);
-setPathForRunningWebKitApp(\%ENV);
-my @testsToRun = listAllTests();
-
-@testsToRun = grep { my $test = $_; grep { $test =~ m/^\Q$_\E/ } @ARGV; } @testsToRun if @ARGV;
-
-if ($dumpTests) {
-    dumpTestsBySuite(@testsToRun);
-    exit 0;
-}
-
-exit runTestsBySuite(@testsToRun, $verbose);
-
-sub isSupportedPlatform()
-{
-    return isAppleMacWebKit() || isAppleWinWebKit() || isChromium();
-}
-
-sub dumpTestsBySuite(\@)
-{
-    my ($tests) = @_;
-    print "Dumping test cases\n";
-    print "------------------\n";
-    my $lastSuite = "";
-    for my $suiteAndTest (sort @$tests) {
-        my ($suite, $test) = split(/\./, $suiteAndTest);
-        if ($lastSuite ne $suite) {
-            $lastSuite = $suite;
-            print "$suite:\n";
-        }
-        print "   $test\n";
-    }
-    print "------------------\n";
-}
-
-sub runTestsBySuite(\@$)
-{
-    my ($tests, $verbose) = @_;
-    my $anyFailures = 0;
-    my $lastSuite = "";
-    for my $suiteAndTest (sort @$tests) {
-        my ($suite, $test) = split(/\./, $suiteAndTest);
-        if ($lastSuite ne $suite) {
-            $lastSuite = $suite;
-            print "Suite: $suite\n" unless $verbose;
-        }
-        my $failed = runTest($suite, $test, $verbose);
-        $anyFailures ||= $failed;
-    }
-    
-    if ($verbose) {
-        if (@testsFailed) {
-            print "Tests that failed:\n";
-            for my $test (@testsFailed) {
-                print "  $test\n";
-            }
-        }
-        if (@testsTimedOut) {
-            print "Tests that timed out:\n";
-            for my $test (@testsTimedOut) {
-                print "  $test\n";
-            }
-        }
-    }
-    return $anyFailures;
-}
-
-sub runTest($$$)
-{
-    my ($suite, $testName, $verbose) = @_;
-    my $test = $suite . "." . $testName;
-
-    my $gtestArg = "--gtest_filter=" . $test;
-
-    print "    Test: $testName -> " unless $verbose;
-
-    my $result = 0;
-    my $timedOut = 0;
-
-    die "run-api-tests is not supported on this platform.\n" unless isSupportedPlatform();
-
-    prepareEnvironmentForRunningTestTool();
-
-    local *DEVNULL;
-    my ($childIn, $childOut, $childErr);
-    if ($verbose) {
-        $childOut = ">&STDERR";
-        $childErr = ">&STDERR";
-    } else {
-        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
-        $childOut = ">&DEVNULL";
-        $childErr = ">&DEVNULL";
-    }
-
-    my $pid;
-    if (isAppleMacWebKit() && architecture()) {
-        $pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), testToolPath(), $gtestArg, @ARGV) or die "Failed to run test: $test.";
-    } else {
-        $pid = open3($childIn, $childOut, $childErr, testToolPath(), $gtestArg, @ARGV) or die "Failed to run test: $test.";
-    }
-
-    close($childIn);
-    close($childOut);
-    close($childErr);
-    close(DEVNULL) unless ($verbose);
-    eval {
-        local $SIG{ALRM} = sub { die "alarm\n" };
-        alarm $timeout;
-        waitpid($pid, 0);
-        alarm 0;
-        $result = $?;
-    };
-    if ($@) {
-        die unless $@ eq "alarm\n";
-        kill SIGTERM, $pid or kill SIGKILL, $pid;
-        $timedOut = 1;
-    }
-
-    if ($result) {
-        push @testsFailed, $test;
-    }
-    if ($timedOut) {
-        push @testsTimedOut, $test;
-        print possiblyColored("bold yellow", "Timeout"), "\n";
-    } elsif (!$verbose) {
-        if ($result) {
-            print possiblyColored("bold red", "Failed"), "\n";
-        } else {
-            print possiblyColored("bold green", "Passed"), "\n";
-        }
-    }
-
-    return $timedOut || $result;
-}
-
-sub listAllTests()
-{
-    my @toolOutput;
-    my $timedOut;
-
-    die "run-api-tests is not supported on this platform.\n" unless isSupportedPlatform();
-
-    prepareEnvironmentForRunningTestTool();
-
-    local *DEVNULL;
-    my ($childIn, $childOut, $childErr);
-    if ($verbose) {
-        $childErr = ">&STDERR";
-    } else {
-        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
-        $childErr = ">&DEVNULL";
-    }
-
-    my $pid;
-    if (isAppleMacWebKit() && architecture()) {
-        $pid = open3($childIn, $childOut, $childErr, "arch", "-" . architecture(), testToolPath(), "--gtest_list_tests") or die "Failed to build list of tests!";
-    } else {
-        $pid = open3($childIn, $childOut, $childErr, testToolPath(), "--gtest_list_tests") or die "Failed to build list of tests!";
-    }
-
-    close($childIn);
-    @toolOutput = <$childOut>;
-    close($childOut);
-    close($childErr);
-    close(DEVNULL) unless ($verbose);
-
-    waitpid($pid, 0);
-    my $result = $?;
-
-    if ($result) {
-        print STDERR "Failed to build list of tests!\n";
-        exit exitStatus($result);
-    }
-
-    my @tests = ();
-    my $suite;
-    for my $line (@toolOutput) {
-       $line =~ s/[\r\n]*$//;
-       if ($line =~ m/\.$/) {
-          $suite = $line; # "SuiteName."
-       } else {
-          # Disabling WebKit2 API test on Windows since we will be disabling WebKit2 on Windows.
-          next if (isAppleWinWebKit() && $suite =~ m/WebKit2*/);       
-          $line =~ s/^\s*//; # "TestName"
-          push @tests, $suite . $line; # "SuiteName.TestName"
-        }
-    }
-
-    return @tests;
-}
-
-sub buildTestTool()
-{
-    my $originalCwd = getcwd();
-
-    chdirWebKit();
-
-    my $buildTestTool = "build-api-tests";
-    print STDERR "Running $buildTestTool\n";
-
-    local *DEVNULL;
-    my ($childIn, $childOut, $childErr);
-    if ($verbose) {
-        # When not quiet, let the child use our stdout/stderr.
-        $childOut = ">&STDOUT";
-        $childErr = ">&STDERR";
-    } else {
-        open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
-        $childOut = ">&DEVNULL";
-        $childErr = ">&DEVNULL";
-    }
-
-    my @args = argumentsForConfiguration();
-    my $pathToBuildTestTool = File::Spec->catfile("Tools", "Scripts", $buildTestTool);
-    my $buildProcess = open3($childIn, $childOut, $childErr, "perl", $pathToBuildTestTool, @args) or die "Failed to run " . $buildTestTool;
-
-    close($childIn);
-    close($childOut);
-    close($childErr);
-    close(DEVNULL) unless ($verbose);
-
-    waitpid($buildProcess, 0);
-    my $buildResult = $?;
-
-    if ($buildResult) {
-        print STDERR "Compiling TestWebKitAPI failed!\n";
-        exit exitStatus($buildResult);
-    }
-
-    chdir $originalCwd;
-}
-
-sub prepareEnvironmentForRunningTestTool()
-{
-    return unless isAppleMacWebKit();
-
-    $ENV{DYLD_FRAMEWORK_PATH} = productDir();
-    $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
-}
-
-sub testToolPath()
-{
-    my $path = File::Spec->catfile(productDir(), "TestWebKitAPI");
-    return $path unless isAppleWinWebKit();
-
-    my $suffix;
-    if (configurationForVisualStudio() eq "Debug_All") {
-        $suffix = "_debug";
-    } else {
-        $suffix = "";
-    }
-    return "$path$suffix.exe";
-}
diff --git a/Tools/Scripts/run-bindings-tests b/Tools/Scripts/run-bindings-tests
index a0785e4..511da4f 100755
--- a/Tools/Scripts/run-bindings-tests
+++ b/Tools/Scripts/run-bindings-tests
@@ -41,17 +41,9 @@
     """
     reset_results = "--reset-results" in argv
 
-    generators = [
-        'JS',
-        'V8',
-        'ObjC',
-        'GObject',
-        'CPP'
-    ]
-
     from webkitpy.bindings.main import BindingsTests
 
-    return BindingsTests(reset_results, generators, executive.Executive()).main()
+    return BindingsTests(reset_results, executive.Executive()).main()
 
 
 if __name__ == '__main__':
diff --git a/Tools/Scripts/run-blink-httpd b/Tools/Scripts/run-blink-httpd
new file mode 100755
index 0000000..a169176
--- /dev/null
+++ b/Tools/Scripts/run-blink-httpd
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""A utility script for starting and stopping the HTTP server with the
+   same configuration as used in the layout tests."""
+
+#
+# This script is also used by Chromium's ui_tests to run http layout tests
+# in a browser.
+#
+import optparse
+import os
+import sys
+import tempfile
+
+import webkitpy.common.version_check
+
+from webkitpy.common.host import Host
+from webkitpy.layout_tests.servers import http_server
+
+
+def run(options):
+    if not options.server:
+        print ('Usage: %s --server {start|stop} [--root=root_dir]'
+               ' [--port=port_number]' % sys.argv[0])
+    else:
+        if (options.root is None) and (options.port is not None):
+            # specifying root but not port means we want httpd on default
+            # set of ports that LayoutTest use, but pointing to a different
+            # source of tests. Specifying port but no root does not seem
+            # meaningful.
+            raise 'Specifying port requires also a root.'
+        host = Host()
+        # FIXME: Make this work with other ports as well.
+        port_obj = host.port_factory.get(port_name='chromium', options=options)
+        httpd = http_server.Lighttpd(port_obj,
+                                     tempfile.gettempdir(),
+                                     port=options.port,
+                                     root=options.root,
+                                     run_background=options.run_background,
+                                     layout_tests_dir=options.layout_tests_dir)
+        if options.server == 'start':
+            httpd.start()
+        else:
+            httpd.stop()
+
+
+def main():
+    option_parser = optparse.OptionParser()
+    option_parser.add_option('-k', '--server',
+        help='Server action (start|stop)')
+    option_parser.add_option('-p', '--port',
+        help='Port to listen on (overrides layout test ports)')
+    option_parser.add_option('-r', '--root',
+        help='Absolute path to DocumentRoot (overrides layout test roots)')
+    option_parser.add_option('--register_cygwin', action="store_true",
+        dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
+    option_parser.add_option('--run_background', action="store_true",
+        dest="run_background",
+        help='Run on background (for running as UI test)')
+    option_parser.add_option('--layout_tests_dir',
+        dest="layout_tests_dir",
+        help='Absolute path to LayoutTests root')
+    options, args = option_parser.parse_args()
+
+    run(options)
+
+
+if '__main__' == __name__:
+    main()
diff --git a/Tools/Scripts/new-run-webkit-websocketserver b/Tools/Scripts/run-blink-websocketserver
similarity index 100%
rename from Tools/Scripts/new-run-webkit-websocketserver
rename to Tools/Scripts/run-blink-websocketserver
diff --git a/Tools/Scripts/run-efl-tests b/Tools/Scripts/run-efl-tests
deleted file mode 100755
index cb6df5b..0000000
--- a/Tools/Scripts/run-efl-tests
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2012 Intel Corporation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $xvfb_display = ":55";
-
-my $xvfb_pid = fork();
-exit(1) if not defined $xvfb_pid;
-
-# Tell CTest to dump gtest output in case of failure.
-$ENV{CTEST_OUTPUT_ON_FAILURE} = "1";
-$ENV{DISPLAY} = $xvfb_display;
-
-if ($xvfb_pid == 0) {
-    # Start Xvfb
-    my @xvfb_args = ( "Xvfb $xvfb_display -screen 0 800x600x24 -nolisten tcp > /dev/null 2>&1" );
-    exec(@xvfb_args);
-} else {
-    setConfiguration();
-
-    # Manually add this for jhbuildWrapperPrefixIfNeeded().
-    push(@ARGV, "--efl");
-
-    my $returnCode = exitStatus(generateBuildSystemFromCMakeProject("Efl", undef, cmakeBasedPortArguments()));
-    exit($returnCode) if $returnCode;
-
-    $returnCode = exitStatus(buildCMakeGeneratedProject("test"));
-
-    # Kill Xvfb
-    kill(15, $xvfb_pid);
-
-    exit($returnCode);
-}
-
diff --git a/Tools/Scripts/run-fast-jsc b/Tools/Scripts/run-fast-jsc
deleted file mode 100755
index 8e004c4..0000000
--- a/Tools/Scripts/run-fast-jsc
+++ /dev/null
@@ -1,161 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2012 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-
-# Script to run selected LayoutTests/fast/{js,regex} tests using jsc
-
-jscCmd="/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc"
-testRoot=/tmp/LayoutTests
-resultsRoot=`date \+/tmp/results-%Y-%m-%d-%H-%M-%S`
-testList="unset"
-
-cmdName=`basename $0`
-
-function usage()
-{
-    echo "usage: $cmdName [[--jsc | -j] <path-to-jsc>] [[--results-dir | -r] <results-path>]"
-    echo "                    [[--test-root | -t] <test-root-path>] [[--test-list | -l] <test-list-file>]"
-    exit 1
-}
-
-while [ $# -gt 1 ]
-do
-    case $1 in
-    --jsc|-j)
-        jscCmd=$2
-        ;;
-    --results-dir|-r)
-        resultsRoot=$2
-        ;;
-    --test-root|-t)
-        testRoot=$2
-        ;;
-    --test-list|-l)
-        testList=$2
-        ;;
-    *)
-        echo "Unrecognized option \"$1\""
-        usage
-        ;;
-    esac
-
-    shift 2
-done
-
-if [ $# -gt 0 ]
-then
-    echo "Extra argument \"$1\""
-    usage
-fi
-
-if [ $testList = "unset" ]
-then
-    testList=$testRoot/fast/js/jsc-test-list
-fi
-
-preScript=$testRoot/fast/js/resources/standalone-pre.js
-postScript=$testRoot/fast/js/resources/standalone-post.js
-passList=$resultsRoot/passed
-failList=$resultsRoot/failed
-crashList=$resultsRoot/crashed
-
-numTestsRun=0
-numPassed=0
-numFailed=0
-numCrashed=0
-
-rm -rf $resultsRoot
-rm -f jsc-tests-passed jsc-tests-failed
-
-for test in `cat $testList`
-do
-    testPassed=0
-    testCrashed=0
-    testName=`basename $test`
-    dirName=`dirname $test`
-     
-    expectedOut="$testRoot/$dirName/${testName}-expected.txt"
-    actualOut="$resultsRoot/$dirName/${testName}-out.txt"
-    actualErr="$resultsRoot/$dirName/${testName}-err.txt"
-    diffOut="$resultsRoot/$dirName/${testName}-diff.txt"
-    jsTest="$testRoot/$dirName/script-tests/${testName}.js"
-
-    if [ ! -d "$resultsRoot/$dirName" ]
-    then
-        mkdir -p "$resultsRoot/$dirName"
-    fi
-
-    if [ -f $expectedOut -a -f $jsTest ]
-    then
-        echo "Testing $test ... \c"
-        let numTestsRun=$numTestsRun+1
-        $jscCmd $preScript $jsTest $postScript 2>$actualErr > $actualOut
-        JSC_RES=$?
-        
-        if [ $JSC_RES -eq 0 ]
-        then
-            diff $actualOut $expectedOut > $diffOut
-            if [ $? -eq 0 ]
-            then
-                testPassed=1
-                echo "PASSED"
-            else
-                testPassed=0
-                echo "FAILED"
-            fi
-        else
-            testPassed=0
-            if [ $JSC_RES -gt 128 ]
-            then
-                testCrashed=1
-                echo "CRASHED"
-            else
-                echo "ERROR: $JSC_RES"
-            fi
-        fi
-
-        if [ $testPassed -eq 1 ]
-        then
-            echo "$test" >> $passList
-            let numPassed=$numPassed+1
-        else
-            echo "$test" >> $failList
-            let numFailed=$numFailed+1
-            if [ $testCrashed -eq 1 ]
-            then
-                echo "$test" >> $crashList
-                let numCrashed=$numCrashed+1
-            fi
-        fi
-    fi
-done
-
-if [ $numPassed -eq $numTestsRun ]
-then
-    echo "All $numTestsRun tests passed!" | tee $resultsRoot/summary
-else
-    echo "$numPassed tests passed, $numFailed tests failed, $numCrashed tests crashed." | tee $resultsRoot/summary
-fi
-
-echo "Test results in $resultsRoot"
diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests
deleted file mode 100755
index 35e70ed..0000000
--- a/Tools/Scripts/run-gtk-tests
+++ /dev/null
@@ -1,386 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2011, 2012 Igalia S.L.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-
-import subprocess
-import os
-import sys
-import optparse
-import re
-from signal import alarm, signal, SIGALRM, SIGKILL
-from gi.repository import Gio, GLib
-
-top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
-sys.path.append(os.path.join(top_level_directory, "Tools", "jhbuild"))
-sys.path.append(os.path.join(top_level_directory, "Tools", "gtk"))
-import common
-import jhbuildutils
-
-class SkippedTest:
-    ENTIRE_SUITE = None
-
-    def __init__(self, test, test_case, reason, bug=None):
-        self.test = test
-        self.test_case = test_case
-        self.reason = reason
-        self.bug = bug
-
-    def __str__(self):
-        skipped_test_str = "%s" % self.test
-
-        if not(self.skip_entire_suite()):
-            skipped_test_str += " [%s]" % self.test_case
-
-        skipped_test_str += ": %s " % self.reason
-        if self.bug is not None:
-            skipped_test_str += "(https://bugs.webkit.org/show_bug.cgi?id=%d)" % self.bug
-        return skipped_test_str
-
-    def skip_entire_suite(self):
-        return self.test_case == SkippedTest.ENTIRE_SUITE
-
-class TestTimeout(Exception):
-    pass
-
-class TestRunner:
-    TEST_DIRS = [ "unittests", "WebKit2APITests", "TestWebKitAPI" ]
-
-    SKIPPED = [
-        SkippedTest("unittests/testdownload", "/webkit/download/not-found", "Test fails in GTK Linux 64-bit Release bot", 82329),
-        SkippedTest("unittests/testwebinspector", "/webkit/webinspector/close-and-inspect", "Test is flaky in GTK Linux 32-bit Release bot", 82869),
-        SkippedTest("unittests/testwebresource", "/webkit/webresource/loading", "Test fails", 104689),
-        SkippedTest("unittests/testwebresource", "/webkit/webresource/sub_resource_loading", "Test fails in GTK Linux 64-bit Release bot", 82330),
-        SkippedTest("unittests/testwebview", "/webkit/webview/icon-uri", "Test times out in GTK Linux 64-bit Release bot", 82328),
-        SkippedTest("unittests/testatk", "/webkit/atk/getTextInParagraphAndBodyModerate", "Test fails", 105538),
-        SkippedTest("WebKit2APITests/TestInspectorServer", SkippedTest.ENTIRE_SUITE, "Test times out", 105866),
-        SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868),
-        SkippedTest("WebKit2APITests/TestWebKitAccessibility", "/webkit2/WebKitAccessibility/atspi-basic-hierarchy", "Test fails", 100408),
-        SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810),
-        SkippedTest("WebKit2APITests/TestWebKitWebContext", "/webkit2/WebKitWebContext/uri-scheme", "Test fails", 104779),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.CanHandleRequest", "Test fails", 88453),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.MouseMoveAfterCrash", "Test is flaky", 85066),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.NewFirstVisuallyNonEmptyLayoutForImages", "Test is flaky", 85066),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.NewFirstVisuallyNonEmptyLayoutFrames", "Test fails", 85037),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.RestoreSessionStateContainingFormData", "Session State is not implemented in GTK+ port", 84960),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.SpacebarScrolling", "Test fails", 84961),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKConnection", "Tests fail and time out out", 84959),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKPageGetScaleFactorNotZero", "Test fails and times out", 88455),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.ForceRepaint", "Test times out", 105532),
-        SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.ReloadPageAfterCrash", "Test flakily times out", 110129),
-    ]
-
-    def __init__(self, options, tests=[]):
-        self._options = options
-        self._build_type = "Debug" if self._options.debug else "Release"
-
-        self._programs_path = common.build_path_for_build_types((self._build_type,), "Programs")
-        self._tests = self._get_tests(tests)
-        self._skipped_tests = TestRunner.SKIPPED
-        if not sys.stdout.isatty():
-            self._tty_colors_pattern = re.compile("\033\[[0-9;]*m")
-
-        # These SPI daemons need to be active for the accessibility tests to work.
-        self._spi_registryd = None
-        self._spi_bus_launcher = None
-
-    def _get_tests(self, tests):
-        if tests:
-            return tests
-
-        tests = []
-        for test_dir in self.TEST_DIRS:
-            absolute_test_dir = os.path.join(self._programs_path, test_dir)
-            if not os.path.isdir(absolute_test_dir):
-                continue
-            for test_file in os.listdir(absolute_test_dir):
-                if not test_file.lower().startswith("test"):
-                    continue
-                test_path = os.path.join(self._programs_path, test_dir, test_file)
-                if os.path.isfile(test_path) and os.access(test_path, os.X_OK):
-                    tests.append(test_path)
-        return tests
-
-    def _lookup_atspi2_binary(self, filename):
-        exec_prefix = common.pkg_config_file_variable('atspi-2', 'exec_prefix')
-        if not exec_prefix:
-            return None
-        for path in ['libexec', 'lib/at-spi2-core', 'lib32/at-spi2-core', 'lib64/at-spi2-core']:
-            filepath = os.path.join(exec_prefix, path, filename)
-            if os.path.isfile(filepath):
-                return filepath
-
-        return None
-
-    def _start_accessibility_daemons(self):
-        spi_bus_launcher_path = self._lookup_atspi2_binary('at-spi-bus-launcher')
-        spi_registryd_path = self._lookup_atspi2_binary('at-spi2-registryd')
-        if not spi_bus_launcher_path or not spi_registryd_path:
-            return False
-
-        try:
-            self._ally_bus_launcher = subprocess.Popen([spi_bus_launcher_path], env=self._test_env)
-        except:
-            sys.stderr.write("Failed to launch the accessibility bus\n")
-            sys.stderr.flush()
-            return False
-
-        # We need to wait until the SPI bus is launched before trying to start the SPI
-        # registry, so we spin a main loop until the bus name appears on DBus.
-        loop = GLib.MainLoop()
-        Gio.bus_watch_name(Gio.BusType.SESSION, 'org.a11y.Bus', Gio.BusNameWatcherFlags.NONE,
-                           lambda *args: loop.quit(), None)
-        loop.run()
-
-        try:
-            self._spi_registryd = subprocess.Popen([spi_registryd_path], env=self._test_env)
-        except:
-            sys.stderr.write("Failed to launch the accessibility registry\n")
-            sys.stderr.flush()
-            return False
-
-        return True
-
-    def _setup_testing_environment(self):
-        self._test_env = os.environ
-        self._test_env["DISPLAY"] = self._options.display
-        self._test_env["WEBKIT_INSPECTOR_PATH"] = os.path.abspath(os.path.join(self._programs_path, 'resources', 'inspector'))
-        self._test_env['GSETTINGS_BACKEND'] = 'memory'
-        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
-        self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.build_path_for_build_types((self._build_type,), "Libraries")
-        self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
-
-        try:
-            self._xvfb = subprocess.Popen(["Xvfb", self._options.display, "-screen", "0", "800x600x24", "-nolisten", "tcp"],
-                                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        except Exception as e:
-            sys.stderr.write("Failed to run Xvfb: %s\n" % e)
-            sys.stderr.flush()
-            return False
-
-        # If we cannot start the accessibility daemons, we can just skip the accessibility tests.
-        if not self._start_accessibility_daemons():
-            print "Could not start accessibility bus, so skipping TestWebKitAccessibility"
-            self._skipped_tests.append(SkippedTest("WebKit2APITests/TestWebKitAccessibility", SkippedTest.ENTIRE_SUITE, "Could not start accessibility bus"))
-        return True
-
-    def _tear_down_testing_environment(self):
-        if self._spi_registryd:
-            self._spi_registryd.terminate()
-        if self._spi_bus_launcher:
-            self._spi_bus_launcher.terminate()
-        self._xvfb.terminate()
-
-    def _test_cases_to_skip(self, test_program):
-        if self._options.skipped_action != 'skip':
-            return []
-
-        test_cases = []
-        for skipped in self._skipped_tests:
-            if test_program.endswith(skipped.test) and not skipped.skip_entire_suite():
-                test_cases.append(skipped.test_case)
-        return test_cases
-
-    def _should_run_test_program(self, test_program):
-        # This is not affected by the command-line arguments, since programs are skipped for
-        # problems in the harness, such as failing to start the accessibility bus.
-        for skipped in self._skipped_tests:
-            if test_program.endswith(skipped.test) and skipped.skip_entire_suite():
-                return False
-        return True
-
-    def _get_child_pid_from_test_output(self, output):
-        if not output:
-            return -1
-        match = re.search(r'\(pid=(?P<child_pid>[0-9]+)\)', output)
-        if not match:
-            return -1
-        return int(match.group('child_pid'))
-
-    def _kill_process(self, pid):
-        try:
-            os.kill(pid, SIGKILL)
-        except OSError:
-            # Process already died.
-            pass
-
-    def _run_test_command(self, command, timeout=-1):
-        def alarm_handler(signum, frame):
-            raise TestTimeout
-
-        child_pid = [-1]
-        def parse_line(line, child_pid = child_pid):
-            if child_pid[0] == -1:
-                child_pid[0] = self._get_child_pid_from_test_output(line)
-
-            if sys.stdout.isatty():
-                sys.stdout.write(line)
-            else:
-                sys.stdout.write(self._tty_colors_pattern.sub('', line.replace('\r', '')))
-
-        def waitpid(pid):
-            while True:
-                try:
-                    return os.waitpid(pid, 0)
-                except (OSError, IOError) as e:
-                    if e.errno == errno.EINTR:
-                        continue
-                    raise
-
-        def return_code_from_exit_status(status):
-            if os.WIFSIGNALED(status):
-                return -os.WTERMSIG(status)
-            elif os.WIFEXITED(status):
-                return os.WEXITSTATUS(status)
-            else:
-                # Should never happen
-                raise RuntimeError("Unknown child exit status!")
-
-        pid, fd = os.forkpty()
-        if pid == 0:
-            os.execvpe(command[0], command, self._test_env)
-            sys.exit(0)
-
-        if timeout > 0:
-            signal(SIGALRM, alarm_handler)
-            alarm(timeout)
-
-        try:
-            common.parse_output_lines(fd, parse_line)
-            if timeout > 0:
-                alarm(0)
-        except TestTimeout:
-            self._kill_process(pid)
-            if child_pid[0] > 0:
-                self._kill_process(child_pid[0])
-            raise
-
-        try:
-            dummy, status = waitpid(pid)
-        except OSError as e:
-            if e.errno != errno.ECHILD:
-                raise
-            # This happens if SIGCLD is set to be ignored or waiting
-            # for child processes has otherwise been disabled for our
-            # process.  This child is dead, we can't get the status.
-            status = 0
-
-        return not return_code_from_exit_status(status)
-
-    def _run_test_glib(self, test_program):
-        tester_command = ['gtester']
-        if self._options.verbose:
-            tester_command.append('--verbose')
-        for test_case in self._test_cases_to_skip(test_program):
-            tester_command.extend(['-s', test_case])
-        tester_command.append(test_program)
-
-        return self._run_test_command(tester_command, self._options.timeout)
-
-    def _run_test_google(self, test_program):
-        tester_command = [test_program]
-        skipped_tests_cases = self._test_cases_to_skip(test_program)
-        if skipped_tests_cases:
-            tester_command.append("--gtest_filter=-%s" % ":".join(skipped_tests_cases))
-
-        return self._run_test_command(tester_command, self._options.timeout)
-
-    def _run_test(self, test_program):
-        if "unittests" in test_program or "WebKit2APITests" in test_program:
-            return self._run_test_glib(test_program)
-
-        if "TestWebKitAPI" in test_program:
-            return self._run_test_google(test_program)
-
-        return False
-
-    def run_tests(self):
-        if not self._tests:
-            sys.stderr.write("ERROR: tests not found in %s.\n" % (self._programs_path))
-            sys.stderr.flush()
-            return 1
-
-        if not self._setup_testing_environment():
-            return 1
-
-        # Remove skipped tests now instead of when we find them, because
-        # some tests might be skipped while setting up the test environment.
-        self._tests = [test for test in self._tests if self._should_run_test_program(test)]
-
-        failed_tests = []
-        timed_out_tests = []
-        try:
-            for test in self._tests:
-                success = True
-                try:
-                    success = self._run_test(test)
-                except TestTimeout:
-                    sys.stdout.write("TEST: %s: TIMEOUT\n" % test)
-                    sys.stdout.flush()
-                    timed_out_tests.append(test)
-
-                if not success:
-                    failed_tests.append(test)
-        finally:
-            self._tear_down_testing_environment()
-
-        if failed_tests:
-            names = [test.replace(self._programs_path, '', 1) for test in failed_tests]
-            sys.stdout.write("Tests failed (%d): %s\n" % (len(names), ", ".join(names)))
-            sys.stdout.flush()
-
-        if timed_out_tests:
-            names = [test.replace(self._programs_path, '', 1) for test in timed_out_tests]
-            sys.stdout.write("Tests that timed out (%d): %s\n" % (len(names), ", ".join(names)))
-            sys.stdout.flush()
-
-        if self._skipped_tests and self._options.skipped_action == 'skip':
-            sys.stdout.write("Tests skipped (%d):\n%s\n" %
-                             (len(self._skipped_tests),
-                              "\n".join([str(skipped) for skipped in self._skipped_tests])))
-            sys.stdout.flush()
-
-        return len(failed_tests) + len(timed_out_tests)
-
-if __name__ == "__main__":
-    if not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
-        print "***"
-        print "*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing."
-        print "***"
-
-    option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
-    option_parser.add_option('-r', '--release',
-                             action='store_true', dest='release',
-                             help='Run in Release')
-    option_parser.add_option('-d', '--debug',
-                             action='store_true', dest='debug',
-                             help='Run in Debug')
-    option_parser.add_option('-v', '--verbose',
-                             action='store_true', dest='verbose',
-                             help='Run gtester in verbose mode')
-    option_parser.add_option('--display', action='store', dest='display', default=':55',
-                             help='Display to run Xvfb')
-    option_parser.add_option('--skipped', action='store', dest='skipped_action',
-                             choices=['skip', 'ignore', 'only'], default='skip',
-                             metavar='skip|ignore|only',
-                             help='Specifies how to treat the skipped tests')
-    option_parser.add_option('-t', '--timeout',
-                             action='store', type='int', dest='timeout', default=10,
-                             help='Time in seconds until a test times out')
-    options, args = option_parser.parse_args()
-
-    sys.exit(TestRunner(options, args).run_tests())
diff --git a/Tools/Scripts/run-iexploder-tests b/Tools/Scripts/run-iexploder-tests
deleted file mode 100755
index cb696a2..0000000
--- a/Tools/Scripts/run-iexploder-tests
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/perl
-
-# 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
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# A script to semi-automatically run iExploder tests.
-
-use strict;
-use warnings;
-
-use Cwd;
-use File::Spec;
-use FindBin;
-use Getopt::Long;
-use IPC::Open2;
-
-use lib $FindBin::Bin;
-use webkitperl::httpd;
-use webkitdirs;
-
-sub configureAndOpenHTTPDIfNeeded();
-sub runSafariWithIExploder();
-
-# Argument handling
-my $guardMalloc = '';
-my $httpdPort = 8000;
-my $downloadTest;
-my $iExploderTestDirectory = "/tmp/iExploderTest";
-
-GetOptions(
-    'guard-malloc|g' => \$guardMalloc,
-    'get=s' => \$downloadTest,
-    'port=i' => \$httpdPort
-);
-
-
-setConfiguration();
-my $productDir = productDir();
-
-chdirWebKit();
-
-checkFrameworks();
-
-my $isHttpdOpen = 0;
-configureAndOpenHTTPDIfNeeded();
-
-if ($downloadTest) {
-    system "/usr/bin/curl -o ~/Desktop/iexploder$downloadTest.html \"http://127.0.0.1:$httpdPort/iexploder.cgi?lookup=1&test=$downloadTest\"";
-    print "Saved the test as iexploder$downloadTest.html on the desktop\n";
-} else {
-    runSafariWithIExploder();
-    print "Last generated tests:\n";
-    system "grep 'iexploder.cgi' $iExploderTestDirectory/access_log.txt | tail -n -5 | awk -F'[ =&\\?]' '{if (\$8 == \"lookup\") print \$11; else print \$9}'";
-}
-
-rmtree $iExploderTestDirectory;
-$isHttpdOpen = !closeHTTPD();
-
-sub runSafariWithIExploder()
-{
-    my $redirectTo;
-    if (@ARGV) {
-        $redirectTo = "http://127.0.0.1:$httpdPort/iexploder.cgi?lookup=1&test=$ARGV[0]";
-    } else {
-        $redirectTo = "http://127.0.0.1:$httpdPort/index.html";
-    }
-
-    open REDIRECT_HTML, ">", "$iExploderTestDirectory/redirect.html" or die;
-    print REDIRECT_HTML "<html>\n";
-    print REDIRECT_HTML "    <head>\n";
-    print REDIRECT_HTML "        <meta http-equiv=\"refresh\" content=\"1;URL=$redirectTo\" />\n";
-    print REDIRECT_HTML "        <script type=\"text/javascript\">\n";
-    print REDIRECT_HTML "            document.location = \"$redirectTo\";\n";
-    print REDIRECT_HTML "        </script>\n";
-    print REDIRECT_HTML "    </head>\n";
-    print REDIRECT_HTML "    <body>\n";
-    print REDIRECT_HTML "    </body>\n";
-    print REDIRECT_HTML "</html>\n";
-    close REDIRECT_HTML;
-    
-    if (!isAppleWebKit()) {
-        system "Tools/Scripts/run-launcher", "$iExploderTestDirectory/redirect.html";
-    } else {
-        local %ENV;
-        $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-        system "Tools/Scripts/run-safari", "-NSOpen", "$iExploderTestDirectory/redirect.html";
-    }
-}
-
-sub configureAndOpenHTTPDIfNeeded()
-{
-    return if $isHttpdOpen;
-    mkdir $iExploderTestDirectory;
-    my $webkitDirectory = getcwd();
-    my $testDirectory = $webkitDirectory . "/LayoutTests";
-    my $iExploderDirectory = $webkitDirectory . "/Tools/iExploder/iExploder-1.3.2";
-
-    my $httpdConfig = getHTTPDConfigPathForTestDirectory($testDirectory);
-
-    my $documentRoot = "$iExploderDirectory/htdocs";
-    my $typesConfig = "$testDirectory/http/conf/mime.types";
-    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
-    my $listen = "127.0.0.1:$httpdPort";
-
-
-    my @args = (
-        "-f", "$httpdConfig",
-        "-C", "DocumentRoot \"$documentRoot\"",
-        "-C", "Listen $listen",
-        "-c", "TypesConfig \"$typesConfig\"",
-        "-c", "CustomLog \"$iExploderTestDirectory/access_log.txt\" common",
-        "-c", "ErrorLog \"$iExploderTestDirectory/error_log.txt\"",
-        "-c", "SSLCertificateFile \"$sslCertificate\"",
-        # Apache wouldn't run CGIs with permissions==700 otherwise
-        "-c", "User \"#$<\""
-    );
-
-    $isHttpdOpen = openHTTPD(@args);
-}
diff --git a/Tools/Scripts/run-javascriptcore-tests b/Tools/Scripts/run-javascriptcore-tests
deleted file mode 100755
index 8b79f25..0000000
--- a/Tools/Scripts/run-javascriptcore-tests
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run the WebKit Open Source Project JavaScriptCore tests (adapted from Mozilla).
-
-use strict;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-# determine configuration
-setConfiguration();
-my $configuration = configuration();
-
-my @testsToSkip = (
-    # Various ecma/Date tests sometimes fail on Windows (but not Mac) https://bugs.webkit.org/show_bug.cgi?id=25160
-    "ecma/Date/15.9.2.1.js",
-    "ecma/Date/15.9.2.2-1.js",
-    "ecma/Date/15.9.2.2-2.js",
-    "ecma/Date/15.9.2.2-3.js",
-    "ecma/Date/15.9.2.2-4.js",
-    "ecma/Date/15.9.2.2-5.js",
-    "ecma/Date/15.9.2.2-6.js",
-    # ecma_3/Date/15.9.5.7.js fails on Mac (but not Windows) https://bugs.webkit.org/show_bug.cgi?id=25161
-    "ecma_3/Date/15.9.5.6.js",
-    "ecma_3/Date/15.9.5.7.js",
-    # These three fail on Linux in certain time zones, at certain times
-    # of the year (!): https://bugs.webkit.org/show_bug.cgi?id=71371
-    "ecma/Date/15.9.5.14.js",
-    "ecma/Date/15.9.5.31-1.js",
-    "ecma/Date/15.9.5.34-1.js",
-);
-
-my $jsDriverArgs = "-L " . join(" ", @testsToSkip);
-# These variables are intentionally left undefined.
-my $root;
-my $showHelp;
-
-my $buildJSC = 1;
-
-my $programName = basename($0);
-my $buildJSCDefault = $buildJSC ? "will check" : "will not check";
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help                        Show this help message
-  --jsDriver-args=              A string of arguments to pass to jsDriver.pl
-  --root=                       Path to pre-built root containing jsc
-  --[no-]build                  Check (or don't check) to see if the jsc build is up-to-date (default: $buildJSCDefault)
-EOF
-
-GetOptions(
-    'j|jsDriver-args=s' => \$jsDriverArgs,
-    'root=s' => \$root,
-    'build!' => \$buildJSC,
-    'help' => \$showHelp
-);
-
-# Assume any arguments left over from GetOptions are assumed to be build arguments
-my @buildArgs = @ARGV;
-
-# Arguments passed to --jsDriver-args (if any) are passed to jsDriver.pl
-my @jsArgs = split(" ", $jsDriverArgs);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-
-if (!defined($root) && $buildJSC) {
-    chdirWebKit();
-
-    push(@buildArgs, argumentsForConfiguration());
-    
-    print "Running: build-jsc " . join(" ", @buildArgs) . "\n";
-    my $buildResult = system "perl", "Tools/Scripts/build-jsc", @buildArgs;
-    if ($buildResult) {
-        print STDERR "Compiling jsc failed!\n";
-        exit exitStatus($buildResult);
-    }
-}
-
-
-my $productDir = jscProductDir();
-$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-setPathForRunningWebKitApp(\%ENV) if isCygwin();
-
-sub testapiPath($)
-{
-    my ($productDir) = @_;
-    my $jscName = "testapi";
-    $jscName .= "_debug" if configurationForVisualStudio() eq "Debug_All";
-    return "$productDir/$jscName";
-}
-
-#run api tests
-if (isAppleMacWebKit() || isAppleWinWebKit()) {
-    chdirWebKit();
-    chdir($productDir) or die "Failed to switch directory to '$productDir'\n";
-    my $path = testapiPath($productDir);
-    # Use an "indirect object" so that system() won't get confused if the path
-    # contains spaces (see perldoc -f exec).
-    my $testapiResult = system { $path } $path;
-    exit exitStatus($testapiResult)  if $testapiResult;
-}
-
-# Find JavaScriptCore directory
-chdirWebKit();
-chdir("Source/JavaScriptCore");
-chdir "tests/mozilla" or die "Failed to switch directory to 'tests/mozilla'\n";
-printf "Running: jsDriver.pl -e squirrelfish -s %s -f actual.html %s\n", jscPath($productDir), join(" ", @jsArgs);
-my @jsDriverCmd = ("perl", "jsDriver.pl", "-e", "squirrelfish", "-s", jscPath($productDir), "-f", "actual.html", @jsArgs);
-if (isGtk() || isEfl()) {
-    my @jhbuildPrefix = sourceDir() . "/Tools/jhbuild/jhbuild-wrapper";
-
-    if (isEfl()) {
-        push(@jhbuildPrefix, '--efl');
-    } elsif (isGtk()) {
-        push(@jhbuildPrefix, '--gtk');
-    }
-    push(@jhbuildPrefix, 'run');
-
-    unshift(@jsDriverCmd, @jhbuildPrefix);
-}
-my $result = system(@jsDriverCmd);
-exit exitStatus($result)  if $result;
-
-my %failures;
-
-open EXPECTED, "expected.html" or die "Failed to open 'expected.html'\n";
-while (<EXPECTED>) {
-    last if /failures reported\.$/;
-}
-while (<EXPECTED>) {
-    chomp;
-    $failures{$_} = 1;
-}
-close EXPECTED;
-
-my %newFailures;
-
-open ACTUAL, "actual.html" or die "Failed to open 'actual.html'";
-while (<ACTUAL>) {
-    last if /failures reported\.$/;
-}
-while (<ACTUAL>) {
-    chomp;
-    if ($failures{$_}) {
-        delete $failures{$_};
-    } else {
-        $newFailures{$_} = 1;
-    }
-}
-close ACTUAL;
-
-my $numNewFailures = keys %newFailures;
-if ($numNewFailures) {
-    print "\n** Danger, Will Robinson! Danger! The following failures have been introduced:\n";
-    foreach my $failure (sort keys %newFailures) {
-        print "\t$failure\n";
-    }
-}
-
-my $numOldFailures = keys %failures;
-if ($numOldFailures) {
-    print "\nYou fixed the following test";
-    print "s" if $numOldFailures != 1;
-    print ":\n";
-    foreach my $failure (sort keys %failures) {
-        print "\t$failure\n";
-    }
-}
-
-print "\n";
-
-print "$numNewFailures regression";
-print "s" if $numNewFailures != 1;
-print " found.\n";
-
-print "$numOldFailures test";
-print "s" if $numOldFailures != 1;
-print " fixed.\n";
-
-print "OK.\n" if $numNewFailures == 0;
-exit(1)  if $numNewFailures;
diff --git a/Tools/Scripts/run-jsc b/Tools/Scripts/run-jsc
deleted file mode 100755
index e5341c1..0000000
--- a/Tools/Scripts/run-jsc
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This script runs a list of scripts through jsc a specified number of times.
-
-use strict;
-use warnings;
-use File::Spec;
-use FindBin;
-use lib $FindBin::Bin;
-use Getopt::Long;
-use webkitdirs;
-
-my $usage = "Usage: run-jsc [--count run_count] [--verbose] shell_file [file2...]";
-
-my $count = 1;
-my $verbose = 0;
-GetOptions("count|c=i" => \$count,
-           "verbose|v" => \$verbose);
-die "$usage\n" if (@ARGV < 1);
-
-my $jsc = jscProductDir() . "/jsc @ARGV";
-$jsc .= " 2> " . File::Spec->devnull() unless $verbose;
-
-my $dyld = jscProductDir();
-
-$ENV{"DYLD_FRAMEWORK_PATH"} = $dyld;
-print STDERR "Running $count time(s): DYLD_FRAMEWORK_PATH=$dyld $jsc\n";
-while ($count--) {
-    if (system("$jsc") != 0) {
-        last;
-    }
-}
-
diff --git a/Tools/Scripts/run-launcher b/Tools/Scripts/run-launcher
deleted file mode 100755
index 32e2b8e..0000000
--- a/Tools/Scripts/run-launcher
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) 2007 Staikos Computing Services, Inc.  <info@staikos.net>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for WebKit Open Source Project.
-
-use strict;
-use File::Spec::Functions qw/catdir/;
-use File::Temp qw/tempfile/;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-setConfiguration();
-my $productDir = productDir();
-my $launcherPath = productDir();
-
-# Check to see that all the frameworks are built.
-checkFrameworks();
-
-# Set paths according to the build system used
-if (isQt()) {
-    my $libDir = catdir(productDir(), 'lib');
-    if (isWK2()) {
-        $launcherPath = catdir($launcherPath, "bin", "MiniBrowser");
-    } else {
-        $launcherPath = catdir($launcherPath, "bin", "QtTestBrowser");
-    }
-
-    $ENV{QTWEBKIT_PLUGIN_PATH} = catdir($libDir, 'plugins');
-
-    print "Starting webkit launcher, running against the built WebKit in $libDir...\n";
-    if (isDarwin()) {
-        $ENV{DYLD_LIBRARY_PATH} = $ENV{DYLD_LIBRARY_PATH} ? "$libDir:$ENV{DYLD_LIBRARY_PATH}" : $libDir;
-        $ENV{DYLD_FRAMEWORK_PATH} = $ENV{DYLD_FRAMEWORK_PATH} ? "$libDir:$ENV{DYLD_FRAMEWORK_PATH}" : $libDir;
-    } else {
-        $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} ? "$libDir:$ENV{LD_LIBRARY_PATH}" : $libDir;
-    }
-} else {
-
-    if (isGtk()) {
-        if (isWK2()) {
-            unshift(@ARGV, catdir($launcherPath, "Programs", "MiniBrowser"));
-        } else {
-            unshift(@ARGV, catdir($launcherPath, "Programs", "GtkLauncher"));
-        }
-        $launcherPath = catdir(sourceDir(), "Tools", "jhbuild", "jhbuild-wrapper");
-        unshift(@ARGV, ("--gtk", "run"));
-    }
-
-    if (isEfl()) {
-        if (isWK2()) {
-            unshift(@ARGV, catdir($launcherPath, "bin", "MiniBrowser"));
-        } else {
-            unshift(@ARGV, catdir($launcherPath, "bin", "EWebLauncher"));
-        }
-        $launcherPath = catdir(sourceDir(), "Tools", "jhbuild", "jhbuild-wrapper");
-        unshift(@ARGV, ("--efl", "run"));
-    }
-
-    if (isWx()) {
-        if (isDarwin()) {
-            $launcherPath = catdir($launcherPath, 'wxBrowser.app', 'Contents', 'MacOS', 'wxBrowser');
-        } else {
-            $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} ? "$productDir:$ENV{LD_LIBRARY_PATH}" : $productDir;
-            $launcherPath = catdir($launcherPath, 'wxBrowser');
-        }
-    }
-
-    print "Starting webkit launcher.\n";
-}
-
-exec $launcherPath, @ARGV or die;
-
diff --git a/Tools/Scripts/run-mangleme-tests b/Tools/Scripts/run-mangleme-tests
deleted file mode 100755
index 10196ef..0000000
--- a/Tools/Scripts/run-mangleme-tests
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/perl
-
-# 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
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# A script to semi-automatically run mangleme tests.
-
-use strict;
-use warnings;
-
-use Cwd;
-use File::Spec;
-use FindBin;
-use Getopt::Long;
-use IPC::Open2;
-
-use lib $FindBin::Bin;
-use webkitdirs;
-
-sub openHTTPDIfNeeded();
-sub closeHTTPD();
-sub runSafariWithMangleme();
-
-# Argument handling
-my $guardMalloc = '';
-my $httpdPort = 8000;
-my $downloadTest;
-
-GetOptions(
-    'guard-malloc|g' => \$guardMalloc,
-    'get=s' => \$downloadTest,
-    'port=i' => \$httpdPort
-);
-
-
-setConfiguration();
-my $productDir = productDir();
-
-chdirWebKit();
-
-checkFrameworks();
-
-mkdir "WebKitBuild/mangleme";
-(system "/usr/bin/make", "-C", "Tools/mangleme") == 0 or die;
-
-my $httpdOpen = 0;
-openHTTPDIfNeeded();
-
-if ($downloadTest) {
-    system "/usr/bin/curl -o ~/Desktop/mangleme$downloadTest.html http://127.0.0.1:$httpdPort/remangle.cgi?$downloadTest";
-    print "Saved the test as mangleme$downloadTest.html on the desktop\n";
-} else {
-    runSafariWithMangleme();
-    print "Last generated tests:\n";
-    system "grep 'Mangle attempt' /tmp/WebKit/error_log.txt | tail -n -5 | awk ' {print \$4}'";
-}
-
-closeHTTPD();
-
-
-sub runSafariWithMangleme()
-{
-    my $redirectTo;
-    if (@ARGV) {
-        $redirectTo = "http://127.0.0.1:$httpdPort/remangle.cgi?$ARGV[0]";
-    } else {
-        $redirectTo = "http://127.0.0.1:$httpdPort/mangle.cgi";
-    }
-
-    open REDIRECT_HTML, ">", "/tmp/WebKit/redirect.html" or die;
-    print REDIRECT_HTML "<html>\n";
-    print REDIRECT_HTML "    <head>\n";
-    print REDIRECT_HTML "        <meta http-equiv=\"refresh\" content=\"1;URL=$redirectTo\" />\n";
-    print REDIRECT_HTML "        <script type=\"text/javascript\">\n";
-    print REDIRECT_HTML "            document.location = \"$redirectTo\";\n";
-    print REDIRECT_HTML "        </script>\n";
-    print REDIRECT_HTML "    </head>\n";
-    print REDIRECT_HTML "    <body>\n";
-    print REDIRECT_HTML "    </body>\n";
-    print REDIRECT_HTML "</html>\n";
-    close REDIRECT_HTML;
-    
-    local %ENV;
-    $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
-    system "Tools/Scripts/run-safari", "-NSOpen", "/tmp/WebKit/redirect.html";
-}
-
-sub openHTTPDIfNeeded()
-{
-    return if $httpdOpen;
-
-    mkdir "/tmp/WebKit";
-    
-    if (-f "/tmp/WebKit/httpd.pid") {
-        my $oldPid = `cat /tmp/WebKit/httpd.pid`;
-        chomp $oldPid;
-        if (0 != kill 0, $oldPid) {
-            print "\nhttpd is already running: pid $oldPid, killing...\n";
-            kill 15, $oldPid;
-            
-            my $retryCount = 20;
-            while ((0 != kill 0, $oldPid) && $retryCount) {
-                sleep 1;
-                --$retryCount;
-            }
-            
-            die "Timed out waiting for httpd to quit" unless $retryCount;
-        }
-    }
-    
-    my $testDirectory = getcwd() . "/LayoutTests";
-    my $manglemeDirectory = getcwd() . "/WebKitBuild/mangleme";
-    my $httpdPath = "/usr/sbin/httpd";
-    my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
-    $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
-    my $documentRoot = "$manglemeDirectory";
-    my $typesConfig = "$testDirectory/http/conf/mime.types";
-    my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
-    my $listen = "127.0.0.1:$httpdPort";
-
-    open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, 
-        "-f", "$httpdConfig",
-        "-C", "DocumentRoot \"$documentRoot\"",
-        "-C", "Listen $listen",
-        "-c", "TypesConfig \"$typesConfig\"",
-        "-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common",
-        "-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"",
-        "-c", "SSLCertificateFile \"$sslCertificate\"",
-        # Apache wouldn't run CGIs with permissions==700 otherwise
-        "-c", "User \"#$<\"");
-
-    my $retryCount = 20;
-    while (system("/usr/bin/curl -q --silent --stderr - --output " . File::Spec->devnull() . " $listen") && $retryCount) {
-        sleep 1;
-        --$retryCount;
-    }
-    
-    die "Timed out waiting for httpd to start" unless $retryCount;
-    
-    $httpdOpen = 1;
-}
-
-sub closeHTTPD()
-{
-    return if !$httpdOpen;
-
-    close HTTPDIN;
-    close HTTPDOUT;
-
-    kill 15, `cat /tmp/WebKit/httpd.pid` if -f "/tmp/WebKit/httpd.pid";
-
-    $httpdOpen = 0;
-}
diff --git a/Tools/Scripts/run-minibrowser b/Tools/Scripts/run-minibrowser
deleted file mode 100755
index c841651..0000000
--- a/Tools/Scripts/run-minibrowser
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for launching the WebKit2 MiniBrowser.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded();
-
-setConfiguration();
-
-exit exitStatus(runMiniBrowser());
diff --git a/Tools/Scripts/run-pageloadtest b/Tools/Scripts/run-pageloadtest
deleted file mode 100755
index 3542aa9..0000000
--- a/Tools/Scripts/run-pageloadtest
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2006 Eric Seidel (eric@webkit.org)
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run the WebKit Open Source Project page load tests (PLTs).
-
-# Run all the tests passed in on the command line.
-
-use strict;
-use warnings;
-
-use File::Basename;
-use File::Spec;
-use FindBin;
-use Getopt::Long;
-
-use lib $FindBin::Bin;
-use webkitdirs;
-
-# Argument handling
-my $testName = 'svg';
-my $showHelp = 0;
-
-my $usage =
-    "Usage: " . basename($0) . "[options] testName\n" .
-    "  --help                  Show this help message\n";
-
-my $getOptionsResult = GetOptions('help' => \$showHelp);
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR $usage;
-    exit 1;
-}
-
-$testName = shift @ARGV if (@ARGV);
-
-my $safariExecutablePath = safariPath();
-my $safariResourcePath = File::Spec->catdir(dirname(dirname($safariExecutablePath)), "Resources");
-
-# Check to see that all the frameworks are built.
-checkFrameworks();
-
-chdirWebKit();
-
-if ($testName eq 'svg') {
-    my $suiteFile = "PerformanceTests/PageLoad/$testName/$testName.pltsuite";
-    my $webkitPath = sourceDir();
-    `cat "$suiteFile" | perl -pe 's|WEBKIT_PATH|$webkitPath|' > $safariResourcePath/$testName.pltsuite`
-}
-
-die "Please copy ${testName}.pltsuite to ${safariResourcePath}/${testName}.pltsuite"
-    if (! -f "${safariResourcePath}/${testName}.pltsuite");
-
-setConfiguration();
-
-my $productDir = productDir();
-
-# Set up DYLD_FRAMEWORK_PATH to point to the product directory.
-print "Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
-$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-$ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
-
-my @testCommands = ('activate');
-# Autovicki would clear history, we skip that here as this is likely an active user account
-@testCommands = (@testCommands, ("run $testName", 'emptyCache', 'wait 30'));
-@testCommands = (@testCommands, (("run $testName", 'wait 10') x 3));
-my $testCommandsString = join('; ', @testCommands);
-exec $safariExecutablePath, '--test-commands', $testCommandsString or die;
diff --git a/Tools/Scripts/run-qtwebkit-tests b/Tools/Scripts/run-qtwebkit-tests
deleted file mode 100755
index ded87c5..0000000
--- a/Tools/Scripts/run-qtwebkit-tests
+++ /dev/null
@@ -1,415 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-#Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Library General Public
-#License as published by the Free Software Foundation; either
-#version 2 of the License, or (at your option) any later version.
-
-#This library is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#Library General Public License for more details.
-
-#You should have received a copy of the GNU Library General Public License
-#along with this library; see the file COPYING.LIB.  If not, write to
-#the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-#Boston, MA 02110-1301, USA.
-
-from __future__ import with_statement
-
-import sys
-import os
-import re
-import logging
-from subprocess import Popen, PIPE, STDOUT
-from optparse import OptionParser
-
-
-class Log(object):
-    def __init__(self, name):
-        self._log = logging.getLogger(name)
-        self.debug = self._log.debug
-        self.warn = self._log.warn
-        self.error = self._log.error
-        self.exception = self._log.exception
-        self.info = self._log.info
-
-
-class Options(Log):
-    """ Option manager. It parses and checks script's parameters, sets an internal variable. """
-
-    def __init__(self, args):
-        Log.__init__(self, "Options")
-        log = self._log
-        opt = OptionParser("%prog [options] PathToSearch.\nTry -h or --help.")
-        opt.add_option("-j", "--parallel-level", action="store", type="int",
-              dest="parallel_level", default=None,
-              help="Number of parallel processes executing the Qt's tests. Default: cpu count.")
-        opt.add_option("-v", "--verbose", action="store", type="int",
-              dest="verbose", default=2,
-              help="Verbose level (0 - quiet, 1 - errors only, 2 - infos and warnings, 3 - debug information). Default: %default.")
-        opt.add_option("", "--tests-options", action="store", type="string",
-              dest="tests_options", default="",
-              help="Parameters passed to Qt's tests (for example '-eventdelay 123').")
-        opt.add_option("-o", "--output-file", action="store", type="string",
-              dest="output_file", default="/tmp/qtwebkittests.html",
-              help="File where results will be stored. The file will be overwritten. Default: %default.")
-        opt.add_option("-b", "--browser", action="store", dest="browser",
-              default="xdg-open",
-              help="Browser in which results will be opened. Default %default.")
-        opt.add_option("", "--do-not-open-results", action="store_false",
-              dest="open_results", default=True,
-              help="The results shouldn't pop-up in a browser automatically")
-        opt.add_option("-d", "--developer-mode", action="store_true",
-              dest="developer", default=False,
-              help="Special mode for debugging. In general it simulates human behavior, running all autotests. In the mode everything is executed synchronously, no html output will be generated, no changes or transformation will be applied to stderr or stdout. In this mode options; parallel-level, output-file, browser and do-not-open-results will be ignored.")
-        opt.add_option("-t", "--timeout", action="store", type="int",
-              dest="timeout", default=0,
-              help="Timeout in seconds for each testsuite. Zero value means that there is not timeout. Default: %default.")
-
-        self._o, self._a = opt.parse_args(args)
-        verbose = self._o.verbose
-        if verbose == 0:
-            logging.basicConfig(level=logging.CRITICAL,)
-        elif verbose == 1:
-            logging.basicConfig(level=logging.ERROR,)
-        elif verbose == 2:
-            logging.basicConfig(level=logging.INFO,)
-        elif verbose == 3:
-            logging.basicConfig(level=logging.DEBUG,)
-        else:
-            logging.basicConfig(level=logging.INFO,)
-            log.warn("Bad verbose level, switching to default.")
-        try:
-            if not os.path.exists(self._a[0]):
-                raise Exception("Given path doesn't exist.")
-            if len(self._a) > 1:
-                raise IndexError("Only one directory could be provided.")
-            self._o.path = self._a[0]
-        except IndexError:
-            log.error("Bad usage. Please try -h or --help.")
-            sys.exit(1)
-        except Exception:
-            log.error("Path '%s' doesn't exist", self._a[0])
-            sys.exit(2)
-        if self._o.developer:
-            if not self._o.parallel_level is None:
-                log.warn("Developer mode sets parallel-level option to one.")
-            self._o.parallel_level = 1
-            self._o.open_results = False
-
-    def __getattr__(self, attr):
-        """ Maps all options properties into this object (remove one level of indirection). """
-        return getattr(self._o, attr)
-
-
-def run_test(args):
-    """ Runs one given test.
-    args should contain a tuple with 3 elements;
-      TestSuiteResult containing full file name of an autotest executable.
-      str with options that should be passed to the autotest executable
-      bool if true then the stdout will be buffered and separated from the stderr, if it is false
-        then the stdout and the stderr will be merged together and left unbuffered (the TestSuiteResult output will be None).
-      int time after which the autotest executable would be killed
-    """
-    log = logging.getLogger("Exec")
-    test_suite, options, buffered, timeout = args
-    timer = None
-    try:
-        log.info("Running... %s", test_suite.test_file_name())
-        if buffered:
-            tst = Popen([test_suite.test_file_name()] + options.split(), stdout=PIPE, stderr=None)
-        else:
-            tst = Popen([test_suite.test_file_name()] + options.split(), stdout=None, stderr=STDOUT)
-        if timeout:
-            from threading import Timer
-            log.debug("Setting timeout timer %i sec on %s (process %s)", timeout, test_suite.test_file_name(), tst.pid)
-            def process_killer():
-                try:
-                    try:
-                        tst.terminate()
-                    except AttributeError:
-                        # Workaround for python version < 2.6 it can be removed as soon as we drop support for python2.5
-                        try:
-                            import ctypes
-                            PROCESS_TERMINATE = 1
-                            handle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, False, tst.pid)
-                            ctypes.windll.kernel32.TerminateProcess(handle, -1)
-                            ctypes.windll.kernel32.CloseHandle(handle)
-                        except AttributeError:
-                            # windll is not accessible so we are on *nix like system
-                            import signal
-                            os.kill(tst.pid, signal.SIGTERM)
-                    log.error("Timeout, process '%s' (%i) was terminated", test_suite.test_file_name(), tst.pid)
-                except OSError, e:
-                    # the process was finished before got killed
-                    pass
-            timer = Timer(timeout, process_killer)
-            timer.start()
-    except OSError, e:
-        log.exception("Can't open an autotest file: '%s'. Skipping the test...", e.filename)
-    else:
-        test_suite.set_output(tst.communicate()[0])  # takes stdout only, in developer mode it would be None.
-    log.info("Finished %s", test_suite.test_file_name())
-    if timeout:
-        timer.cancel()
-    return test_suite
-
-
-class TestSuiteResult(object):
-    """ Keeps information about a test. """
-
-    def __init__(self):
-        self._output = None
-        self._test_file_name = None
-
-    def set_output(self, xml):
-        if xml:
-            self._output = xml.strip()
-
-    def output(self):
-        return self._output
-
-    def set_test_file_name(self, file_name):
-        self._test_file_name = file_name
-
-    def test_file_name(self):
-        return self._test_file_name
-
-
-class Main(Log):
-    """ The main script. All real work is done in run() method. """
-
-    def __init__(self, options):
-        Log.__init__(self, "Main")
-        self._options = options
-        if options.parallel_level > 1 or options.parallel_level is None:
-            try:
-                from multiprocessing import Pool
-            except ImportError:
-                self.warn("Import Error: the multiprocessing module couldn't be loaded (may be lack of python-multiprocessing package?). The Qt autotests will be executed one by one.")
-                options.parallel_level = 1
-        if options.parallel_level == 1:
-
-            class Pool(object):
-                """ A hack, created to avoid problems with multiprocessing module, this class is single thread replacement for the multiprocessing.Pool class. """
-                def __init__(self, processes):
-                    pass
-
-                def imap_unordered(self, func, files):
-                    return map(func, files)
-
-                def map(self, func, files):
-                    return map(func, files)
-
-        self._Pool = Pool
-
-    def run(self):
-        """ Find && execute && publish results of all test. "All in one" function. """
-        # This is needed for Qt finding our QML modules. The current code makes our
-        # two existing API tests (WK1 API and WK2 UI process API) work correctly.
-        qml_import_path = self._options.path + "../../../../imports"
-        qml_import_path += ":" + self._options.path + "../../../../../../imports"
-        os.putenv("QML_IMPORT_PATH", qml_import_path)
-        path = os.getenv("PATH")
-        path += ":" + self._options.path + "../../../../../../bin"
-        os.putenv("PATH", path)
-        self.debug("Searching executables...")
-        tests_executables = self.find_tests_paths(self._options.path)
-        self.debug("Found: %s", len(tests_executables))
-        self.debug("Executing tests...")
-        results = self.run_tests(tests_executables)
-        if not self._options.developer:
-            self.debug("Transforming...")
-            transformed_results = self.transform(results)
-            self.debug("Publishing...")
-            self.announce_results(transformed_results)
-
-    def find_tests_paths(self, path):
-        """ Finds all tests executables inside the given path. """
-        executables = []
-        for root, dirs, files in os.walk(path):
-            # Check only for a file that name starts from 'tst_' and that we can execute.
-            filtered_path = filter(lambda w: w.startswith('tst_') and os.access(os.path.join(root, w), os.X_OK), files)
-            filtered_path = map(lambda w: os.path.join(root, w), filtered_path)
-            for file_name in filtered_path:
-                r = TestSuiteResult()
-                r.set_test_file_name(file_name)
-                executables.append(r)
-        return executables
-
-    def run_tests(self, files):
-        """ Executes given files by using a pool of workers. """
-        workers = self._Pool(processes=self._options.parallel_level)
-        # to each file add options.
-        self.debug("Using %s the workers pool, number of workers %i", repr(workers), self._options.parallel_level)
-        package = map(lambda w: [w, self._options.tests_options, not self._options.developer, self._options.timeout], files)
-        self.debug("Generated packages for workers: %s", repr(package))
-        results = workers.map(run_test, package)  # Collects results.
-        return results
-
-    def transform(self, results):
-        """ Transforms list of the results to specialized versions. """
-        stdout = self.convert_to_stdout(results)
-        html = self.convert_to_html(results)
-        return {"stdout": stdout, "html": html}
-
-    def announce_results(self, results):
-        """ Shows the results. """
-        self.announce_results_stdout(results['stdout'])
-        self.announce_results_html(results['html'])
-
-    def announce_results_stdout(self, results):
-        """ Show the results by printing to the stdout."""
-        print(results)
-
-    def announce_results_html(self, results):
-        """ Shows the result by creating a html file and calling a web browser to render it. """
-        with file(self._options.output_file, 'w') as f:
-            f.write(results)
-        if self._options.open_results:
-            Popen(self._options.browser + " " + self._options.output_file, stdout=None, stderr=None, shell=True)
-
-    def check_crash_occurences(self, results):
-        """ Checks if any test crashes and it sums them  """
-        totals = [0,0,0]
-        crash_count = 0
-        txt = []
-        #collecting results into one container with checking crash
-        for result in results:
-            found = None
-            if result.output():
-                txt.append(result.output())
-                found = re.search(r"([0-9]+) passed, ([0-9]+) failed, ([0-9]+) skipped", result.output())
-
-            if found:
-                totals = reduce(lambda x, y: (int(x[0]) + int(y[0]), int(x[1]) + int(y[1]), int(x[2]) + int(y[2])), (totals, found.groups()))
-            else:
-                txt.append('CRASHED: %s' % result.test_file_name())
-                crash_count += 1
-                self.warn("Missing sub-summary: %s" % result.test_file_name())
-
-        txt='\n\n'.join(txt)
-
-        totals = list(totals)
-        totals.append(crash_count)
-        totals = map(str, totals)
-        return txt, totals
-
-    def convert_to_stdout(self, results):
-        """ Converts results, that they could be nicely presented in the stdout. """
-        txt, totals = self.check_crash_occurences(results)
-
-        totals = "%s passed, %s failed, %s skipped, %s crashed" % (totals[0], totals[1], totals[2], totals[3])
-
-        txt += '\n' + '*' * 70
-        txt += "\n**" + ("TOTALS: " + totals).center(66) + '**'
-        txt += '\n' + '*' * 70 + '\n'
-        return txt
-
-    def convert_to_html(self, results):
-        """ Converts results, that they could showed as a html page. """
-        txt, totals = self.check_crash_occurences(results)
-        txt = txt.replace('&', '&amp;').replace('<', "&lt;").replace('>', "&gt;")
-        # Add a color and a style.
-        txt = re.sub(r"([* ]+(Finished)[ a-z_A-Z0-9]+[*]+)",
-            lambda w: r"",
-            txt)
-        txt = re.sub(r"([*]+[ a-z_A-Z0-9]+[*]+)",
-            lambda w: "<case class='good'><br><br><b>" + w.group(0) + r"</b></case>",
-            txt)
-        txt = re.sub(r"(Config: Using QTest library)((.)+)",
-            lambda w: "\n<case class='good'><br><i>" + w.group(0) + r"</i>  ",
-            txt)
-        txt = re.sub(r"\n(PASS)((.)+)",
-            lambda w: "</case>\n<case class='good'><br><status class='pass'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(FAIL!)((.)+)",
-            lambda w: "</case>\n<case class='bad'><br><status class='fail'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(XPASS)((.)+)",
-            lambda w: "</case>\n<case class='bad'><br><status class='xpass'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(XFAIL)((.)+)",
-            lambda w: "</case>\n<case class='good'><br><status class='xfail'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(SKIP)((.)+)",
-            lambda w: "</case>\n<case class='good'><br><status class='xfail'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(QWARN)((.)+)",
-            lambda w: "</case>\n<case class='bad'><br><status class='warn'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(RESULT)((.)+)",
-            lambda w: "</case>\n<case class='good'><br><status class='benchmark'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(QFATAL|CRASHED)((.)+)",
-            lambda w: "</case>\n<case class='bad'><br><status class='crash'>" + w.group(1) + r"</status>" + w.group(2),
-            txt)
-        txt = re.sub(r"\n(Totals:)([0-9', a-z]*)",
-            lambda w: "</case>\n<case class='good'><br><b>" + w.group(1) + r"</b>" + w.group(2) + "</case>",
-            txt)
-        # Find total count of failed, skipped, passed and crashed tests.
-        totals = "%s passed, %s failed, %s skipped, %s crashed." % (totals[0], totals[1], totals[2], totals[3])
-        # Create a header of the html source.
-        txt = """
-        <html>
-        <head>
-          <script>
-          function init() {
-              // Try to find the right styleSheet (this document could be embedded in an other html doc)
-              for (i = document.styleSheets.length - 1; i >= 0; --i) {
-                  if (document.styleSheets[i].cssRules[0].selectorText == "case.good") {
-                      resultStyleSheet = i;
-                      return;
-                  }
-              }
-              // The styleSheet hasn't been found, but it should be the last one.
-              resultStyleSheet = document.styleSheets.length - 1;
-          }
-
-          function hide() {
-              document.styleSheets[resultStyleSheet].cssRules[0].style.display='none';
-          }
-
-          function show() {
-              document.styleSheets[resultStyleSheet].cssRules[0].style.display='';
-          }
-
-          </script>
-          <style type="text/css">
-            case.good {color:black}
-            case.bad {color:black}
-            status.pass {color:green}
-            status.crash {color:red}
-            status.fail {color:red}
-            status.xpass {color:663300}
-            status.xfail {color:004500}
-            status.benchmark {color:000088}
-            status.warn {color:orange}
-            status.crash {color:red; text-decoration:blink; background-color:black}
-          </style>
-        </head>
-        <body onload="init()">
-        <center>
-          <h1>Qt's autotests results</h1>%(totals)s<br>
-          <hr>
-          <form>
-            <input type="button" value="Show failures only" onclick="hide()"/>
-            &nbsp;
-            <input type="button" value="Show all" onclick="show()"/>
-          </form>
-        </center>
-        <hr>
-        %(results)s
-        </body>
-        </html>""" % {"totals": totals, "results": txt}
-        return txt
-
-
-if __name__ == '__main__':
-    options = Options(sys.argv[1:])
-    main = Main(options)
-    main.run()
diff --git a/Tools/Scripts/run-regexp-tests b/Tools/Scripts/run-regexp-tests
deleted file mode 100755
index dc35ce9..0000000
--- a/Tools/Scripts/run-regexp-tests
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run the WebKit Open Source Project Regular Expression functional tests.
-
-use strict;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-# determine configuration
-setConfiguration();
-my $configuration = configuration();
-
-my $defaultTestFile = "RegExpTest.data";
-
-# These variables are intentionally left undefined.
-my $root;
-my $testFile;
-my $showHelp;
-my $verbose;
-
-my $buildJSC = 1;
-
-my $programName = basename($0);
-my $buildJSCDefault = $buildJSC ? "will check" : "will not check";
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help                        Show this help message
-  --file=                       File to use instead of default ($defaultTestFile)
-  --root=                       Path to pre-built root containing jsc
-  --[no-]build                  Check (or don't check) to see if the jsc build is up-to-date (default: $buildJSCDefault)
-  --verbose                     Increase test output on failures
-EOF
-
-GetOptions(
-    'verbose' => \$verbose,
-    'root=s' => \$root,
-    'file=s' => \$testFile,
-    'build!' => \$buildJSC,
-    'help' => \$showHelp
-);
-
-# Assume any arguments left over from GetOptions are assumed to be build arguments
-my @buildArgs = @ARGV;
-
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-
-if (!defined($root) && $buildJSC) {
-    chdirWebKit();
-
-    push(@buildArgs, argumentsForConfiguration());
-    
-    print "Running: build-jsc " . join(" ", @buildArgs) . "\n";
-    my $buildResult = system "perl", "Tools/Scripts/build-jsc", @buildArgs;
-    if ($buildResult) {
-        print STDERR "Compiling jsc failed!\n";
-        exit exitStatus($buildResult);
-    }
-}
-
-my $productDir = jscProductDir();
-$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-setPathForRunningWebKitApp(\%ENV) if isCygwin();
-
-sub testapiPath($)
-{
-    my ($productDir) = @_;
-    my $jscName = "testapi";
-    $jscName .= "_debug" if configurationForVisualStudio() eq "Debug_All";
-    return "$productDir/$jscName";
-}
-
-# Find JavaScriptCore directory
-if (!defined($testFile)) {
-    $testFile = $defaultTestFile;
-    chdirWebKit();
-    chdir("Source/JavaScriptCore");
-    chdir "tests/regexp" or die;
-}
-
-my $command = $productDir . "/testRegExp";
-
-if (defined($verbose) && $verbose) {
-    $command .= " --verbose";
-}
-
-$command .= " " . $testFile;
-
-printf "Running: " . $command . "\n";
-my $result = system $command;
-exit exitStatus($result)  if $result;
-
diff --git a/Tools/Scripts/run-safari b/Tools/Scripts/run-safari
deleted file mode 100755
index 8688a93..0000000
--- a/Tools/Scripts/run-safari
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for WebKit Open Source Project.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded();
-
-setConfiguration();
-
-# Check to see that all the frameworks are built.
-checkFrameworks();
-
-exit exitStatus(runSafari());
diff --git a/Tools/Scripts/run-sunspider b/Tools/Scripts/run-sunspider
deleted file mode 100755
index 4aec301..0000000
--- a/Tools/Scripts/run-sunspider
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007 Apple Inc. All rights reserved.
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-
-use strict;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-# determine configuration, but default to "Release" instead of last-used configuration
-setConfiguration("Release");
-setConfiguration();
-my $configuration = configuration();
-
-my $root;
-my $testRuns = 10; # This number may be different from what sunspider defaults to (that's OK)
-my $runInstruments = 0;
-my $suite = "";
-my $ubench = 0;
-my $v8suite = 0;
-my $parseonly = 0;
-my $setBaseline = 0;
-my $showHelp = 0;
-my $testsPattern;
-my $noBuild = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] [options to pass to build system]
-  --help            Show this help message
-  --set-baseline    Set baseline for future comparisons
-  --root            Path to root tools build
-  --runs            Number of times to run tests (default: $testRuns)
-  --tests           Only run tests matching provided pattern
-  --instruments     Sample with the Mac OS X "Instruments" tool (Time Profile) (implies --runs=1)
-  --suite           Select a specific benchmark suite. The default is sunspider-0.9.1
-  --ubench          Use microbenchmark suite instead of regular tests. Same as --suite=ubench
-  --v8-suite        Use the V8 benchmark suite. Same as --suite=v8-v4
-  --parse-only      Use the parse-only benchmark suite. Same as --suite=parse-only
-  --no-build        Do not try to build JSC before running the tests.
-EOF
-
-GetOptions('root=s' => sub { my ($x, $value) = @_; $root = $value; setConfigurationProductDir(Cwd::abs_path($root)); },
-           'runs=i' => \$testRuns,
-           'set-baseline' => \$setBaseline,
-           'instruments' => \$runInstruments,
-           'suite=s' => \$suite,
-           'ubench' => \$ubench,
-           'v8-suite' => \$v8suite,
-           'parse-only' => \$parseonly,
-           'tests=s' => \$testsPattern,
-           'help' => \$showHelp,
-           'no-build' => \$noBuild);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-sub buildJSC
-{
-    if (!defined($root)){
-        push(@ARGV,  "--" . $configuration);
-        
-        chdirWebKit();
-        my $buildResult = system currentPerlPath(), "Tools/Scripts/build-jsc", @ARGV;
-        if ($buildResult) {
-            print STDERR "Compiling jsc failed!\n";
-            exit exitStatus($buildResult);
-        }
-    }
-}
-
-sub setupEnvironmentForExecution($)
-{
-    my ($productDir) = @_;
-    print "Starting sunspider with DYLD_FRAMEWORK_PATH set to point to built JavaScriptCore in $productDir.\n";
-    $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-    # FIXME: Other platforms may wish to augment this method to use LD_LIBRARY_PATH, etc.
-}
-
-unless ($noBuild) {
-    buildJSC();
-}
-
-chdirWebKit();
-chdir("PerformanceTests/SunSpider");
-
-my $productDir = jscProductDir();
-
-setupEnvironmentForExecution($productDir);
-my @args = ("--shell", jscPath($productDir), "--runs", $testRuns);
-# This code could be removed if we chose to pass extra args to sunspider instead of Xcode
-push @args, "--set-baseline" if $setBaseline;
-push @args, "--instruments" if $runInstruments;
-push @args, "--suite=${suite}" if $suite;
-push @args, "--ubench" if $ubench;
-push @args, "--v8-suite" if $v8suite;
-push @args, "--parse-only" if $parseonly;
-push @args, "--tests", $testsPattern if $testsPattern;
-
-exec currentPerlPath(), "./sunspider", @args;
diff --git a/Tools/Scripts/run-test-runner b/Tools/Scripts/run-test-runner
deleted file mode 100755
index b474eb5..0000000
--- a/Tools/Scripts/run-test-runner
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for launching the WebKit2 WebKitTestRunner.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded();
-
-setConfiguration();
-
-exit exitStatus(runWebKitTestRunner());
diff --git a/Tools/Scripts/run-test-webkit-api b/Tools/Scripts/run-test-webkit-api
deleted file mode 100755
index 90b27f7..0000000
--- a/Tools/Scripts/run-test-webkit-api
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2010 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for launching TestWebKitAPI.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded();
-
-setConfiguration();
-
-exit exitStatus(runTestWebKitAPI());
diff --git a/Tools/Scripts/run-webkit-app b/Tools/Scripts/run-webkit-app
deleted file mode 100755
index d0c17f5..0000000
--- a/Tools/Scripts/run-webkit-app
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Simplified "run" script for WebKit Open Source Project.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-printHelpAndExitForRunAndDebugWebKitAppIfNeeded();
-
-setConfiguration();
-
-die "Did not specify an application to open (e.g. run-webkit-app AppName).\n" unless length($ARGV[0]) > 0;
-
-# Check to see that all the frameworks are built.
-checkFrameworks();
-
-my $appPath = shift(@ARGV);
-exit exitStatus(runMacWebKitApp($appPath, USE_OPEN_COMMAND));
diff --git a/Tools/Scripts/run-webkit-httpd b/Tools/Scripts/run-webkit-httpd
deleted file mode 100755
index af4d4f3..0000000
--- a/Tools/Scripts/run-webkit-httpd
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
-# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
-# Copyright (C) 2011 Research In Motion Limited. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run Apache with the same configuration as used in http layout tests.
-
-use strict;
-use warnings;
-
-use Cwd;
-use File::Path;
-use File::Basename;
-use Getopt::Long;
-use FindBin;
-
-use lib $FindBin::Bin;
-use webkitperl::httpd;
-use webkitdirs;
-
-# FIXME: Dynamic HTTP-port configuration in this file is wrong.  The various
-# apache config files in LayoutTests/http/config govern the port numbers.
-# Dynamic configuration as-written will also cause random failures in
-# an IPv6 environment.  See https://bugs.webkit.org/show_bug.cgi?id=37104.
-# Argument handling
-my $httpdPort = 8000;
-my $allInterfaces = 0;
-my $showHelp;
-
-my $result = GetOptions(
-    'all-interfaces|a' => \$allInterfaces,
-    'help|h' => \$showHelp,
-    'port=i' => \$httpdPort,
-);
-
-if (!$result || @ARGV || $showHelp) {
-    print "Usage: " . basename($0) . " [options]\n";
-    print "  -a|--all-interfaces  Bind to all interfaces\n";
-    print "  -h|--help            Show this help message\n";
-    print "  -p|--port NNNN       Bind to port NNNN\n";
-    exit 1;
-}
-
-setConfiguration();
-my $productDir = productDir();
-chdirWebKit();
-my $testDirectory = File::Spec->catfile(getcwd(), "LayoutTests");
-my $listen = "127.0.0.1:$httpdPort";
-$listen = "$httpdPort" if ($allInterfaces);
-
-if ($allInterfaces) {
-    print "Starting httpd on port $httpdPort (all interfaces)...\n";
-} else {
-    print "Starting httpd on <http://$listen/>...\n";
-}
-setShouldWaitForUserInterrupt();
-print "Press Ctrl+C to stop it.\n\n";
-
-my @args = (
-    "-C", "Listen $listen",
-    "-c", "CustomLog |/usr/bin/tee common",
-    "-c", "ErrorLog |/usr/bin/tee",
-    # Run in single-process mode, do not detach from the controlling terminal.
-    "-X",
-    # Disable Keep-Alive support. Makes testing in multiple browsers easier (no need to wait
-    # for another browser's connection to expire).
-    "-c", "KeepAlive off"
-);
-
-my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
-@args = (@defaultArgs, @args);
-openHTTPD(@args);
diff --git a/Tools/Scripts/run-webkit-tests b/Tools/Scripts/run-webkit-tests
index fa6243f..4d6826e 100755
--- a/Tools/Scripts/run-webkit-tests
+++ b/Tools/Scripts/run-webkit-tests
@@ -1,5 +1,5 @@
-#!/usr/bin/perl
-# Copyright (C) 2010 Google Inc. All rights reserved.
+#!/usr/bin/env python
+# Copyright (C) 2012 Google Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -27,80 +27,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# This file is a temporary hack.
-# It will be removed as soon as all platforms are are ready to move to
-# new-run-webkit-tests and we can then update the buildbots to explicitly
-# call old-run-webkit-tests for any platforms which will never support
-# a Python run-webkit-tests.
+"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
+from webkitpy.common import multiprocessing_bootstrap
 
-# This is intentionally written in Perl to guarantee support on
-# the same set of platforms as old-run-webkit-tests currently supports.
-# The buildbot master.cfg also currently passes run-webkit-tests to
-# perl directly instead of executing it in a shell.
-
-use strict;
-use warnings;
-
-use File::Spec;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-sub runningOnBuildBot()
-{
-    # This is a hack to detect if we're running on the buildbot so we can
-    # pass --verbose to new-run-webkit-tests.  This will be removed when we
-    # update the buildbot config to call new-run-webkit-tests explicitly.
-    my %isBuildBotUser = ("apple" => 1, "buildbot" => 1, "webkitbuildbot" => 1, "slave" => 1, "buildslave-1" => 1, "chrome-bot" => 1);
-    return $isBuildBotUser{$ENV{"USER"}};
-}
-
-sub useNewRunWebKitTests()
-{
-    # NRWT Windows support still needs work: https://bugs.webkit.org/show_bug.cgi?id=38756
-    return 0 if (isWindows() or isCygwin()) and !isChromium();
-    # NRWT does not support qt-arm: https://bugs.webkit.org/show_bug.cgi?id=64086
-    return 0 if isQt() and isARM();
-    # All other platforms should use NRWT by default.
-    return 1;
-}
-
-my $script = "perl";
-my $harnessName = "old-run-webkit-tests";
-
-if (useNewRunWebKitTests()) {
-    $script = "python";
-    $harnessName = "new-run-webkit-tests";
-
-    if (runningOnBuildBot()) {
-        push(@ARGV, "--debug-rwt-logging");
-    }
-}
-
-# webkitdirs.pm strips --qt and --gtk from @ARGV when we call isQt/isGtk.
-# We have to add back any --PORT arguments which may have been removed by isPort() checks above.
-if (isQt()) {
-    my $isPlatformSet = 0;
-    for (@ARGV){
-        # Pass --qt if platform isn't passed explicitly (eg. qt-5.0, qt-wk2, ...)
-        if(/^--platform.*/){
-            $isPlatformSet = 1;
-        }
-    }
-    push(@ARGV, "--qt") if(!$isPlatformSet);
-} elsif (isGtk()) {
-    push(@ARGV, "--gtk");
-} elsif (isEfl()) {
-    push(@ARGV, "--efl");
-} elsif (isChromiumAndroid()) {
-    push(@ARGV, "--chromium-android");
-} elsif (isChromium()) {
-    push(@ARGV, "--chromium");
-} elsif (isWinCairo()) {
-    push(@ARGV, "--wincairo");
-}
-
-my $harnessPath = File::Spec->catfile(relativeScriptsDir(), $harnessName);
-unshift(@ARGV, $harnessPath);
-unshift(@ARGV, $script);
-system(@ARGV) == 0 or die "Failed to execute $harnessPath";
+multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py')
diff --git a/Tools/Scripts/run-webkit-websocketserver b/Tools/Scripts/run-webkit-websocketserver
deleted file mode 100755
index d030951..0000000
--- a/Tools/Scripts/run-webkit-websocketserver
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to run Web Socket server.
-
-use strict;
-use warnings;
-
-use File::Spec;
-use FindBin;
-use IPC::Open2;
-
-use lib $FindBin::Bin;
-use webkitdirs;
-
-sub closeWebSocketServer();
-sub openWebSocketServer();
-
-my $webSocketPort = 8880;
-
-my $srcDir = sourceDir();
-my $layoutTestsName = "$srcDir/LayoutTests";
-my $testDirectory = File::Spec->rel2abs($layoutTestsName);
-my $webSocketServerPidFile = "$testDirectory/websocket.pid";
-
-
-print "Starting Web Socket server...\n";
-openWebSocketServer();
-print "Started.\n";
-print "Hit [ENTER] to stop it.";
-<STDIN>;
-print "Stopping Web Socket server...\n";
-closeWebSocketServer();
-print "Stopped.\n";
-exit 0;
-
-sub openWebSocketServer()
-{
-    my $webSocketHandlerDir = "$testDirectory";
-
-    my @args = (
-        "$srcDir/Tools/Scripts/new-run-webkit-websocketserver",
-        "--server", "start",
-        "--port", "$webSocketPort",
-        "--root", "$webSocketHandlerDir",
-        "--pidfile", "$webSocketServerPidFile"
-    );
-    system "/usr/bin/python", @args;
-}
-
-sub closeWebSocketServer()
-{
-    my @args = (
-        "$srcDir/Tools/Scripts/new-run-webkit-websocketserver",
-        "--server", "stop",
-        "--pidfile", "$webSocketServerPidFile"
-    );
-    system "/usr/bin/python", @args;
-    unlink "$webSocketServerPidFile";
-}
-
-
diff --git a/Tools/Scripts/set-webkit-configuration b/Tools/Scripts/set-webkit-configuration
deleted file mode 100755
index 4992256..0000000
--- a/Tools/Scripts/set-webkit-configuration
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options]
-  --32-bit                Set the default architecture to 32-bit
-  --64-bit                Set the default architecture to 64-bit
-  --debug                 Set the default configuration to debug
-  --release               Set the default configuration to release
-EOF
-
-my $configuration = passedConfiguration();
-my $architecture = passedArchitecture();
-
-if (!$architecture) {
-    # Handle --64-bit explicitly here, as we don't want our other scripts to accept it
-    for my $i (0 .. $#ARGV) {
-        my $opt = $ARGV[$i];
-        if ($opt =~ /^--64-bit$/i) {
-            splice(@ARGV, $i, 1);
-            $architecture = 'x86_64';
-        }
-    }
-}
-
-if (!$configuration && !$architecture) {
-    print STDERR $usage;
-    exit 1;
-}
-
-my $baseProductDir = baseProductDir();
-system "mkdir", "-p", "$baseProductDir";
-
-if ($configuration) {
-    open CONFIGURATION, ">", "$baseProductDir/Configuration" or die;
-    print CONFIGURATION $configuration;
-    close CONFIGURATION;
-}
-
-if ($architecture) {
-    if ($architecture ne "x86_64") {
-        open ARCHITECTURE, ">", "$baseProductDir/Architecture" or die;
-        print ARCHITECTURE $architecture;
-        close ARCHITECTURE;
-    } else {
-        unlink "$baseProductDir/Architecture";
-    }
-}
diff --git a/Tools/Scripts/show-pretty-diff b/Tools/Scripts/show-pretty-diff
index be426c0..b20dac8 100755
--- a/Tools/Scripts/show-pretty-diff
+++ b/Tools/Scripts/show-pretty-diff
@@ -60,10 +60,10 @@
 );
 close($prettydiffFileHandle);
 
-my $prettyPatchDir = sourceDir() . "/Websites/bugs.webkit.org/PrettyPatch/";
-my $prettyPatchTool = sourceDir() . "/Websites/bugs.webkit.org/PrettyPatch/prettify.rb";
+my $prettyPatchDir = sourceDir() . "/Tools/Scripts/webkitruby/PrettyPatch/";
+my $prettyPatchTool = sourceDir() . "/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb";
 
-my $pathToPrettify = "ruby -I " . sourceDir() . "/Websites/bugs.webkit.org/PrettyPatch/ " . sourceDir() . "/Websites/bugs.webkit.org/PrettyPatch/prettify.rb";
+my $pathToPrettify = "ruby -I " . sourceDir() . "/Tools/Scripts/webkitruby/PrettyPatch/ " . sourceDir() . "/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb";
 system "$pathToPrettify " . quotemeta($inputPath) . " > $prettydiffPath";
 
 if (isAppleMacWebKit()) {
diff --git a/Tools/Scripts/sort-Xcode-project-file b/Tools/Scripts/sort-Xcode-project-file
deleted file mode 100755
index 705b41d..0000000
--- a/Tools/Scripts/sort-Xcode-project-file
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Script to sort "children" and "files" sections in Xcode project.pbxproj files
-
-use strict;
-
-use File::Basename;
-use File::Spec;
-use File::Temp qw(tempfile);
-use Getopt::Long;
-
-sub sortChildrenByFileName($$);
-sub sortFilesByFileName($$);
-
-# Files (or products) without extensions
-my %isFile = map { $_ => 1 } qw(
-    create_hash_table
-    jsc
-    minidom
-    testapi
-    testjsglue
-);
-
-my $printWarnings = 1;
-my $showHelp;
-
-my $getOptionsResult = GetOptions(
-    'h|help'         => \$showHelp,
-    'w|warnings!'    => \$printWarnings,
-);
-
-if (scalar(@ARGV) == 0 && !$showHelp) {
-    print STDERR "ERROR: No Xcode project files (project.pbxproj) listed on command-line.\n";
-    undef $getOptionsResult;
-}
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR <<__END__;
-Usage: @{[ basename($0) ]} [options] path/to/project.pbxproj [path/to/project.pbxproj ...]
-  -h|--help           show this help message
-  -w|--[no-]warnings  show or suppress warnings (default: show warnings)
-__END__
-    exit 1;
-}
-
-for my $projectFile (@ARGV) {
-    if (basename($projectFile) =~ /\.xcodeproj$/) {
-        $projectFile = File::Spec->catfile($projectFile, "project.pbxproj");
-    }
-
-    if (basename($projectFile) ne "project.pbxproj") {
-        print STDERR "WARNING: Not an Xcode project file: $projectFile\n" if $printWarnings;
-        next;
-    }
-
-    # Grab the mainGroup for the project file
-    my $mainGroup = "";
-    open(IN, "< $projectFile") || die "Could not open $projectFile: $!";
-    while (my $line = <IN>) {
-        $mainGroup = $2 if $line =~ m#^(\s*)mainGroup = ([0-9A-F]{24} /\* .+ \*/);$#;
-    }
-    close(IN);
-
-    my ($OUT, $tempFileName) = tempfile(
-        basename($projectFile) . "-XXXXXXXX",
-        DIR => dirname($projectFile),
-        UNLINK => 0,
-    );
-
-    # Clean up temp file in case of die()
-    $SIG{__DIE__} = sub {
-        close(IN);
-        close($OUT);
-        unlink($tempFileName);
-    };
-
-    my @lastTwo = ();
-    open(IN, "< $projectFile") || die "Could not open $projectFile: $!";
-    while (my $line = <IN>) {
-        if ($line =~ /^(\s*)files = \(\s*$/) {
-            print $OUT $line;
-            my $endMarker = $1 . ");";
-            my @files;
-            while (my $fileLine = <IN>) {
-                if ($fileLine =~ /^\Q$endMarker\E\s*$/) {
-                    $endMarker = $fileLine;
-                    last;
-                }
-                push @files, $fileLine;
-            }
-            print $OUT sort sortFilesByFileName @files;
-            print $OUT $endMarker;
-        } elsif ($line =~ /^(\s*)children = \(\s*$/) {
-            print $OUT $line;
-            my $endMarker = $1 . ");";
-            my @children;
-            while (my $childLine = <IN>) {
-                if ($childLine =~ /^\Q$endMarker\E\s*$/) {
-                    $endMarker = $childLine;
-                    last;
-                }
-                push @children, $childLine;
-            }
-            if ($lastTwo[0] =~ m#^\s+\Q$mainGroup\E = \{$#) {
-                # Don't sort mainGroup
-                print $OUT @children;
-            } else {
-                print $OUT sort sortChildrenByFileName @children;
-            }
-            print $OUT $endMarker;
-        } else {
-            print $OUT $line;
-        }
-
-        push @lastTwo, $line;
-        shift @lastTwo if scalar(@lastTwo) > 2;
-    }
-    close(IN);
-    close($OUT);
-
-    unlink($projectFile) || die "Could not delete $projectFile: $!";
-    rename($tempFileName, $projectFile) || die "Could not rename $tempFileName to $projectFile: $!";
-}
-
-exit 0;
-
-sub sortChildrenByFileName($$)
-{
-    my ($a, $b) = @_;
-    my $aFileName = $1 if $a =~ /^\s*[A-Z0-9]{24} \/\* (.+) \*\/,$/;
-    my $bFileName = $1 if $b =~ /^\s*[A-Z0-9]{24} \/\* (.+) \*\/,$/;
-    my $aSuffix = $1 if $aFileName =~ m/\.([^.]+)$/;
-    my $bSuffix = $1 if $bFileName =~ m/\.([^.]+)$/;
-    if ((!$aSuffix && !$isFile{$aFileName} && $bSuffix) || ($aSuffix && !$bSuffix && !$isFile{$bFileName})) {
-        return !$aSuffix ? -1 : 1;
-    }
-    return lc($aFileName) cmp lc($bFileName);
-}
-
-sub sortFilesByFileName($$)
-{
-    my ($a, $b) = @_;
-    my $aFileName = $1 if $a =~ /^\s*[A-Z0-9]{24} \/\* (.+) in /;
-    my $bFileName = $1 if $b =~ /^\s*[A-Z0-9]{24} \/\* (.+) in /;
-    return lc($aFileName) cmp lc($bFileName);
-}
diff --git a/Tools/Scripts/sunspider-compare-results b/Tools/Scripts/sunspider-compare-results
deleted file mode 100755
index ce95944..0000000
--- a/Tools/Scripts/sunspider-compare-results
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2007 Apple Inc. All rights reserved.
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-
-use strict;
-use File::Spec;
-use FindBin;
-use Getopt::Long qw(:config pass_through);
-use lib $FindBin::Bin;
-use webkitdirs;
-use POSIX;
-
-# determine configuration, but default to "Release" instead of last-used configuration to match run-sunspider
-setConfiguration("Release");
-setConfiguration();
-my $configuration = configuration();
-
-my $root;
-my $showHelp = 0;
-my $suite = "";
-my $ubench = 0;
-my $v8 = 0;
-my $parseonly = 0;
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options] FILE FILE
-  --help        Show this help message
-  --root        Path to root tools build
-  --suite           Select a specific benchmark suite. The default is sunspider-0.9.1
-  --ubench          Use microbenchmark suite instead of regular tests. Same as --suite=ubench
-  --v8-suite        Use the V8 benchmark suite. Same as --suite=v8-v4
-  --parse-only      Use the parse-only benchmark suite. Same as --suite=parse-only
-EOF
-
-GetOptions('root=s' => sub { my ($argName, $value) = @_; setConfigurationProductDir(Cwd::abs_path($value)); $root = $value; },
-           'suite=s' => \$suite,
-           'ubench' => \$ubench,
-           'v8' => \$v8,
-           'parse-only' => \$parseonly,
-           'help' => \$showHelp);
-
-if ($showHelp) {
-   print STDERR $usage;
-   exit 1;
-}
-
-sub buildJSC
-{
-    if (!defined($root)){
-        chdirWebKit();
-        my $buildResult = system currentPerlPath(), "Tools/Scripts/build-jsc", "--" . $configuration;
-        if ($buildResult) {
-            print STDERR "Compiling jsc failed!\n";
-            exit WEXITSTATUS($buildResult);
-        }
-    }
-}
-
-sub setupEnvironmentForExecution($)
-{
-    my ($productDir) = @_;
-    print "Starting sunspider-compare-results with DYLD_FRAMEWORK_PATH set to point to built JavaScriptCore in $productDir.\n";
-    $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
-    # FIXME: Other platforms may wish to augment this method to use LD_LIBRARY_PATH, etc.
-}
-
-sub pathToBuiltJSC($)
-{
-    my ($productDir) = @_;
-    my $jscName = "jsc";
-    $jscName .= "_debug" if configurationForVisualStudio() eq "Debug_All";
-    return "$productDir/$jscName";
-}
-
-sub pathToSystemJSC()
-{
-    my $path = "/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc";
-    if (-f $path) {
-        return $path;
-    }
-    return undef;
-}
-
-sub pathToJSC()
-{
-    my $path = pathToSystemJSC();
-    return $path if defined $path;
-
-    buildJSC();
-
-    my $productDir = jscProductDir();
-
-    setupEnvironmentForExecution($productDir);
-    return pathToBuiltJSC($productDir);
-}
-
-my $jscPath = pathToJSC();
-chdirWebKit();
-chdir("PerformanceTests/SunSpider");
-
-my @args = ("--shell", $jscPath);
-# This code could be removed if we chose to pass extra args to sunspider instead of Xcode
-push @args, "--suite=${suite}" if $suite;
-push @args, "--ubench" if $ubench;
-push @args, "--v8" if $v8;
-push @args, "--parse-only" if $parseonly;
-
-@ARGV = map { File::Spec->rel2abs($_) } @ARGV;
-
-exec currentPerlPath(), "./sunspider-compare-results", @args, @ARGV;
diff --git a/Tools/Scripts/update-iexploder-cssproperties b/Tools/Scripts/update-iexploder-cssproperties
deleted file mode 100755
index 65e559f..0000000
--- a/Tools/Scripts/update-iexploder-cssproperties
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2007 Apple Inc.  All rights reserved.
-# Copyright (C) 2010 Holger Hans Peter Freyther
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This script updates Tools/iExploder/iExploder-1.3.2/htdocs/*.in based on
-# WebCore/css/CSSPropertyNames.in, WebCore/html/HTMLTagNames.in
-# and WebCore/html/HTMLAttributeNames.in
-
-use warnings;
-use strict;
-
-use FindBin;
-use lib $FindBin::Bin;
-use VCSUtils;
-use webkitdirs;
-
-use File::Spec;
-
-sub generateEntityListFromFile($);
-sub readiExploderFile($);
-sub update($$);
-sub writeiExploderFile($@);
-
-update("cssproperties.in", "css/CSSPropertyNames.in");
-update("htmlattrs.in", "html/HTMLAttributeNames.in");
-update("htmltags.in", "html/HTMLTagNames.in");
-print "Successfully updated!\n";
-
-exit 0;
-
-sub generateEntityListFromFile($)
-{
-    my ($filename) = @_;
-
-    my $revision = svnRevisionForDirectory(dirname($filename));
-    my $path = File::Spec->abs2rel($filename, sourceDir());
-    my $result = "# From WebKit svn r" . $revision . " (" . $path . ")\n";
-
-    my @entities = ();
-    my $in_namespace = 0;
-
-    open(IN, $filename) || die "$!";
-    while (my $l = <IN>) {
-        chomp $l;
-        if ($l =~ m/^namespace=\"/) {
-            $in_namespace = 1;
-        } elsif ($in_namespace && $l =~ m/^$/) {
-            $in_namespace = 0;
-        }
-
-        next if $in_namespace;
-        next if $l =~ m/^\s*#/ || $l =~ m/^\s*$/;
-
-        # For HTML Tags that can have additional information
-        if ($l =~ m/ /) {
-            my @split = split / /, $l;
-            $l = $split[0]
-        }
-
-        push(@entities, $l);
-    }
-    close(IN);
-
-    $result .= join("\n", sort { $a cmp $b } @entities) . "\n\n";
-
-    return $result;
-}
-
-sub readiExploderFile($)
-{
-    my ($filename) = @_;
-
-    my @sections = ();
-    local $/ = "\n\n";
-
-    open(IN, $filename) || die "$!";
-    @sections = <IN>;
-    close(IN);
-
-    return @sections;
-}
-
-sub update($$)
-{
-    my ($iexploderPath, $webcorePath) = @_;
-
-    $iexploderPath = File::Spec->catfile(sourceDir(), "Tools", "iExploder", "iExploder-1.3.2", "htdocs", split("/", $iexploderPath));
-    $webcorePath = File::Spec->catfile(sourceDir(), "Source", "WebCore", split("/", $webcorePath));
-
-    my @sections = readiExploderFile($iexploderPath);
-    $sections[0] = generateEntityListFromFile($webcorePath);
-    writeiExploderFile($iexploderPath, @sections);
-}
-
-
-sub writeiExploderFile($@)
-{
-    my ($filename, @sections) = @_;
-
-    open(OUT, "> $filename") || die "$!";
-    print OUT join("", @sections);
-    close(OUT);
-}
-
diff --git a/Tools/Scripts/update-javascriptcore-test-results b/Tools/Scripts/update-javascriptcore-test-results
deleted file mode 100755
index cc8cd2c..0000000
--- a/Tools/Scripts/update-javascriptcore-test-results
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use FindBin;
-use Getopt::Long;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-chdirWebKit();
-chdir "Source/JavaScriptCore/tests/mozilla" or die;
-
-my $force = 0;
-GetOptions('force' => \$force);
-
-open EXPECTED, "expected.html" or die;
-while (<EXPECTED>) {
-    last if /failures reported\.$/;
-}
-my %expected;
-while (<EXPECTED>) {
-    chomp;
-    $expected{$_} = 1;
-}
-close EXPECTED;
-
-open ACTUAL, "actual.html" or die;
-my $actual;
-while (<ACTUAL>) {
-    $actual .= $_;
-    last if /failures reported\.$/;
-}
-my $failed = 0;
-while (<ACTUAL>) {
-    $actual .= $_;
-    chomp;
-    if (!$expected{$_}) {
-        $failed = 1;
-        print "failure not expected: $_\n";
-    }
-}
-close ACTUAL;
-
-die "won't update, failures introduced\n" if $failed && !$force;
-
-open EXPECTED, ">expected.html";
-print EXPECTED $actual;
-close EXPECTED;
diff --git a/Tools/Scripts/update-sources-list.py b/Tools/Scripts/update-sources-list.py
deleted file mode 100755
index 2a4a5ef..0000000
--- a/Tools/Scripts/update-sources-list.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2007 Kevin Ollivier  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Make sure any port-independent files added to the Bakefile are
-# added to GTK, QT, etc. so that file updates can happen in one place.
-
-import os, sys
-from xml.dom import minidom
-
-scriptDir = os.path.abspath(sys.path[0])
-wkroot = os.path.abspath(os.path.join(scriptDir, "../.."))
-
-def getWebCoreFilesDict():
-    """
-    This method parses the WebCoreSources.bkl file, which has a list of all sources not specific
-    to any port, and returns the result as a dictionary with items of the form
-    (groupName, groupFiles). 
-    """
-    sources = {}
-    sources_prefix = "WEBCORE_"
-    filepath = os.path.join(wkroot, "Source", "WebCore", "WebCoreSources.bkl")
-    assert(os.path.exists(filepath))
-    
-    doc = minidom.parse(filepath)
-    for sourceGroup in doc.getElementsByTagName("set"):
-        groupName = ""
-        if sourceGroup.attributes.has_key("var"):
-            groupName = sourceGroup.attributes["var"].value
-            groupName = groupName.replace(sources_prefix, "")
-            
-        sourcesList = []
-        for node in sourceGroup.childNodes:
-            if node.nodeType == node.TEXT_NODE:
-                sourcesText = node.nodeValue.strip()
-                sourcesList = sourcesText.split("\n")
-                
-        assert(groupName != "")
-        assert(sourcesList != [])
-        
-        sources[groupName] = sourcesList
-        
-    return sources
-
-def generateWebCoreSourcesGTKAndQT(sources):
-    """
-    Convert the dictionary obtained from getWebCoreFilesDict() into a Unix makefile syntax,
-    which IIUC is suitable for both GTK and QT build systems. To take advantage of this,
-    QT and GTK would have to include the file "WebCore/sources.inc" into their makefiles.
-    """
-    makefileString = ""
-    
-    for key in sources.keys():
-        makefileString += key + "+="
-        for source in sources[key]:
-            makefileString += " \\\n\t\t" + source.strip()
-            
-        makefileString += "\n\n"
-    
-    makefileString += "BASE_SOURCES +="
-    for key in sources.keys():
-        makefileString += " \\\n\t\t" + key
-    
-    outfile = os.path.join(wkroot, "Source", "WebCore", "sources.inc")
-    sourcefile = open(outfile, "w")
-    sourcefile.write(makefileString)
-    sourcefile.close()
-    
-sources = getWebCoreFilesDict()
-generateWebCoreSourcesGTKAndQT(sources)
-
-# Coming soon - MSVC and hopefully XCode support!
diff --git a/Tools/Scripts/update-webkit b/Tools/Scripts/update-webkit
deleted file mode 100755
index d0d1afe..0000000
--- a/Tools/Scripts/update-webkit
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2011 Brent Fulgham. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Update script for WebKit Open Source Project.
-
-use strict;
-use FindBin;
-use lib $FindBin::Bin;
-use File::Basename;
-use File::Spec;
-use Getopt::Long;
-use VCSUtils;
-use webkitdirs;
-
-sub runSvnUpdate();
-sub runGitUpdate();
-
-# Handle options
-my $quiet = '';
-my $showHelp;
-my $useGYP = 0;
-my $useMake = 0;
-my $useNinja = -1; # -1: Let update-webkit-chromium pick the default.
-
-determineIsChromium();
-determineIsChromiumAndroid();
-determineIsQt();
-determineIsWinCairo();
-
-chdirWebKit();
-
-my $getOptionsResult = GetOptions(
-    'h|help'  => \$showHelp,
-    'q|quiet' => \$quiet,
-    'gyp' => \$useGYP,
-    'make' => \$useMake,
-    'ninja!' => \$useNinja,
-); 
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR <<__END__;
-Usage: @{[ basename($0) ]} [options]
-  --chromium          also update dependencies of the chromium port
-  --make              generate the Makefile-based build system (Chromium only)
-  --[no-]ninja        generate the ninja-based build system (Chromium only)
-  --chromium-android  also update dependencies of the chromium port for Android
-  -h|--help           show the help message
-  -q|--quiet          pass -q to svn update for quiet updates
-  --gyp               generate project files from gyp after update
-  --wincairo          also update dependencies of the WinCairo port
-__END__
-    exit 1;
-}
-
-if ($useMake) {
-    $ENV{"GYP_GENERATORS"} = "make";
-}
-
-my @svnOptions = ();
-push @svnOptions, '-q' if $quiet;
-
-# Don't prompt when using svn-1.6 or newer.
-push @svnOptions, qw(--accept postpone) if isSVNVersion16OrNewer();
-
-print "Updating OpenSource\n" unless $quiet;
-runSvnUpdate() if isSVN();
-runGitUpdate() if isGit();
-
-if (-d "../Internal") {
-    chdir("../Internal");
-    print "Updating Internal\n" unless $quiet;
-    runSvnUpdate() if isSVNDirectory(".");
-    runGitUpdate() if isGitDirectory(".");
-} elsif (isChromium()) {
-    my @chromiumUpdateArgs = ("perl", "Tools/Scripts/update-webkit-chromium");
-    push @chromiumUpdateArgs, "--chromium-android" if isChromiumAndroid();
-    push @chromiumUpdateArgs, "--force" if forceChromiumUpdate();
-    push @chromiumUpdateArgs, "--ninja" if $useNinja == 1;
-    push @chromiumUpdateArgs, "--no-ninja" if $useNinja == 0;
-    system(@chromiumUpdateArgs) == 0 or die $!;
-} elsif (isAppleWinWebKit()) {
-    system("perl", "Tools/Scripts/update-webkit-auxiliary-libs") == 0 or die;
-    if (isWinCairo()) {
-        # WinCairo shares the auxiliary libs from the Apple port.
-        system("perl", "Tools/Scripts/update-webkit-wincairo-libs") == 0 or die;
-    }
-}
-
-setupAppleWinEnv() if isAppleWinWebKit();
-
-if ($useGYP) {
-    print "Generating Project Files\n";
-    system("perl", "Tools/Scripts/generate-project-files") == 0 or die "Failed to run generate-project-files";
-}
-
-exit 0;
-
-sub runSvnUpdate()
-{
-    open UPDATE, "-|", "svn", "update", @svnOptions or die;
-    my @conflictedChangeLogs;
-    while (my $line = <UPDATE>) {
-        print $line;
-        $line =~ m/^C\s+(.+?)[\r\n]*$/;
-        if ($1) {
-          my $filename = normalizePath($1);
-          push @conflictedChangeLogs, $filename if basename($filename) eq "ChangeLog";
-        }
-    }
-    close UPDATE or die;
-
-    if (@conflictedChangeLogs) {
-        print "Attempting to merge conflicted ChangeLogs.\n";
-        my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
-        (system($resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs) == 0)
-            or die "Could not open resolve-ChangeLogs script: $!.\n";
-    }
-}
-
-sub runGitUpdate()
-{
-    # Doing a git fetch first allows setups with svn-remote.svn.fetch = trunk:refs/remotes/origin/master
-    # to perform the rebase much much faster.
-    system("git", "fetch") == 0 or die;
-    if (isGitSVN()) {
-        system("git", "svn", "rebase") == 0 or die;
-    } else {
-        # This will die if branch.$BRANCHNAME.merge isn't set, which is
-        # almost certainly what we want.
-        system("git", "pull") == 0 or die;
-    }
-}
diff --git a/Tools/Scripts/update-webkit-auxiliary-libs b/Tools/Scripts/update-webkit-auxiliary-libs
deleted file mode 100755
index 1bb99d5..0000000
--- a/Tools/Scripts/update-webkit-auxiliary-libs
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Updates a development environment to the new WebKitAuxiliaryLibrary
-
-use strict;
-use warnings;
-use FindBin;
-
-my $file = "WebKitAuxiliaryLibrary";
-my $zipFile = "$file.zip"; 
-my $auxiliaryLibsURL = "https://developer.apple.com/opensource/internet/$zipFile";
-my $command = "$FindBin::Bin/update-webkit-dependency";
-
-system("perl", $command, $auxiliaryLibsURL, "win") == 0 or die;
diff --git a/Tools/Scripts/update-webkit-chromium b/Tools/Scripts/update-webkit-chromium
deleted file mode 100755
index f98473f..0000000
--- a/Tools/Scripts/update-webkit-chromium
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Update script for the WebKit Chromium Port.
-
-use File::Path;
-use FindBin;
-use Getopt::Long;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-determineIsChromiumAndroid();
-
-chdirWebKit();
-chdir("Source/WebKit/chromium") or die $!;
-
-# Find gclient or install it.
-my $gclientPath;
-if (commandExists('gclient')) {
-    $gclientPath = 'gclient';
-} elsif (-e 'depot_tools/gclient') {
-    $gclientPath = 'depot_tools/gclient';
-} else {
-    print "Installing chromium's depot_tools...\n";
-    system("svn co http://src.chromium.org/svn/trunk/tools/depot_tools") == 0 or die $1;
-    $gclientPath = 'depot_tools/gclient';
-}
-
-if (! -e ".gclient") {
-    # If .gclient configuration file doesn't exist, create it.
-    print "Configuring gclient...\n";
-    system($gclientPath,
-           "config",
-           "--spec=solutions=[{'name':'./','url':None}]") == 0 or die $!;
-}
-
-# When building Chromium for Android, the envsetup.sh script needs to be
-# executed prior to project file generation. We need to tell gyp_webkit to do
-# that, as it's a Chromium file and may not be available yet right now.
-if (isChromiumAndroid()) {
-    $ENV{WEBKIT_ANDROID_BUILD} = 1;
-}
-
-my $force = 0;
-my $useNinja = 1;
-
-GetOptions(
-  'force' => \$force,
-  'ninja!' => \$useNinja,
-);
-
-if ($useNinja) {
-    $ENV{"GYP_GENERATORS"} = "ninja";
-}
-
-# Execute gclient sync.
-print "Updating chromium port dependencies using gclient...\n";
-my @gclientArgs = ($gclientPath, "sync");
-push @gclientArgs, "--force" if $force;
-# --reset could delete modified files if necessary to sync.
-push @gclientArgs, "--reset" if $force;
-push @gclientArgs, "--delete_unversioned_trees" if $force;
-push @gclientArgs, "--deps=unix,android" if isChromiumAndroid();
-
-my $cmd = join(" ",@gclientArgs);
-my $max_attempts = 3;
-my $rc = -1;
-
-# The following will call glient up to $max_attempts times before
-# it gives up and fails.  We need this because glcient can fail
-# for several reasons, some of which are transient (flakiness).
-
-for (1 .. $max_attempts) {
-    $rc = system($cmd);
-    print "Re-trying '" . $cmd . "'\n" if $rc != 0;
-    last if $rc == 0;
-}
-
-die "Error: '$cmd' failed $max_attempts tries and returned " . $rc if ($rc);
diff --git a/Tools/Scripts/update-webkit-dependency b/Tools/Scripts/update-webkit-dependency
deleted file mode 100755
index 71d4672..0000000
--- a/Tools/Scripts/update-webkit-dependency
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) 2011 Carl Lobo.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Updates a development environment to the new WebKitAuxiliaryLibrary
-
-use strict;
-use warnings;
-
-use File::Find;
-use File::Spec;
-use File::Temp ();
-use FindBin;
-use HTTP::Date qw(str2time);
-use POSIX;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-if ($#ARGV != 1) {
-    die <<EOF;
-Usage:
-        update-webkit-dependancy <URL with the dependancy zip file> <*prefix dir inside zip without filename>
-
-        * If filename is requirements.zip and the contents of the zipfile are "requirements/x" then prefix = "."
-        * If filename is xyz.zip and the contents of the zipfile are xyz/abc/x" then prefix = "abc"
-        * x is lib or include or bin.
-EOF
-}
-
-sub lastModifiedToUnixTime($);
-sub getLibraryName($);
-
-# Time in seconds that the new zip file must be newer than the old for us to
-# consider them to be different. If the difference in modification time is less
-# than this threshold, we assume that the files are the same. We need this
-# because the zip file is served from a set of mirrors with slightly different
-# Last-Modified times.
-my $newnessThreshold = 30;
-
-my $libsURL = shift;
-my $prefixInZip = shift;
-my $sourceDir = sourceDir();
-my $file = getLibraryName($libsURL);
-my $zipFile = "$file.zip"; 
-my $webkitLibrariesDir = toUnixPath($ENV{'WEBKITLIBRARIESDIR'}) || "$sourceDir/WebKitLibraries/win";
-my $tmpRelativeDir = File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR => 1, CLEANUP => 1);
-my $tmpAbsDir = File::Spec->rel2abs($tmpRelativeDir);
-
-print "Checking Last-Modified date of $zipFile...\n";
-
-my $result = system "curl -s -I -k --sslv3 $libsURL | grep Last-Modified > \"$tmpAbsDir/$file.headers\"";
-
-if (WEXITSTATUS($result)) {
-
-    #Note: Neither GitHub nor DropBox emit the Last-Modified HTTP header, so fall back to a file
-	#containing the necessary information if we do not receive the information in our initial query.
-    my $headerURL = $libsURL;
-    $headerURL =~ s/\.zip$/\.headers/;
-
-    $result = system "curl -k --sslv3 -o \"$tmpAbsDir/$file.headers\" $headerURL";
-
-    if (WEXITSTATUS($result)) {
-        print STDERR "Couldn't check Last-Modified date of new $zipFile.\n";
-        print STDERR "Please ensure that $libsURL is reachable.\n";
-
-        if (! -f "$webkitLibrariesDir/$file.headers") {
-            print STDERR "Unable to check Last-Modified date and no version of $file to fall back to.\n";
-            exit 1;
-        }
-
-        print STDERR "Falling back to existing version of $file.\n";
-        exit 0;
-    }
-}
-
-if (open NEW, "$tmpAbsDir/$file.headers") {
-    my $new = lastModifiedToUnixTime(<NEW>);
-    close NEW;
-
-    if (defined $new && open OLD, "$webkitLibrariesDir/$file.headers") {
-        my $old = lastModifiedToUnixTime(<OLD>);
-        close OLD;
-        if (defined $old && abs($new - $old) < $newnessThreshold) {
-            print "Current $file is up to date\n";
-            exit 0;
-        }
-    }
-}
-
-print "Downloading $zipFile...\n\n";
-$result = system "curl -k --sslv3 -o \"$tmpAbsDir/$zipFile\" $libsURL";
-die "Couldn't download $zipFile!" if $result;
-
-$result = system "unzip", "-q", "-d", $tmpAbsDir, "$tmpAbsDir/$zipFile";
-die "Couldn't unzip $zipFile." if $result;
-
-print "\nInstalling $file...\n";
-
-sub wanted
-{
-    my $relativeName = File::Spec->abs2rel($File::Find::name, "$tmpAbsDir/$file/$prefixInZip");
-    my $destination = "$webkitLibrariesDir/$relativeName";
-
-    if (-d $_) {
-        mkdir $destination;
-        return;
-    }
-
-    system "cp", $_, $destination;
-}
-
-File::Find::find(\&wanted, "$tmpAbsDir/$file");
-
-$result = system "mv", "$tmpAbsDir/$file.headers", $webkitLibrariesDir;
-print STDERR "Couldn't move $file.headers to $webkitLibrariesDir" . ".\n" if $result;
-
-print "The $file has been sucessfully installed in\n $webkitLibrariesDir\n";
-exit;
-
-sub toUnixPath
-{
-    my $path = shift;
-    return unless $path;
-    chomp($path = `cygpath -u '$path'`);
-    return $path;
-}
-
-sub lastModifiedToUnixTime($)
-{
-    my ($str) = @_;
-
-    $str =~ /^Last-Modified: (.*)$/ or return;
-    return str2time($1);
-}
-
-sub getLibraryName($)
-{
-    my $url = shift;
-    $url =~ m#/([^/]+)\.zip$#;
-    return $1;
-}
-
diff --git a/Tools/Scripts/update-webkit-libs-jhbuild b/Tools/Scripts/update-webkit-libs-jhbuild
deleted file mode 100755
index 51605bd..0000000
--- a/Tools/Scripts/update-webkit-libs-jhbuild
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2011 Igalia S.L.
-# Copyright (C) 2012 Intel Corporation
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-use Getopt::Long;
-
-my $platformEfl = 0;
-my $platformGtk = 0;
-
-my $getOptionsResult = GetOptions(
-    'efl' => \$platformEfl,
-    'gtk' => \$platformGtk
-    );
-
-my $platform = "";
-if (!$getOptionsResult) {
-    die "No platform specified for " . basename($0) .". Use --gtk or --efl.\n";
-} else {
-    if ($platformEfl) {
-        $platform = "efl";
-    }
-    if ($platformGtk) {
-        $platform = "gtk";
-    }
-}
-
-sub getMD5HashForFile($)
-{
-    my $file = shift;
-
-    open(FILE_CONTENTS, $file);
-
-    my $contents = "";
-    while (<FILE_CONTENTS>) {
-        $contents .= $_;
-    }
-
-    close(FILE_CONTENTS);
-
-    return md5_hex($contents);
-}
-
-sub jhbuildConfigurationChanged()
-{
-    foreach my $file (qw(jhbuildrc jhbuild.modules)) {
-        my $path = join('/', getJhbuildPath(), $file . '.md5sum');
-        if (! -e $path) {
-            return 1;
-        }
-
-        # Get the md5 sum of the file we're testing, look in the right platform directory.
-        my $actualFile = join('/', sourceDir(), 'Tools', $platform, $file);
-        my $currentSum = getMD5HashForFile($actualFile);
-
-        # Get our previous record.
-        open(PREVIOUS_MD5, $path);
-        chomp(my $previousSum = <PREVIOUS_MD5>);
-        close(PREVIOUS_MD5);
-
-        if ($previousSum ne $currentSum) {
-            return 1;
-        }
-    }
-}
-
-sub saveJhbuildMd5() {
-    # Save md5sum for jhbuild-related files.saveJhbuildMd5();
-    foreach my $file (qw(jhbuildrc jhbuild.modules)) {
-        my $source = join('/', sourceDir(), "Tools", $platform, $file);
-        my $destination = join('/', getJhbuildPath(), $file);
-        open(SUM, ">$destination" . ".md5sum");
-        print SUM getMD5HashForFile($source);
-        close(SUM);
-    }
-}
-
-sub runJhbuild
-{
-    my $command = shift;
-    my @jhbuildArgs = ("./jhbuild-wrapper", "--".$platform, $command);
-    push(@jhbuildArgs, @ARGV[2..-1]);
-    system(@jhbuildArgs) == 0 or die "Running jhbuild-wrapper " . $command . " failed.\n";
-}
-
-sub cleanJhbuild()
-{
-    runJhbuild("clean");
-
-    # If the configuration changed, dependencies may have been removed.
-    # Since we lack a granular way of uninstalling those we wipe out the
-    # jhbuild root and start from scratch.
-    my $jhbuildPath = getJhbuildPath();
-    if (system("rm -rf $jhbuildPath/Root") ne 0) {
-        die "Cleaning jhbuild root failed!";
-    }
-}
-
-delete $ENV{AR_FLAGS} if exists $ENV{AR_FLAGS};
-
-chdir(relativeScriptsDir() . "/../jhbuild") or die $!;
-
-my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+" );
-
-if (-e getJhbuildPath() && jhbuildConfigurationChanged()) {
-    cleanJhbuild();
-}
-
-print "Updating " . $prettyPlatform{$platform} . " port dependencies using jhbuild...\n";
-runJhbuild("build");
-
-saveJhbuildMd5();
diff --git a/Tools/Scripts/update-webkit-localizable-strings b/Tools/Scripts/update-webkit-localizable-strings
deleted file mode 100755
index ceb25a5..0000000
--- a/Tools/Scripts/update-webkit-localizable-strings
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use warnings;
-
-use File::Basename;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-# WebKit and WebKit2 strings go into WebCore's Localizable.strings.
-my @directoriesToScan = ("Source/WebCore", "Source/WebKit/mac", "Source/WebKit/win", "Source/WebKit2", "-Source/WebCore/icu", "-Source/WebKit/mac/icu");
-my $fileToUpdate = "Source/WebCore/English.lproj/Localizable.strings";
-
-@ARGV == 0 or die "Usage: " . basename($0) . "\n";
-
-chdirWebKit();
-
-system "Tools/Scripts/extract-localizable-strings", "-", $fileToUpdate, @directoriesToScan;
diff --git a/Tools/Scripts/update-webkit-support-libs b/Tools/Scripts/update-webkit-support-libs
deleted file mode 100755
index afced1d..0000000
--- a/Tools/Scripts/update-webkit-support-libs
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2005, 2006, 2007 Apple Computer, Inc.  All rights reserved.
-# Copyright (C) Research In Motion Limited 2010. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Updates a development environment to the new WebKitSupportLibrary
-
-use strict;
-use warnings;
-
-use File::Find;
-use File::Temp ();
-use File::Spec;
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-use constant NOTAVERSION => "-1";
-
-my $sourceDir = sourceDir();
-my $file = "WebKitSupportLibrary";
-my $zipFile = "$file.zip"; 
-my $zipDirectory = toUnixPath($ENV{'WEBKITSUPPORTLIBRARIESZIPDIR'}) || $sourceDir;
-my $pathToZip = File::Spec->catfile($zipDirectory, $zipFile);
-my $webkitLibrariesDir = toUnixPath($ENV{'WEBKITLIBRARIESDIR'}) || "$sourceDir/WebKitLibraries/win";
-my $versionFile = $file . "Version";
-my $pathToVersionFile = File::Spec->catfile($webkitLibrariesDir, $versionFile);
-my $tmpRelativeDir = File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR => 1, CLEANUP => 1);
-my $tmpAbsDir = File::Spec->rel2abs($tmpRelativeDir);
-my $versionFileURL = "https://developer.apple.com/opensource/internet/$versionFile";
-
-my $extractedVersion = extractedVersion();
-
-# Check whether the extracted library is up-to-date. If it is, we don't have anything to do.
-my $expectedVersion = downloadExpectedVersionNumber();
-if ($extractedVersion ne NOTAVERSION && $extractedVersion eq $expectedVersion) {
-    print "$file is up-to-date.\n";
-    exit;
-}
-
-# Check whether the downloaded library is up-to-date. If it isn't, the user needs to download it.
-my $zipFileVersion = zipFileVersion();
-dieAndInstructToDownload("$zipFile could not be found in $zipDirectory.") if $zipFileVersion eq NOTAVERSION;
-dieAndInstructToDownload("$zipFile is out-of-date.") if $expectedVersion ne NOTAVERSION && $zipFileVersion ne $expectedVersion;
-if ($zipFileVersion eq $extractedVersion) {
-    print "Falling back to existing version of $file.\n";
-    exit;
-}
-
-my $result = system "unzip", "-q", "-d", $tmpAbsDir, $pathToZip;
-die "Couldn't unzip $zipFile." if $result;
-
-print "\nInstalling $file...\n";
-
-sub wanted
-{
-    my $relativeName = File::Spec->abs2rel($File::Find::name, "$tmpAbsDir/$file/win");
-    my $destination = "$webkitLibrariesDir/$relativeName";
-
-    if (-d $_) {
-        mkdir $destination;
-        return;
-    }
-
-    system "cp", $_, $destination;
-}
-
-File::Find::find(\&wanted, "$tmpAbsDir/$file");
-
-print "The $file has been sucessfully installed in\n $webkitLibrariesDir\n";
-exit;
-
-sub toUnixPath
-{
-    my $path = shift;
-    return unless $path;
-    chomp($path = `cygpath -u '$path'`);
-    return $path;
-}
-
-sub extractedVersion
-{
-    if (open VERSION, "<", $pathToVersionFile) {
-        chomp(my $extractedVersion = <VERSION>);
-        close VERSION;
-        return $extractedVersion;
-    }
-    return NOTAVERSION;
-}
-
-sub downloadExpectedVersionNumber
-{
-    chomp(my $expectedVersion = `curl -s --sslv3 -k $versionFileURL`);
-    return WEXITSTATUS($?) ? NOTAVERSION : $expectedVersion;
-}
-
-sub zipFileVersion
-{
-    return NOTAVERSION unless -f $pathToZip;
-    chomp(my $zipFileVersion = `unzip -p "$pathToZip" $file/win/$versionFile`);
-    return $zipFileVersion;
-}
-
-sub dieAndInstructToDownload
-{
-    my $message = shift;
-
-    die <<EOF;
-
-===============================================================================
-$message
-Please download $zipFile from:
-
-    https://developer.apple.com/opensource/internet/webkit_sptlib_agree.html
-
-and place it in:
-
-    $sourceDir
-
-Then run build-webkit again.
-===============================================================================
-
-EOF
-
-}
diff --git a/Tools/Scripts/update-webkit-wincairo-libs b/Tools/Scripts/update-webkit-wincairo-libs
deleted file mode 100755
index 52d052e..0000000
--- a/Tools/Scripts/update-webkit-wincairo-libs
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (C) 2012 Brent Fulgham <bfulgham@webkit.org>.  All rights reserved.
-# Copyright (C) 2011 Carl Lobo.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Updates a development environment to the new WebKitAuxiliaryLibrary
-
-use strict;
-use warnings;
-use FindBin;
-
-my $file = "WinCairoRequirements";
-my $zipFile = "$file.zip";
-my $winCairoLibsURL = "http://dl.dropbox.com/u/39598926/$zipFile";
-my $command = "$FindBin::Bin/update-webkit-dependency";
-
-system("perl", $command, $winCairoLibsURL, ".") == 0 or die;
diff --git a/Tools/Scripts/update-webkitefl-libs b/Tools/Scripts/update-webkitefl-libs
deleted file mode 100755
index 30b2104..0000000
--- a/Tools/Scripts/update-webkitefl-libs
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2012 Intel Corporation
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $scriptsDir = relativeScriptsDir();
-system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--efl") == 0 or die $!;
diff --git a/Tools/Scripts/update-webkitgtk-libs b/Tools/Scripts/update-webkitgtk-libs
deleted file mode 100755
index 792cc28..0000000
--- a/Tools/Scripts/update-webkitgtk-libs
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright (C) 2011 Igalia S.L.
-# Copyright (C) 2012 Intel Corporation
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $scriptsDir = relativeScriptsDir();
-system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--gtk", @ARGV) == 0 or die $!;
diff --git a/Tools/Scripts/webkit-build-directory b/Tools/Scripts/webkit-build-directory
deleted file mode 100755
index d5085b5..0000000
--- a/Tools/Scripts/webkit-build-directory
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# A script to expose WebKit's build directory detection logic to non-perl scripts.
-
-use FindBin;
-use Getopt::Long;
-
-use lib $FindBin::Bin;
-use webkitdirs;
-
-my $showConfigurationDirectory = 0;
-my $showHelp = 0;
-my $showTopLevelDirectory = 0;
-
-
-my $programName = basename($0);
-my $usage = <<EOF;
-Usage: $programName [options]
-  --configuration       Show the build directory for a specific configuration (e.g. Debug, Release.  Defaults to the active configuration set by set-webkit-configuration)
-  -h|--help             Show this help message
-  --top-level           Show the top-level build directory
-
-  --blackberry          Find the build directory for the BlackBerry port on Mac/Linux
-  --chromium            Find the build directory for the Chromium port on Mac/Win/Linux
-  --chromium-android    Find the build directory for the Chromium port on Android
-  --efl                 Find the build directory for the EFL port
-  --gtk                 Find the build directory for the GTK+ port
-  --qt                  Find the build directory for the Qt port
-  --wincairo            Find the build directory for using Cairo (rather than CoreGraphics) on Windows
-  --wince               Find the build directory for the WinCE port
-
-Either --configuration or --top-level is required.
-EOF
-
-setConfiguration(); # Figure out from the command line if we're --debug or --release or the default.
-
-# FIXME: Check if extra flags are valid or not.
-Getopt::Long::Configure('pass_through'); # Let --blackberry, etc... be handled by webkitdirs
-my $getOptionsResult = GetOptions(
-    'configuration' => \$showConfigurationDirectory,
-    'top-level' => \$showTopLevelDirectory,
-    'help|h' => \$showHelp,
-);
-
-if (!$getOptionsResult || $showHelp) {
-    print STDERR $usage;
-    exit 1;
-}
-
-if (!$showConfigurationDirectory && !$showTopLevelDirectory) {
-    print baseProductDir() . "\n";
-    print productDir() . "\n";
-} elsif ($showTopLevelDirectory) {
-    print baseProductDir() . "\n";
-} else {
-    print productDir() . "\n";
-}
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index bcd48e7..009d258 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -126,8 +126,8 @@
     $sourceDir =~ s|/+$||; # Remove trailing '/' as we would die later
 
     # walks up path checking each directory to see if it is the main WebKit project dir, 
-    # defined by containing Sources, WebCore, and WebKit
-    until ((-d "$sourceDir/Source" && -d "$sourceDir/Source/WebCore" && -d "$sourceDir/Source/WebKit") || (-d "$sourceDir/Internal" && -d "$sourceDir/OpenSource"))
+    # defined by containing Sources, core, and WebKit
+    until ((-d "$sourceDir/Source" && -d "$sourceDir/Source/core" && -d "$sourceDir/Source/WebKit") || (-d "$sourceDir/Internal" && -d "$sourceDir/OpenSource"))
     {
         if ($sourceDir !~ s|/[^/]+$||) {
             die "Could not find top level webkit directory above source directory using FindBin.\n";
@@ -806,7 +806,7 @@
     }
     if (isGtk()) {
         # WebKitGTK+ for GTK2, WebKitGTK+ for GTK3, and WebKit2 respectively.
-        my @libraries = ("libwebkitgtk-1.0", "libwebkitgtk-3.0", "libwebkit2gtk-1.0");
+        my @libraries = ("libwebkitgtk-1.0", "libwebkitgtk-3.0", "libwebkit2gtk-3.0");
         my $extension = isDarwin() ? ".dylib" : ".so";
 
         foreach $libraryName (@libraries) {
@@ -2850,15 +2850,6 @@
     return 1;
 }
 
-sub runTestWebKitAPI
-{
-    if (isAppleMacWebKit()) {
-        return runMacWebKitApp(File::Spec->catfile(productDir(), "TestWebKitAPI"));
-    }
-
-    return 1;
-}
-
 sub readRegistryString
 {
     my ($valueName) = @_;
diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm
deleted file mode 100644
index 1d7a596..0000000
--- a/Tools/Scripts/webkitperl/FeatureList.pm
+++ /dev/null
@@ -1,494 +0,0 @@
-# Copyright (C) 2012 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# A module to contain all the enable/disable feature option code.
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-BEGIN {
-   use Exporter   ();
-   our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-   $VERSION     = 1.00;
-   @ISA         = qw(Exporter);
-   @EXPORT      = qw(&getFeatureOptionList);
-   %EXPORT_TAGS = ( );
-   @EXPORT_OK   = ();
-}
-
-my (
-    $threeDRenderingSupport,
-    $accelerated2DCanvasSupport,
-    $batteryStatusSupport,
-    $blobSupport,
-    $canvasPathSupport,
-    $canvasProxySupport,
-    $channelMessagingSupport,
-    $cspNextSupport,
-    $css3ConditionalRulesSupport,
-    $css3TextSupport,
-    $css3TextLineBreakSupport,
-    $cssBoxDecorationBreakSupport,
-    $cssDeviceAdaptation,
-    $cssExclusionsSupport,
-    $cssFiltersSupport,
-    $cssImageOrientationSupport,
-    $cssImageResolutionSupport,
-    $cssImageSetSupport,
-    $cssRegionsSupport,
-    $cssShadersSupport,
-    $cssStickyPositionSupport,
-    $cssCompositingSupport,
-    $cssAnimationsTransformsUnprefixedSupport,
-    $cssVariablesSupport,
-    $customSchemeHandlerSupport,
-    $dataTransferItemsSupport,
-    $datalistSupport,
-    $detailsSupport,
-    $deviceOrientationSupport,
-    $dialogElementSupport,
-    $directoryUploadSupport,
-    $dom4EventsConstructor,
-    $downloadAttributeSupport,
-    $fileSystemSupport,
-    $filtersSupport,
-    $fontLoadEventsSupport,
-    $ftpDirSupport,
-    $fullscreenAPISupport,
-    $gamepadSupport,
-    $geolocationSupport,
-    $highDPICanvasSupport,
-    $icondatabaseSupport,
-    $iframeSeamlessSupport,
-    $indexedDatabaseSupport,
-    $inputSpeechSupport,
-    $inputTypeColorSupport,
-    $inputTypeDateSupport,
-    $inputTypeDatetimeSupport,
-    $inputTypeDatetimelocalSupport,
-    $inputTypeMonthSupport,
-    $inputTypeTimeSupport,
-    $inputTypeWeekSupport,
-    $inspectorSupport,
-    $javascriptDebuggerSupport,
-    $legacyNotificationsSupport,
-    $legacyVendorPrefixSupport,
-    $legacyWebAudioSupport,
-    $linkPrefetchSupport,
-    $linkPrerenderSupport,
-    $mathmlSupport,
-    $mediaCaptureSupport,
-    $mediaSourceSupport,
-    $mediaStatisticsSupport,
-    $mediaStreamSupport,
-    $meterTagSupport,
-    $mhtmlSupport,
-    $microdataSupport,
-    $mouseCursorScaleSupport,
-    $netscapePluginAPISupport,
-    $networkInfoSupport,
-    $nosniffSupport,
-    $notificationsSupport,
-    $orientationEventsSupport,
-    $pageVisibilityAPISupport,
-    $performanceTimelineSupport,
-    $progressTagSupport,
-    $proximityEventsSupport,
-    $quotaSupport,
-    $resolutionMediaQuerySupport,
-    $registerProtocolHandlerSupport,
-    $requestAnimationFrameSupport,
-    $resourceTimingSupport,
-    $scriptedSpeechSupport,
-    $shadowDOMSupport,
-    $sharedWorkersSupport,
-    $sqlDatabaseSupport,
-    $styleScopedSupport,
-    $suidLinuxSandbox,
-    $svgDOMObjCBindingsSupport,
-    $svgFontsSupport,
-    $svgSupport,
-    $systemMallocSupport,
-    $templateElementSupport,
-    $textAutosizingSupport,
-    $tiledBackingStoreSupport,
-    $threadedHTMLParserSupport,
-    $touchEventsSupport,
-    $touchSliderSupport,
-    $touchIconLoadingSupport,
-    $userTimingSupport,
-    $vibrationSupport,
-    $videoSupport,
-    $videoTrackSupport,
-    $webglSupport,
-    $webAudioSupport,
-    $webSocketsSupport,
-    $webTimingSupport,
-    $workersSupport,
-    $xhrTimeoutSupport,
-    $xsltSupport,
-);
-
-my @features = (
-    { option => "3d-rendering", desc => "Toggle 3D Rendering support",
-      define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() || isQt() || isGtk() || isEfl()), value => \$threeDRenderingSupport },
-
-    { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
-      define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2DCanvasSupport },
-
-    { option => "battery-status", desc => "Toggle Battery Status support",
-      define => "ENABLE_BATTERY_STATUS", default => (isEfl() || isBlackBerry()), value => \$batteryStatusSupport },
-
-    { option => "blob", desc => "Toggle Blob support",
-      define => "ENABLE_BLOB", default => (isAppleMacWebKit() || isGtk() || isChromium() || isBlackBerry() || isEfl()), value => \$blobSupport },
-
-    { option => "canvas-path", desc => "Toggle Canvas Path support",
-      define => "ENABLE_CANVAS_PATH", default => 1, value => \$canvasPathSupport },
-
-    { option => "canvas-proxy", desc => "Toggle CanvasProxy support",
-      define => "ENABLE_CANVAS_PROXY", default => 0, value => \$canvasProxySupport },
-
-    { option => "channel-messaging", desc => "Toggle Channel Messaging support",
-      define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
-
-    { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support",
-      define => "ENABLE_CSP_NEXT", default => isGtk(), value => \$cspNextSupport },
-
-    { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support",
-      define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation },
-
-    { option => "css-exclusions", desc => "Toggle CSS Exclusions support",
-      define => "ENABLE_CSS_EXCLUSIONS", default => 1, value => \$cssExclusionsSupport },
-
-    { option => "css-filters", desc => "Toggle CSS Filters support",
-      define => "ENABLE_CSS_FILTERS", default => isAppleWebKit() || isBlackBerry(), value => \$cssFiltersSupport },
-
-    { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)",
-      define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 0, value => \$css3ConditionalRulesSupport },
-
-    { option => "css3-text", desc => "Toggle CSS3 Text support",
-      define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
-
-    { option => "css3-text-line-break", desc => "Toggle CSS3 Text Line Break support",
-      define => "ENABLE_CSS3_TEXT_LINE_BREAK", default => 0, value => \$css3TextLineBreakSupport },
-
-    { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
-      define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
-
-    { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
-      define => "ENABLE_CSS_IMAGE_ORIENTATION", default => isGtk(), value => \$cssImageOrientationSupport },
-
-    { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
-      define => "ENABLE_CSS_IMAGE_RESOLUTION", default => (isBlackBerry() || isGtk()), value => \$cssImageResolutionSupport },
-
-    { option => "css-image-set", desc => "Toggle CSS image-set support",
-      define => "ENABLE_CSS_IMAGE_SET", default => (isEfl() || isGtk()), value => \$cssImageSetSupport },
-
-    { option => "css-regions", desc => "Toggle CSS Regions support",
-      define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
-
-    { option => "css-shaders", desc => "Toggle CSS Shaders support",
-      define => "ENABLE_CSS_SHADERS", default => isAppleMacWebKit(), value => \$cssShadersSupport },
-
-    { option => "css-sticky-position", desc => "Toggle CSS sticky position support",
-      define => "ENABLE_CSS_STICKY_POSITION", default => (isGtk() || isEfl()), value => \$cssStickyPositionSupport },
-
-    { option => "css-compositing", desc => "Toggle CSS Compositing support",
-      define => "ENABLE_CSS_COMPOSITING", default => isAppleWebKit(), value => \$cssCompositingSupport },
-
-    { option => "css-transforms-animations-unprefixed", desc => "Toggle support for unprefixed CSS animations and transforms",
-      define => "ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED", default => 1, value => \$cssAnimationsTransformsUnprefixedSupport },
-
-    { option => "css-variables", desc => "Toggle CSS Variable support",
-      define => "ENABLE_CSS_VARIABLES", default => (isBlackBerry() || isEfl() || isGtk()), value => \$cssVariablesSupport },
-
-    { option => "custom-scheme-handler", desc => "Toggle Custom Scheme Handler support",
-      define => "ENABLE_CUSTOM_SCHEME_HANDLER", default => (isBlackBerry() || isEfl()), value => \$customSchemeHandlerSupport },
-
-    { option => "datalist", desc => "Toggle Datalist support",
-      define => "ENABLE_DATALIST_ELEMENT", default => isEfl(), value => \$datalistSupport },
-
-    { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
-      define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
-
-    { option => "details", desc => "Toggle Details support",
-      define => "ENABLE_DETAILS_ELEMENT", default => 1, value => \$detailsSupport },
-
-    { option => "device-orientation", desc => "Toggle Device Orientation support",
-      define => "ENABLE_DEVICE_ORIENTATION", default => isBlackBerry(), value => \$deviceOrientationSupport },
-
-    { option => "dialog", desc => "Toggle Dialog Element support",
-      define => "ENABLE_DIALOG_ELEMENT", default => 0, value => \$dialogElementSupport },
-
-    { option => "directory-upload", desc => "Toggle Directory Upload support",
-      define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport },
-
-    { option => "dom4-events-constructor", desc => "Expose DOM4 Events constructors",
-      define => "ENABLE_DOM4_EVENTS_CONSTRUCTOR", default => (isAppleWebKit() || isGtk()), value => \$dom4EventsConstructor },
-
-    { option => "download-attribute", desc => "Toggle Download Attribute support",
-      define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => (isBlackBerry() || isEfl()), value => \$downloadAttributeSupport },
-
-    { option => "file-system", desc => "Toggle File System support",
-      define => "ENABLE_FILE_SYSTEM", default => isBlackBerry(), value => \$fileSystemSupport },
-
-    { option => "filters", desc => "Toggle Filters support",
-      define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl() || isBlackBerry()), value => \$filtersSupport },
-
-    { option => "font-load-events", desc => "Toggle Font Load Events support",
-      define => "ENABLE_FONT_LOAD_EVENTS", default => 0, value => \$fontLoadEventsSupport },
-
-    { option => "ftpdir", desc => "Toggle FTP Directory support",
-      define => "ENABLE_FTPDIR", default => !isWinCE(), value => \$ftpDirSupport },
-
-    { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
-      define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk() || isBlackBerry() || isQt()), value => \$fullscreenAPISupport },
-
-    { option => "gamepad", desc => "Toggle Gamepad support",
-      define => "ENABLE_GAMEPAD", default => (isEfl() || isGtk() || isQt()), value => \$gamepadSupport },
-
-    { option => "geolocation", desc => "Toggle Geolocation support",
-      define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$geolocationSupport },
-
-    { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
-      define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
-
-    { option => "icon-database", desc => "Toggle Icondatabase support",
-      define => "ENABLE_ICONDATABASE", default => 1, value => \$icondatabaseSupport },
-
-    { option => "iframe-seamless", desc => "Toggle iframe seamless attribute support",
-      define => "ENABLE_IFRAME_SEAMLESS", default => 1, value => \$iframeSeamlessSupport },
-
-    { option => "indexed-database", desc => "Toggle Indexed Database support",
-      define => "ENABLE_INDEXED_DATABASE", default => isGtk(), value => \$indexedDatabaseSupport },
-
-    { option => "input-speech", desc => "Toggle Input Speech support",
-      define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
-
-    { option => "input-type-color", desc => "Toggle Input Type Color support",
-      define => "ENABLE_INPUT_TYPE_COLOR", default => (isBlackBerry() || isEfl() || isQt()), value => \$inputTypeColorSupport },
-
-    { option => "input-type-date", desc => "Toggle Input Type Date support",
-      define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
-
-    { option => "input-type-datetime", desc => "Toggle Input Type Datetime support",
-      define => "ENABLE_INPUT_TYPE_DATETIME", default => 0, value => \$inputTypeDatetimeSupport },
-
-    { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
-      define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
-
-    { option => "input-type-month", desc => "Toggle Input Type Month support",
-      define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
-
-    { option => "input-type-time", desc => "Toggle Input Type Time support",
-      define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
-
-    { option => "input-type-week", desc => "Toggle Input Type Week support",
-      define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
-
-    { option => "inspector", desc => "Toggle Inspector support",
-      define => "ENABLE_INSPECTOR", default => !isWinCE(), value => \$inspectorSupport },
-
-    { option => "javascript-debugger", desc => "Toggle JavaScript Debugger support",
-      define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javascriptDebuggerSupport },
-
-    { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
-      define => "ENABLE_LEGACY_NOTIFICATIONS", default => isBlackBerry(), value => \$legacyNotificationsSupport },
-
-    { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
-      define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => !isChromium(), value => \$legacyVendorPrefixSupport },
-
-    { option => "legacy-web-audio", desc => "Toggle Legacy Web Audio support",
-      define => "ENABLE_LEGACY_WEB_AUDIO", default => 1, value => \$legacyWebAudioSupport },
-
-    { option => "link-prefetch", desc => "Toggle Link Prefetch support",
-      define => "ENABLE_LINK_PREFETCH", default => (isGtk() || isEfl()), value => \$linkPrefetchSupport },
-
-    { option => "link-prerender", desc => "Toggle Link Prerender support",
-      define => "ENABLE_LINK_PRERENDER", default => 0, value => \$linkPrerenderSupport },
-
-    { option => "mathml", desc => "Toggle MathML support",
-      define => "ENABLE_MATHML", default => !isBlackBerry(), value => \$mathmlSupport },
-
-    { option => "media-capture", desc => "Toggle Media Capture support",
-      define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
-
-    { option => "media-source", desc => "Toggle Media Source support",
-      define => "ENABLE_MEDIA_SOURCE", default => 0, value => \$mediaSourceSupport },
-
-    { option => "media-statistics", desc => "Toggle Media Statistics support",
-      define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
-
-    { option => "media-stream", desc => "Toggle Media Stream support",
-      define => "ENABLE_MEDIA_STREAM", default => (isChromium() || isBlackBerry()), value => \$mediaStreamSupport },
-
-    { option => "meter-tag", desc => "Toggle Meter Tag support",
-      define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterTagSupport },
-
-    { option => "mhtml", desc => "Toggle MHTML support",
-      define => "ENABLE_MHTML", default => (isGtk() || isEfl()), value => \$mhtmlSupport },
-
-    { option => "microdata", desc => "Toggle Microdata support",
-      define => "ENABLE_MICRODATA", default => (isEfl() || isBlackBerry() || isGtk()), value => \$microdataSupport },
-
-    { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
-      define => "ENABLE_MOUSE_CURSOR_SCALE", default => 0, value => \$mouseCursorScaleSupport },
-
-    { option => "navigator-content-utils", desc => "Toggle Navigator Content Utils support",
-      define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => (isBlackBerry() || isEfl()), value => \$registerProtocolHandlerSupport },
-
-    { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
-      define => "ENABLE_NETSCAPE_PLUGIN_API", default => 1, value => \$netscapePluginAPISupport },
-
-    { option => "network-info", desc => "Toggle Network Info support",
-      define => "ENABLE_NETWORK_INFO", default => (isEfl() || isBlackBerry()), value => \$networkInfoSupport },
-
-    { option => "nosniff", desc => "Toggle support for 'X-Content-Type-Options: nosniff'",
-      define => "ENABLE_NOSNIFF", default => 0, value => \$nosniffSupport },
-
-    { option => "notifications", desc => "Toggle Notifications support",
-      define => "ENABLE_NOTIFICATIONS", default => isBlackBerry(), value => \$notificationsSupport },
-
-    { option => "orientation-events", desc => "Toggle Orientation Events support",
-      define => "ENABLE_ORIENTATION_EVENTS", default => isBlackBerry(), value => \$orientationEventsSupport },
-
-    { option => "page-visibility-api", desc => "Toggle Page Visibility API support",
-      define => "ENABLE_PAGE_VISIBILITY_API", default => (isBlackBerry() || isEfl()), value => \$pageVisibilityAPISupport },
-
-    { option => "performance-timeline", desc => "Toggle Performance Timeline support",
-      define => "ENABLE_PERFORMANCE_TIMELINE", default => isGtk(), value => \$performanceTimelineSupport },
-
-    { option => "progress-tag", desc => "Toggle Progress Tag support",
-      define => "ENABLE_PROGRESS_ELEMENT", default => 1, value => \$progressTagSupport },
-
-    { option => "proximity-events", desc => "Toggle Proximity Events support",
-      define => "ENABLE_PROXIMITY_EVENTS", default => 0, value => \$proximityEventsSupport },
-
-    { option => "quota", desc => "Toggle Quota support",
-      define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
-
-    { option => "resolution-media-query", desc => "Toggle resolution media query support",
-      define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => (isEfl() || isQt()), value => \$resolutionMediaQuerySupport },
-
-    { option => "resource-timing", desc => "Toggle Resource Timing support",
-      define => "ENABLE_RESOURCE_TIMING", default => isGtk(), value => \$resourceTimingSupport },
-
-    { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
-      define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl() || isBlackBerry()), value => \$requestAnimationFrameSupport },
-
-    { option => "scripted-speech", desc => "Toggle Scripted Speech support",
-      define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
-
-    { option => "shadow-dom", desc => "Toggle Shadow DOM support",
-      define => "ENABLE_SHADOW_DOM", default => (isGtk() || isEfl()), value => \$shadowDOMSupport },
-
-    { option => "shared-workers", desc => "Toggle Shared Workers support",
-      define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$sharedWorkersSupport },
-
-    { option => "sql-database", desc => "Toggle SQL Database support",
-      define => "ENABLE_SQL_DATABASE", default => 1, value => \$sqlDatabaseSupport },
-
-    { option => "style-scoped", desc => "Toggle Style Scoped support",
-      define => "ENABLE_STYLE_SCOPED", default => (isBlackBerry() || isGtk()), value => \$styleScopedSupport },
-
-    { option => "suid-linux-sandbox", desc => "Toggle suid sandbox for linux",
-      define => "ENABLE_SUID_SANDBOX_LINUX", default => 0, value => \$suidLinuxSandbox },
-
-    { option => "svg", desc => "Toggle SVG support",
-      define => "ENABLE_SVG", default => 1, value => \$svgSupport },
-
-    { option => "svg-dom-objc-bindings", desc => "Toggle SVG DOM ObjC Bindings support",
-      define => "ENABLE_SVG_DOM_OBJC_BINDINGS", default => isAppleMacWebKit(), value => \$svgDOMObjCBindingsSupport },
-
-    { option => "svg-fonts", desc => "Toggle SVG Fonts support",
-      define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
-
-    { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
-      define => "USE_SYSTEM_MALLOC", default => (isBlackBerry() || isWinCE()), value => \$systemMallocSupport },
-
-    { option => "template-element", desc => "Toggle HTMLTemplateElement support",
-      define => "ENABLE_TEMPLATE_ELEMENT", default => (isEfl() || isGtk()), value => \$templateElementSupport },
-
-    { option => "text-autosizing", desc => "Toggle Text Autosizing support",
-      define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },
-
-    { option => "tiled-backing-store", desc => "Toggle Tiled Backing Store support",
-      define => "WTF_USE_TILED_BACKING_STORE", default => (isQt() || isEfl()), value => \$tiledBackingStoreSupport },
-
-    { option => "threaded-html-parser", desc => "Toggle threaded HTML parser support",
-      define => "ENABLE_THREADED_HTML_PARSER", default => isChromium(), value => \$threadedHTMLParserSupport },
-
-    { option => "touch-events", desc => "Toggle Touch Events support",
-      define => "ENABLE_TOUCH_EVENTS", default => (isQt() || isBlackBerry() || isEfl()), value => \$touchEventsSupport },
-
-    { option => "touch-slider", desc => "Toggle Touch Slider support",
-      define => "ENABLE_TOUCH_SLIDER", default => isBlackBerry(), value => \$touchSliderSupport },
-
-    { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
-      define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
-
-    { option => "user-timing", desc => "Toggle User Timing support",
-      define => "ENABLE_USER_TIMING", default => isGtk(), value => \$userTimingSupport },
-
-    { option => "vibration", desc => "Toggle Vibration support",
-      define => "ENABLE_VIBRATION", default => (isEfl() || isBlackBerry()), value => \$vibrationSupport },
-
-    { option => "video", desc => "Toggle Video support",
-      define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$videoSupport },
-
-    { option => "video-track", desc => "Toggle Video Track support",
-      define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl() || isBlackBerry()), value => \$videoTrackSupport },
-
-    { option => "webgl", desc => "Toggle WebGL support",
-      define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isGtk() || isEfl()), value => \$webglSupport },
-
-    { option => "web-audio", desc => "Toggle Web Audio support",
-      define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
-
-    { option => "web-sockets", desc => "Toggle Web Sockets support",
-      define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
-
-    { option => "web-timing", desc => "Toggle Web Timing support",
-      define => "ENABLE_WEB_TIMING", default => (isBlackBerry() || isGtk() || isEfl()), value => \$webTimingSupport },
-
-    { option => "workers", desc => "Toggle Workers support",
-      define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$workersSupport },
-
-    { option => "xhr-timeout", desc => "Toggle XHR Timeout support",
-      define => "ENABLE_XHR_TIMEOUT", default => (isEfl() || isGtk() || isAppleMacWebKit()), value => \$xhrTimeoutSupport },
-
-    { option => "xslt", desc => "Toggle XSLT support",
-      define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
-);
-
-sub getFeatureOptionList()
-{
-    return @features;
-}
-
-1;
diff --git a/Tools/Scripts/webkitperl/features.pm b/Tools/Scripts/webkitperl/features.pm
deleted file mode 100644
index e546c39..0000000
--- a/Tools/Scripts/webkitperl/features.pm
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved
-# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
-# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Module to share code to detect the existance of features in built binaries.
-
-use strict;
-use warnings;
-
-use FindBin;
-use lib $FindBin::Bin;
-use webkitdirs;
-
-BEGIN {
-   use Exporter   ();
-   our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-   $VERSION     = 1.00;
-   @ISA         = qw(Exporter);
-   @EXPORT      = qw(&checkWebCoreFeatureSupport);
-   %EXPORT_TAGS = ( );
-   @EXPORT_OK   = ();
-}
-
-sub libraryContainsSymbol($$)
-{
-    my ($path, $symbol) = @_;
-
-    if (isCygwin() or isWindows()) {
-        # FIXME: Implement this for Windows.
-        return 0;
-    }
-
-    my $foundSymbol = 0;
-    if (-e $path) {
-        open NM, "-|", nmPath(), $path or die;
-        while (<NM>) {
-            $foundSymbol = 1 if /$symbol/; # FIXME: This should probably check for word boundaries before/after the symbol name.
-        }
-        close NM;
-    }
-    return $foundSymbol;
-}
-
-sub hasFeature($$)
-{
-    my ($featureName, $path) = @_;
-    my %symbolForFeature = (
-        "MathML" => "MathMLElement",
-        "SVG" => "SVGDefsElement", # We used to look for SVGElement but isSVGElement exists (and would match) in --no-svg builds.
-        "Accelerated Compositing" => "GraphicsLayer",
-        "3D Rendering" => "WebCoreHas3DRendering",
-        "3D Canvas" => "WebGLShader",
-        "MHTML" => "MHTMLArchive"
-    );
-    my $symbolName = $symbolForFeature{$featureName};
-    die "Unknown feature: $featureName" unless $symbolName;
-    return libraryContainsSymbol($path, $symbolName);
-}
-
-sub checkWebCoreFeatureSupport($$)
-{
-    my ($feature, $required) = @_;
-    my $libraryName = "WebCore";
-    my $path = builtDylibPathForName($libraryName);
-    my $hasFeature = hasFeature($feature, $path);
-    if ($required && !$hasFeature) {
-        die "$libraryName at \"$path\" does not include $hasFeature support.  See build-webkit --help\n";
-    }
-    return $hasFeature;
-}
-
-1;
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl
deleted file mode 100644
index df29d47..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/parser_unittests.pl
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Copyright (C) 2011 Google Inc.  All rights reserved.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-
-# This script tests the parser of prepare-ChangeLog (i.e. get_function_line_ranges_for_XXXX()).
-# This script runs the unittests specified in @testFiles.
-
-use strict;
-use warnings;
-
-use Data::Dumper;
-use File::Basename;
-use File::Spec;
-use File::Temp qw(tempfile);
-use FindBin;
-use Getopt::Long;
-use Test::More;
-use lib File::Spec->catdir($FindBin::Bin, "..");
-use LoadAsModule qw(PrepareChangeLog prepare-ChangeLog);
-
-sub captureOutput($);
-sub convertAbsolutepathToWebKitPath($);
-
-my %testFiles = ("perl_unittests.pl" => "get_function_line_ranges_for_perl",
-                 "python_unittests.py" => "get_function_line_ranges_for_python",
-                 "java_unittests.java" => "get_function_line_ranges_for_java",
-                 "cpp_unittests.cpp" => "get_function_line_ranges_for_cpp",
-                 "javascript_unittests.js" => "get_function_line_ranges_for_javascript",
-                 "css_unittests.css" => "get_selector_line_ranges_for_css",
-                 "css_unittests_warning.css" => "get_selector_line_ranges_for_css",
-                );
-
-my $resetResults;
-GetOptions('reset-results' => \$resetResults);
-
-my @testSet;
-foreach my $testFile (sort keys %testFiles) {
-    my $basename = $testFile;
-    $basename = $1 if $basename =~ /^(.*)\.[^\.]*$/;
-    push @testSet, {method => $testFiles{$testFile},
-                    inputFile => File::Spec->catdir($FindBin::Bin, "resources", $testFile),
-                    expectedFile => File::Spec->catdir($FindBin::Bin, "resources", $basename . "-expected.txt")};
-}
-
-plan(tests => scalar @testSet);
-foreach my $test (@testSet) {
-    open FH, "< $test->{inputFile}" or die "Cannot open $test->{inputFile}: $!";
-    my $parser = eval "\\&PrepareChangeLog::$test->{method}";
-    my @ranges;
-    my ($stdout, $stderr) = captureOutput(sub { @ranges = $parser->(\*FH, $test->{inputFile}); });
-    close FH;
-    $stdout = convertAbsolutepathToWebKitPath($stdout);
-    $stderr = convertAbsolutepathToWebKitPath($stderr);
-
-    my %actualOutput = (ranges => \@ranges, stdout => $stdout, stderr => $stderr);
-    if ($resetResults) {
-        open FH, "> $test->{expectedFile}" or die "Cannot open $test->{expectedFile}: $!";
-        print FH Data::Dumper->new([\%actualOutput])->Terse(1)->Indent(1)->Dump();
-        close FH;
-        next;
-    }
-
-    open FH, "< $test->{expectedFile}" or die "Cannot open $test->{expectedFile}: $!";
-    local $/ = undef;
-    my $expectedOutput = eval <FH>;
-    close FH;
-
-    is_deeply(\%actualOutput, $expectedOutput, "Tests $test->{inputFile}");
-}
-
-sub captureOutput($)
-{
-    my ($targetMethod) = @_;
-
-    my ($stdoutFH, $stdoutFileName) = tempfile();
-    my ($stderrFH, $stderrFileName) = tempfile();
-
-    open OLDSTDOUT, ">&", \*STDOUT or die "Cannot dup STDOUT: $!";
-    open OLDSTDERR, ">&", \*STDERR or die "Cannot dup STDERR: $!";
-
-    open STDOUT, ">&", $stdoutFH or die "Cannot redirect STDOUT: $!";
-    open STDERR, ">&", $stderrFH or die "Cannot redirect STDERR: $!";
-
-    &$targetMethod();
-
-    close STDOUT;
-    close STDERR;
-
-    open STDOUT, ">&OLDSTDOUT" or die "Cannot dup OLDSTDOUT: $!";
-    open STDERR, ">&OLDSTDERR" or die "Cannot dup OLDSTDERR: $!";
-
-    close OLDSTDOUT;
-    close OLDSTDERR;
-
-    seek $stdoutFH, 0, 0;
-    seek $stderrFH, 0, 0;
-    local $/ = undef;
-    my $stdout = <$stdoutFH>;
-    my $stderr = <$stderrFH>;
-
-    close $stdoutFH;
-    close $stderrFH;
-
-    unlink $stdoutFileName or die "Cannot unlink $stdoutFileName: $!";
-    unlink $stderrFileName or die "Cannot unlink $stderrFileName: $!";
-    return ($stdout, $stderr);
-}
-
-sub convertAbsolutepathToWebKitPath($)
-{
-    my $string = shift;
-    my $sourceDir = LoadAsModule::sourceDir();
-    $sourceDir .= "/" unless $sourceDir =~ m-/$-;
-    $string =~ s/$sourceDir//g;
-    return $string;
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt
deleted file mode 100644
index d94b074..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests-expected.txt
+++ /dev/null
@@ -1,356 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '20',
-      '22',
-      'func1'
-    ],
-    [
-      '24',
-      '27',
-      'func2'
-    ],
-    [
-      '29',
-      '29',
-      'func3'
-    ],
-    [
-      '33',
-      '36',
-      'func5'
-    ],
-    [
-      '44',
-      '46',
-      'func6'
-    ],
-    [
-      '52',
-      '54',
-      'func7'
-    ],
-    [
-      '58',
-      '60',
-      'func8'
-    ],
-    [
-      '62',
-      '64',
-      'func9'
-    ],
-    [
-      '67',
-      '69',
-      'func10'
-    ],
-    [
-      '76',
-      '78',
-      'func11'
-    ],
-    [
-      '85',
-      '87',
-      'func12'
-    ],
-    [
-      '89',
-      '91',
-      'func13'
-    ],
-    [
-      '93',
-      '97',
-      'func14'
-    ],
-    [
-      '99',
-      '102',
-      'func15'
-    ],
-    [
-      '104',
-      '106',
-      'funcOverloaded'
-    ],
-    [
-      '108',
-      '110',
-      'funcOverloaded'
-    ],
-    [
-      '112',
-      '114',
-      'funcOverloaded'
-    ],
-    [
-      '116',
-      '118',
-      'Class::func16'
-    ],
-    [
-      '120',
-      '122',
-      'Class1::Class2::func17'
-    ],
-    [
-      '124',
-      '126',
-      'Class2::func18'
-    ],
-    [
-      '128',
-      '130',
-      'Class2::func19'
-    ],
-    [
-      '132',
-      '134',
-      'Class2::func20'
-    ],
-    [
-      '136',
-      '138',
-      'Class2::func21'
-    ],
-    [
-      '140',
-      '142',
-      'Class2::func22'
-    ],
-    [
-      '144',
-      '146',
-      'func23'
-    ],
-    [
-      '149',
-      '151',
-      'func24'
-    ],
-    [
-      '153',
-      '155',
-      'Class2::func25'
-    ],
-    [
-      '158',
-      '159',
-      'Class1'
-    ],
-    [
-      '162',
-      '164',
-      'Class1::func26'
-    ],
-    [
-      '167',
-      '169',
-      'Class2::func27'
-    ],
-    [
-      '173',
-      '175',
-      'Class3::func28'
-    ],
-    [
-      '179',
-      '182',
-      'Class7::operator+'
-    ],
-    [
-      '185',
-      '187',
-      'Class100::Class100'
-    ],
-    [
-      '189',
-      '191',
-      'Class101::~Class101'
-    ],
-    [
-      '193',
-      '196',
-      'Class102::Class102'
-    ],
-    [
-      '198',
-      '201',
-      'Class103::Class103'
-    ],
-    [
-      '204',
-      '205',
-      'Struct1'
-    ],
-    [
-      '208',
-      '210',
-      'Struct1::func29'
-    ],
-    [
-      '213',
-      '215',
-      'Struct2::func30'
-    ],
-    [
-      '219',
-      '219',
-      'NameSpace1'
-    ],
-    [
-      '220',
-      '222',
-      'NameSpace1::func30'
-    ],
-    [
-      '223',
-      '223',
-      'NameSpace1'
-    ],
-    [
-      '228',
-      '228',
-      'NameSpace2'
-    ],
-    [
-      '229',
-      '231',
-      'NameSpace1::NameSpace2::func31'
-    ],
-    [
-      '232',
-      '232',
-      'NameSpace2'
-    ],
-    [
-      '237',
-      '240',
-      'Class104'
-    ],
-    [
-      '244',
-      '249',
-      'Class105'
-    ],
-    [
-      '253',
-      '254',
-      'Class106'
-    ],
-    [
-      '255',
-      '259',
-      'Class106::func32'
-    ],
-    [
-      '260',
-      '261',
-      'Class106'
-    ],
-    [
-      '262',
-      '266',
-      'Class106::func33'
-    ],
-    [
-      '267',
-      '268',
-      'Class106'
-    ],
-    [
-      '272',
-      '273',
-      'NameSpace3'
-    ],
-    [
-      '275',
-      '276',
-      'NameSpace4'
-    ],
-    [
-      '278',
-      '279',
-      'NameSpace3'
-    ],
-    [
-      '283',
-      '284',
-      'NameSpace5'
-    ],
-    [
-      '286',
-      '287',
-      'NameSpace6'
-    ],
-    [
-      '289',
-      '290',
-      'Class107'
-    ],
-    [
-      '291',
-      '295',
-      'NameSpace5::NameSpace6::Class107::func34'
-    ],
-    [
-      '296',
-      '297',
-      'Class107'
-    ],
-    [
-      '299',
-      '300',
-      'NameSpace6'
-    ],
-    [
-      '302',
-      '303',
-      'NameSpace5'
-    ],
-    [
-      '307',
-      '307',
-      'Class108'
-    ],
-    [
-      '308',
-      '320',
-      'Class108::func35'
-    ],
-    [
-      '321',
-      '321',
-      'Class108'
-    ],
-    [
-      '340',
-      '354',
-      'NameSpace7'
-    ],
-    [
-      '356',
-      '369',
-      'NameSpace8'
-    ],
-    [
-      '371',
-      '371',
-      'NameSpace7'
-    ],
-    [
-      '373',
-      '386',
-      'Class109'
-    ],
-    [
-      '388',
-      '388',
-      'NameSpace7'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp
deleted file mode 100644
index 015a694..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/cpp_unittests.cpp
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-void func1()
-{
-}
-
-void func2()
-{
-    return 123;
-}
-
-void func3() { return 123; }
-
-void func4();
-
-void func5()
-{
-    /* comment */
-}
-
-/*
-void funcInsideComment()
-{
-}
-*/
-
-void func6()
-{
-}
-
-#define MACRO 123 \
-    456 \
-    789
-
-void func7()
-{
-}
-
-#if 1 || 1 || \
-    1 || 1 || 1
-void func8()
-{
-}
-#else
-void func9()
-{
-}
-#endif
-
-void func10()
-{
-}
-
-std::string str = "abcde"
-"void funcInsideDoubleQuotedString()"
-"{"
-"}";
-
-void func11()
-{
-}
-
-std::string str = 'abcde'
-'void funcInsideSingleQuotedString()'
-'{'
-'}';
-
-void func12(int a)
-{
-}
-
-void func13(int a, int b, int c)
-{
-}
-
-void func14(int a, int b,
-            int c, int d
-            , int e, int f)
-{
-}
-
-void func15
-    (int a, int b)
-{
-}
-
-void funcOverloaded()
-{
-}
-
-void funcOverloaded(int a)
-{
-}
-
-void funcOverloaded(float a)
-{
-}
-
-void Class::func16()
-{
-}
-
-void Class1::Class2::func17()
-{
-}
-
-static void Class2::func18()
-{
-}
-
-inline void Class2::func19()
-{
-}
-
-const void Class2::func20()
-{
-}
-
-Class1::Type Class2::func21()
-{
-}
-
-inline static const Class1::Type Class2::func22()
-{
-}
-
-template<class T> void func23(T t)
-{
-}
-
-template<class T>
-void func24(T t)
-{
-}
-
-inline static Class1::Type Class2::func25()
-{
-}
-
-class Class1 {
-public:
-    void func26();
-};
-
-void Class1::func26()
-{
-}
-
-class Class2 {
-    void func27()
-    {
-    }
-};
-
-class Class3 : public Class4, Class5, Class6 {
-    void func28()
-    {
-    }
-};
-
-class Class7 {
-    int operator+()
-    {
-        return 123;
-    }
-};
-
-Class100::Class100()
-{
-}
-
-Class101::~Class101()
-{
-}
-
-Class102::Class102() :
-    member(1), member(2)
-{
-}
-
-Class103::Class103()
-    : member(1), member(2)
-{
-}
-
-struct Struct1 {
-public:
-    void func29();
-};
-
-void Struct1::func29()
-{
-}
-
-struct Struct2 {
-    void func30()
-    {
-    }
-};
-
-namespace NameSpace1 {
-
-void func30()
-{
-}
-
-}
-
-namespace NameSpace1 {
-namespace NameSpace2 {
-
-void func31()
-{
-}
-
-}
-}
-
-class Class104 {
-    int a;
-    int b;
-    int c;
-    int d;
-};
-
-class Class105 {
-public:
-    int a;
-    int b;
-private:
-    int c;
-    int d;
-};
-
-class Class106 {
-    int a;
-    int b;
-    void func32()
-    {
-        int c;
-        int d;
-    }
-    int e;
-    int f;
-    void func33()
-    {
-        int g;
-        int h;
-    }
-    int i;
-    int j;
-};
-
-namespace NameSpace3 {
-int a;
-int b;
-namespace NameSpace4 {
-int c;
-int d;
-};
-int e;
-int f;
-};
-
-namespace NameSpace5 {
-int a;
-int b;
-namespace NameSpace6 {
-int c;
-int d;
-class Class107 {
-    int e;
-    int f;
-    void func34()
-    {
-        int g;
-        int h;
-    }
-    int i;
-    int j;
-};
-int k;
-int ll;
-};
-int m;
-int n;
-};
-
-class Class108 {
-    int a;
-    void func35()
-    {
-        int b;
-        if (1) {
-            int c;
-            for (;;) {
-                int d;
-                int e;
-            }
-            int f;
-        }
-        int g;
-    }
-    int h;
-};
-
-int a[] = { };
-int a[] = {
-};
-int a[] = { 1, 2, 3 };
-int a[] = {
-    1,
-    2,
-    3
-};
-int a[3] = { 1, 2, 3 };
-int a[][3] = { {1, 2, 3}, {4, 5, 6} };
-int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
-extern int a[];
-char a[4] = "test";
-
-namespace NameSpace7 {
-int a[] = { };
-int a[] = {
-};
-int a[] = { 1, 2, 3 };
-int a[] = {
-    1,
-    2,
-    3
-};
-int a[3] = { 1, 2, 3 };
-int a[][3] = { {1, 2, 3}, {4, 5, 6} };
-int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
-extern int a[];
-char a[4] = "test";
-
-namespace NameSpace8 {
-int a[] = { };
-int a[] = {
-};
-int a[] = { 1, 2, 3 };
-int a[] = {
-    1,
-    2,
-    3
-};
-int a[3] = { 1, 2, 3 };
-int a[][3] = { {1, 2, 3}, {4, 5, 6} };
-int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
-extern int a[];
-char a[4] = "test";
-};
-
-class Class109 {
-    int a[] = { };
-    int a[] = {
-    };
-    int a[] = { 1, 2, 3 };
-    int a[] = {
-        1,
-        2,
-        3
-    };
-    int a[3] = { 1, 2, 3 };
-    int a[][3] = { {1, 2, 3}, {4, 5, 6} };
-    int a[2][3] = { {1, 2, 3}, {4, 5, 6} };
-    extern int a[];
-    char a[4] = "test";
-};
-
-};
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests-expected.txt
deleted file mode 100644
index cacd783..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests-expected.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '20',
-      '21',
-      'element1'
-    ],
-    [
-      '23',
-      '23',
-      'element2'
-    ],
-    [
-      '25',
-      '27',
-      'element3'
-    ],
-    [
-      '29',
-      '30',
-      'element4.p'
-    ],
-    [
-      '32',
-      '33',
-      'element5.p.q.r.s'
-    ],
-    [
-      '35',
-      '36',
-      'element6#p'
-    ],
-    [
-      '38',
-      '39',
-      'element7 element8'
-    ],
-    [
-      '41',
-      '42',
-      'element9.p element10.q'
-    ],
-    [
-      '44',
-      '45',
-      'element11#p element12#q'
-    ],
-    [
-      '47',
-      '48',
-      'element13, element14'
-    ],
-    [
-      '50',
-      '51',
-      '.p'
-    ],
-    [
-      '53',
-      '55',
-      '#p'
-    ],
-    [
-      '57',
-      '58',
-      '.p element15 #q element16.r element17#s'
-    ],
-    [
-      '60',
-      '61',
-      'element18:target'
-    ],
-    [
-      '63',
-      '65',
-      'element19'
-    ],
-    [
-      '67',
-      '69',
-      'element20'
-    ],
-    [
-      '71',
-      '74',
-      'element21'
-    ],
-    [
-      '76',
-      '79',
-      'element22'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests.css b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests.css
deleted file mode 100644
index 4bd172e..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests.css
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-element1 {
-}
-
-element2 { }
-
-element3
-{
-}
-
-element4.p {
-}
-
-element5.p.q.r.s {
-}
-
-element6#p {
-}
-
-element7 element8 {
-}
-
-element9.p element10.q {
-}
-
-element11#p element12#q {
-}
-
-element13, element14 {
-}
-
-.p {
-}
-
-#p {
-
-}
-
-.p element15 #q element16.r element17#s {
-}
-
-element18:target {
-}
-
-element19 {
-    property1: 123
-}
-
-element20 {
-    property1: 123;
-}
-
-element21 {
-    property1: 123;
-    property2: 456;
-}
-
-element22 {
-    property1: 123;
-    /* comment */
-}
-
-/*
-elementInsideComment {
-    property1: 123;
-}
-*/
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning-expected.txt
deleted file mode 100644
index 27a5399..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning-expected.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-  'stderr' => 'mismatched comment found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched comment found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched comment found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched brace found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched brace found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched brace found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched brace found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-mismatched brace found in Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
-',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '20',
-      '22',
-      'element1'
-    ],
-    [
-      '24',
-      '26',
-      'element2'
-    ],
-    [
-      '28',
-      '30',
-      'element3'
-    ],
-    [
-      '32',
-      '33',
-      'element4'
-    ],
-    [
-      0,
-      '34',
-      ''
-    ],
-    [
-      '36',
-      '38',
-      'element5'
-    ],
-    [
-      '40',
-      '41',
-      'element6'
-    ],
-    [
-      0,
-      '42',
-      ''
-    ],
-    [
-      0,
-      '47',
-      ''
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
deleted file mode 100644
index 41b7b67..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-element1 {
-    /* comment mismatched */ */
-}
-
-element2 {
-    */ /* comment mismatched */
-}
-
-element3 {
-    */
-}
-
-element4 {
-    { } /* brace mismatched */
-}
-
-element5 {
-    { /* brace mismatched */
-}
-
-element6 {
-    } /* brace mismatched */
-}
-
-{
-element7 {
-    /* brace mismatched */
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests-expected.txt
deleted file mode 100644
index 6f37c67..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests-expected.txt
+++ /dev/null
@@ -1,321 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '20',
-      '26',
-      'Simple'
-    ],
-    [
-      '26',
-      '28',
-      'Simple.func1'
-    ],
-    [
-      '29',
-      '30',
-      'Simple'
-    ],
-    [
-      '30',
-      '33',
-      'Simple.func2'
-    ],
-    [
-      '34',
-      '34',
-      'Simple'
-    ],
-    [
-      '35',
-      '37',
-      'Simple.func3'
-    ],
-    [
-      '38',
-      '38',
-      'Simple'
-    ],
-    [
-      '39',
-      '39',
-      'Simple.func4'
-    ],
-    [
-      '40',
-      '41',
-      'Simple'
-    ],
-    [
-      '41',
-      '44',
-      'Simple.func5'
-    ],
-    [
-      '45',
-      '52',
-      'Simple'
-    ],
-    [
-      '52',
-      '54',
-      'Simple.func6'
-    ],
-    [
-      '55',
-      '56',
-      'Simple'
-    ],
-    [
-      '56',
-      '58',
-      'Simple.func7'
-    ],
-    [
-      '59',
-      '62',
-      'Simple'
-    ],
-    [
-      '60',
-      '64',
-      'Simple.func8'
-    ],
-    [
-      '65',
-      '67',
-      'Simple'
-    ],
-    [
-      '66',
-      '69',
-      'Simple.func9'
-    ],
-    [
-      '70',
-      '71',
-      'Simple'
-    ],
-    [
-      '71',
-      '73',
-      'Simple.func10'
-    ],
-    [
-      '74',
-      '75',
-      'Simple'
-    ],
-    [
-      '75',
-      '77',
-      'Simple.funcOverloaded'
-    ],
-    [
-      '78',
-      '79',
-      'Simple'
-    ],
-    [
-      '79',
-      '81',
-      'Simple.funcOverloaded'
-    ],
-    [
-      '82',
-      '83',
-      'Simple'
-    ],
-    [
-      '83',
-      '85',
-      'Simple.funcOverloaded'
-    ],
-    [
-      '86',
-      '87',
-      'Simple'
-    ],
-    [
-      '87',
-      '89',
-      'Simple.func11'
-    ],
-    [
-      '90',
-      '91',
-      'Simple'
-    ],
-    [
-      '91',
-      '93',
-      'Simple.func12'
-    ],
-    [
-      '94',
-      '95',
-      'Simple'
-    ],
-    [
-      '95',
-      '97',
-      'Simple.func13'
-    ],
-    [
-      '98',
-      '99',
-      'Simple'
-    ],
-    [
-      '99',
-      '101',
-      'Simple.func14'
-    ],
-    [
-      '102',
-      '103',
-      'Simple'
-    ],
-    [
-      '103',
-      '105',
-      'Simple.func15'
-    ],
-    [
-      '106',
-      '107',
-      'Simple'
-    ],
-    [
-      '107',
-      '109',
-      'Simple.func16'
-    ],
-    [
-      '110',
-      '111',
-      'Simple'
-    ],
-    [
-      '111',
-      '113',
-      'Simple.func17'
-    ],
-    [
-      '114',
-      '115',
-      'Simple'
-    ],
-    [
-      '115',
-      '117',
-      'Simple.func18'
-    ],
-    [
-      '118',
-      '119',
-      'Simple'
-    ],
-    [
-      '119',
-      '121',
-      'Simple.func19'
-    ],
-    [
-      '122',
-      '123',
-      'Simple'
-    ],
-    [
-      '123',
-      '125',
-      'Simple.func20'
-    ],
-    [
-      '126',
-      '127',
-      'Simple'
-    ],
-    [
-      '127',
-      '129',
-      'Simple.func21'
-    ],
-    [
-      '130',
-      '130',
-      'Simple'
-    ],
-    [
-      '135',
-      '137',
-      'Derived1'
-    ],
-    [
-      '137',
-      '139',
-      'Derived1.Derived1'
-    ],
-    [
-      '140',
-      '141',
-      'Derived1'
-    ],
-    [
-      '141',
-      '143',
-      'Derived1.func22'
-    ],
-    [
-      '144',
-      '144',
-      'Derived1'
-    ],
-    [
-      '146',
-      '148',
-      'Interface1'
-    ],
-    [
-      '150',
-      '154',
-      'Interface2'
-    ],
-    [
-      '154',
-      '156',
-      'Interface2.func23'
-    ],
-    [
-      '157',
-      '157',
-      'Interface2'
-    ],
-    [
-      '159',
-      '161',
-      'Derived2'
-    ],
-    [
-      '161',
-      '163',
-      'Derived2.Derived2'
-    ],
-    [
-      '164',
-      '165',
-      'Derived2'
-    ],
-    [
-      '165',
-      '167',
-      'Derived2.func23'
-    ],
-    [
-      '168',
-      '168',
-      'Derived2'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests.java b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests.java
deleted file mode 100644
index ebee914..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/java_unittests.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-public class Simple
-{
-    int a;
-    String b;
-    final int c = 12345;
-
-    void func1()
-    {
-    }
-
-    void func2()
-    {
-        return 123;
-    }
-
-    void func3() {
-        return 123;
-    }
-
-    void func4() { return 123; }
-
-    void func5()
-    {
-        /* comment */
-    }
-
-    /*
-      void funcInsideComment()
-      {
-      }
-    */
-
-    void func6(int a)
-    {
-    }
-
-    void func7(int a, int b, int c)
-    {
-    }
-
-    void func8(int a, int b,
-               int c, int d
-               , int e, int f)
-    {
-    }
-
-    void func9
-        (int a, int b)
-    {
-    }
-
-    LinkedList func10()
-    {
-    }
-
-    void funcOverloaded()
-    {
-    }
-
-    void funcOverloaded(int a)
-    {
-    }
-
-    void funcOverloaded(float a)
-    {
-    }
-
-    static void func11()
-    {
-    }
-
-    public void func12()
-    {
-    }
-
-    protected void func13()
-    {
-    }
-
-    private void func14()
-    {
-    }
-
-    static void func15()
-    {
-    }
-
-    final void func16()
-    {
-    }
-
-    abstract void func17()
-    {
-    }
-
-    synchronized void func18()
-    {
-    }
-
-    final static public synchronized void func19()
-    {
-    }
-
-    void func20() throws IOException
-    {
-    }
-
-    void func21() throws IOException, ArithmeticException
-    {
-    }
-}
-
-import java.util.*;
-import java.math.*;
-
-class Derived1 extends Base
-{
-    public Derived1()
-    {
-    }
-
-    public func22()
-    {
-    }
-}
-
-interface Interface1
-{
-}
-
-interface Interface2
-{
-    int a;
-
-    void func23()
-    {
-    }
-}
-
-class Derived2 extends Base interface Interface1, Interface2
-{
-    public Derived2()
-    {
-    }
-
-    public func23()
-    {
-    }
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests-expected.txt
deleted file mode 100644
index 35a3080..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests-expected.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '20',
-      '22',
-      'func1'
-    ],
-    [
-      '24',
-      '25',
-      'func2'
-    ],
-    [
-      '27',
-      '27',
-      'func3'
-    ],
-    [
-      '29',
-      '32',
-      'func4'
-    ],
-    [
-      '34',
-      '37',
-      'func5'
-    ],
-    [
-      '39',
-      '42',
-      'func6'
-    ],
-    [
-      '50',
-      '52',
-      'func7'
-    ],
-    [
-      '56',
-      '58',
-      'func8'
-    ],
-    [
-      '62',
-      '64',
-      'func9'
-    ],
-    [
-      '66',
-      '68',
-      'func10'
-    ],
-    [
-      '70',
-      '73',
-      'func11'
-    ],
-    [
-      '75',
-      '79',
-      'func12'
-    ],
-    [
-      '81',
-      '83',
-      'funcOverloaded'
-    ],
-    [
-      '85',
-      '87',
-      'funcOverloaded'
-    ],
-    [
-      '89',
-      '91',
-      'funcOverloaded'
-    ],
-    [
-      '94',
-      '96',
-      'Func1.prototype.get x1'
-    ],
-    [
-      '98',
-      '101',
-      'Func1.prototype.get x2'
-    ],
-    [
-      '103',
-      '105',
-      'Func1.prototype.set x1'
-    ],
-    [
-      '107',
-      '110',
-      'Func1.prototype.set x3'
-    ],
-    [
-      '114',
-      '116',
-      'Func2.prototype.func13'
-    ],
-    [
-      '118',
-      '120',
-      'Func2.prototype.func14'
-    ],
-    [
-      '122',
-      '125',
-      'Func2.prototype.func15'
-    ],
-    [
-      '133',
-      '134',
-      'func16.func17'
-    ],
-    [
-      '136',
-      '137',
-      'func16.func18'
-    ],
-    [
-      '139',
-      '141',
-      'func16.func19'
-    ],
-    [
-      '128',
-      '150',
-      'func16'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests.js b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests.js
deleted file mode 100644
index 93d1d4c..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/javascript_unittests.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc.  All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-function func1()
-{
-}
-
-function func2() {
-}
-
-function func3() { }
-
-function func4()
-{
-    return 123;
-}
-
-function func5()
-{
-    // comment
-}
-
-function func6()
-{
-    /* comment */
-}
-
-/*
-function funcInsideComment()
-{
-}
-*/
-
-function func7()
-{
-}
-
-var str1 = "function funcInsideDoubleQuotedString() {}";
-
-function func8()
-{
-}
-
-var str2 = 'function funcInsideSingleQuotedString() {}';
-
-function func9(a)
-{
-}
-
-function func10(a, b)
-{
-}
-
-function func11
-    (a, b)
-{
-}
-
-function func12(a, b,
-                c, d
-                , e, f)
-{
-}
-
-function funcOverloaded()
-{
-}
-
-function funcOverloaded(a)
-{
-}
-
-function funcOverloaded(a, b)
-{
-}
-
-Func1.prototype = {
-    get x1()
-    {
-    },
-
-    get x2()
-    {
-        return this.x2;
-    },
-
-    set x1(a)
-    {
-    },
-
-    set x3(a)
-    {
-        this.x3 = a;
-    }
-};
-
-Func2.prototype = {
-    func13 : function()
-    {
-    },
-
-    func14 : function(a)
-    {
-    },
-
-    func15 : function(a, b)
-    {
-        return 123;
-    }
-};
-
-function func16()
-{
-    var a = 123;
-    var b = 456;
-
-    var func17 = function() {
-    };
-
-    var func18 = function(a) {
-    };
-
-    var func19 = function(a, b) {
-        return 123;
-    };
-
-    func20(function()
-           {
-           },
-           function(a)
-           {
-               return 123;
-           });
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests-expected.txt
deleted file mode 100644
index d5a2ce9..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests-expected.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '21',
-      '23',
-      'func1'
-    ],
-    [
-      '25',
-      '28',
-      'func2'
-    ],
-    [
-      '30',
-      '34',
-      'func3'
-    ],
-    [
-      '36',
-      '38',
-      'func4'
-    ],
-    [
-      '40',
-      '42',
-      'func5'
-    ],
-    [
-      '44',
-      '46',
-      'func6'
-    ],
-    [
-      '48',
-      '53',
-      'func7'
-    ],
-    [
-      '55',
-      '60',
-      'func8'
-    ],
-    [
-      '62',
-      '67',
-      'func9'
-    ],
-    [
-      '69',
-      '76',
-      'func10'
-    ],
-    [
-      '78',
-      '88',
-      'func11'
-    ],
-    [
-      '90',
-      '100',
-      'func12'
-    ],
-    [
-      '102',
-      '111',
-      'func13'
-    ],
-    [
-      '113',
-      '118',
-      'func14'
-    ],
-    [
-      '120',
-      '125',
-      'func15'
-    ],
-    [
-      '127',
-      '128',
-      'func16'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl
deleted file mode 100644
index ed869f3..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Copyright (C) 2011 Google Inc.  All rights reserved.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-#
-
-sub func1
-{
-}
-
-sub func2
-{
-    return 123;
-}
-
-sub func3
-{
-    return 123;
-    return 456;
-}
-
-sub func4()
-{
-}
-
-sub func5($$$$)
-{
-}
-
-sub func6(\@\@\$\$\$\$)
-{
-}
-
-sub func7
-{
-    $str =<< EOF;
-
-EOF
-}
-
-sub func8
-{
-    $str =<< "EOF";
-
-EOF
-}
-
-sub func9
-{
-    $str =<< 'EOF';
-
-EOF
-}
-
-sub func10
-{
-    $str =<< EOF;
-sub funcInHereDocument1
-{
-}
-EOF
-}
-
-sub func11
-{
-    $str =<< EOF;
-sub funcInHereDocument2
-{
-}
-sub funcInHereDocument3
-{
-}
-EOF
-}
-
-sub func12
-{
-    $str =<< EOF;
-{
-{
-{
-}
-}
-}
-EOF
-}
-
-sub func13
-{
-    $str =<< EOF;
-
-$str << DUMMY_EOF
-
-DUMMY_EOF
-
-EOF
-}
-
-sub func14
-{
-    push(@array, << EOF);
-
-EOF
-}
-
-sub func15
-{
-    print << EOF;
-
-EOF
-}
-
-sub func16 {
-}
-
-sub prototypeDeclaration1;
-sub prototypeDeclaration2();
-sub prototypeDeclaration3(\@$$);
-
-if (1) {
-}
-
-for (@array) {
-}
-
-{}
-
-{
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests-expected.txt b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests-expected.txt
deleted file mode 100644
index 8dad37e..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests-expected.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-{
-  'stderr' => '',
-  'stdout' => '',
-  'ranges' => [
-    [
-      '21',
-      '23',
-      'func1'
-    ],
-    [
-      '24',
-      '27',
-      'func2'
-    ],
-    [
-      '28',
-      '34',
-      'func3'
-    ],
-    [
-      '35',
-      '38',
-      'func4'
-    ],
-    [
-      '39',
-      '42',
-      'func5'
-    ],
-    [
-      '43',
-      '47',
-      'func6'
-    ],
-    [
-      '48',
-      '51',
-      'funcOverloaded'
-    ],
-    [
-      '52',
-      '55',
-      'funcOverloaded'
-    ],
-    [
-      '56',
-      '59',
-      'funcOverloaded'
-    ],
-    [
-      '60',
-      '62',
-      'func7'
-    ],
-    [
-      '63',
-      '65',
-      'func7.func8'
-    ],
-    [
-      '66',
-      '67',
-      'func7.func8.func9'
-    ],
-    [
-      '68',
-      '68',
-      'func7.func8'
-    ],
-    [
-      '69',
-      '71',
-      'func7'
-    ],
-    [
-      '72',
-      '75',
-      'Class1'
-    ],
-    [
-      '76',
-      '78',
-      'Class2'
-    ],
-    [
-      '79',
-      '81',
-      'Class2.Class3'
-    ],
-    [
-      '82',
-      '83',
-      'Class2.Class3.Class4'
-    ],
-    [
-      '84',
-      '84',
-      'Class2.Class3'
-    ],
-    [
-      '85',
-      '87',
-      'Class2'
-    ],
-    [
-      '88',
-      '90',
-      'Class5'
-    ],
-    [
-      '91',
-      '92',
-      'Class5.func10'
-    ],
-    [
-      '93',
-      '94',
-      'Class5'
-    ],
-    [
-      '95',
-      '96',
-      'Class5.func11'
-    ],
-    [
-      '97',
-      '97',
-      'Class5'
-    ]
-  ]
-}
diff --git a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py b/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py
deleted file mode 100644
index 1a19cc2..0000000
--- a/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/python_unittests.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Copyright (C) 2011 Google Inc.  All rights reserved.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-#
-
-
-def func1():
-
-
-def func2():
-    return
-
-
-def func3():
-    # comment
-    return
-
-# def funcInsideComment():
-
-
-def func4(a):
-    return
-
-
-def func5(a, b, c):
-    return
-
-
-def func6(a, b, \
-          c, d):
-    return
-
-
-def funcOverloaded(a):
-    return
-
-
-def funcOverloaded(a, b):
-    return
-
-
-def funcOverloaded(a, b, c=100):
-    return
-
-
-def func7():
-    pass
-
-    def func8():
-        pass
-
-        def func9():
-            pass
-        pass
-    pass
-
-
-class Class1:
-    pass
-
-
-class Class2:
-    pass
-
-    class Class3:
-        pass
-
-        class Class4:
-            pass
-        pass
-    pass
-
-
-class Class5:
-    pass
-
-    def func10():
-        pass
-    pass
-
-    def func11():
-        pass
-    pass
diff --git a/Tools/Scripts/webkitpy/bindings/main.py b/Tools/Scripts/webkitpy/bindings/main.py
index af541f0..887a861 100644
--- a/Tools/Scripts/webkitpy/bindings/main.py
+++ b/Tools/Scripts/webkitpy/bindings/main.py
@@ -34,21 +34,20 @@
 
 class BindingsTests:
 
-    def __init__(self, reset_results, generators, executive):
+    def __init__(self, reset_results, executive):
         self.reset_results = reset_results
-        self.generators = generators
         self.executive = executive
 
-    def generate_from_idl(self, generator, idl_file, output_directory, supplemental_dependency_file):
+    def generate_from_idl(self, idl_file, output_directory, supplemental_dependency_file):
         cmd = ['perl', '-w',
-               '-IWebCore/bindings/scripts',
-               'WebCore/bindings/scripts/generate-bindings.pl',
+               '-Ibindings/scripts',
+               '-Icore/scripts',
+               'bindings/scripts/generate-bindings.pl',
                # idl include directories (path relative to generate-bindings.pl)
                '--include', '.',
-               '--defines', 'TESTING_%s' % generator,
-               '--generator', generator,
                '--outputDir', output_directory,
                '--supplementalDependencyFile', supplemental_dependency_file,
+               '--idlAttributesFile', 'bindings/scripts/IDLAttributes.txt',
                idl_file]
 
         exit_code = 0
@@ -71,10 +70,9 @@
         os.close(idl_files_list[0])
 
         cmd = ['perl', '-w',
-               '-IWebCore/bindings/scripts',
-               'WebCore/bindings/scripts/preprocess-idls.pl',
+               '-Ibindings/scripts',
+               'bindings/scripts/preprocess-idls.pl',
                '--idlFilesList', idl_files_list[1],
-               '--defines', '',
                '--supplementalDependencyFile', supplemental_dependency_file]
 
         exit_code = 0
@@ -88,7 +86,7 @@
         os.remove(idl_files_list[1])
         return exit_code
 
-    def detect_changes(self, generator, work_directory, reference_directory):
+    def detect_changes(self, work_directory, reference_directory):
         changes_found = False
         for output_file in os.listdir(work_directory):
             cmd = ['diff',
@@ -105,14 +103,14 @@
                 exit_code = e.exit_code
 
             if exit_code or output:
-                print 'FAIL: (%s) %s' % (generator, output_file)
+                print 'FAIL: %s' % (output_file)
                 print output
                 changes_found = True
             else:
-                print 'PASS: (%s) %s' % (generator, output_file)
+                print 'PASS: %s' % (output_file)
         return changes_found
 
-    def run_tests(self, generator, input_directory, reference_directory, supplemental_dependency_file):
+    def run_tests(self, input_directory, reference_directory, supplemental_dependency_file):
         work_directory = reference_directory
 
         passed = True
@@ -125,18 +123,17 @@
             if not self.reset_results:
                 work_directory = tempfile.mkdtemp()
 
-            if self.generate_from_idl(generator,
-                                      os.path.join(input_directory, input_file),
+            if self.generate_from_idl(os.path.join(input_directory, input_file),
                                       work_directory,
                                       supplemental_dependency_file):
                 passed = False
 
             if self.reset_results:
-                print "Reset results: (%s) %s" % (generator, input_file)
+                print "Reset results: %s" % (input_file)
                 continue
 
             # Detect changes
-            if self.detect_changes(generator, work_directory, reference_directory):
+            if self.detect_changes(work_directory, reference_directory):
                 passed = False
             shutil.rmtree(work_directory)
 
@@ -148,18 +145,17 @@
 
         all_tests_passed = True
 
-        input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
+        input_directory = os.path.join('bindings', 'tests', 'idls')
         supplemental_dependency_file = tempfile.mkstemp()[1]
         if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file):
             print 'Failed to generate a supplemental dependency file.'
             os.remove(supplemental_dependency_file)
             return -1
 
-        for generator in self.generators:
-            input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
-            reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
-            if not self.run_tests(generator, input_directory, reference_directory, supplemental_dependency_file):
-                all_tests_passed = False
+        input_directory = os.path.join('bindings', 'tests', 'idls')
+        reference_directory = os.path.join('bindings', 'tests', 'results')
+        if not self.run_tests(input_directory, reference_directory, supplemental_dependency_file):
+            all_tests_passed = False
 
         os.remove(supplemental_dependency_file)
         print ''
diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
index d2d53a5..31408a7 100644
--- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
+++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
@@ -29,40 +29,11 @@
 import copy
 import logging
 
+from webkitpy.common.memoized import memoized
 
 _log = logging.getLogger(__name__)
 
 
-# Yes, it's a hypergraph.
-# FIXME: Should this function live with the ports somewhere?
-# Perhaps this should move onto PortFactory?
-def _baseline_search_hypergraph(host, port_names):
-    hypergraph = {}
-
-    # These edges in the hypergraph aren't visible on build.webkit.org,
-    # but they impose constraints on how we optimize baselines.
-    hypergraph.update(_VIRTUAL_PORTS)
-
-    # FIXME: Should we get this constant from somewhere?
-    fallback_path = ['LayoutTests']
-
-    port_factory = host.port_factory
-    for port_name in port_names:
-        port = port_factory.get(port_name)
-        webkit_base = port.webkit_base()
-        search_path = port.baseline_search_path()
-        if search_path:
-            hypergraph[port_name] = [host.filesystem.relpath(path, webkit_base) for path in search_path] + fallback_path
-    return hypergraph
-
-
-_VIRTUAL_PORTS = {
-    'mac-future': ['LayoutTests/platform/mac-future', 'LayoutTests/platform/mac', 'LayoutTests'],
-    'win-future': ['LayoutTests/platform/win-future', 'LayoutTests/platform/win', 'LayoutTests'],
-    'qt-unknown': ['LayoutTests/platform/qt-unknown', 'LayoutTests/platform/qt', 'LayoutTests'],
-}
-
-
 # FIXME: Should this function be somewhere more general?
 def _invert_dictionary(dictionary):
     inverted_dictionary = {}
@@ -75,16 +46,24 @@
 
 
 class BaselineOptimizer(object):
+    ROOT_LAYOUT_TESTS_DIRECTORY = 'LayoutTests'
+
     def __init__(self, host, port_names):
-        self._host = host
-        self._filesystem = self._host.filesystem
-        self._scm = self._host.scm()
-        self._hypergraph = _baseline_search_hypergraph(host, port_names)
-        self._directories = reduce(set.union, map(set, self._hypergraph.values()))
+        self._filesystem = host.filesystem
+        self._port_factory = host.port_factory
+        self._scm = host.scm()
+        self._port_names = port_names
+
+    @memoized
+    def _relative_baseline_search_paths(self, port_name):
+        port = self._port_factory.get(port_name)
+        relative_paths = [self._filesystem.relpath(path, port.webkit_base()) for path in port.baseline_search_path()]
+        return relative_paths + [self.ROOT_LAYOUT_TESTS_DIRECTORY]
 
     def read_results_by_directory(self, baseline_name):
         results_by_directory = {}
-        for directory in self._directories:
+        directories = reduce(set.union, map(set, [self._relative_baseline_search_paths(port_name) for port_name in self._port_names]))
+        for directory in directories:
             path = self._filesystem.join(self._scm.checkout_root, directory, baseline_name)
             if self._filesystem.exists(path):
                 results_by_directory[directory] = self._filesystem.sha1(path)
@@ -92,113 +71,100 @@
 
     def _results_by_port_name(self, results_by_directory):
         results_by_port_name = {}
-        for port_name, search_path in self._hypergraph.items():
-            for directory in search_path:
+        for port_name in self._port_names:
+            for directory in self._relative_baseline_search_paths(port_name):
                 if directory in results_by_directory:
                     results_by_port_name[port_name] = results_by_directory[directory]
                     break
         return results_by_port_name
 
-    def _most_specific_common_directory(self, port_names):
-        paths = [self._hypergraph[port_name] for port_name in port_names]
-        common_directories = reduce(set.intersection, map(set, paths))
+    @memoized
+    def _directories_immediately_preceding_root(self):
+        directories = set()
+        for port_name in self._port_names:
+            port = self._port_factory.get(port_name)
+            directory = self._filesystem.relpath(port.baseline_search_path()[-1], port.webkit_base())
+            directories.add(directory)
+        return directories
 
-        def score(directory):
-            return sum([path.index(directory) for path in paths])
+    def _optimize_result_for_root(self, new_results_by_directory):
+        # The root directory (i.e. LayoutTests) is the only one that doesn't correspond
+        # to a specific platform. As such, it's the only one where the baseline in fallback directories
+        # immediately before it can be promoted up, i.e. if chromium-win and chromium-mac
+        # have the same baseline, then it can be promoted up to be the LayoutTests baseline.
+        # All other baselines can only be removed if they're redundant with a baseline earlier
+        # in the fallback order. They can never promoted up.
+        directories_immediately_preceding_root = self._directories_immediately_preceding_root()
 
-        _, directory = sorted([(score(directory), directory) for directory in common_directories])[0]
-        return directory
+        shared_result = None
+        root_baseline_unused = False
+        for directory in directories_immediately_preceding_root:
+            this_result = new_results_by_directory.get(directory)
 
-    def _filter_port_names_by_result(self, predicate, port_names_by_result):
-        filtered_port_names_by_result = {}
-        for result, port_names in port_names_by_result.items():
-            filtered_port_names = filter(predicate, port_names)
-            if filtered_port_names:
-                filtered_port_names_by_result[result] = filtered_port_names
-        return filtered_port_names_by_result
+            # If any of these directories don't have a baseline, there's no optimization we can do.
+            if not this_result:
+                return
 
-    def _place_results_in_most_specific_common_directory(self, port_names_by_result, results_by_directory):
-        for result, port_names in port_names_by_result.items():
-            directory = self._most_specific_common_directory(port_names)
-            results_by_directory[directory] = result
+            if not shared_result:
+                shared_result = this_result
+            elif shared_result != this_result:
+                root_baseline_unused = True
+
+        # The root baseline is unused if all the directories immediately preceding the root
+        # have a baseline, but have different baselines, so the baselines can't be promoted up.
+        if root_baseline_unused:
+            if self.ROOT_LAYOUT_TESTS_DIRECTORY in new_results_by_directory:
+                del new_results_by_directory[self.ROOT_LAYOUT_TESTS_DIRECTORY]
+            return
+
+        new_results_by_directory[self.ROOT_LAYOUT_TESTS_DIRECTORY] = shared_result
+        for directory in directories_immediately_preceding_root:
+            del new_results_by_directory[directory]
 
     def _find_optimal_result_placement(self, baseline_name):
         results_by_directory = self.read_results_by_directory(baseline_name)
         results_by_port_name = self._results_by_port_name(results_by_directory)
         port_names_by_result = _invert_dictionary(results_by_port_name)
 
-        new_results_by_directory = self._optimize_by_most_specific_common_directory(results_by_directory, results_by_port_name, port_names_by_result)
-        if not new_results_by_directory:
-            new_results_by_directory = self._optimize_by_pushing_results_up(results_by_directory, results_by_port_name, port_names_by_result)
+        new_results_by_directory = self._remove_redundant_results(results_by_directory, results_by_port_name, port_names_by_result)
+        self._optimize_result_for_root(new_results_by_directory)
 
         return results_by_directory, new_results_by_directory
 
-    def _optimize_by_most_specific_common_directory(self, results_by_directory, results_by_port_name, port_names_by_result):
-        new_results_by_directory = {}
-        unsatisfied_port_names_by_result = port_names_by_result
-        while unsatisfied_port_names_by_result:
-            self._place_results_in_most_specific_common_directory(unsatisfied_port_names_by_result, new_results_by_directory)
-            new_results_by_port_name = self._results_by_port_name(new_results_by_directory)
+    def _remove_redundant_results(self, results_by_directory, results_by_port_name, port_names_by_result):
+        new_results_by_directory = copy.copy(results_by_directory)
+        for port_name in self._port_names:
+            current_result = results_by_port_name.get(port_name)
 
-            def is_unsatisfied(port_name):
-                return results_by_port_name[port_name] != new_results_by_port_name[port_name]
+            # This happens if we're missing baselines for a port.
+            if not current_result:
+                continue;
 
-            new_unsatisfied_port_names_by_result = self._filter_port_names_by_result(is_unsatisfied, port_names_by_result)
-
-            if len(new_unsatisfied_port_names_by_result.values()) >= len(unsatisfied_port_names_by_result.values()):
-                return {}  # Frowns. We do not appear to be converging.
-            unsatisfied_port_names_by_result = new_unsatisfied_port_names_by_result
+            fallback_path = self._relative_baseline_search_paths(port_name)
+            current_index, current_directory = self._find_in_fallbackpath(fallback_path, current_result, new_results_by_directory)
+            for index in range(current_index + 1, len(fallback_path)):
+                new_directory = fallback_path[index]
+                if not new_directory in new_results_by_directory:
+                    # No result for this baseline in this directory.
+                    continue
+                elif new_results_by_directory[new_directory] == current_result:
+                    # Result for new_directory are redundant with the result earlier in the fallback order.
+                    if current_directory in new_results_by_directory:
+                        del new_results_by_directory[current_directory]
+                else:
+                    # The new_directory contains a different result, so stop trying to push results up.
+                    break
 
         return new_results_by_directory
 
-    def _optimize_by_pushing_results_up(self, results_by_directory, results_by_port_name, port_names_by_result):
-        try:
-            results_by_directory = results_by_directory
-            best_so_far = results_by_directory
-            while True:
-                new_results_by_directory = copy.copy(best_so_far)
-                for port_name in self._hypergraph.keys():
-                    fallback_path = self._hypergraph[port_name]
-                    current_index, current_directory = self._find_in_fallbackpath(fallback_path, results_by_port_name[port_name], best_so_far)
-                    current_result = results_by_port_name[port_name]
-                    for index in range(current_index + 1, len(fallback_path)):
-                        new_directory = fallback_path[index]
-                        if not new_directory in new_results_by_directory:
-                            new_results_by_directory[new_directory] = current_result
-                            if current_directory in new_results_by_directory:
-                                del new_results_by_directory[current_directory]
-                        elif new_results_by_directory[new_directory] == current_result:
-                            if current_directory in new_results_by_directory:
-                                del new_results_by_directory[current_directory]
-                        else:
-                            # The new_directory contains a different result, so stop trying to push results up.
-                            break
-
-                if len(new_results_by_directory) >= len(best_so_far):
-                    # We've failed to improve, so give up.
-                    break
-                best_so_far = new_results_by_directory
-
-            return best_so_far
-        except KeyError as e:
-            # FIXME: KeyErrors get raised if we're missing baselines. We should handle this better.
-            return {}
-
     def _find_in_fallbackpath(self, fallback_path, current_result, results_by_directory):
         for index, directory in enumerate(fallback_path):
             if directory in results_by_directory and (results_by_directory[directory] == current_result):
                 return index, directory
         assert False, "result %s not found in fallback_path %s, %s" % (current_result, fallback_path, results_by_directory)
 
-    def _filtered_results_by_port_name(self, results_by_directory):
-        results_by_port_name = self._results_by_port_name(results_by_directory)
-        for port_name in _VIRTUAL_PORTS.keys():
-            if port_name in results_by_port_name:
-                del results_by_port_name[port_name]
-        return results_by_port_name
-
     def _platform(self, filename):
-        platform_dir = 'LayoutTests' + self._filesystem.sep + 'platform' + self._filesystem.sep
+        platform_dir = self.ROOT_LAYOUT_TESTS_DIRECTORY + self._filesystem.sep + 'platform' + self._filesystem.sep
         if filename.startswith(platform_dir):
             return filename.replace(platform_dir, '').split(self._filesystem.sep)[0]
         platform_dir = self._filesystem.join(self._scm.checkout_root, platform_dir)
@@ -240,10 +206,6 @@
         else:
             _log.debug("    (Nothing to add)")
 
-    def directories_by_result(self, baseline_name):
-        results_by_directory = self.read_results_by_directory(baseline_name)
-        return _invert_dictionary(results_by_directory)
-
     def write_by_directory(self, results_by_directory, writer, indent):
         for path in sorted(results_by_directory):
             writer("%s%s: %s" % (indent, self._platform(path), results_by_directory[path][0:6]))
@@ -251,16 +213,21 @@
     def optimize(self, baseline_name):
         basename = self._filesystem.basename(baseline_name)
         results_by_directory, new_results_by_directory = self._find_optimal_result_placement(baseline_name)
-        self.new_results_by_directory = new_results_by_directory
+
         if new_results_by_directory == results_by_directory:
             if new_results_by_directory:
                 _log.debug("  %s: (already optimal)" % basename)
                 self.write_by_directory(results_by_directory, _log.debug, "    ")
             else:
                 _log.debug("  %s: (no baselines found)" % basename)
+            # This is just used for unittests. Intentionally set it to the old data if we don't modify anything.
+            self.new_results_by_directory = results_by_directory
             return True
-        if self._filtered_results_by_port_name(results_by_directory) != self._filtered_results_by_port_name(new_results_by_directory):
-            _log.warning("  %s: optimization failed" % basename)
+
+        if self._results_by_port_name(results_by_directory) != self._results_by_port_name(new_results_by_directory):
+            # This really should never happen. Just a sanity check to make sure the script fails in the case of bugs
+            # instead of committing incorrect baselines.
+            _log.error("  %s: optimization failed" % basename)
             self.write_by_directory(results_by_directory, _log.warning, "      ")
             return False
 
diff --git a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
index 308fc17..69dfb9d 100644
--- a/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
+++ b/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
@@ -55,26 +55,22 @@
         self.assertTrue(baseline_optimizer.optimize('mock-baseline.png'))
         self.assertEqual(baseline_optimizer.new_results_by_directory, expected_new_results_by_directory)
 
-    def _assertOptimizationFailed(self, results_by_directory):
-        baseline_optimizer = TestBaselineOptimizer(results_by_directory)
-        self.assertFalse(baseline_optimizer.optimize('mock-baseline.png'))
-
     def test_move_baselines(self):
         host = MockHost()
         host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-win/another/test-expected.txt', 'result A')
         host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium-mac/another/test-expected.txt', 'result A')
-        host.filesystem.write_binary_file('/mock-checkout/LayoutTests/platform/chromium/another/test-expected.txt', 'result B')
+        host.filesystem.write_binary_file('/mock-checkout/LayoutTests/another/test-expected.txt', 'result B')
         baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_names())
         baseline_optimizer._move_baselines('another/test-expected.txt', {
             'LayoutTests/platform/chromium-win': 'aaa',
             'LayoutTests/platform/chromium-mac': 'aaa',
-            'LayoutTests/platform/chromium': 'bbb',
+            'LayoutTests': 'bbb',
         }, {
-            'LayoutTests/platform/chromium': 'aaa',
+            'LayoutTests': 'aaa',
         })
-        self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/LayoutTests/platform/chromium/another/test-expected.txt'), 'result A')
+        self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/LayoutTests/another/test-expected.txt'), 'result A')
 
-    def test_chromium_linux_redundant_with_win(self):
+    def test_linux_redundant_with_win(self):
         self._assertOptimization({
             'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
             'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
@@ -82,121 +78,91 @@
             'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
         })
 
-    def test_efl(self):
-        self._assertOptimization({
-            'LayoutTests/platform/efl': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        }, {
-            'LayoutTests/platform/efl': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        })
-
-
-    def test_no_add_mac_future(self):
-        self._assertOptimization({
-            'LayoutTests/platform/mac': '29a1715a6470d5dd9486a142f609708de84cdac8',
-            'LayoutTests/platform/win-xp': '453e67177a75b2e79905154ece0efba6e5bfb65d',
-            'LayoutTests/platform/mac-lion': 'c43eaeb358f49d5e835236ae23b7e49d7f2b089f',
-            'LayoutTests/platform/chromium-mac': 'a9ba153c700a94ae1b206d8e4a75a621a89b4554',
-        }, {
-            'LayoutTests/platform/mac': '29a1715a6470d5dd9486a142f609708de84cdac8',
-            'LayoutTests/platform/win-xp': '453e67177a75b2e79905154ece0efba6e5bfb65d',
-            'LayoutTests/platform/mac-lion': 'c43eaeb358f49d5e835236ae23b7e49d7f2b089f',
-            'LayoutTests/platform/chromium-mac': 'a9ba153c700a94ae1b206d8e4a75a621a89b4554',
-        })
-
-    def test_chromium_covers_mac_win_linux(self):
+    def test_covers_mac_win_linux(self):
         self._assertOptimization({
             'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
             'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
             'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
         }, {
-            'LayoutTests/platform/chromium': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
         })
 
-    def test_mac_future(self):
+    def test_overwrites_root(self):
         self._assertOptimization({
-            'LayoutTests/platform/mac-lion': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        }, {
-            'LayoutTests/platform/mac-lion': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        })
-
-    def test_qt_unknown(self):
-        self._assertOptimization({
-            'LayoutTests/platform/qt': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        }, {
-            'LayoutTests/platform/qt': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-        })
-
-    def test_win_does_not_drop_to_win_7sp0(self):
-        self._assertOptimization({
-            'LayoutTests/platform/win': '1',
-            'LayoutTests/platform/mac': '2',
-            'LayoutTests/platform/gtk': '3',
-            'LayoutTests/platform/qt': '4',
-            'LayoutTests/platform/chromium': '5',
-        }, {
-            'LayoutTests/platform/win': '1',
-            'LayoutTests/platform/mac': '2',
-            'LayoutTests/platform/gtk': '3',
-            'LayoutTests/platform/qt': '4',
-            'LayoutTests/platform/chromium': '5',
-        })
-
-    def test_common_directory_includes_root(self):
-        # This test case checks that we don't throw an exception when we fail
-        # to optimize.
-        self._assertOptimizationFailed({
-            'LayoutTests/platform/gtk': 'e8608763f6241ddacdd5c1ef1973ba27177d0846',
-            'LayoutTests/platform/qt': 'bcbd457d545986b7abf1221655d722363079ac87',
-            'LayoutTests/platform/chromium-win': '3764ac11e1f9fbadd87a90a2e40278319190a0d3',
-            'LayoutTests/platform/mac': 'e8608763f6241ddacdd5c1ef1973ba27177d0846',
-        })
-
-        self._assertOptimization({
-            'LayoutTests/platform/chromium-win': '23a30302a6910f8a48b1007fa36f3e3158341834',
-            'LayoutTests': '9c876f8c3e4cc2aef9519a6c1174eb3432591127',
-            'LayoutTests/platform/chromium-mac': '23a30302a6910f8a48b1007fa36f3e3158341834',
-            'LayoutTests/platform/chromium': '1',
-        }, {
-            'LayoutTests/platform/chromium': '23a30302a6910f8a48b1007fa36f3e3158341834',
-            'LayoutTests': '9c876f8c3e4cc2aef9519a6c1174eb3432591127',
-        })
-
-    def test_complex_shadowing(self):
-        # This test relies on OS specific functionality, so it doesn't work on Windows.
-        # FIXME: What functionality does this rely on?  When can we remove this if?
-        if sys.platform == 'win32':
-            return
-        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
             'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-            'LayoutTests/platform/mac': '5daa78e55f05d9f0d1bb1f32b0cd1bc3a01e9364',
-            'LayoutTests/platform/chromium-win-xp': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-            'LayoutTests/platform/mac-lion': '7ad045ece7c030e2283c5d21d9587be22bcba56e',
-            'LayoutTests/platform/chromium-win': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
-            'LayoutTests/platform/win-xp': '5b1253ef4d5094530d5f1bc6cdb95c90b446bec7',
-            'LayoutTests/platform/chromium-linux': 'f52fcdde9e4be8bd5142171cd859230bd4471036',
+            'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests': '1',
         }, {
-            'LayoutTests/platform/chromium-win': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-            'LayoutTests/platform/mac': '5daa78e55f05d9f0d1bb1f32b0cd1bc3a01e9364',
-            'LayoutTests/platform/chromium-win-xp': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
-            'LayoutTests/platform/mac-lion': '7ad045ece7c030e2283c5d21d9587be22bcba56e',
-            'LayoutTests/platform/chromium-win': 'f83af9732ce74f702b8c9c4a3d9a4c6636b8d3bd',
-            'LayoutTests/platform/win-xp': '5b1253ef4d5094530d5f1bc6cdb95c90b446bec7',
-            'LayoutTests/platform/chromium-linux': 'f52fcdde9e4be8bd5142171cd859230bd4471036'
+            'LayoutTests': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
         })
 
-    def test_virtual_ports_filtered(self):
+    def test_no_new_common_directory(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests': '1',
+        }, {
+            'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests/platform/chromium-linux': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests': '1',
+        })
+
+
+    def test_no_common_directory(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests/platform/chromium-android': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+        }, {
+            'LayoutTests/platform/chromium-mac': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+            'LayoutTests/platform/chromium-android': '462d03b9c025db1b0392d7453310dbee5f9a9e74',
+        })
+
+    def test_local_optimization(self):
         self._assertOptimization({
             'LayoutTests/platform/chromium-mac': '1',
-            'LayoutTests/platform/chromium-mac-snowleopard': '1',
-            'LayoutTests/platform/chromium-win': '2',
-            'LayoutTests/platform/gtk': '3',
-            'LayoutTests/platform/efl': '3',
-            'LayoutTests/platform/qt': '4',
-            'LayoutTests/platform/mac': '5',
+            'LayoutTests/platform/chromium-linux': '1',
+            'LayoutTests/platform/chromium-linux-x86': '1',
         }, {
             'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests/platform/chromium-linux': '1',
+        })
+
+    def test_local_optimization_skipping_a_port_in_the_middle(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac-snowleopard': '1',
+            'LayoutTests/platform/chromium-win': '1',
+            'LayoutTests/platform/chromium-linux-x86': '1',
+        }, {
+            'LayoutTests/platform/chromium-mac-snowleopard': '1',
+            'LayoutTests/platform/chromium-win': '1',
+        })
+
+    def test_baseline_redundant_with_root(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests/platform/chromium-win': '2',
+            'LayoutTests': '2',
+        }, {
+            'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests': '2',
+        })
+
+    def test_root_baseline_unused(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '1',
             'LayoutTests/platform/chromium-win': '2',
             'LayoutTests': '3',
-            'LayoutTests/platform/qt': '4',
-            'LayoutTests/platform/mac': '5',
+        }, {
+            'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests/platform/chromium-win': '2',
+        })
+
+    def test_root_baseline_unused_and_non_existant(self):
+        self._assertOptimization({
+            'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests/platform/chromium-win': '2',
+        }, {
+            'LayoutTests/platform/chromium-mac': '1',
+            'LayoutTests/platform/chromium-win': '2',
         })
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
index a29cead..6a22291 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
@@ -168,6 +168,9 @@
     def delete_list(self, paths):
         return self._run_git(["rm", "-f"] + paths)
 
+    def move(self, origin, destination):
+        return self._run_git(["mv", "-f", origin, destination])
+
     def exists(self, path):
         return_code = self._run_git(["show", "HEAD:%s" % path], return_exit_code=True, decode_output=False)
         return return_code != self.ERROR_FILE_IS_MISSING
@@ -467,8 +470,11 @@
         first_remote_branch_ref = remote_branch_refs.split('\n')[0]
         return first_remote_branch_ref.split(':')[1]
 
-    def commit_locally_with_message(self, message):
-        self._run_git(['commit', '--all', '-F', '-'], input=message)
+    def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
+        command = ['commit', '-F', '-']
+        if commit_all_working_directory_changes:
+            command.insert(1, '--all')
+        self._run_git(command, input=message)
 
     def push_local_commits_to_server(self, username=None, password=None):
         dcommit_command = ['svn', 'dcommit']
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
index 11e7ddb..a972ca4 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
@@ -142,6 +142,9 @@
     def delete_list(self, paths):
         self._subclass_must_implement()
 
+    def move(self, origin, destination):
+        self._subclass_must_implement()
+
     def exists(self, path):
         self._subclass_must_implement()
 
@@ -234,7 +237,7 @@
     def remote_merge_base(self):
         SCM._subclass_must_implement()
 
-    def commit_locally_with_message(self, message):
+    def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
         _log.error("Your source control manager does not support local commits.")
         sys.exit(1)
 
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
index b701c34..961a7fd 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
@@ -96,7 +96,7 @@
     def committer_email_for_revision(self, revision):
         return "mock@webkit.org"
 
-    def commit_locally_with_message(self, message):
+    def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
         pass
 
     def commit_with_message(self, message, username=None, password=None, git_commit=None, force_squash=False, changed_files=None):
@@ -135,3 +135,7 @@
         for path in paths:
             if self._filesystem.exists(path):
                 self._filesystem.remove(path)
+
+    def move(self, origin, destination):
+        if self._filesystem:
+            self._filesystem.move(self.absolute_path(origin), self.absolute_path(destination))
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
index 215edd1..93eb9b5 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
@@ -500,6 +500,21 @@
     def _shared_test_head_svn_revision(self):
         self.assertEqual(self.scm.head_svn_revision(), '5')
 
+    def _shared_test_move(self):
+        write_into_file_at_path('added_file', 'new stuff')
+        self.scm.add('added_file')
+        self.scm.move('added_file', 'moved_file')
+        self.assertIn('moved_file', self.scm.added_files())
+
+    def _shared_test_move_recursive(self):
+        os.mkdir("added_dir")
+        write_into_file_at_path('added_dir/added_file', 'new stuff')
+        write_into_file_at_path('added_dir/another_added_file', 'more new stuff')
+        self.scm.add('added_dir')
+        self.scm.move('added_dir', 'moved_dir')
+        self.assertIn('moved_dir/added_file', self.scm.added_files())
+        self.assertIn('moved_dir/another_added_file', self.scm.added_files())
+
 
 # Context manager that overrides the current timezone.
 class TimezoneOverride(object):
@@ -844,6 +859,12 @@
     def test_head_svn_revision(self):
         self._shared_test_head_svn_revision()
 
+    def test_move(self):
+        self._shared_test_move()
+
+    def test_move_recursive(self):
+        self._shared_test_move_recursive()
+
     def test_propset_propget(self):
         filepath = os.path.join(self.svn_checkout_path, "test_file")
         expected_mime_type = "x-application/foo-bar"
@@ -1018,7 +1039,7 @@
     def test_rename_files(self):
         scm = self.tracking_scm
 
-        run_command(['git', 'mv', 'foo_file', 'bar_file'])
+        scm.move('foo_file', 'bar_file')
         scm.commit_locally_with_message('message')
 
         patch = scm.create_patch()
@@ -1186,6 +1207,31 @@
         self._local_commit('test_file_commit0', 'more test content', 'another test commit')
         self._two_local_commits()
 
+    def test_locally_commit_all_working_copy_changes(self):
+        self._local_commit('test_file', 'test content', 'test commit')
+        write_into_file_at_path('test_file', 'changed test content')
+        self.assertTrue(self.scm.has_working_directory_changes())
+        self.scm.commit_locally_with_message('all working copy changes')
+        self.assertFalse(self.scm.has_working_directory_changes())
+
+    def test_locally_commit_no_working_copy_changes(self):
+        self._local_commit('test_file', 'test content', 'test commit')
+        write_into_file_at_path('test_file', 'changed test content')
+        self.assertTrue(self.scm.has_working_directory_changes())
+        self.assertRaises(ScriptError, self.scm.commit_locally_with_message, 'no working copy changes', False)
+
+    def test_locally_commit_selected_working_copy_changes(self):
+        self._local_commit('test_file_1', 'test content 1', 'test commit 1')
+        self._local_commit('test_file_2', 'test content 2', 'test commit 2')
+        write_into_file_at_path('test_file_1', 'changed test content 1')
+        write_into_file_at_path('test_file_2', 'changed test content 2')
+        self.assertTrue(self.scm.has_working_directory_changes())
+        run_command(['git', 'add', 'test_file_1'])
+        self.scm.commit_locally_with_message('selected working copy changes', commit_all_working_directory_changes=False)
+        self.assertTrue(self.scm.has_working_directory_changes())
+        self.assertTrue(self.scm.diff_for_file('test_file_1') == '')
+        self.assertFalse(self.scm.diff_for_file('test_file_2') == '')
+
     def test_revisions_changing_files_with_local_commit(self):
         self._one_local_commit()
         self.assertItemsEqual(self.scm.revisions_changing_file('test_file_commit1'), [])
@@ -1513,6 +1559,12 @@
     def test_head_svn_revision(self):
         self._shared_test_head_svn_revision()
 
+    def test_move(self):
+        self._shared_test_move()
+
+    def test_move_recursive(self):
+        self._shared_test_move_recursive()
+
     def test_to_object_name(self):
         relpath = 'test_file_commit1'
         fullpath = os.path.realpath(os.path.join(self.git_checkout_path, relpath))
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
index 8646a5c..dc9ad53 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
@@ -201,6 +201,9 @@
             self._delete_parent_directories(os.path.dirname(abs_path))
         return result
 
+    def move(self, origin, destination):
+        return self._run_svn(["mv", "--force", origin, destination], return_exit_code=True)
+
     def exists(self, path):
         return not self._run_svn(["info", path], return_exit_code=True, decode_output=False)
 
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index 81153c1..f7aa0d7 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -229,12 +229,12 @@
     Committer("Anton D'Auria", "adauria@apple.com", "antonlefou"),
     Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
     Committer("Arko Saha", "arko@motorola.com", "arkos"),
-    Committer("Arvid Nilsson", "anilsson@rim.com", "anilsson"),
+    Committer("Arvid Nilsson", ["anilsson@blackberry.com", "anilsson@rim.com"], "anilsson"),
     Committer("Balazs Kelemen", "kbalazs@webkit.org", "kbalazs"),
     Committer("Bear Travis", "betravis@adobe.com", "betravis"),
     Committer("Ben Murdoch", "benm@google.com", "benm"),
     Committer("Ben Wells", "benwells@chromium.org", "benwells"),
-    Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org", "bmeyer@rim.com"], "icefox"),
+    Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"], "icefox"),
     Committer("Benjamin Kalman", ["kalman@chromium.org", "kalman@google.com"], "kalman"),
     Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"),
     Committer("Bill Budge", ["bbudge@chromium.org", "bbudge@gmail.com"], "bbudge"),
@@ -271,7 +271,7 @@
     Committer(u"Dominik R\u00f6ttsches", ["dominik.rottsches@intel.com", "d-r@roettsches.de"], "drott"),
     Committer("Dongwoo Joshua Im", ["dw.im@samsung.com", "dwim79@gmail.com"], "dwim"),
     Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"),
-    Committer("Eli Fidler", ["eli@staikos.net", "efidler@rim.com"], "efidler"),
+    Committer("Eli Fidler", ["efidler@blackberry.com", "efidler@rim.com"], "efidler"),
     Committer("Elliot Poger", "epoger@chromium.org", "epoger"),
     Committer("Erik Arvidsson", "arv@chromium.org", "arv"),
     Committer("Eric Roman", "eroman@chromium.org", "eroman"),
@@ -304,8 +304,8 @@
     Committer("Ilya Sherman", "isherman@chromium.org", "isherman"),
     Committer("Ilya Tikhonovsky", "loislo@chromium.org", "loislo"),
     Committer("Ivan Krsti\u0107", "ike@apple.com"),
-    Committer("Jacky Jiang", ["jkjiang@webkit.org", "zkjiang008@gmail.com", "zhajiang@rim.com"], "jkjiang"),
-    Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
+    Committer("Jacky Jiang", ["jkjiang@webkit.org", "zkjiang008@gmail.com", "zhajiang@blackberry.com", "zhajiang@rim.com"], "jkjiang"),
+    Committer("Jakob Petsovits", ["jpetsovits@blackberry.com", "jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
     Committer("Jakub Wieczorek", "jwieczorek@webkit.org", "fawek"),
     Committer("James Hawkins", ["jhawkins@chromium.org", "jhawkins@google.com"], "jhawkins"),
     Committer("James Kozianski", ["koz@chromium.org", "koz@google.com"], "koz"),
@@ -350,14 +350,14 @@
     Committer("Kimmo Kinnunen", ["kimmo.t.kinnunen@nokia.com", "kimmok@iki.fi", "ktkinnun@webkit.org"], "kimmok"),
     Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
     Committer("Kiran Muppala", "cmuppala@apple.com", "kiranm"),
-    Committer("Konrad Piascik", "kpiascik@rim.com", "kpiascik"),
+    Committer("Konrad Piascik", ["kpiascik@blackberry.com", "kpiascik@rim.com"], "kpiascik"),
     Committer("Kristof Kosztyo", "kkristof@inf.u-szeged.hu", "kkristof"),
     Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
     Committer("Kwang Yul Seo", ["skyul@company100.net", "kseo@webkit.org"], "kseo"),
     Committer("Lauro Neto", "lauro.neto@openbossa.org", "lmoura"),
     Committer("Leandro Gracia Gil", "leandrogracia@chromium.org", "leandrogracia"),
     Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
-    Committer("Leo Yang", ["leoyang@rim.com", "leoyang@webkit.org", "leoyang.webkit@gmail.com"], "leoyang"),
+    Committer("Leo Yang", ["leoyang@blackberry.com", "leoyang@rim.com", "leoyang@webkit.org", "leoyang.webkit@gmail.com"], "leoyang"),
     Committer("Li Yin", ["li.yin@intel.com"], "liyin"),
     Committer("Lucas De Marchi", ["demarchi@webkit.org", "lucas.demarchi@profusion.mobi"], "demarchi"),
     Committer("Lucas Forschler", ["lforschler@apple.com"], "lforschler"),
@@ -382,7 +382,7 @@
     Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
     Committer("Mihnea Ovidenie", "mihnea@adobe.com", "mihnea"),
     Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
-    Committer("Mike Fenton", ["mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
+    Committer("Mike Fenton", ["mifenton@blackberry.com", "mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
     Committer("Mike Lawther", "mikelawther@chromium.org", "mikelawther"),
     Committer("Mike Reed", "reed@google.com", "reed"),
     Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
@@ -392,7 +392,7 @@
     Committer("Naoki Takano", ["honten@chromium.org", "takano.naoki@gmail.com"], "honten"),
     Committer("Nat Duca", ["nduca@chromium.org", "nduca@google.com"], "nduca"),
     Committer("Nayan Kumar K", ["nayankk@motorola.com", "nayankk@gmail.com"], "xc0ffee"),
-    Committer("Nima Ghanavatian", ["nghanavatian@rim.com", "nima.ghanavatian@gmail.com"], "nghanavatian"),
+    Committer("Nima Ghanavatian", ["nghanavatian@blackberry.com", "nghanavatian@rim.com", "nima.ghanavatian@gmail.com"], "nghanavatian"),
     Committer("Noel Gordon", ["noel.gordon@gmail.com", "noel@chromium.org", "noel@google.com"], "noel"),
     Committer("Pablo Flouret", ["pablof@motorola.com", "pf@parb.es"], "pablof"),
     Committer("Pam Greene", "pam@chromium.org", "pamg"),
@@ -465,7 +465,7 @@
     Committer("Yoshifumi Inoue", "yosin@chromium.org", "yosin"),
     Committer("Yuqiang Xian", "yuqiang.xian@intel.com"),
     Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
-    Committer("Zalan Bujtas", ["zbujtas@gmail.com", "zalan.bujtas@nokia.com"], "zalan"),
+    Committer("Zalan Bujtas", ["zalan@apple.com", "zbujtas@gmail.com", "zalan.bujtas@nokia.com"], "zalan"),
     Committer("Zeno Albisser", ["zeno@webkit.org", "zeno.albisser@nokia.com"], "zalbisser"),
     Committer("Zhenyao Mo", "zmo@google.com", "zhenyao"),
     Committer("Zoltan Arvai", "zarvai@inf.u-szeged.hu", "azbest_hu"),
@@ -484,7 +484,7 @@
     Reviewer("Ada Chan", "adachan@apple.com", "chanada"),
     Reviewer("Adam Barth", "abarth@webkit.org", "abarth"),
     Reviewer("Adam Roben", ["aroben@webkit.org", "aroben@apple.com"], "aroben"),
-    Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org", "atreat@rim.com"], "manyoso"),
+    Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org"], "manyoso"),
     Reviewer("Adele Peterson", "adele@apple.com", "adele"),
     Reviewer("Adrienne Walker", ["enne@google.com", "enne@chromium.org"], "enne"),
     Reviewer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"], "alexg__"),
@@ -497,7 +497,7 @@
     Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"], "andersca"),
     Reviewer("Andreas Kling", ["akling@apple.com", "kling@webkit.org", "awesomekling@apple.com", "andreas.kling@nokia.com"], "kling"),
     Reviewer("Andy Estes", "aestes@apple.com", "estes"),
-    Reviewer("Antonio Gomes", ["tonikitoo@webkit.org", "a1.gomes@sisa.samsung.com", "antonio.netto@samsung.com", "agomes@rim.com", "antonio.gomes@openbossa.org"], "tonikitoo"),
+    Reviewer("Antonio Gomes", ["tonikitoo@webkit.org", "a1.gomes@sisa.samsung.com", "antonio.netto@samsung.com", "antonio.gomes@openbossa.org"], "tonikitoo"),
     Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com", "antti.j.koivisto@nokia.com"], "anttik"),
     Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@sencha.com", "ariya@webkit.org"], "ariya"),
     Reviewer("Benjamin Poulain", ["benjamin@webkit.org", "benjamin.poulain@nokia.com", "ikipou@gmail.com"], "benjaminp"),
@@ -516,7 +516,7 @@
     Reviewer("Chris Rogers", "crogers@google.com", "crogers"),
     Reviewer(u"Csaba Osztrogon\u00e1c", "ossy@webkit.org", "ossy"),
     Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"], "mitzpettel"),
-    Reviewer("Daniel Bates", ["dbates@webkit.org", "dbates@rim.com"], "dydz"),
+    Reviewer("Daniel Bates", "dbates@webkit.org", "dydz"),
     Reviewer("Darin Adler", "darin@apple.com", "darin"),
     Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"], "fishd"),
     Reviewer("David Harrison", "harrison@apple.com", "harrison"),
@@ -576,7 +576,7 @@
     Reviewer("Mihai Parparita", "mihaip@chromium.org", "mihaip"),
     Reviewer("Nate Chapin", "japhet@chromium.org", ["japhet", "natechapin"]),
     Reviewer("Nico Weber", ["thakis@chromium.org", "thakis@google.com"], "thakis"),
-    Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org", "nzimmermann@rim.com"], "wildfox"),
+    Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org", "nzimmermann@blackberry.com", "nzimmermann@rim.com"], "wildfox"),
     Reviewer("Noam Rosenthal", ["noam@webkit.org", "noam.rosenthal@nokia.com"], "noamr"),
     Reviewer("Ojan Vafai", ["ojan@chromium.org", "ojan.autocc@gmail.com"], "ojan"),
     Reviewer("Oliver Hunt", "oliver@apple.com", "olliej"),
@@ -584,7 +584,7 @@
     Reviewer("Philip Rogers", ["pdr@google.com", "pdr@chromium.org"], "pdr"),
     Reviewer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org", "philn@igalia.com"], ["philn-tp", "pnormand"]),
     Reviewer("Richard Williamson", "rjw@apple.com", "rjw"),
-    Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org", "rbuis@rim.com"], "rwlbuis"),
+    Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org", "rbuis@blackberry.com", "rbuis@rim.com"], "rwlbuis"),
     Reviewer("Ryosuke Niwa", "rniwa@webkit.org", "rniwa"),
     Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"], "weinig"),
     Reviewer("Shinichiro Hamaji", "hamaji@chromium.org", "hamaji"),
diff --git a/Tools/Scripts/webkitpy/common/config/contributionareas.py b/Tools/Scripts/webkitpy/common/config/contributionareas.py
index b48df2a..ed10290 100644
--- a/Tools/Scripts/webkitpy/common/config/contributionareas.py
+++ b/Tools/Scripts/webkitpy/common/config/contributionareas.py
@@ -155,7 +155,6 @@
     _Area('V8 Bindings', [_Intersection('bindings', 'v8')]),
     _Area('Web Inspector / Developer Tools', ['inspector']),
     _Area('Web Timing', ['PerformanceNavigation', 'PerformanceTiming']),  # more tokens?
-    _Area('WebArchive'),
     _Area('WebCore Icon Database', ['icon']),
     _Area('WebGL', ['webgl']),
     _Area('WebKit Websites', ['websites']),
diff --git a/Tools/Scripts/webkitpy/common/config/ports.py b/Tools/Scripts/webkitpy/common/config/ports.py
index 5c7bea0..236a534 100644
--- a/Tools/Scripts/webkitpy/common/config/ports.py
+++ b/Tools/Scripts/webkitpy/common/config/ports.py
@@ -64,19 +64,8 @@
             "chromium": ChromiumPort,
             "chromium-android": ChromiumAndroidPort,
             "chromium-xvfb": ChromiumXVFBPort,
-            "gtk": GtkPort,
-            "mac": MacPort,
-            "mac-wk2": MacWK2Port,
-            "win": WinPort,
-            "qt": QtPort,
-            "efl": EflPort,
         }
-        default_port = {
-            "Windows": WinPort,
-            "Darwin": MacPort,
-        }
-        # Do we really need MacPort as the ultimate default?
-        return ports.get(port_name, default_port.get(platform.system(), MacPort))()
+        return ports.get(port_name, ChromiumPort)()
 
     def makeArgs(self):
         # FIXME: This shouldn't use a static Executive().
@@ -121,64 +110,6 @@
         return self.script_shell_command("run-bindings-tests")
 
 
-class MacPort(DeprecatedPort):
-    port_flag_name = "mac"
-
-
-class MacWK2Port(DeprecatedPort):
-    port_flag_name = "mac-wk2"
-
-    def run_webkit_tests_command(self):
-        command = super(MacWK2Port, self).run_webkit_tests_command()
-        command.append("-2")
-        return command
-
-
-class WinPort(DeprecatedPort):
-    port_flag_name = "win"
-
-    def run_bindings_tests_command(self):
-        return None
-
-
-class GtkPort(DeprecatedPort):
-    port_flag_name = "gtk"
-
-    def build_webkit_command(self, build_style=None):
-        command = super(GtkPort, self).build_webkit_command(build_style=build_style)
-        command.append("--gtk")
-        command.append("--update-gtk")
-        command.append("--no-webkit2")
-        command.append(super(GtkPort, self).makeArgs())
-        return command
-
-    def run_webkit_tests_command(self):
-        command = super(GtkPort, self).run_webkit_tests_command()
-        command.append("--gtk")
-        return command
-
-
-class QtPort(DeprecatedPort):
-    port_flag_name = "qt"
-
-    def build_webkit_command(self, build_style=None):
-        command = super(QtPort, self).build_webkit_command(build_style=build_style)
-        command.append("--qt")
-        command.append(super(QtPort, self).makeArgs())
-        return command
-
-
-class EflPort(DeprecatedPort):
-    port_flag_name = "efl"
-
-    def build_webkit_command(self, build_style=None):
-        command = super(EflPort, self).build_webkit_command(build_style=build_style)
-        command.append("--efl")
-        command.append("--update-efl")
-        command.append(super(EflPort, self).makeArgs())
-        return command
-
-
 class ChromiumPort(DeprecatedPort):
     port_flag_name = "chromium"
 
diff --git a/Tools/Scripts/webkitpy/common/config/ports_unittest.py b/Tools/Scripts/webkitpy/common/config/ports_unittest.py
index a434211..7800b05 100644
--- a/Tools/Scripts/webkitpy/common/config/ports_unittest.py
+++ b/Tools/Scripts/webkitpy/common/config/ports_unittest.py
@@ -32,30 +32,6 @@
 
 
 class DeprecatedPortTest(unittest.TestCase):
-    def test_mac_port(self):
-        self.assertEqual(MacPort().flag(), "--port=mac")
-        self.assertEqual(MacPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests"))
-        self.assertEqual(MacPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit"))
-        self.assertEqual(MacPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug"])
-        self.assertEqual(MacPort().build_webkit_command(build_style="release"), DeprecatedPort().script_shell_command("build-webkit") + ["--release"])
-
-    def test_gtk_port(self):
-        self.assertEqual(GtkPort().flag(), "--port=gtk")
-        self.assertEqual(GtkPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests") + ["--gtk"])
-        self.assertEqual(GtkPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--gtk", "--update-gtk", "--no-webkit2", DeprecatedPort().makeArgs()])
-        self.assertEqual(GtkPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--gtk", "--update-gtk", "--no-webkit2", DeprecatedPort().makeArgs()])
-
-    def test_efl_port(self):
-        self.assertEqual(EflPort().flag(), "--port=efl")
-        self.assertEqual(EflPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--efl", "--update-efl", DeprecatedPort().makeArgs()])
-        self.assertEqual(EflPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--efl", "--update-efl", DeprecatedPort().makeArgs()])
-
-    def test_qt_port(self):
-        self.assertEqual(QtPort().flag(), "--port=qt")
-        self.assertEqual(QtPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("run-webkit-tests"))
-        self.assertEqual(QtPort().build_webkit_command(), DeprecatedPort().script_shell_command("build-webkit") + ["--qt", DeprecatedPort().makeArgs()])
-        self.assertEqual(QtPort().build_webkit_command(build_style="debug"), DeprecatedPort().script_shell_command("build-webkit") + ["--debug", "--qt", DeprecatedPort().makeArgs()])
-
     def test_chromium_port(self):
         self.assertEqual(ChromiumPort().flag(), "--port=chromium")
         self.assertEqual(ChromiumPort().run_webkit_tests_command(), DeprecatedPort().script_shell_command("new-run-webkit-tests") + ["--chromium", "--skip-failing-tests"])
diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist
index fd66cb4..e61f122 100644
--- a/Tools/Scripts/webkitpy/common/config/watchlist
+++ b/Tools/Scripts/webkitpy/common/config/watchlist
@@ -91,7 +91,7 @@
         },
         "SkiaGraphics": {
             "filename": r"Source/WebCore/platform/graphics/skia/"
-                        r"|Source/WebCore/platform/graphics/filters/skia/",
+                        r"|Source/WebCore/platform/graphics/filters/",
         },
         "V8Bindings": {
             "filename": r"Source/WebCore/bindings/v8/",
diff --git a/Tools/Scripts/webkitpy/common/net/irc/irc_mock.py b/Tools/Scripts/webkitpy/common/net/irc/irc_mock.py
deleted file mode 100644
index b2ae071..0000000
--- a/Tools/Scripts/webkitpy/common/net/irc/irc_mock.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-
-_log = logging.getLogger(__name__)
-
-
-class MockIRC(object):
-    def post(self, message):
-        _log.info("MOCK: irc.post: %s" % message)
-
-    def disconnect(self):
-        _log.info("MOCK: irc.disconnect")
diff --git a/Tools/Scripts/webkitpy/common/net/irc/ircbot.py b/Tools/Scripts/webkitpy/common/net/irc/ircbot.py
deleted file mode 100644
index c8c1a38..0000000
--- a/Tools/Scripts/webkitpy/common/net/irc/ircbot.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.common.config import irc as config_irc
-
-from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
-from webkitpy.thirdparty.autoinstalled.irc import ircbot
-from webkitpy.thirdparty.autoinstalled.irc import irclib
-
-
-class IRCBotDelegate(object):
-    def irc_message_received(self, nick, message):
-        raise NotImplementedError, "subclasses must implement"
-
-    def irc_nickname(self):
-        raise NotImplementedError, "subclasses must implement"
-
-    def irc_password(self):
-        raise NotImplementedError, "subclasses must implement"
-
-
-class IRCBot(ircbot.SingleServerIRCBot, MessagePumpDelegate):
-    # FIXME: We should get this information from a config file.
-    def __init__(self,
-                 message_queue,
-                 delegate):
-        self._message_queue = message_queue
-        self._delegate = delegate
-        ircbot.SingleServerIRCBot.__init__(
-            self,
-            [(
-                config_irc.server,
-                config_irc.port,
-                self._delegate.irc_password()
-            )],
-            self._delegate.irc_nickname(),
-            self._delegate.irc_nickname())
-        self._channel = config_irc.channel
-
-    # ircbot.SingleServerIRCBot methods
-
-    def on_nicknameinuse(self, connection, event):
-        connection.nick(connection.get_nickname() + "_")
-
-    def on_welcome(self, connection, event):
-        connection.join(self._channel)
-        self._message_pump = MessagePump(self, self._message_queue)
-
-    def on_pubmsg(self, connection, event):
-        nick = irclib.nm_to_n(event.source())
-        request = event.arguments()[0]
-
-        if not irclib.irc_lower(request).startswith(irclib.irc_lower(connection.get_nickname())):
-            return
-
-        if len(request) <= len(connection.get_nickname()):
-            return
-
-        # Some IRC clients, like xchat-gnome, default to using a comma
-        # when addressing someone.
-        vocative_separator = request[len(connection.get_nickname())]
-        if vocative_separator == ':':
-            request = request.split(':', 1)
-        elif vocative_separator == ',':
-            request = request.split(',', 1)
-        else:
-            return
-
-        if len(request) > 1:
-            response = self._delegate.irc_message_received(nick, request[1])
-            if response:
-                connection.privmsg(self._channel, response)
-
-    # MessagePumpDelegate methods
-
-    def schedule(self, interval, callback):
-        self.connection.execute_delayed(interval, callback)
-
-    def message_available(self, message):
-        self.connection.privmsg(self._channel, message)
-
-    def final_message_delivered(self):
-        self.die()
diff --git a/Tools/Scripts/webkitpy/common/net/irc/ircproxy.py b/Tools/Scripts/webkitpy/common/net/irc/ircproxy.py
deleted file mode 100644
index 521f6f7..0000000
--- a/Tools/Scripts/webkitpy/common/net/irc/ircproxy.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import threading
-
-from webkitpy.common.net.irc.ircbot import IRCBot
-from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
-
-_log = logging.getLogger(__name__)
-
-
-class _IRCThread(threading.Thread):
-    def __init__(self, message_queue, irc_delegate, irc_bot):
-        threading.Thread.__init__(self)
-        self.setDaemon(True)
-        self._message_queue = message_queue
-        self._irc_delegate = irc_delegate
-        self._irc_bot = irc_bot
-
-    def run(self):
-        bot = self._irc_bot(self._message_queue, self._irc_delegate)
-        bot.start()
-
-
-class IRCProxy(object):
-    def __init__(self, irc_delegate, irc_bot=IRCBot):
-        _log.info("Connecting to IRC")
-        self._message_queue = ThreadedMessageQueue()
-        self._child_thread = _IRCThread(self._message_queue, irc_delegate, irc_bot)
-        self._child_thread.start()
-
-    def post(self, message):
-        self._message_queue.post(message)
-
-    def disconnect(self):
-        _log.info("Disconnecting from IRC...")
-        self._message_queue.stop()
-        self._child_thread.join()
diff --git a/Tools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py b/Tools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
deleted file mode 100644
index 639979a..0000000
--- a/Tools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.common.net.irc.ircproxy import IRCProxy
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.thirdparty.mock import Mock
-
-class IRCProxyTest(unittest.TestCase):
-    def test_trivial(self):
-        def fun():
-            proxy = IRCProxy(Mock(), Mock())
-            proxy.post("hello")
-            proxy.disconnect()
-
-        expected_logs = "Connecting to IRC\nDisconnecting from IRC...\n"
-        OutputCapture().assert_outputs(self, fun, expected_logs=expected_logs)
diff --git a/Tools/Scripts/webkitpy/common/prettypatch.py b/Tools/Scripts/webkitpy/common/prettypatch.py
index e8a913a..ffadea6 100644
--- a/Tools/Scripts/webkitpy/common/prettypatch.py
+++ b/Tools/Scripts/webkitpy/common/prettypatch.py
@@ -53,7 +53,7 @@
             return ""
 
         pretty_patch_path = os.path.join(self._checkout_root,
-                                         "Websites", "bugs.webkit.org",
+                                         "Tools", "Scripts", "webkitruby",
                                          "PrettyPatch")
         prettify_path = os.path.join(pretty_patch_path, "prettify.rb")
         args = [
diff --git a/Tools/Scripts/webkitpy/common/prettypatch_unittest.py b/Tools/Scripts/webkitpy/common/prettypatch_unittest.py
deleted file mode 100644
index 3ae1c43..0000000
--- a/Tools/Scripts/webkitpy/common/prettypatch_unittest.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-import sys
-import unittest2 as unittest
-
-from webkitpy.common.system.executive import Executive
-from webkitpy.common.prettypatch import PrettyPatch
-
-
-class PrettyPatchTest(unittest.TestCase):
-    def check_ruby(self):
-        executive = Executive()
-        try:
-            result = executive.run_command(['ruby', '--version'])
-        except OSError, e:
-            return False
-        return True
-
-    _diff_with_multiple_encodings = """
-Index: utf8_test
-===================================================================
---- utf8_test\t(revision 0)
-+++ utf8_test\t(revision 0)
-@@ -0,0 +1 @@
-+utf-8 test: \xc2\xa0
-Index: latin1_test
-===================================================================
---- latin1_test\t(revision 0)
-+++ latin1_test\t(revision 0)
-@@ -0,0 +1 @@
-+latin1 test: \xa0
-"""
-
-    def _webkit_root(self):
-        webkitpy_common = os.path.dirname(__file__)
-        webkitpy = os.path.dirname(webkitpy_common)
-        scripts = os.path.dirname(webkitpy)
-        webkit_tools = os.path.dirname(scripts)
-        webkit_root = os.path.dirname(webkit_tools)
-        return webkit_root
-
-    def test_pretty_diff_encodings(self):
-        if not self.check_ruby():
-            return
-
-        if sys.platform == 'win32':
-            # FIXME: disabled due to https://bugs.webkit.org/show_bug.cgi?id=93192
-            return
-
-        pretty_patch = PrettyPatch(Executive(), self._webkit_root())
-        pretty = pretty_patch.pretty_diff(self._diff_with_multiple_encodings)
-        self.assertTrue(pretty)  # We got some output
-        self.assertIsInstance(pretty, str)  # It's a byte array, not unicode
-
-    def test_pretty_print_empty_string(self):
-        if not self.check_ruby():
-            return
-
-        # Make sure that an empty diff does not hang the process.
-        pretty_patch = PrettyPatch(Executive(), self._webkit_root())
-        self.assertEqual(pretty_patch.pretty_diff(""), "")
diff --git a/Tools/Scripts/webkitpy/common/system/filesystem_mock.py b/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
index ee0664e..91a7df4 100644
--- a/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -339,27 +339,32 @@
         start = self.abspath(start)
         path = self.abspath(path)
 
-        if not path.lower().startswith(start.lower()):
-            # path is outside the directory given by start; compute path from root
-            return '../' * start.count('/') + path
+        common_root = start
+        dot_dot = ''
+        while not common_root == '':
+            if path.startswith(common_root):
+                 break
+            common_root = self.dirname(common_root)
+            dot_dot += '..' + self.sep
 
-        rel_path = path[len(start):]
+        rel_path = path[len(common_root):]
 
         if not rel_path:
-            # Then the paths are the same.
-            pass
-        elif rel_path[0] == self.sep:
+            return '.'
+
+        if rel_path[0] == self.sep:
             # It is probably sufficient to remove just the first character
             # since os.path.normpath() collapses separators, but we use
             # lstrip() just to be sure.
             rel_path = rel_path.lstrip(self.sep)
-        else:
+        elif not common_root == '/':
             # We are in the case typified by the following example:
             # path = "/tmp/foobar", start = "/tmp/foo" -> rel_path = "bar"
-            # FIXME: We return a less-than-optimal result here.
-            return '../' * start.count('/') + path
+            common_root = self.dirname(common_root)
+            dot_dot += '..' + self.sep
+            rel_path = path[len(common_root) + 1:]
 
-        return rel_path
+        return dot_dot + rel_path
 
     def remove(self, path):
         if self.files[path] is None:
@@ -371,10 +376,12 @@
         path = self.normpath(path)
 
         for f in self.files:
-            if f.startswith(path):
+            # We need to add a trailing separator to path to avoid matching
+            # cases like path='/foo/b' and f='/foo/bar/baz'.
+            if f == path or f.startswith(path + self.sep):
                 self.files[f] = None
 
-        self.dirs = set(filter(lambda d: not d.startswith(path), self.dirs))
+        self.dirs = set(filter(lambda d: not (d == path or d.startswith(path + self.sep)), self.dirs))
 
     def copytree(self, source, destination):
         source = self.normpath(source)
diff --git a/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py b/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py
index 26389e7..db984d5 100644
--- a/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py
+++ b/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py
@@ -74,6 +74,31 @@
         self.fs.chdir(self.generic_test_dir)
         self.assertEqual(set(self.fs.glob('foo.*')), set(['foo.txt']))
 
+    def test_relpath(self):
+        self.assertEqual(self.fs.relpath('aaa/bbb'), 'aaa/bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb/'), 'aaa/bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb/.'), 'aaa/bbb')
+        self.assertEqual(self.fs.relpath('aaa/./bbb'), 'aaa/bbb')
+        self.assertEqual(self.fs.relpath('aaa/../bbb/'), 'bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb', 'aaa/bbb'), '.')
+        self.assertEqual(self.fs.relpath('aaa/bbb/ccc', 'aaa/bbb'), 'ccc')
+        self.assertEqual(self.fs.relpath('aaa/./ccc', 'aaa/bbb'), '../ccc')
+        self.assertEqual(self.fs.relpath('aaa/../ccc', 'aaa/bbb'), '../../ccc')
+        self.assertEqual(self.fs.relpath('aaa/bbb', 'aaa/ccc'), '../bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb', 'ccc/ddd'), '../../aaa/bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb', 'aaa/b'), '../bbb')
+        self.assertEqual(self.fs.relpath('aaa/bbb', 'a/bbb'), '../../aaa/bbb')
+
+    def test_rmtree(self):
+        self.fs.chdir(self.generic_test_dir)
+        self.fs.rmtree('foo')
+        self.assertTrue(self.fs.exists('foodir'))
+        self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz')))
+        self.fs.rmtree('foodir')
+        self.assertFalse(self.fs.exists('foodir'))
+        self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz')))
+
+
 class RealFileSystemTest(unittest.TestCase, GenericFileSystemTests):
     def setUp(self):
         self.fs = FileSystem()
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
new file mode 100644
index 0000000..7e39129
--- /dev/null
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
@@ -0,0 +1,123 @@
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Generates a fake TestExpectations file consisting of flaky tests from the bot
+corresponding to the give port."""
+
+import json
+import logging
+import os.path
+import urllib
+import urllib2
+
+from webkitpy.layout_tests.port import builders
+
+_log = logging.getLogger(__name__)
+
+
+class BotTestExpectations(object):
+    RLE_LENGTH = 0
+    RLE_VALUE = 1
+    RESULTS_KEY = 'results'
+    TESTS_KEY = 'tests'
+    RESULTS_URL_PREFIX = 'http://test-results.appspot.com/testfile?master=ChromiumWebkit&testtype=layout-tests&name=results-small.json&builder='
+
+    # FIXME: This map should be generated from data in json_layout_results_generator.py and test_expectations.py.
+    MAP_ENCODED_RESULT_STRING_TO_EXPECTATIONS_VALUE = {
+        'P': 'Pass',
+        'N': '', # No data
+        'X': '', # Skip
+        'T': 'Timeout',
+        'F': 'Failure', # text-only
+        'C': 'Crash',
+        'I': 'ImageOnlyFailure',
+        'Z': 'Failure', # image+text
+        'O': 'Missing',
+    };
+
+    def __init__(self, only_ignore_very_flaky):
+        self._only_ignore_very_flaky = only_ignore_very_flaky
+
+    def expectations_string(self, port_name):
+        builder_name = builders.builder_name_for_port_name(port_name)
+        if not builder_name:
+            return ""
+
+        url = self.RESULTS_URL_PREFIX + urllib.quote(builder_name)
+        try:
+            _log.debug('Fetching flakiness data from appengine.')
+            data = urllib2.urlopen(url)
+            parsed_data = json.load(data)[builder_name]
+            result = self._generate_expectations_string(parsed_data)
+            return result
+        except urllib2.URLError as error:
+            _log.warning('Could not retrieve flakiness data from the bot.')
+            _log.warning(error)
+            return ""
+
+    def _generate_expectations_string(self, test_data):
+        out = []
+        self._walk_tests_trie(test_data[self.TESTS_KEY], out)
+        return "\n".join(out)
+
+    def _actual_results_for_test(self, run_length_encoded_results):
+        resultsMap = {}
+
+        seenResults = {};
+        for result in run_length_encoded_results:
+            numResults = result[self.RLE_LENGTH];
+            result_string = result[self.RLE_VALUE];
+
+            if result_string == 'N' or result_string == 'X':
+                continue
+
+            if self._only_ignore_very_flaky and result_string not in seenResults:
+                # Only consider a short-lived result if we've seen it more than once.
+                # Otherwise, we include lots of false-positives due to tests that fail
+                # for a couple runs and then start passing.
+                # FIXME: Maybe we should make this more liberal and consider it a flake
+                # even if we only see that failure once.
+                seenResults[result_string] = True
+                continue
+
+            expectation = self.MAP_ENCODED_RESULT_STRING_TO_EXPECTATIONS_VALUE[result_string]
+            resultsMap[expectation] = True;
+
+        return resultsMap.keys()
+
+    def _walk_tests_trie(self, trie, out, path_so_far=""):
+        for name in trie:
+            new_path = os.path.join(path_so_far, name)
+            if self.RESULTS_KEY not in trie[name]:
+                self._walk_tests_trie(trie[name], out, new_path)
+                continue
+
+            results = trie[name][self.RESULTS_KEY]
+            actual_results = self._actual_results_for_test(results)
+            if len(actual_results) > 1:
+                out.append('Bug(auto) %s [ %s ]' % (new_path, " ".join(actual_results)))
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py
new file mode 100644
index 0000000..d98ac84
--- /dev/null
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py
@@ -0,0 +1,86 @@
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest2 as unittest
+
+from webkitpy.layout_tests.layout_package import bot_test_expectations
+
+class BotTestExpectationsTest(unittest.TestCase):
+
+    def test_basic(self):
+        expectations = bot_test_expectations.BotTestExpectations(only_ignore_very_flaky=True)
+        test_data = {
+            'tests': {
+                'foo': {
+                    'veryflaky.html': {
+                        'results': [[1, 'F'], [1, 'P'], [1, 'F'], [1, 'P']]
+                    },
+                    'maybeflaky.html': {
+                        'results': [[3, 'P'], [1, 'F'], [3, 'P']]
+                    },
+                    'notflakypass.html': {
+                        'results': [[4, 'P']]
+                    },
+                    'notflakyfail.html': {
+                        'results': [[4, 'F']]
+                    },
+                }
+            }
+        }
+        output = expectations._generate_expectations_string(test_data)
+        expected_output = """Bug(auto) foo/veryflaky.html [ Failure Pass ]"""
+        self.assertMultiLineEqual(output, expected_output)
+
+        expectations = bot_test_expectations.BotTestExpectations(only_ignore_very_flaky=False)
+        output = expectations._generate_expectations_string(test_data)
+        expected_output = """Bug(auto) foo/veryflaky.html [ Failure Pass ]
+Bug(auto) foo/maybeflaky.html [ Failure Pass ]"""
+        self.assertMultiLineEqual(output, expected_output)
+
+    def test_all_failure_types(self):
+        expectations = bot_test_expectations.BotTestExpectations(only_ignore_very_flaky=True)
+        test_data = {
+            'tests': {
+                'foo': {
+                    'allfailures.html': {
+                        'results': [[1, 'F'], [1, 'P'], [1, 'F'], [1, 'P'],
+                            [1, 'C'], [1, 'N'], [1, 'C'], [1, 'N'],
+                            [1, 'T'], [1, 'X'], [1, 'T'], [1, 'X'],
+                            [1, 'I'], [1, 'Z'], [1, 'I'], [1, 'Z'],
+                            [1, 'O'], [1, 'C'], [1, 'O'], [1, 'C']]
+                    },
+                    'imageplustextflake.html': {
+                        'results': [[1, 'Z'], [1, 'P'], [1, 'Z'], [1, 'P']]
+                    },
+                }
+            }
+        }
+        output = expectations._generate_expectations_string(test_data)
+        expected_output = """Bug(auto) foo/imageplustextflake.html [ Failure Pass ]
+Bug(auto) foo/allfailures.html [ Crash Missing ImageOnlyFailure Failure Timeout Pass ]"""
+        self.assertMultiLineEqual(output, expected_output)
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover.py b/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover.py
new file mode 100755
index 0000000..9e11800
--- /dev/null
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover.py
@@ -0,0 +1,324 @@
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Moves a directory of LayoutTests.
+
+Given a path to a directory of LayoutTests, moves that directory, including all recursive children,
+to the specified destination path. Updates all references in tests and resources to reflect the new
+location. Also moves any corresponding platform-specific expected results and updates the test
+expectations to reflect the move.
+
+If the destination directory does not exist, it and any missing parent directories are created. If
+the destination directory already exists, the child members of the origin directory are added to the
+destination directory. If any of the child members clash with existing members of the destination
+directory, the move fails.
+
+Note that when new entries are added to the test expectations, no attempt is made to group or merge
+them with existing entries. This should be be done manually and with lint-test-expectations.
+"""
+
+import argparse
+import copy
+import logging
+import os
+import re
+import urlparse
+
+from webkitpy.common.checkout.scm.detection import SCMDetector
+from webkitpy.common.host import Host
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.filesystem import FileSystem
+from webkitpy.layout_tests.port.base import Port
+from webkitpy.layout_tests.models.test_expectations import TestExpectations
+
+
+logging.basicConfig()
+_log = logging.getLogger(__name__)
+_log.setLevel(logging.INFO)
+
+PLATFORM_DIRECTORY = 'platform'
+
+class LayoutTestsMover(object):
+
+    def __init__(self, port=None):
+        self._port = port
+        if not self._port:
+            host = Host()
+            # Given that we use include_overrides=False and model_all_expectations=True when
+            # constructing the TestExpectations object, it doesn't matter which Port object we use.
+            self._port = host.port_factory.get()
+            self._port.host.initialize_scm()
+        self._filesystem = self._port.host.filesystem
+        self._scm = self._port.host.scm()
+        self._layout_tests_root = self._port.layout_tests_dir()
+
+    def _scm_path(self, *paths):
+        return self._filesystem.join('LayoutTests', *paths)
+
+    def _is_child_path(self, parent, possible_child):
+        normalized_parent = self._filesystem.normpath(parent)
+        normalized_child = self._filesystem.normpath(possible_child)
+        # We need to add a trailing separator to parent to avoid returning true for cases like
+        # parent='/foo/b', and possible_child='/foo/bar/baz'.
+        return normalized_parent == normalized_child or normalized_child.startswith(normalized_parent + self._filesystem.sep)
+
+    def _move_path(self, path, origin, destination):
+        if not self._is_child_path(origin, path):
+            return path
+        return self._filesystem.normpath(self._filesystem.join(destination, self._filesystem.relpath(path, origin)))
+
+    def _validate_input(self):
+        if not self._filesystem.isdir(self._absolute_origin):
+            raise Exception('Source path %s is not a directory' % self._origin)
+        if not self._is_child_path(self._layout_tests_root, self._absolute_origin):
+            raise Exception('Source path %s is not in LayoutTests directory' % self._origin)
+        if self._filesystem.isfile(self._absolute_destination):
+            raise Exception('Destination path %s is a file' % self._destination)
+        if not self._is_child_path(self._layout_tests_root, self._absolute_destination):
+            raise Exception('Destination path %s is not in LayoutTests directory' % self._destination)
+
+        # If destination is an existing directory, we move the children of origin into destination.
+        # However, if any of the children of origin would clash with existing children of
+        # destination, we fail.
+        # FIXME: Consider adding support for recursively moving into an existing directory.
+        if self._filesystem.isdir(self._absolute_destination):
+            for file_path in self._filesystem.listdir(self._absolute_origin):
+                if self._filesystem.exists(self._filesystem.join(self._absolute_destination, file_path)):
+                    raise Exception('Origin path %s clashes with existing destination path %s' %
+                            (self._filesystem.join(self._origin, file_path), self._filesystem.join(self._destination, file_path)))
+
+    def _get_expectations_for_test(self, model, test_path):
+        """Given a TestExpectationsModel object, finds all expectations that match the specified
+        test, specified as a relative path. Handles the fact that expectations may be keyed by
+        directory.
+        """
+        expectations = set()
+        if model.has_test(test_path):
+            expectations.add(model.get_expectation_line(test_path))
+        test_path = self._filesystem.dirname(test_path)
+        while not test_path == '':
+            # The model requires a trailing slash for directories.
+            test_path_for_model = test_path + '/'
+            if model.has_test(test_path_for_model):
+                expectations.add(model.get_expectation_line(test_path_for_model))
+            test_path = self._filesystem.dirname(test_path)
+        return expectations
+
+    def _get_expectations(self, model, path):
+        """Given a TestExpectationsModel object, finds all expectations for all tests under the
+        specified relative path.
+        """
+        expectations = set()
+        for test in self._filesystem.files_under(self._filesystem.join(self._layout_tests_root, path), dirs_to_skip=['script-tests', 'resources'],
+                                                 file_filter=Port.is_test_file):
+            expectations = expectations.union(self._get_expectations_for_test(model, self._filesystem.relpath(test, self._layout_tests_root)))
+        return expectations
+
+    @staticmethod
+    def _clone_expectation_line_for_path(expectation_line, path):
+        """Clones a TestExpectationLine object and updates the clone to apply to the specified
+        relative path.
+        """
+        clone = copy.copy(expectation_line)
+        clone.original_string = re.compile(expectation_line.name).sub(path, expectation_line.original_string)
+        clone.name = path
+        clone.path = path
+        # FIXME: Should we search existing expectations for matches, like in
+        # TestExpectationsParser._collect_matching_tests()?
+        clone.matching_tests = [path]
+        return clone
+
+    def _update_expectations(self):
+        """Updates all test expectations that are affected by the move.
+        """
+        _log.info('Updating expectations')
+        test_expectations = TestExpectations(self._port, include_overrides=False, model_all_expectations=True)
+
+        for expectation in self._get_expectations(test_expectations.model(), self._origin):
+            path = expectation.path
+            if self._is_child_path(self._origin, path):
+                # If the existing expectation is a child of the moved path, we simply replace it
+                # with an expectation for the updated path.
+                new_path = self._move_path(path, self._origin, self._destination)
+                _log.debug('Updating expectation for %s to %s' % (path, new_path))
+                test_expectations.remove_expectation_line(path)
+                test_expectations.add_expectation_line(LayoutTestsMover._clone_expectation_line_for_path(expectation, new_path))
+            else:
+                # If the existing expectation is not a child of the moved path, we have to leave it
+                # in place. But we also add a new expectation for the destination path.
+                new_path = self._destination
+                _log.warning('Copying expectation for %s to %s. You should check that these expectations are still correct.' %
+                             (path, new_path))
+                test_expectations.add_expectation_line(LayoutTestsMover._clone_expectation_line_for_path(expectation, new_path))
+
+        expectations_file = self._port.path_to_generic_test_expectations_file()
+        self._filesystem.write_text_file(expectations_file,
+                                         TestExpectations.list_to_string(test_expectations._expectations, reconstitute_only_these=[]))
+        self._scm.add(self._filesystem.relpath(expectations_file, self._scm.checkout_root))
+
+    def _find_references(self, input_files):
+        """Attempts to find all references to other files in the supplied list of files. Returns a
+        dictionary that maps from an absolute file path to an array of reference strings.
+        """
+        reference_regex = re.compile(r'(?:src=|href=|importScripts\(|url\()(?:"([^"]*)"|\'([^\']*)\')')
+        references = {}
+        for input_file in input_files:
+            matches = reference_regex.findall(self._filesystem.read_binary_file(input_file))
+            if matches:
+                references[input_file] = [(match[0] if match[0] else match[1]) for match in matches]
+        return references
+
+    def _get_updated_reference(self, root, reference):
+        """For a reference <reference> in a directory <root>, determines the updated reference.
+        Returns the the updated reference, or None if no update is required.
+        """
+        # If the reference is the empty string or an absolute path or url, it's safe.
+        if reference == '' or reference.startswith('/') or urlparse.urlparse(reference).scheme:
+            return None
+
+        # Both the root path and the target of the reference my be subject to the move, so there are
+        # four cases to consider. In the case where both or neither are subject to the move, the
+        # reference doesn't need updating.
+        #
+        # This is true even if the reference includes superfluous dot segments which mention a moved
+        # directory, as dot segments are collapsed during URL normalization. For example, if
+        # foo.html contains a reference 'bar/../script.js', this remains valid (though ugly) even if
+        # bar/ is moved to baz/, because the reference is always normalized to 'script.js'.
+        absolute_reference = self._filesystem.normpath(self._filesystem.join(root, reference))
+        if self._is_child_path(self._absolute_origin, root) == self._is_child_path(self._absolute_origin, absolute_reference):
+            return None;
+
+        new_root = self._move_path(root, self._absolute_origin, self._absolute_destination)
+        new_absolute_reference = self._move_path(absolute_reference, self._absolute_origin, self._absolute_destination)
+        return self._filesystem.relpath(new_absolute_reference, new_root)
+
+    def _get_all_updated_references(self, references):
+        """Determines the updated references due to the move. Returns a dictionary that maps from an
+        absolute file path to a dictionary that maps from a reference string to the corresponding
+        updated reference.
+        """
+        updates = {}
+        for file_path in references.keys():
+            root = self._filesystem.dirname(file_path)
+            # sript-tests/TEMPLATE.html files contain references which are written as if the file
+            # were in the parent directory. This special-casing is ugly, but there are plans to
+            # remove script-tests.
+            if root.endswith('script-tests') and file_path.endswith('TEMPLATE.html'):
+                root = self._filesystem.dirname(root)
+            local_updates = {}
+            for reference in references[file_path]:
+                update = self._get_updated_reference(root, reference)
+                if update:
+                    local_updates[reference] = update
+            if local_updates:
+                updates[file_path] = local_updates
+        return updates
+
+    def _update_file(self, path, updates):
+        contents = self._filesystem.read_binary_file(path)
+        # Note that this regex isn't quite as strict as that used to find the references, as it
+        # doesn't force the type of the opening and closing quotes to match. But this avoids the
+        # need for alternative match groups, which simplifies things.
+        for target in updates.keys():
+            regex = re.compile(r'((?:src=|href=|importScripts\(|url\()["\'])%s(["\'])' % target)
+            contents = regex.sub(r'\1%s\2' % updates[target], contents)
+        self._filesystem.write_binary_file(path, contents)
+        self._scm.add(path)
+
+    def _update_test_source_files(self):
+        def is_test_source_file(filesystem, dirname, basename):
+            pass_regex = re.compile(r'\.(css|js)$')
+            fail_regex = re.compile(r'-expected\.')
+            return (Port.is_test_file(filesystem, dirname, basename) or pass_regex.search(basename)) and not fail_regex.search(basename)
+
+        test_source_files = self._filesystem.files_under(self._layout_tests_root, file_filter=is_test_source_file)
+        _log.info('Considering %s test source files for references' % len(test_source_files))
+        references = self._find_references(test_source_files)
+        _log.info('Considering references in %s files' % len(references))
+        updates = self._get_all_updated_references(references)
+        _log.info('Updating references in %s files' % len(updates))
+        count = 0
+        for file_path in updates.keys():
+            self._update_file(file_path, updates[file_path])
+            count += 1
+            if count % 1000 == 0 or count == len(updates):
+                _log.debug('Updated references in %s files' % count)
+
+    def _move_directory(self, origin, destination):
+        """Moves the directory <origin> to <destination>. If <destination> is a directory, moves the
+        children of <origin> into <destination>. Uses relative paths.
+        """
+        absolute_origin = self._filesystem.join(self._layout_tests_root, origin)
+        if not self._filesystem.isdir(absolute_origin):
+            return
+        _log.info('Moving directory %s to %s' % (origin, destination))
+        # Note that FileSystem.move() may silently overwrite existing files, but we
+        # check for this in _validate_input().
+        absolute_destination = self._filesystem.join(self._layout_tests_root, destination)
+        self._filesystem.maybe_make_directory(absolute_destination)
+        for directory in self._filesystem.listdir(absolute_origin):
+            self._scm.move(self._scm_path(origin, directory), self._scm_path(destination, directory))
+        self._filesystem.rmtree(absolute_origin)
+
+    def _move_files(self):
+        """Moves the all files that correspond to the move, including platform-specific expected
+        results.
+        """
+        self._move_directory(self._origin, self._destination)
+        for directory in self._filesystem.listdir(self._filesystem.join(self._layout_tests_root, PLATFORM_DIRECTORY)):
+            self._move_directory(self._filesystem.join(PLATFORM_DIRECTORY, directory, self._origin),
+                           self._filesystem.join(PLATFORM_DIRECTORY, directory, self._destination))
+
+    def _commit_changes(self):
+        if not self._scm.supports_local_commits():
+            return
+        title = 'Move LayoutTests directory %s to %s' % (self._origin, self._destination)
+        _log.info('Committing change \'%s\'' % title)
+        self._scm.commit_locally_with_message('%s\n\nThis commit was automatically generated by move-layout-tests.' % title,
+                                              commit_all_working_directory_changes=False)
+
+    def move(self, origin, destination):
+        self._origin = origin
+        self._destination = destination
+        self._absolute_origin = self._filesystem.join(self._layout_tests_root, self._origin)
+        self._absolute_destination = self._filesystem.join(self._layout_tests_root, self._destination)
+        self._validate_input()
+        self._update_expectations()
+        self._update_test_source_files()
+        self._move_files()
+        # FIXME: Handle virtual test suites.
+        self._commit_changes()
+
+def main(argv):
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument('origin',
+                        help=('The directory of tests to move, as a relative path from the LayoutTests directory.'))
+    parser.add_argument('destination',
+                        help=('The new path for the directory of tests, as a relative path from the LayoutTests directory.'))
+    args = parser.parse_args()
+    LayoutTestsMover().move(args.origin, args.destination)
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover_unittest.py
new file mode 100755
index 0000000..a83b2d3
--- /dev/null
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_tests_mover_unittest.py
@@ -0,0 +1,155 @@
+# Copyright (C) 2013 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import unittest2 as unittest
+
+from webkitpy.common.host_mock import MockHost
+from webkitpy.common.checkout.scm.scm_mock import MockSCM
+from webkitpy.common.system.filesystem_mock import MockFileSystem
+from webkitpy.layout_tests.layout_tests_mover import LayoutTestsMover
+from webkitpy.layout_tests.port.chromium import ChromiumPort
+
+
+class MockPort(ChromiumPort):
+
+    def __init__(self, **kwargs):
+        # This sets up a mock FileSystem and SCM using that FileSystem.
+        host = MockHost()
+        ChromiumPort.__init__(self, host, host.port_factory.all_port_names()[0], **kwargs)
+
+        host.filesystem.maybe_make_directory(self._absolute_path('platform'))
+        host.filesystem.maybe_make_directory(self._absolute_path('existing_directory'))
+        host.filesystem.write_text_file(self._absolute_path('existing_file.txt'), '')
+        host.filesystem.write_text_file(self._absolute_path('TestExpectations'), """
+crbug.com/42 [ Debug ] origin/path/test.html [ Pass Timeout Failure ]
+crbug.com/42 [ Win ] origin/path [ Slow ]
+crbug.com/42 [ Release ] origin [ Crash ]
+""")
+        host.filesystem.write_text_file(self._absolute_path('existing_directory_with_contents', 'test.html'), '')
+        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.html'), """
+<script src="local_script.js">
+<script src="../../unmoved/remote_script.js">
+<script href="../../unmoved/remote_script.js">
+""")
+        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.css'), """
+url('../../unmoved/url_function.js')
+""")
+        host.filesystem.write_text_file(self._absolute_path('origin', 'path', 'test.js'), """
+importScripts('../../unmoved/import_scripts_function.js')
+""")
+        host.filesystem.write_text_file(self._absolute_path('unmoved', 'test.html'), """
+<script src="local_script.js">
+<script src="../origin/path/remote_script.js">
+""")
+
+    def _absolute_path(self, *paths):
+        return self.host.scm().absolute_path('LayoutTests', *paths)
+
+    def layout_tests_dir(self):
+        return self._absolute_path()
+
+
+class LayoutTestsMoverTest(unittest.TestCase):
+
+    def setUp(self):
+        port = MockPort()
+        self._port = port
+        self._filesystem = self._port.host.filesystem
+        self._mover = LayoutTestsMover(port=self._port)
+
+    def test_non_existent_origin_raises(self):
+        self.assertRaises(Exception, self._mover.move, 'non_existent', 'destination')
+
+    def test_origin_outside_layout_tests_directory_raises(self):
+        self.assertRaises(Exception, self._mover.move, '../outside', 'destination')
+
+    def test_file_destination_raises(self):
+        self.assertRaises(Exception, self._mover.move, 'origin/path', 'existing_file.txt')
+
+    def test_destination_outside_layout_tests_directory_raises(self):
+        self.assertRaises(Exception, self._mover.move, 'origin/path', '../outside')
+
+    def test_basic_operation(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin/path')))
+        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('destination/test.html')))
+
+    def test_move_to_existing_directory(self):
+        self._mover.move('origin/path', 'existing_directory')
+        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin', 'path')))
+        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('existing_directory', 'test.html')))
+
+    def test_collision_in_existing_directory_raises(self):
+        self.assertRaises(Exception, self._mover.move, 'origin/path', 'existing_directory_with_contents')
+
+    def test_move_to_layout_tests_root(self):
+        self._mover.move('origin/path', '')
+        self.assertFalse(self._filesystem.exists(self._port._absolute_path('origin', 'path')))
+        self.assertTrue(self._filesystem.isfile(self._port._absolute_path('test.html')))
+
+    def test_moved_reference_in_moved_file_not_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('src="local_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
+
+    def test_unmoved_reference_in_unmoved_file_not_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('src="local_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('unmoved', 'test.html')))
+
+    def test_moved_reference_in_unmoved_file_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('src="../destination/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('unmoved', 'test.html')))
+
+    def test_unmoved_reference_in_moved_file_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('src="../unmoved/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
+        self.assertTrue('href="../unmoved/remote_script.js"' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.html')))
+
+    def test_css_file_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('url(\'../unmoved/url_function.js\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.css')))
+
+    def test_javascript_file_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('importScripts(\'../unmoved/import_scripts_function.js\')' in self._filesystem.read_text_file(self._port._absolute_path('destination', 'test.js')))
+
+    def test_expectation_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertFalse('origin/path/test.html' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
+        self.assertTrue('crbug.com/42 [ Debug ] destination/test.html [ Pass Timeout Failure ]'
+                        in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
+
+    def test_directory_expectation_is_updated(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertFalse('origin/path' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
+        self.assertTrue('crbug.com/42 [ Win ] destination [ Slow ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
+
+    def test_expectation_is_added_when_subdirectory_moved(self):
+        self._mover.move('origin/path', 'destination')
+        self.assertTrue('crbug.com/42 [ Release ] origin [ Crash ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
+        self.assertTrue('crbug.com/42 [ Release ] destination [ Crash ]' in self._filesystem.read_text_file(self._port._absolute_path('TestExpectations')))
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py b/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
index 95d0f2b..5e0cd04 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
@@ -26,6 +26,8 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+import copy
+
 
 class TestConfiguration(object):
     def __init__(self, version, architecture, build_type):
@@ -146,7 +148,7 @@
     def to_config_set(self, specifier_set, error_list=None):
         """Convert a list of specifiers into a set of TestConfiguration instances."""
         if len(specifier_set) == 0:
-            return self._all_test_configurations
+            return copy.copy(self._all_test_configurations)
 
         matching_sets = {}
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
index f5c977e..eaf16f7 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
@@ -587,6 +587,11 @@
                 return item[0].upper()
         raise ValueError(expectation)
 
+    def remove_expectation_line(self, test):
+        if not self.has_test(test):
+            return
+        self._clear_expectations_for_test(test)
+        del self._test_to_expectation_line[test]
 
     def add_expectation_line(self, expectation_line, in_skipped=False):
         """Returns a list of warnings encountered while matching modifiers."""
@@ -842,10 +847,11 @@
     # FIXME: This constructor does too much work. We should move the actual parsing of
     # the expectations into separate routines so that linting and handling overrides
     # can be controlled separately, and the constructor can be more of a no-op.
-    def __init__(self, port, tests=None, include_generic=True, include_overrides=True, expectations_to_lint=None):
+    def __init__(self, port, tests=None, include_overrides=True, expectations_to_lint=None, model_all_expectations=False):
         self._full_test_list = tests
         self._test_config = port.test_configuration()
         self._is_lint_mode = expectations_to_lint is not None
+        self._model_all_expectations = self._is_lint_mode or model_all_expectations
         self._model = TestExpectationsModel(self._shorten_filename)
         self._parser = TestExpectationParser(port, tests, self._is_lint_mode)
         self._port = port
@@ -855,16 +861,8 @@
         expectations_dict = expectations_to_lint or port.expectations_dict()
 
         expectations_dict_index = 0
-        # Populate generic expectations (if enabled by include_generic).
+        # Populate generic expectations (always enabled).
         if port.path_to_generic_test_expectations_file() in expectations_dict:
-            if include_generic:
-                expectations = self._parser.parse(expectations_dict.keys()[expectations_dict_index], expectations_dict.values()[expectations_dict_index])
-                self._add_expectations(expectations)
-                self._expectations += expectations
-            expectations_dict_index += 1
-
-        # Populate default port expectations (always enabled).
-        if len(expectations_dict) > expectations_dict_index:
             expectations = self._parser.parse(expectations_dict.keys()[expectations_dict_index], expectations_dict.values()[expectations_dict_index])
             self._add_expectations(expectations)
             self._expectations += expectations
@@ -1002,7 +1000,7 @@
             if not expectation_line.expectations:
                 continue
 
-            if self._is_lint_mode or self._test_config in expectation_line.matching_configurations:
+            if self._model_all_expectations or self._test_config in expectation_line.matching_configurations:
                 self._model.add_expectation_line(expectation_line)
 
     def add_skipped_tests(self, tests_to_skip):
@@ -1016,6 +1014,16 @@
             expectation_line = self._parser.expectation_for_skipped_test(test_name)
             self._model.add_expectation_line(expectation_line, in_skipped=True)
 
+    def add_expectation_line(self, expectation_line):
+        self._model.add_expectation_line(expectation_line)
+        self._expectations += [expectation_line]
+
+    def remove_expectation_line(self, test):
+        if not self._model.has_test(test):
+            return
+        self._expectations.remove(self._model.get_expectation_line(test))
+        self._model.remove_expectation_line(test)
+
     @staticmethod
     def list_to_string(expectation_lines, test_configuration_converter=None, reconstitute_only_these=None):
         def serialize(expectation_line):
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
index 966a4a6..a198cce 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
@@ -33,7 +33,6 @@
 
 from webkitpy.layout_tests.models.test_configuration import *
 from webkitpy.layout_tests.models.test_expectations import *
-from webkitpy.layout_tests.models.test_configuration import *
 
 try:
     from collections import OrderedDict
@@ -248,7 +247,7 @@
 
 class SkippedTests(Base):
     def check(self, expectations, overrides, skips, lint=False):
-        port = MockHost().port_factory.get('qt')
+        port = MockHost().port_factory.get('test-win-xp')
         port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo')
         expectations_dict = OrderedDict()
         expectations_dict['expectations'] = expectations
@@ -287,7 +286,7 @@
                    skips=['failures/expected'])
 
     def test_skipped_entry_dont_exist(self):
-        port = MockHost().port_factory.get('qt')
+        port = MockHost().port_factory.get('test-win-xp')
         expectations_dict = OrderedDict()
         expectations_dict['expectations'] = ''
         port.expectations_dict = lambda: expectations_dict
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/apple.py b/Tools/Scripts/webkitpy/layout_tests/port/apple.py
deleted file mode 100644
index 9290bca..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/apple.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-
-from webkitpy.layout_tests.port.base import Port
-from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-
-
-_log = logging.getLogger(__name__)
-
-
-class ApplePort(Port):
-    """Shared logic between all of Apple's ports."""
-
-    # This is used to represent the version of an operating system
-    # corresponding to the "mac" or "win" base LayoutTests/platform
-    # directory.  I'm not sure this concept is very useful,
-    # but it gives us a way to refer to fallback paths *only* including
-    # the base directory.
-    # This is mostly done because TestConfiguration assumes that self.version()
-    # will never return None. (None would be another way to represent this concept.)
-    # Apple supposedly has explicit "future" results which are kept in an internal repository.
-    # It's possible that Apple would want to fix this code to work better with those results.
-    FUTURE_VERSION = 'future'  # FIXME: This whole 'future' thing feels like a hack.
-
-    # overridden in subclasses
-    VERSION_FALLBACK_ORDER = []
-    ARCHITECTURES = []
-
-    @classmethod
-    def determine_full_port_name(cls, host, options, port_name):
-        options = options or {}
-        if port_name in (cls.port_name, cls.port_name + '-wk2'):
-            # If the port_name matches the (badly named) cls.port_name, that
-            # means that they passed 'mac' or 'win' and didn't specify a version.
-            # That convention means that we're supposed to use the version currently
-            # being run, so this won't work if you're not on mac or win (respectively).
-            # If you're not on the o/s in question, you must specify a full version or -future (cf. above).
-            assert host.platform.os_name in port_name, "%s is not in %s!" % (host.platform.os_name, port_name)
-            if port_name == cls.port_name and not getattr(options, 'webkit_test_runner', False):
-                port_name = cls.port_name + '-' + host.platform.os_version
-            else:
-                port_name = cls.port_name + '-' + host.platform.os_version + '-wk2'
-        elif getattr(options, 'webkit_test_runner', False) and  '-wk2' not in port_name:
-            port_name += '-wk2'
-
-        return port_name
-
-    def _strip_port_name_prefix(self, port_name):
-        # Callers treat this return value as the "version", which only works
-        # because Apple ports use a simple name-version port_name scheme.
-        # FIXME: This parsing wouldn't be needed if port_name handling was moved to factory.py
-        # instead of the individual port constructors.
-        return port_name[len(self.port_name + '-'):]
-
-    def __init__(self, host, port_name, **kwargs):
-        super(ApplePort, self).__init__(host, port_name, **kwargs)
-
-        allowed_port_names = self.VERSION_FALLBACK_ORDER + [self.operating_system() + "-future"]
-        port_name = port_name.replace('-wk2', '')
-        self._version = self._strip_port_name_prefix(port_name)
-        assert port_name in allowed_port_names, "%s is not in %s" % (port_name, allowed_port_names)
-
-    def _skipped_file_search_paths(self):
-        # We don't have a dedicated Skipped file for the most recent version of the port;
-        # we just use the one in platform/{mac,win}
-        most_recent_name = self.VERSION_FALLBACK_ORDER[-1]
-        return set(filter(lambda name: name != most_recent_name, super(ApplePort, self)._skipped_file_search_paths()))
-
-    # FIXME: A more sophisticated version of this function should move to WebKitPort and replace all calls to name().
-    # This is also a misleading name, since 'mac-future' gets remapped to 'mac'.
-    def _port_name_with_version(self):
-        return self.name().replace('-future', '').replace('-wk2', '')
-
-    def _generate_all_test_configurations(self):
-        configurations = []
-        allowed_port_names = self.VERSION_FALLBACK_ORDER + [self.operating_system() + "-future"]
-        for port_name in allowed_port_names:
-            for build_type in self.ALL_BUILD_TYPES:
-                for architecture in self.ARCHITECTURES:
-                    configurations.append(TestConfiguration(version=self._strip_port_name_prefix(port_name), architecture=architecture, build_type=build_type))
-        return configurations
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 0811c9f..56f7662 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -54,6 +54,7 @@
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.common.system.systemhost import SystemHost
 from webkitpy.common.webkit_finder import WebKitFinder
+from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestExpectations
 from webkitpy.layout_tests.models.test_configuration import TestConfiguration
 from webkitpy.layout_tests.port import config as port_config
 from webkitpy.layout_tests.port import driver
@@ -84,14 +85,13 @@
 
     ALL_BUILD_TYPES = ('debug', 'release')
 
+    CONTENT_SHELL_NAME = 'content_shell'
+
     @classmethod
     def determine_full_port_name(cls, host, options, port_name):
         """Return a fully-specified port name that can be used to construct objects."""
         # Subclasses will usually override this.
-        options = options or {}
         assert port_name.startswith(cls.port_name)
-        if getattr(options, 'webkit_test_runner', False) and not '-wk2' in port_name:
-            return port_name + '-wk2'
         return port_name
 
     def __init__(self, host, port_name, options=None, **kwargs):
@@ -109,9 +109,6 @@
         # options defined on it.
         self._options = options or optparse.Values()
 
-        if self._name and '-wk2' in self._name:
-            self._options.webkit_test_runner = True
-
         self.host = host
         self._executive = host.executive
         self._filesystem = host.filesystem
@@ -141,7 +138,7 @@
         self._wdiff_available = None
 
         # FIXME: prettypatch.py knows this path, why is it copied here?
-        self._pretty_patch_path = self.path_from_webkit_base("Websites", "bugs.webkit.org", "PrettyPatch", "prettify.rb")
+        self._pretty_patch_path = self.path_from_webkit_base("Tools", "Scripts", "webkitruby", "PrettyPatch", "prettify.rb")
         self._pretty_patch_available = None
 
         if not hasattr(options, 'configuration') or not options.configuration:
@@ -151,7 +148,12 @@
         self._results_directory = None
         self._root_was_set = hasattr(options, 'root') and options.root
 
+    def buildbot_archives_baselines(self):
+        return True
+
     def additional_drt_flag(self):
+        if self.driver_name() == self.CONTENT_SHELL_NAME:
+            return ['--dump-render-tree']
         return []
 
     def supports_per_test_timeout(self):
@@ -162,10 +164,6 @@
         return False
 
     def default_timeout_ms(self):
-        if self.get_option('webkit_test_runner'):
-            # Add some more time to WebKitTestRunner because it needs to syncronise the state
-            # with the web process and we want to detect if there is a problem with that in the driver.
-            return 80 * 1000
         return 35 * 1000
 
     def driver_stop_timeout(self):
@@ -223,8 +221,6 @@
         """Return a list of absolute paths to directories to search under for
         baselines. The directories are searched in order."""
         search_paths = []
-        if self.get_option('webkit_test_runner'):
-            search_paths.append(self._wk2_port_name())
         search_paths.append(self.name())
         if self.name() != self.port_name:
             search_paths.append(self.port_name)
@@ -242,7 +238,7 @@
         """This routine is used to ensure that the build is up to date
         and all the needed binaries are present."""
         # If we're using a pre-built copy of WebKit (--root), we assume it also includes a build of DRT.
-        if not self._root_was_set and self.get_option('build') and not self._build_driver():
+        if not self._root_was_set and self.get_option('build'):
             return False
         if not self._check_driver():
             return False
@@ -398,8 +394,8 @@
     def driver_name(self):
         if self.get_option('driver_name'):
             return self.get_option('driver_name')
-        if self.get_option('webkit_test_runner'):
-            return 'WebKitTestRunner'
+        if self.get_option('content_shell'):
+            return self.CONTENT_SHELL_NAME
         return 'DumpRenderTree'
 
     def expected_baselines_by_extension(self, test_name):
@@ -421,7 +417,7 @@
 
     def baseline_extensions(self):
         """Returns a tuple of all of the non-reftest baseline extensions we use. The extensions include the leading '.'."""
-        return ('.wav', '.webarchive', '.txt', '.png')
+        return ('.wav', '.txt', '.png')
 
     def expected_baselines(self, test_name, suffix, all_baselines=False):
         """Given a test name, finds where the baseline results are located.
@@ -538,9 +534,7 @@
         # baselines as a binary string, too.
         baseline_path = self.expected_filename(test_name, '.txt')
         if not self._filesystem.exists(baseline_path):
-            baseline_path = self.expected_filename(test_name, '.webarchive')
-            if not self._filesystem.exists(baseline_path):
-                return None
+            return None
         text = self._filesystem.read_binary_file(baseline_path)
         return text.replace("\r\n", "\n")
 
@@ -605,11 +599,11 @@
     def _real_tests(self, paths):
         # When collecting test cases, skip these directories
         skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests', 'reference', 'reftest'])
-        files = find_files.find(self._filesystem, self.layout_tests_dir(), paths, skipped_directories, Port._is_test_file, self.test_key)
+        files = find_files.find(self._filesystem, self.layout_tests_dir(), paths, skipped_directories, Port.is_test_file, self.test_key)
         return [self.relative_test_filename(f) for f in files]
 
     # When collecting test cases, we include any file with these extensions.
-    _supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl',
+    _supported_file_extensions = set(['.html', '.xml', '.xhtml', '.pl',
                                       '.htm', '.php', '.svg', '.mht'])
 
     @staticmethod
@@ -630,7 +624,7 @@
         return extension in Port._supported_file_extensions
 
     @staticmethod
-    def _is_test_file(filesystem, dirname, filename):
+    def is_test_file(filesystem, dirname, filename):
         return Port._has_supported_extension(filesystem, filename) and not Port.is_reference_html_file(filesystem, dirname, filename)
 
     def test_key(self, test_name):
@@ -809,22 +803,6 @@
     def path_to_generic_test_expectations_file(self):
         return self._filesystem.join(self.layout_tests_dir(), 'TestExpectations')
 
-    @memoized
-    def path_to_test_expectations_file(self):
-        """Update the test expectations to the passed-in string.
-
-        This is used by the rebaselining tool. Raises NotImplementedError
-        if the port does not use expectations files."""
-
-        # FIXME: We need to remove this when we make rebaselining work with multiple files and just generalize expectations_files().
-
-        # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
-        port_name = self.port_name
-        if port_name.startswith('chromium'):
-            port_name = 'chromium'
-
-        return self._filesystem.join(self._webkit_baseline_path(port_name), 'TestExpectations')
-
     def relative_test_filename(self, filename):
         """Returns a test_name a relative unix-style path for a filename under the LayoutTests
         directory. Ports may legitimately return abspaths here if no relpath makes sense."""
@@ -1043,9 +1021,8 @@
         raise NotImplementedError
 
     def uses_test_expectations_file(self):
-        # This is different from checking test_expectations() is None, because
-        # some ports have Skipped files which are returned as part of test_expectations().
-        return self._filesystem.exists(self.path_to_test_expectations_file())
+        # FIXME: Remove this method.
+        return True
 
     def warn_if_bug_missing_in_test_expectations(self):
         return False
@@ -1061,6 +1038,12 @@
         # FIXME: rename this to test_expectations() once all the callers are updated to know about the ordered dict.
         expectations = OrderedDict()
 
+        ignore_flaky_tests = self.get_option('ignore_flaky_tests')
+        if ignore_flaky_tests == 'very-flaky' or ignore_flaky_tests == 'maybe-flaky':
+            ignore_only_very_flaky = self.get_option('ignore_flaky_tests') == 'very-flaky'
+            full_port_name = self.determine_full_port_name(self.host, self._options, self.port_name)
+            expectations['autogenerated'] = BotTestExpectations(ignore_only_very_flaky).expectations_string(full_port_name)
+
         for path in self.expectations_files():
             if self._filesystem.exists(path):
                 expectations[path] = self._filesystem.read_text_file(path)
@@ -1083,11 +1066,6 @@
         if non_wk2_name != self.port_name:
             search_paths.append(non_wk2_name)
 
-        if self.get_option('webkit_test_runner'):
-            # Because nearly all of the skipped tests for WebKit 2 are due to cross-platform
-            # issues, all wk2 ports share a skipped list under platform/wk2.
-            search_paths.extend(["wk2", self._wk2_port_name()])
-
         search_paths.extend(self.get_option("additional_platform_directory", []))
 
         return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpectations') for d in search_paths]
@@ -1204,13 +1182,7 @@
         """Returns the full path to the apache binary.
 
         This is needed only by ports that use the apache_http_server module."""
-        # The Apache binary path can vary depending on OS and distribution
-        # See http://wiki.apache.org/httpd/DistrosDefaultLayout
-        for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
-            if self._filesystem.exists(path):
-                return path
-        _log.error("Could not find apache. Not installed or unknown path.")
-        return None
+        raise NotImplementedError('Port._path_to_apache')
 
     # FIXME: This belongs on some platform abstraction instead of Port.
     def _is_redhat_based(self):
@@ -1325,7 +1297,7 @@
     def _generate_all_test_configurations(self):
         """Generates a list of TestConfiguration instances, representing configurations
         for a platform across all OSes, architectures, build and graphics types."""
-        raise NotImplementedError('Port._generate_test_configurations')
+        raise NotImplementedError('Port._generate_all_test_configurations')
 
     def _driver_class(self):
         """Returns the port's driver implementation."""
@@ -1431,28 +1403,6 @@
         _log.debug('Output of %s:\n%s' % (run_script_command, output))
         return output
 
-    def _build_driver(self):
-        environment = self.host.copy_current_environment()
-        environment.disable_gcc_smartquotes()
-        env = environment.to_dictionary()
-
-        # FIXME: We build both DumpRenderTree and WebKitTestRunner for
-        # WebKitTestRunner runs because DumpRenderTree still includes
-        # the DumpRenderTreeSupport module and the TestNetscapePlugin.
-        # These two projects should be factored out into their own
-        # projects.
-        try:
-            self._run_script("build-dumprendertree", args=self._build_driver_flags(), env=env)
-            if self.get_option('webkit_test_runner'):
-                self._run_script("build-webkittestrunner", args=self._build_driver_flags(), env=env)
-        except ScriptError, e:
-            _log.error(e.message_with_output(output_limit=None))
-            return False
-        return True
-
-    def _build_driver_flags(self):
-        return []
-
     def _tests_for_other_platforms(self):
         # By default we will skip any directory under LayoutTests/platform
         # that isn't in our baseline search path (this mirrors what
@@ -1513,7 +1463,6 @@
         return {
             "MathMLElement": ["mathml"],
             "GraphicsLayer": ["compositing"],
-            "WebCoreHas3DRendering": ["animations/3d", "transforms/3d"],
             "WebGLShader": ["fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl", "webgl"],
             "MHTMLArchive": ["mhtml"],
             "CSSVariableValue": ["fast/css/variables", "inspector/styles/variables"],
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 7685695..393076f 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -293,14 +293,6 @@
         self.assertEqual(environment['FOO'], 'BAR')
         self.assertEqual(environment['BAR'], 'FOO')
 
-    def test_uses_test_expectations_file(self):
-        port = self.make_port(port_name='foo')
-        port.port_name = 'foo'
-        port.path_to_test_expectations_file = lambda: '/mock-results/TestExpectations'
-        self.assertFalse(port.uses_test_expectations_file())
-        port._filesystem = MockFileSystem({'/mock-results/TestExpectations': ''})
-        self.assertTrue(port.uses_test_expectations_file())
-
     def test_find_no_paths_specified(self):
         port = self.make_port(with_tests=True)
         layout_tests_dir = port.layout_tests_dir()
@@ -329,23 +321,22 @@
 
     def test_is_test_file(self):
         filesystem = MockFileSystem()
-        self.assertTrue(Port._is_test_file(filesystem, '', 'foo.html'))
-        self.assertTrue(Port._is_test_file(filesystem, '', 'foo.shtml'))
-        self.assertTrue(Port._is_test_file(filesystem, '', 'foo.svg'))
-        self.assertTrue(Port._is_test_file(filesystem, '', 'test-ref-test.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo.png'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.svg'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected.xht'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.svg'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-expected-mismatch.xhtml'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-notref.xht'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'foo-ref.xhtml'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'ref-foo.html'))
-        self.assertFalse(Port._is_test_file(filesystem, '', 'notref-foo.xhr'))
+        self.assertTrue(Port.is_test_file(filesystem, '', 'foo.html'))
+        self.assertTrue(Port.is_test_file(filesystem, '', 'foo.svg'))
+        self.assertTrue(Port.is_test_file(filesystem, '', 'test-ref-test.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo.png'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected.svg'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected.xht'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected-mismatch.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected-mismatch.svg'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-expected-mismatch.xhtml'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-ref.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-notref.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-notref.xht'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'foo-ref.xhtml'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'ref-foo.html'))
+        self.assertFalse(Port.is_test_file(filesystem, '', 'notref-foo.xhr'))
 
     def test_parse_reftest_list(self):
         port = self.make_port(with_tests=True)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/builders.py b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
index cdc9e5b..63621f8 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/builders.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/builders.py
@@ -58,52 +58,10 @@
     "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "is_debug": False},
     "WebKit Mac10.7 (dbg)": {"port_name": "chromium-mac-lion", "is_debug": True},
     "WebKit Mac10.8": {"port_name": "chromium-mac-mountainlion", "is_debug": False},
-
-    # These builders are on build.webkit.org.
-    "Apple MountainLion Release WK1 (Tests)": {"port_name": "mac-mountainlion", "is_debug": False, "rebaseline_override_dir": "mac"},
-    "Apple MountainLion Debug WK1 (Tests)": {"port_name": "mac-mountainlion", "is_debug": True, "rebaseline_override_dir": "mac"},
-    "Apple MountainLion Release WK2 (Tests)": {"port_name": "mac-mountainlion-wk2", "is_debug": False, "rebaseline_override_dir": "mac"},
-    "Apple MountainLion Debug WK2 (Tests)": {"port_name": "mac-mountainlion-wk2", "is_debug": True, "rebaseline_override_dir": "mac"},
-    "Apple Lion Release WK1 (Tests)": {"port_name": "mac-lion", "is_debug": False},
-    "Apple Lion Debug WK1 (Tests)": {"port_name": "mac-lion", "is_debug": True},
-    "Apple Lion Release WK2 (Tests)": {"port_name": "mac-lion-wk2", "is_debug": False},
-    "Apple Lion Debug WK2 (Tests)": {"port_name": "mac-lion-wk2", "is_debug": True},
-
-    "Apple Win XP Debug (Tests)": {"port_name": "win-xp", "is_debug": True},
-    # FIXME: Remove rebaseline_override_dir once there is an Apple buildbot that corresponds to platform/win.
-    "Apple Win 7 Release (Tests)": {"port_name": "win-7sp0", "is_debug": False, "rebaseline_override_dir": "win"},
-
-    "GTK Linux 32-bit Release": {"port_name": "gtk", "is_debug": False},
-    "GTK Linux 64-bit Debug": {"port_name": "gtk", "is_debug": True},
-    "GTK Linux 64-bit Release": {"port_name": "gtk", "is_debug": False},
-    "GTK Linux 64-bit Release WK2 (Tests)": {"port_name": "gtk-wk2", "is_debug": False},
-
-    # FIXME: Remove rebaseline_override_dir once there are Qt bots for all the platform/qt-* directories.
-    "Qt Linux Release": {"port_name": "qt-linux", "is_debug": False, "rebaseline_override_dir": "qt"},
-
-    "EFL Linux 64-bit Release": {"port_name": "efl", "is_debug": False},
-    "EFL Linux 64-bit Release WK2": {"port_name": "efl-wk2", "is_debug": False},
-    "EFL Linux 64-bit Debug WK2": {"port_name": "efl-wk2", "is_debug": True},
-}
-
-
-_fuzzy_matches = {
-    # These builders are on build.webkit.org.
-    r"SnowLeopard": "mac-snowleopard",
-    r"Apple Lion": "mac-lion",
-    r"Windows": "win",
-    r"GTK": "gtk",
-    r"Qt": "qt",
-    r"Chromium Mac": "chromium-mac",
-    r"Chromium Linux": "chromium-linux",
-    r"Chromium Win": "chromium-win",
 }
 
 
 _ports_without_builders = [
-    "qt-mac",
-    "qt-win",
-    "qt-wk2",
     # FIXME: Move to _extact_matches.
     "chromium-android",
 ]
@@ -130,12 +88,7 @@
 
 
 def port_name_for_builder_name(builder_name):
-    if builder_name in _exact_matches:
-        return _exact_matches[builder_name]["port_name"]
-
-    for regexp, port_name in _fuzzy_matches.items():
-        if re.match(regexp, builder_name):
-            return port_name
+    return _exact_matches[builder_name]["port_name"]
 
 
 def builder_name_for_port_name(target_port_name):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index aa4d30c..ce0564d 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -60,7 +60,10 @@
         ('lucid', 'x86_64'),
         # FIXME: Technically this should be 'arm', but adding a third architecture type breaks TestConfigurationConverter.
         # If we need this to be 'arm' in the future, then we first have to fix TestConfigurationConverter.
-        ('icecreamsandwich', 'x86'))
+        # FIXME: Until we have an android bot to do rebaselines, we need to not include it in ALL_SYSTEMS
+        # because otherwise rebaselines won't correclty remove lines from TestExpectations.
+        #('icecreamsandwich', 'x86'),
+        )
 
     ALL_BASELINE_VARIANTS = [
         'chromium-mac-mountainlion', 'chromium-mac-lion', 'chromium-mac-snowleopard',
@@ -81,6 +84,10 @@
     FALLBACK_PATHS = {}
 
     @classmethod
+    def latest_platform_fallback_path(cls):
+        return cls.FALLBACK_PATHS[cls.SUPPORTED_VERSIONS[-1]]
+
+    @classmethod
     def _static_build_path(cls, filesystem, build_directory, chromium_base, webkit_base, configuration, comps):
         if build_directory:
             return filesystem.join(build_directory, configuration, *comps)
@@ -122,6 +129,15 @@
     def is_chromium(self):
         return True
 
+    def default_child_processes(self):
+        default_count = super(ChromiumPort, self).default_child_processes()
+        # Since content_shell spawns multiple subprocesses, we need to reduce
+        # the number of running processes.
+        if self.driver_name() == self.CONTENT_SHELL_NAME:
+            default_count = int(.75 * default_count)
+
+        return default_count
+
     def default_max_locked_shards(self):
         """Return the number of "locked" shards to run in parallel (like the http tests)."""
         max_locked_shards = int(self.default_child_processes()) / 4
@@ -351,12 +367,9 @@
         return True
 
     def _port_specific_expectations_files(self):
-        paths = [self.path_to_test_expectations_file()]
-        skia_expectations_path = self.path_from_chromium_base('skia', 'skia_test_expectations.txt')
-        # FIXME: we should probably warn if this file is missing in some situations.
-        # See the discussion in webkit.org/b/97699.
-        if self._filesystem.exists(skia_expectations_path):
-            paths.append(skia_expectations_path)
+        paths = []
+        paths.append(self.path_from_chromium_base('skia', 'skia_test_expectations.txt'))
+        paths.append(self._filesystem.join(self.layout_tests_dir(), 'NeverFixTests'))
 
         builder_name = self.get_option('builder_name', 'DUMMY_BUILDER_NAME')
         if builder_name == 'DUMMY_BUILDER_NAME' or '(deps)' in builder_name or builder_name in self.try_builder_names:
@@ -388,31 +401,31 @@
 
     def virtual_test_suites(self):
         return [
-            VirtualTestSuite('platform/chromium/virtual/gpu/fast/canvas',
+            VirtualTestSuite('virtual/gpu/fast/canvas',
                              'fast/canvas',
                              ['--enable-accelerated-2d-canvas']),
-            VirtualTestSuite('platform/chromium/virtual/gpu/canvas/philip',
+            VirtualTestSuite('virtual/gpu/canvas/philip',
                              'canvas/philip',
                              ['--enable-accelerated-2d-canvas']),
-            VirtualTestSuite('platform/chromium/virtual/threaded/compositing/visibility',
+            VirtualTestSuite('virtual/threaded/compositing/visibility',
                              'compositing/visibility',
                              ['--enable-threaded-compositing']),
-            VirtualTestSuite('platform/chromium/virtual/threaded/compositing/webgl',
+            VirtualTestSuite('virtual/threaded/compositing/webgl',
                              'compositing/webgl',
                              ['--enable-threaded-compositing']),
-            VirtualTestSuite('platform/chromium/virtual/gpu/fast/hidpi',
+            VirtualTestSuite('virtual/gpu/fast/hidpi',
                              'fast/hidpi',
                              ['--force-compositing-mode']),
-            VirtualTestSuite('platform/chromium/virtual/softwarecompositing',
+            VirtualTestSuite('virtual/softwarecompositing',
                              'compositing',
                              ['--enable-software-compositing']),
-            VirtualTestSuite('platform/chromium/virtual/deferred/fast/images',
+            VirtualTestSuite('virtual/deferred/fast/images',
                              'fast/images',
                              ['--enable-deferred-image-decoding', '--enable-per-tile-painting', '--force-compositing-mode']),
-            VirtualTestSuite('platform/chromium/virtual/gpu/compositedscrolling/overflow',
+            VirtualTestSuite('virtual/gpu/compositedscrolling/overflow',
                              'compositing/overflow',
                              ['--enable-accelerated-overflow-scroll']),
-            VirtualTestSuite('platform/chromium/virtual/gpu/compositedscrolling/scrollbars',
+            VirtualTestSuite('virtual/gpu/compositedscrolling/scrollbars',
                              'scrollbars',
                              ['--enable-accelerated-overflow-scroll']),
         ]
@@ -429,8 +442,8 @@
 
     def _build_path_with_configuration(self, configuration, *comps):
         # Note that we don't implement --root or do the option caching that the
-        # base class does, because chromium doesn't use 'webkit-build-directory' and
-        # hence finding the right directory is relatively fast.
+        # base class does, because finding the right directory is relatively
+        # fast.
         configuration = configuration or self.get_option('configuration')
         return self._static_build_path(self._filesystem, self.get_option('build_directory'),
             self.path_from_chromium_base(), self.path_from_webkit_base(), configuration, comps)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
index b095463..046317b 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
@@ -36,6 +36,7 @@
 import time
 
 from webkitpy.layout_tests.port import chromium
+from webkitpy.layout_tests.port import chromium_linux
 from webkitpy.layout_tests.port import driver
 from webkitpy.layout_tests.port import factory
 from webkitpy.layout_tests.port import server_process
@@ -47,26 +48,18 @@
 # source root directory of Chromium.
 # This path is defined in Chromium's base/test/test_support_android.cc.
 DEVICE_SOURCE_ROOT_DIR = '/data/local/tmp/'
-COMMAND_LINE_FILE = DEVICE_SOURCE_ROOT_DIR + 'chrome-native-tests-command-line'
 
-# The directory to put tools and resources of DumpRenderTree.
-# If change this, must also change Tools/DumpRenderTree/chromium/TestShellAndroid.cpp
-# and Chromium's webkit/support/platform_support_android.cc.
-DEVICE_DRT_DIR = DEVICE_SOURCE_ROOT_DIR + 'drt/'
-DEVICE_FORWARDER_PATH = DEVICE_DRT_DIR + 'forwarder'
-
-# Path on the device where the test framework will create the fifo pipes.
-DEVICE_FIFO_PATH = '/data/data/org.chromium.native_test/files/'
-
-DRT_APP_PACKAGE = 'org.chromium.native_test'
-DRT_ACTIVITY_FULL_NAME = DRT_APP_PACKAGE + '/.ChromeNativeTestActivity'
-DRT_APP_CACHE_DIR = DEVICE_DRT_DIR + 'cache/'
-DRT_LIBRARY_NAME = 'libDumpRenderTree.so'
+# The layout tests directory on device, which has two usages:
+# 1. as a virtual path in file urls that will be bridged to HTTP.
+# 2. pointing to some files that are pushed to the device for tests that
+# don't work on file-over-http (e.g. blob protocol tests).
+DEVICE_WEBKIT_BASE_DIR = DEVICE_SOURCE_ROOT_DIR + 'third_party/WebKit/'
+DEVICE_LAYOUT_TESTS_DIR = DEVICE_WEBKIT_BASE_DIR + 'LayoutTests/'
 
 SCALING_GOVERNORS_PATTERN = "/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
 KPTR_RESTRICT_PATH = "/proc/sys/kernel/kptr_restrict"
 
-# All the test cases are still served to DumpRenderTree through file protocol,
+# All the test cases are still served to the test runner through file protocol,
 # but we use a file-to-http feature to bridge the file request to host's http
 # server to get the real test files and corresponding resources.
 # See webkit/support/platform_support_android.cc for the other side of this bridge.
@@ -82,10 +75,9 @@
 MS_TRUETYPE_FONTS_DIR = '/usr/share/fonts/truetype/msttcorefonts/'
 MS_TRUETYPE_FONTS_PACKAGE = 'ttf-mscorefonts-installer'
 
-# Timeout in seconds to wait for start/stop of DumpRenderTree.
-DRT_START_STOP_TIMEOUT_SECS = 10
+# Timeout in seconds to wait for starting/stopping the driver.
+DRIVER_START_STOP_TIMEOUT_SECS = 10
 
-# List of fonts that layout tests expect, copied from DumpRenderTree/chromium/TestShellX11.cpp.
 HOST_FONT_FILES = [
     [[MS_TRUETYPE_FONTS_DIR], 'Arial.ttf', MS_TRUETYPE_FONTS_PACKAGE],
     [[MS_TRUETYPE_FONTS_DIR], 'Arial_Bold.ttf', MS_TRUETYPE_FONTS_PACKAGE],
@@ -126,15 +118,6 @@
     [['/usr/share/fonts/truetype/ttf-indic-fonts-core/', '/usr/share/fonts/truetype/ttf-punjabi-fonts/'], 'lohit_pa.ttf', 'ttf-indic-fonts-core'],
 ]
 
-DEVICE_FONTS_DIR = DEVICE_DRT_DIR + 'fonts/'
-
-# The layout tests directory on device, which has two usages:
-# 1. as a virtual path in file urls that will be bridged to HTTP.
-# 2. pointing to some files that are pushed to the device for tests that
-# don't work on file-over-http (e.g. blob protocol tests).
-DEVICE_WEBKIT_BASE_DIR = DEVICE_SOURCE_ROOT_DIR + 'third_party/WebKit/'
-DEVICE_LAYOUT_TESTS_DIR = DEVICE_WEBKIT_BASE_DIR + 'LayoutTests/'
-
 # Test resources that need to be accessed as files directly.
 # Each item can be the relative path of a directory or a file.
 TEST_RESOURCES_TO_PUSH = [
@@ -158,18 +141,176 @@
 MD5SUM_DEVICE_FILE_NAME = 'md5sum_bin'
 MD5SUM_DEVICE_PATH = '/data/local/tmp/' + MD5SUM_DEVICE_FILE_NAME
 
+# Shared pieces of information for the two supported test runners.
+class SharedDriverDetails(object):
+    def device_cache_directory(self):
+        return self.device_directory() + 'cache/'
+    def device_fonts_directory(self):
+        return self.device_directory() + 'fonts/'
+    def device_forwarder_path(self):
+        return self.device_directory() + 'forwarder'
+    def device_fifo_directory(self):
+        return '/data/data/' + self.package_name() + '/files/'
+
+# Information required when running layout tests using DumpRenderTree as the test runner.
+class DumpRenderTreeDriverDetails(SharedDriverDetails):
+    def apk_name(self):
+        return 'DumpRenderTree_apk/DumpRenderTree-debug.apk'
+    def package_name(self):
+        return 'org.chromium.native_test'
+    def activity_name(self):
+        return self.package_name() + '/.ChromeNativeTestActivity'
+    def library_name(self):
+        return 'libDumpRenderTree.so'
+    def additional_resources(self):
+        return ['DumpRenderTree.pak', 'DumpRenderTree_resources']
+    def command_line_file(self):
+        return '/data/local/tmp/chrome-native-tests-command-line'
+    def additional_command_line_flags(self):
+        return ['--create-stdin-fifo', '--separate-stderr-fifo']
+    def device_directory(self):
+        return DEVICE_SOURCE_ROOT_DIR + 'drt/'
+
+# Information required when running layout tests using content_shell as the test runner.
+class ContentShellDriverDetails(SharedDriverDetails):
+    def apk_name(self):
+        return 'apks/ContentShell.apk'
+    def package_name(self):
+        return 'org.chromium.content_shell_apk'
+    def activity_name(self):
+        return self.package_name() + '/.ContentShellActivity'
+    def library_name(self):
+        return 'libcontent_shell_content_view.so'
+    def additional_resources(self):
+        return ['content_resources.pak', 'shell_resources.pak']
+    def command_line_file(self):
+        return '/data/local/tmp/content-shell-command-line'
+    def additional_command_line_flags(self):
+        return []
+    def device_directory(self):
+        return DEVICE_SOURCE_ROOT_DIR + 'content_shell/'
+
+# The AndroidCommands class encapsulates commands to communicate with an attached device.
+class AndroidCommands(object):
+    _adb_command_path = None
+    _adb_command_path_options = []
+
+    def __init__(self, executive, device_serial):
+        self._executive = executive
+        self._device_serial = device_serial
+
+    # Local public methods.
+
+    def file_exists(self, full_path):
+        assert full_path.startswith('/')
+        return self.run(['shell', 'ls', full_path]).strip() == full_path
+
+    def push(self, host_path, device_path, ignore_error=False):
+        return self.run(['push', host_path, device_path], ignore_error=ignore_error)
+
+    def pull(self, device_path, host_path, ignore_error=False):
+        return self.run(['pull', device_path, host_path], ignore_error=ignore_error)
+
+    def restart_as_root(self):
+        output = self.run(['root'])
+        if 'adbd is already running as root' in output:
+            return
+
+        elif not 'restarting adbd as root' in output:
+            self._log_error('Unrecognized output from adb root: %s' % output)
+
+        self.run(['wait-for-device'])
+
+    def run(self, command, ignore_error=False):
+        self._log_debug('Run adb command: ' + str(command))
+        if ignore_error:
+            error_handler = self._executive.ignore_error
+        else:
+            error_handler = None
+
+        result = self._executive.run_command(self.adb_command() + command,
+                error_handler=error_handler)
+
+        # We limit the length to avoid outputting too verbose commands, such as "adb logcat".
+        self._log_debug('Run adb result: ' + result[:80])
+        return result
+
+    def get_serial(self):
+        return self._device_serial
+
+    def adb_command(self):
+        return [AndroidCommands.adb_command_path(self._executive), '-s', self._device_serial]
+
+    @staticmethod
+    def set_adb_command_path_options(paths):
+        AndroidCommands._adb_command_path_options = paths
+
+    @staticmethod
+    def adb_command_path(executive):
+        if AndroidCommands._adb_command_path:
+            return AndroidCommands._adb_command_path
+
+        assert AndroidCommands._adb_command_path_options, 'No commands paths have been set to look for the "adb" command.'
+
+        command_path = None
+        command_version = None
+        for path_option in AndroidCommands._adb_command_path_options:
+            path_version = AndroidCommands._determine_adb_version(path_option, executive)
+            if not path_version:
+                continue
+            if command_version != None and path_version < command_version:
+                continue
+
+            command_path = path_option
+            command_version = path_version
+
+        assert command_path, 'Unable to locate the "adb" command. Are you using an Android checkout of Chromium?'
+
+        AndroidCommands._adb_command_path = command_path
+        return command_path
+
+    @staticmethod
+    def get_devices(executive):
+        re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE)
+        result = executive.run_command([AndroidCommands.adb_command_path(executive), 'devices'],
+                error_handler=executive.ignore_error)
+        devices = re_device.findall(result)
+        if not devices:
+            raise AssertionError('No devices attached. Result of "adb devices": %s' % result)
+
+        return devices
+
+    # Local private methods.
+
+    def _log_error(self, message):
+        _log.error('[%s] %s' % (self._device_serial, message))
+
+    def _log_debug(self, message):
+        _log.debug('[%s] %s' % (self._device_serial, message))
+
+    @staticmethod
+    def _determine_adb_version(adb_command_path, executive):
+        re_version = re.compile('^.*version ([\d\.]+)$')
+        try:
+            output = executive.run_command([adb_command_path, 'version'], error_handler=executive.ignore_error)
+        except OSError:
+            return None
+
+        result = re_version.match(output)
+        if not output or not result:
+            return None
+
+        return [int(n) for n in result.group(1).split('.')]
+
 class ChromiumAndroidPort(chromium.ChromiumPort):
     port_name = 'chromium-android'
 
     # Avoid initializing the adb path [worker count]+1 times by storing it as a static member.
     _adb_path = None
 
-    FALLBACK_PATHS = [
-        'chromium-android',
-        'chromium-linux',
-        'chromium-win',
-        'chromium',
-    ]
+    SUPPORTED_VERSIONS = ('android')
+
+    FALLBACK_PATHS = { 'android': [ 'chromium-android' ] + chromium_linux.ChromiumLinuxPort.latest_platform_fallback_path() }
 
     def __init__(self, host, port_name, **kwargs):
         super(ChromiumAndroidPort, self).__init__(host, port_name, **kwargs)
@@ -180,18 +321,39 @@
         self._host_port = factory.PortFactory(host).get('chromium', **kwargs)
         self._server_process_constructor = self._android_server_process_constructor
 
-        if hasattr(self._options, 'adb_device'):
-            self._devices = self._options.adb_device
+        if self.driver_name() == 'content_shell':
+            self._driver_details = ContentShellDriverDetails()
+        else:
+            self._driver_details = DumpRenderTreeDriverDetails()
+
+        if hasattr(self._options, 'adb_device') and len(self._options.adb_device):
+            self._devices = [self._options.adb_device]
         else:
             self._devices = []
 
-    @staticmethod
-    def _android_server_process_constructor(port, server_name, cmd_line, env=None):
-        return server_process.ServerProcess(port, server_name, cmd_line, env,
-                                            universal_newlines=True, treat_no_data_as_crash=True)
+        AndroidCommands.set_adb_command_path_options(['adb',
+            self.path_from_chromium_base('third_party', 'android_tools', 'sdk', 'platform-tools', 'adb')])
+
+    # Local public methods.
+    def get_device_serial(self, worker_number):
+        if not self._devices:
+            self._devices = AndroidCommands.get_devices(self._executive)
+        if worker_number >= len(self._devices):
+            raise AssertionError('Worker number exceeds available number of devices')
+        return self._devices[worker_number]
+
+    def path_to_forwarder(self):
+        return self._build_path('forwarder')
+
+    def path_to_md5sum(self):
+        return self._build_path(MD5SUM_DEVICE_FILE_NAME)
+
+    # Overridden public methods.
+    def buildbot_archives_baselines(self):
+        return False
 
     def additional_drt_flag(self):
-        # The Chromium port for Android always uses the hardware GPU path.
+        # Chromium for Android always uses the hardware GPU path.
         return ['--encode-binary', '--enable-hardware-gpu',
                 '--force-compositing-mode',
                 '--enable-accelerated-fixed-position']
@@ -203,14 +365,17 @@
         return 10 * 1000
 
     def driver_stop_timeout(self):
-        # DRT doesn't respond to closing stdin, so we might as well stop the driver immediately.
+        # The driver doesn't respond to closing stdin, so we might as well stop the driver immediately.
         return 0.0
 
     def default_child_processes(self):
-        return len(self._get_devices())
+        if self._devices:
+            return len(self._devices)
+
+        return len(AndroidCommands.get_devices(self._executive))
 
     def default_baseline_search_path(self):
-        return map(self._webkit_baseline_path, self.FALLBACK_PATHS)
+        return map(self._webkit_baseline_path, self.FALLBACK_PATHS['android'])
 
     def check_wdiff(self, logging=True):
         return self._host_port.check_wdiff(logging)
@@ -239,16 +404,9 @@
                 return False
         return True
 
-    def _port_specific_expectations_files(self):
-        # LayoutTests/platform/chromium-android/TestExpectations should contain only the rules to
-        # skip tests for the features not supported or not testable on Android.
-        # Other rules should be in LayoutTests/platform/chromium/TestExpectations.
-        android_expectations_file = self.path_from_webkit_base('LayoutTests', 'platform', 'chromium-android', 'TestExpectations')
-        return super(ChromiumAndroidPort, self)._port_specific_expectations_files() + [android_expectations_file]
-
     def requires_http_server(self):
         """Chromium Android runs tests on devices, and uses the HTTP server to
-        serve the actual layout tests to DumpRenderTree."""
+        serve the actual layout tests to the test driver."""
         return True
 
     def start_http_server(self, additional_dirs=None, number_of_servers=0):
@@ -261,41 +419,23 @@
     def create_driver(self, worker_number, no_timeout=False):
         # We don't want the default DriverProxy which is not compatible with our driver.
         # See comments in ChromiumAndroidDriver.start().
-        return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'),
-                                     # Force no timeout to avoid DumpRenderTree timeouts before NRWT.
+        return ChromiumAndroidDriver(self, worker_number, pixel_tests=self.get_option('pixel_tests'), driver_details=self._driver_details,
+                                     # Force no timeout to avoid test driver timeouts before NRWT.
                                      no_timeout=True)
 
     def driver_cmd_line(self):
-        # Override to return the actual DumpRenderTree command line.
-        return self.create_driver(0)._drt_cmd_line(self.get_option('pixel_tests'), [])
+        # Override to return the actual test driver's command line.
+        return self.create_driver(0)._android_driver_cmd_line(self.get_option('pixel_tests'), [])
 
-    def path_to_adb(self):
-        if ChromiumAndroidPort._adb_path:
-            return ChromiumAndroidPort._adb_path
+    # Overridden protected methods.
 
-        provided_adb_path = self.path_from_chromium_base('third_party', 'android_tools', 'sdk', 'platform-tools', 'adb')
+    def _port_specific_expectations_files(self):
+        # LayoutTests/platform/chromium-android/TestExpectations should contain only the rules to
+        # skip tests for the features not supported or not testable on Android.
+        # Other rules should be in LayoutTests/TestExpectations.
+        android_expectations_file = self.path_from_webkit_base('LayoutTests', 'platform', 'chromium-android', 'TestExpectations')
+        return super(ChromiumAndroidPort, self)._port_specific_expectations_files() + [android_expectations_file]
 
-        path_version = self._determine_adb_version('adb')
-        provided_version = self._determine_adb_version(provided_adb_path)
-        assert provided_version, 'The checked in Android SDK is missing. Are you sure you ran update-webkit --chromium-android?'
-
-        if not path_version:
-            ChromiumAndroidPort._adb_path = provided_adb_path
-        elif provided_version > path_version:
-            _log.warning('The "adb" version in your path is older than the one checked in, consider updating your local Android SDK. Using the checked in one.')
-            ChromiumAndroidPort._adb_path = provided_adb_path
-        else:
-            ChromiumAndroidPort._adb_path = 'adb'
-
-        return ChromiumAndroidPort._adb_path
-
-    def path_to_forwarder(self):
-        return self._build_path('forwarder')
-
-    def path_to_md5sum(self):
-        return self._build_path(MD5SUM_DEVICE_FILE_NAME)
-
-    # Overridden private functions.
 
     def _build_path(self, *comps):
         return self._host_port._build_path(*comps)
@@ -310,7 +450,7 @@
         return self._host_port._path_to_apache_config_file()
 
     def _path_to_driver(self, configuration=None):
-        return self._build_path_with_configuration(configuration, 'DumpRenderTree_apk/DumpRenderTree-debug.apk')
+        return self._build_path_with_configuration(configuration, self._driver_details.apk_name())
 
     def _path_to_helper(self):
         return None
@@ -336,56 +476,36 @@
     def _driver_class(self):
         return ChromiumAndroidDriver
 
-    # Local private functions.
+    # Local private methods.
 
-    def _determine_adb_version(self, adb_path):
-        re_version = re.compile('^.*version ([\d\.]+)$')
-        try:
-            output = self._executive.run_command([adb_path, 'version'], error_handler=self._executive.ignore_error)
-        except OSError:
-            return None
-        result = re_version.match(output)
-        if not output or not result:
-            return None
-        return [int(n) for n in result.group(1).split('.')]
-
-    def _get_devices(self):
-        if not self._devices:
-            re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE)
-            result = self._executive.run_command([self.path_to_adb(), 'devices'], error_handler=self._executive.ignore_error)
-            self._devices = re_device.findall(result)
-            if not self._devices:
-                raise AssertionError('No devices attached. Result of "adb devices": %s' % result)
-        return self._devices
-
-    def _get_device_serial(self, worker_number):
-        devices = self._get_devices()
-        if worker_number >= len(devices):
-            raise AssertionError('Worker number exceeds available number of devices')
-        return devices[worker_number]
+    @staticmethod
+    def _android_server_process_constructor(port, server_name, cmd_line, env=None):
+        return server_process.ServerProcess(port, server_name, cmd_line, env,
+                                            universal_newlines=True, treat_no_data_as_crash=True)
 
 
 class AndroidPerf(SingleFileOutputProfiler):
     _cached_perf_host_path = None
     _have_searched_for_perf_host = False
 
-    def __init__(self, host, executable_path, output_dir, adb_path, device_serial, symfs_path, kallsyms_path, identifier=None):
+    def __init__(self, host, executable_path, output_dir, android_commands, symfs_path, kallsyms_path, identifier=None):
         super(AndroidPerf, self).__init__(host, executable_path, output_dir, "data", identifier)
-        self._device_serial = device_serial
-        self._adb_command = [adb_path, '-s', self._device_serial]
+        self._android_commands = android_commands
         self._perf_process = None
         self._symfs_path = symfs_path
         self._kallsyms_path = kallsyms_path
 
     def check_configuration(self):
         # Check that perf is installed
-        if not self._file_exists_on_device('/system/bin/perf'):
-            print "Cannot find /system/bin/perf on device %s" % self._device_serial
+        if not self._android_commands.file_exists('/system/bin/perf'):
+            print "Cannot find /system/bin/perf on device %s" % self._android_commands.get_serial()
             return False
+
         # Check that the device is a userdebug build (or at least has the necessary libraries).
-        if self._run_adb_command(['shell', 'getprop', 'ro.build.type']).strip() != 'userdebug':
-            print "Device %s is not flashed with a userdebug build of Android" % self._device_serial
+        if self._android_commands.run(['shell', 'getprop', 'ro.build.type']).strip() != 'userdebug':
+            print "Device %s is not flashed with a userdebug build of Android" % self._android_commands.get_serial()
             return False
+
         # FIXME: Check that the binary actually is perf-able (has stackframe pointers)?
         # objdump -s a function and make sure it modifies the fp?
         # Instruct users to rebuild after export GYP_DEFINES="profiling=1 $GYP_DEFINES"
@@ -401,7 +521,7 @@
 and requires libefl, libebl, libdw, and libdwfl available in:
 https://android.googlesource.com/platform/external/elfutils/
 
-DumpRenderTree must be built with profiling=1, make sure you've done:
+The test driver must be built with profiling=1, make sure you've done:
 export GYP_DEFINES="profiling=1 $GYP_DEFINES"
 update-webkit --chromium-android
 build-webkit --chromium-android
@@ -410,18 +530,11 @@
 http://goto.google.com/cr-android-perf-howto
 """
 
-    def _file_exists_on_device(self, full_file_path):
-        assert full_file_path.startswith('/')
-        return self._run_adb_command(['shell', 'ls', full_file_path]).strip() == full_file_path
-
-    def _run_adb_command(self, cmd):
-        return self._host.executive.run_command(self._adb_command + cmd)
-
     def attach_to_pid(self, pid):
         assert(pid)
         assert(self._perf_process == None)
         # FIXME: This can't be a fixed timeout!
-        cmd = self._adb_command + ['shell', 'perf', 'record', '-g', '-p', pid, 'sleep', 30]
+        cmd = self._android_commands.adb_command() + ['shell', 'perf', 'record', '-g', '-p', pid, 'sleep', 30]
         self._perf_process = self._host.executive.popen(cmd)
 
     def _perf_version_string(self, perf_path):
@@ -455,7 +568,8 @@
         if perf_exitcode != 0:
             print "Perf failed (exit code: %i), can't process results." % perf_exitcode
             return
-        self._run_adb_command(['pull', '/data/perf.data', self._output_path])
+
+        self._android_commands.pull('/data/perf.data', self._output_path)
 
         perfhost_path = self._perfhost_path()
         perfhost_report_command = [
@@ -490,20 +604,21 @@
 
 
 class ChromiumAndroidDriver(driver.Driver):
-    def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
+    def __init__(self, port, worker_number, pixel_tests, driver_details, no_timeout=False):
         super(ChromiumAndroidDriver, self).__init__(port, worker_number, pixel_tests, no_timeout)
         self._cmd_line = None
-        self._in_fifo_path = DEVICE_FIFO_PATH + 'stdin.fifo'
-        self._out_fifo_path = DEVICE_FIFO_PATH + 'test.fifo'
-        self._err_fifo_path = DEVICE_FIFO_PATH + 'stderr.fifo'
+        self._in_fifo_path = driver_details.device_fifo_directory() + 'stdin.fifo'
+        self._out_fifo_path = driver_details.device_fifo_directory() + 'test.fifo'
+        self._err_fifo_path = driver_details.device_fifo_directory() + 'stderr.fifo'
         self._read_stdout_process = None
         self._read_stderr_process = None
         self._forwarder_process = None
         self._has_setup = False
         self._original_governors = {}
         self._original_kptr_restrict = None
-        self._device_serial = port._get_device_serial(worker_number)
-        self._adb_command_base = None
+
+        self._android_commands = AndroidCommands(port._executive, port.get_device_serial(worker_number))
+        self._driver_details = driver_details
 
         # FIXME: If we taught ProfileFactory about "target" devices we could
         # just use the logic in Driver instead of duplicating it here.
@@ -513,7 +628,7 @@
             kallsyms_path = self._update_kallsyms_cache(symfs_path)
             # FIXME: We should pass this some sort of "Bridge" object abstraction around ADB instead of a path/device pair.
             self._profiler = AndroidPerf(self._port.host, self._port._path_to_driver(), self._port.results_directory(),
-                self._port.path_to_adb(), self._device_serial, symfs_path, kallsyms_path)
+                self._android_commands, symfs_path, kallsyms_path)
             # FIXME: This is a layering violation and should be moved to Port.check_sys_deps
             # once we have an abstraction around an adb_path/device_serial pair to make it
             # easy to make these class methods on AndroidPerf.
@@ -528,18 +643,18 @@
         super(ChromiumAndroidDriver, self).__del__()
 
     def _update_kallsyms_cache(self, output_dir):
-        kallsyms_name = "%s-kallsyms" % self._device_serial
+        kallsyms_name = "%s-kallsyms" % self._android_commands.get_serial()
         kallsyms_cache_path = self._port.host.filesystem.join(output_dir, kallsyms_name)
 
-        self._restart_adb_as_root()
+        self._android_commands.restart_as_root()
 
-        saved_kptr_restrict = self._run_adb_command(['shell', 'cat', KPTR_RESTRICT_PATH]).strip()
-        self._run_adb_command(['shell', 'echo', '0', '>', KPTR_RESTRICT_PATH])
+        saved_kptr_restrict = self._android_commands.run(['shell', 'cat', KPTR_RESTRICT_PATH]).strip()
+        self._android_commands.run(['shell', 'echo', '0', '>', KPTR_RESTRICT_PATH])
 
         print "Updating kallsyms file (%s) from device" % kallsyms_cache_path
-        self._pull_from_device("/proc/kallsyms", kallsyms_cache_path)
+        self._android_commands.pull("/proc/kallsyms", kallsyms_cache_path)
 
-        self._run_adb_command(['shell', 'echo', saved_kptr_restrict, '>', KPTR_RESTRICT_PATH])
+        self._android_commands.run(['shell', 'echo', saved_kptr_restrict, '>', KPTR_RESTRICT_PATH])
 
         return kallsyms_cache_path
 
@@ -556,8 +671,8 @@
 
         # find the installed path, and the path of the symboled built library
         # FIXME: We should get the install path from the device!
-        symfs_library_path = fs.join(symfs_path, "data/app-lib/%s-1/%s" % (DRT_APP_PACKAGE, DRT_LIBRARY_NAME))
-        built_library_path = self._port._build_path('lib', DRT_LIBRARY_NAME)
+        symfs_library_path = fs.join(symfs_path, "data/app-lib/%s-1/%s" % (self._driver_details.package_name(), self._driver_details.library_name()))
+        built_library_path = self._port._build_path('lib', self._driver_details.library_name())
         assert(fs.exists(built_library_path))
 
         # FIXME: Ideally we'd check the sha1's first and make a soft-link instead of copying (since we probably never care about windows).
@@ -569,8 +684,8 @@
 
     def _setup_md5sum_and_push_data_if_needed(self):
         self._md5sum_path = self._port.path_to_md5sum()
-        if not self._file_exists_on_device(MD5SUM_DEVICE_PATH):
-            if not self._push_to_device(self._md5sum_path, MD5SUM_DEVICE_PATH):
+        if not self._android_commands.file_exists(MD5SUM_DEVICE_PATH):
+            if not self._android_commands.push(self._md5sum_path, MD5SUM_DEVICE_PATH):
                 raise AssertionError('Could not push md5sum to device')
 
         self._push_executable()
@@ -582,32 +697,32 @@
         if self._has_setup:
             return
 
-        self._restart_adb_as_root()
+        self._android_commands.restart_as_root()
         self._setup_md5sum_and_push_data_if_needed()
         self._has_setup = True
         self._setup_performance()
 
         # Required by webkit_support::GetWebKitRootDirFilePath().
         # Other directories will be created automatically by adb push.
-        self._run_adb_command(['shell', 'mkdir', '-p', DEVICE_SOURCE_ROOT_DIR + 'chrome'])
+        self._android_commands.run(['shell', 'mkdir', '-p', DEVICE_SOURCE_ROOT_DIR + 'chrome'])
 
-        # Allow the DumpRenderTree app to fully access the directory.
+        # Allow the test driver to get full read and write access to the directory.
         # The native code needs the permission to write temporary files and create pipes here.
-        self._run_adb_command(['shell', 'mkdir', '-p', DEVICE_DRT_DIR])
-        self._run_adb_command(['shell', 'chmod', '777', DEVICE_DRT_DIR])
+        self._android_commands.run(['shell', 'mkdir', '-p', self._driver_details.device_directory()])
+        self._android_commands.run(['shell', 'chmod', '777', self._driver_details.device_directory()])
 
         # Delete the disk cache if any to ensure a clean test run.
         # This is like what's done in ChromiumPort.setup_test_run but on the device.
-        self._run_adb_command(['shell', 'rm', '-r', DRT_APP_CACHE_DIR])
+        self._android_commands.run(['shell', 'rm', '-r', self._driver_details.device_cache_directory()])
 
     def _log_error(self, message):
-        _log.error('[%s] %s' % (self._device_serial, message))
+        _log.error('[%s] %s' % (self._android_commands.get_serial(), message))
 
     def _log_debug(self, message):
-        _log.debug('[%s] %s' % (self._device_serial, message))
+        _log.debug('[%s] %s' % (self._android_commands.get_serial(), message))
 
     def _abort(self, message):
-        raise AssertionError('[%s] %s' % (self._device_serial, message))
+        raise AssertionError('[%s] %s' % (self._android_commands.get_serial(), message))
 
     @staticmethod
     def _extract_hashes_from_md5sum_output(md5sum_output):
@@ -617,36 +732,39 @@
     def _push_file_if_needed(self, host_file, device_file):
         assert os.path.exists(host_file)
         device_hashes = self._extract_hashes_from_md5sum_output(
-                self._port.host.executive.popen(self._adb_command() + ['shell', MD5SUM_DEVICE_PATH, device_file],
+                self._port.host.executive.popen(self._android_commands.adb_command() + ['shell', MD5SUM_DEVICE_PATH, device_file],
                                                 stdout=subprocess.PIPE).stdout)
         host_hashes = self._extract_hashes_from_md5sum_output(
                 self._port.host.executive.popen(args=['%s_host' % self._md5sum_path, host_file],
                                                 stdout=subprocess.PIPE).stdout)
         if host_hashes and device_hashes == host_hashes:
             return
-        self._push_to_device(host_file, device_file)
+
+        self._android_commands.push(host_file, device_file)
 
     def _push_executable(self):
-        self._push_file_if_needed(self._port.path_to_forwarder(), DEVICE_FORWARDER_PATH)
-        self._push_file_if_needed(self._port._build_path('DumpRenderTree.pak'), DEVICE_DRT_DIR + 'DumpRenderTree.pak')
-        self._push_file_if_needed(self._port._build_path('DumpRenderTree_resources'), DEVICE_DRT_DIR + 'DumpRenderTree_resources')
-        self._push_file_if_needed(self._port._build_path('android_main_fonts.xml'), DEVICE_DRT_DIR + 'android_main_fonts.xml')
-        self._push_file_if_needed(self._port._build_path('android_fallback_fonts.xml'), DEVICE_DRT_DIR + 'android_fallback_fonts.xml')
-        self._run_adb_command(['uninstall', DRT_APP_PACKAGE])
-        drt_host_path = self._port._path_to_driver()
-        install_result = self._run_adb_command(['install', drt_host_path])
+        self._push_file_if_needed(self._port.path_to_forwarder(), self._driver_details.device_forwarder_path())
+        for resource in self._driver_details.additional_resources():
+            self._push_file_if_needed(self._port._build_path(resource), self._driver_details.device_directory() + resource)
+
+        self._push_file_if_needed(self._port._build_path('android_main_fonts.xml'), self._driver_details.device_directory() + 'android_main_fonts.xml')
+        self._push_file_if_needed(self._port._build_path('android_fallback_fonts.xml'), self._driver_details.device_directory() + 'android_fallback_fonts.xml')
+
+        self._android_commands.run(['uninstall', self._driver_details.package_name()])
+        driver_host_path = self._port._path_to_driver()
+        install_result = self._android_commands.run(['install', driver_host_path])
         if install_result.find('Success') == -1:
-            self._abort('Failed to install %s onto device: %s' % (drt_host_path, install_result))
+            self._abort('Failed to install %s onto device: %s' % (driver_host_path, install_result))
 
     def _push_fonts(self):
         self._log_debug('Pushing fonts')
         path_to_ahem_font = self._port._build_path('AHEM____.TTF')
-        self._push_file_if_needed(path_to_ahem_font, DEVICE_FONTS_DIR + 'AHEM____.TTF')
+        self._push_file_if_needed(path_to_ahem_font, self._driver_details.device_fonts_directory() + 'AHEM____.TTF')
         for (host_dirs, font_file, package) in HOST_FONT_FILES:
             for host_dir in host_dirs:
                 host_font_path = host_dir + font_file
                 if self._port._check_file_exists(host_font_path, '', logging=False):
-                    self._push_file_if_needed(host_font_path, DEVICE_FONTS_DIR + font_file)
+                    self._push_file_if_needed(host_font_path, self._driver_details.device_fonts_directory() + font_file)
 
     def _push_test_resources(self):
         self._log_debug('Pushing test resources')
@@ -655,47 +773,14 @@
 
     def _push_platform_resources(self):
         self._log_debug('Pushing platform resources')
-        external_storage = self._port._filesystem.join(self._run_adb_command(['shell', 'echo $EXTERNAL_STORAGE']).strip(), 'Source', 'WebKit', 'chromium')
+        external_storage = self._port._filesystem.join(self._android_commands.run(['shell', 'echo $EXTERNAL_STORAGE']).strip(), 'Source', 'WebKit', 'chromium')
         for resource in WEBKIT_PLATFORM_RESOURCES_TO_PUSH:
             self._push_file_if_needed(self._port._chromium_base_dir(self._port._filesystem) + '/' + resource, external_storage + '/' + resource)
 
-    def _restart_adb_as_root(self):
-        output = self._run_adb_command(['root'])
-        if 'adbd is already running as root' in output:
-            return
-        elif not 'restarting adbd as root' in output:
-            self._log_error('Unrecognized output from adb root: %s' % output)
-
-        # Regardless the output, give the device a moment to come back online.
-        self._run_adb_command(['wait-for-device'])
-
-    def _run_adb_command(self, cmd, ignore_error=False):
-        self._log_debug('Run adb command: ' + str(cmd))
-        if ignore_error:
-            error_handler = self._port._executive.ignore_error
-        else:
-            error_handler = None
-        result = self._port._executive.run_command(self._adb_command() + cmd, error_handler=error_handler)
-        # Limit the length to avoid too verbose output of commands like 'adb logcat' and 'cat /data/tombstones/tombstone01'
-        # whose outputs are normally printed in later logs.
-        self._log_debug('Run adb result: ' + result[:80])
-        return result
-
-    def _link_device_file(self, from_file, to_file, ignore_error=False):
-        # rm to_file first to make sure that ln succeeds.
-        self._run_adb_command(['shell', 'rm', to_file], ignore_error)
-        return self._run_adb_command(['shell', 'ln', '-s', from_file, to_file], ignore_error)
-
-    def _push_to_device(self, host_path, device_path, ignore_error=False):
-        return self._run_adb_command(['push', host_path, device_path], ignore_error)
-
-    def _pull_from_device(self, device_path, host_path, ignore_error=False):
-        return self._run_adb_command(['pull', device_path, host_path], ignore_error)
-
     def _get_last_stacktrace(self):
-        tombstones = self._run_adb_command(['shell', 'ls', '-n', '/data/tombstones'])
+        tombstones = self._android_commands.run(['shell', 'ls', '-n', '/data/tombstones'])
         if not tombstones or tombstones.startswith('/data/tombstones: No such file or directory'):
-            self._log_error('DRT crashed, but no tombstone found!')
+            self._log_error('The driver crashed, but no tombstone found!')
             return ''
         tombstones = tombstones.rstrip().split('\n')
         last_tombstone = tombstones[0].split()
@@ -714,45 +799,41 @@
         # stack trace into a human readable format, if needed.
         # It takes a long time, so don't do it here.
         return '%s\n%s' % (' '.join(last_tombstone),
-                           self._run_adb_command(['shell', 'cat', '/data/tombstones/' + last_tombstone[6]]))
+                           self._android_commands.run(['shell', 'cat', '/data/tombstones/' + last_tombstone[6]]))
 
     def _get_logcat(self):
-        return self._run_adb_command(['logcat', '-d', '-v', 'threadtime'])
+        return self._android_commands.run(['logcat', '-d', '-v', 'threadtime'])
 
     def _setup_performance(self):
         # Disable CPU scaling and drop ram cache to reduce noise in tests
         if not self._original_governors:
-            governor_files = self._run_adb_command(['shell', 'ls', SCALING_GOVERNORS_PATTERN])
+            governor_files = self._android_commands.run(['shell', 'ls', SCALING_GOVERNORS_PATTERN])
             if governor_files.find('No such file or directory') == -1:
                 for file in governor_files.split():
-                    self._original_governors[file] = self._run_adb_command(['shell', 'cat', file]).strip()
-                    self._run_adb_command(['shell', 'echo', 'performance', '>', file])
+                    self._original_governors[file] = self._android_commands.run(['shell', 'cat', file]).strip()
+                    self._android_commands.run(['shell', 'echo', 'performance', '>', file])
 
     def _teardown_performance(self):
         for file, original_content in self._original_governors.items():
-            self._run_adb_command(['shell', 'echo', original_content, '>', file])
+            self._android_commands.run(['shell', 'echo', original_content, '>', file])
         self._original_governors = {}
 
     def _get_crash_log(self, stdout, stderr, newer_than):
         if not stdout:
             stdout = ''
-        stdout += '********* [%s] Logcat:\n%s' % (self._device_serial, self._get_logcat())
+        stdout += '********* [%s] Logcat:\n%s' % (self._android_commands.get_serial(), self._get_logcat())
         if not stderr:
             stderr = ''
-        stderr += '********* [%s] Tombstone file:\n%s' % (self._device_serial, self._get_last_stacktrace())
+        stderr += '********* [%s] Tombstone file:\n%s' % (self._android_commands.get_serial(), self._get_last_stacktrace())
         return super(ChromiumAndroidDriver, self)._get_crash_log(stdout, stderr, newer_than)
 
     def cmd_line(self, pixel_tests, per_test_args):
         # The returned command line is used to start _server_process. In our case, it's an interactive 'adb shell'.
-        # The command line passed to the DRT process is returned by _drt_cmd_line() instead.
-        return self._adb_command() + ['shell']
+        # The command line passed to the driver process is returned by _driver_cmd_line() instead.
+        return self._android_commands.adb_command() + ['shell']
 
-    def _file_exists_on_device(self, full_file_path):
-        assert full_file_path.startswith('/')
-        return self._run_adb_command(['shell', 'ls', full_file_path]).strip() == full_file_path
-
-    def _drt_cmd_line(self, pixel_tests, per_test_args):
-        return driver.Driver.cmd_line(self, pixel_tests, per_test_args) + ['--create-stdin-fifo', '--separate-stderr-fifo']
+    def _android_driver_cmd_line(self, pixel_tests, per_test_args):
+        return driver.Driver.cmd_line(self, pixel_tests, per_test_args) + self._driver_details.additional_command_line_flags()
 
     @staticmethod
     def _loop_with_timeout(condition, timeout_secs):
@@ -763,17 +844,17 @@
         return False
 
     def _all_pipes_created(self):
-        return (self._file_exists_on_device(self._in_fifo_path) and
-                self._file_exists_on_device(self._out_fifo_path) and
-                self._file_exists_on_device(self._err_fifo_path))
+        return (self._android_commands.file_exists(self._in_fifo_path) and
+                self._android_commands.file_exists(self._out_fifo_path) and
+                self._android_commands.file_exists(self._err_fifo_path))
 
     def _remove_all_pipes(self):
         for file in [self._in_fifo_path, self._out_fifo_path, self._err_fifo_path]:
-            self._run_adb_command(['shell', 'rm', file])
+            self._android_commands.run(['shell', 'rm', file])
 
-        return (not self._file_exists_on_device(self._in_fifo_path) and
-                not self._file_exists_on_device(self._out_fifo_path) and
-                not self._file_exists_on_device(self._err_fifo_path))
+        return (not self._android_commands.file_exists(self._in_fifo_path) and
+                not self._android_commands.file_exists(self._out_fifo_path) and
+                not self._android_commands.file_exists(self._err_fifo_path))
 
     def run_test(self, driver_input, stop_when_done):
         base = self._port.lookup_virtual_test_base(driver_input.test_name)
@@ -785,8 +866,8 @@
 
     def start(self, pixel_tests, per_test_args):
         # Only one driver instance is allowed because of the nature of Android activity.
-        # The single driver needs to restart DumpRenderTree when the command line changes.
-        cmd_line = self._drt_cmd_line(pixel_tests, per_test_args)
+        # The single driver needs to restart content_shell when the command line changes.
+        cmd_line = self._android_driver_cmd_line(pixel_tests, per_test_args)
         if cmd_line != self._cmd_line:
             self.stop()
             self._cmd_line = cmd_line
@@ -798,45 +879,45 @@
         for retries in range(3):
             if self._start_once(pixel_tests, per_test_args):
                 return
-            self._log_error('Failed to start DumpRenderTree application. Retries=%d. Log:%s' % (retries, self._get_logcat()))
+            self._log_error('Failed to start the content_shell application. Retries=%d. Log:%s' % (retries, self._get_logcat()))
             self.stop()
             time.sleep(2)
-        self._abort('Failed to start DumpRenderTree application multiple times. Give up.')
+        self._abort('Failed to start the content_shell application multiple times. Giving up.')
 
     def _start_once(self, pixel_tests, per_test_args):
         super(ChromiumAndroidDriver, self)._start(pixel_tests, per_test_args)
 
         self._log_debug('Starting forwarder')
         self._forwarder_process = self._port._server_process_constructor(
-            self._port, 'Forwarder', self._adb_command() + ['shell', '%s -D %s' % (DEVICE_FORWARDER_PATH, FORWARD_PORTS)])
+            self._port, 'Forwarder', self._android_commands.adb_command() + ['shell', '%s -D %s' % (self._driver_details.device_forwarder_path(), FORWARD_PORTS)])
         self._forwarder_process.start()
 
-        self._run_adb_command(['logcat', '-c'])
-        self._run_adb_command(['shell', 'echo'] + self._cmd_line + ['>', COMMAND_LINE_FILE])
-        start_result = self._run_adb_command(['shell', 'am', 'start', '-e', 'RunInSubThread', '-n', DRT_ACTIVITY_FULL_NAME])
+        self._android_commands.run(['logcat', '-c'])
+        self._android_commands.run(['shell', 'echo'] + self._cmd_line + ['>', self._driver_details.command_line_file()])
+        start_result = self._android_commands.run(['shell', 'am', 'start', '-e', 'RunInSubThread', '-n', self._driver_details.activity_name()])
         if start_result.find('Exception') != -1:
-            self._log_error('Failed to start DumpRenderTree application. Exception:\n' + start_result)
+            self._log_error('Failed to start the content_shell application. Exception:\n' + start_result)
             return False
 
-        if not ChromiumAndroidDriver._loop_with_timeout(self._all_pipes_created, DRT_START_STOP_TIMEOUT_SECS):
+        if not ChromiumAndroidDriver._loop_with_timeout(self._all_pipes_created, DRIVER_START_STOP_TIMEOUT_SECS):
             return False
 
         # Read back the shell prompt to ensure adb shell ready.
-        deadline = time.time() + DRT_START_STOP_TIMEOUT_SECS
+        deadline = time.time() + DRIVER_START_STOP_TIMEOUT_SECS
         self._server_process.start()
         self._read_prompt(deadline)
         self._log_debug('Interactive shell started')
 
-        # Start a process to read from the stdout fifo of the DumpRenderTree app and print to stdout.
+        # Start a process to read from the stdout fifo of the test driver and print to stdout.
         self._log_debug('Redirecting stdout to ' + self._out_fifo_path)
         self._read_stdout_process = self._port._server_process_constructor(
-            self._port, 'ReadStdout', self._adb_command() + ['shell', 'cat', self._out_fifo_path])
+            self._port, 'ReadStdout', self._android_commands.adb_command() + ['shell', 'cat', self._out_fifo_path])
         self._read_stdout_process.start()
 
-        # Start a process to read from the stderr fifo of the DumpRenderTree app and print to stdout.
+        # Start a process to read from the stderr fifo of the test driver and print to stdout.
         self._log_debug('Redirecting stderr to ' + self._err_fifo_path)
         self._read_stderr_process = self._port._server_process_constructor(
-            self._port, 'ReadStderr', self._adb_command() + ['shell', 'cat', self._err_fifo_path])
+            self._port, 'ReadStderr', self._android_commands.adb_command() + ['shell', 'cat', self._err_fifo_path])
         self._read_stderr_process.start()
 
         self._log_debug('Redirecting stdin to ' + self._in_fifo_path)
@@ -846,7 +927,7 @@
         self._server_process.replace_outputs(self._read_stdout_process._proc.stdout, self._read_stderr_process._proc.stdout)
 
         def deadlock_detector(processes, normal_startup_event):
-            if not ChromiumAndroidDriver._loop_with_timeout(lambda: normal_startup_event.is_set(), DRT_START_STOP_TIMEOUT_SECS):
+            if not ChromiumAndroidDriver._loop_with_timeout(lambda: normal_startup_event.is_set(), DRIVER_START_STOP_TIMEOUT_SECS):
                 # If normal_startup_event is not set in time, the main thread must be blocked at
                 # reading/writing the fifo. Kill the fifo reading/writing processes to let the
                 # main thread escape from the deadlocked state. After that, the main thread will
@@ -867,9 +948,9 @@
             line = self._server_process.read_stdout_line(deadline)
 
         if self._server_process.timed_out and not self.has_crashed():
-            # DumpRenderTree crashes during startup, or when the deadlock detector detected
-            # deadlock and killed the fifo reading/writing processes.
-            _log.error('Failed to start DumpRenderTree: \n%s' % output)
+            # The test driver crashed during startup, or when the deadlock detector hit
+            # a deadlock and killed the fifo reading/writing processes.
+            _log.error('Failed to start the test driver: \n%s' % output)
             return False
 
         # Inform the deadlock detector that the startup is successful without deadlock.
@@ -880,17 +961,17 @@
         # ps output seems to be fixed width, we only care about the name and the pid
         # u0_a72    21630 125   947920 59364 ffffffff 400beee4 S org.chromium.native_test
         for line in ps_output.split('\n'):
-            if line.find(DRT_APP_PACKAGE) != -1:
+            if line.find(self._driver_details.package_name()) != -1:
                 match = re.match(r'\S+\s+(\d+)', line)
                 return int(match.group(1))
 
     def _pid_on_target(self):
         # FIXME: There must be a better way to do this than grepping ps output!
-        ps_output = self._run_adb_command(['shell', 'ps'])
-        return self._pid_from_android_ps_output(ps_output, DRT_APP_PACKAGE)
+        ps_output = self._android_commands.run(['shell', 'ps'])
+        return self._pid_from_android_ps_output(ps_output, self._driver_details.package_name())
 
     def stop(self):
-        self._run_adb_command(['shell', 'am', 'force-stop', DRT_APP_PACKAGE])
+        self._android_commands.run(['shell', 'am', 'force-stop', self._driver_details.package_name()])
 
         if self._read_stdout_process:
             self._read_stdout_process.kill()
@@ -907,7 +988,7 @@
             self._forwarder_process = None
 
         if self._has_setup:
-            if not ChromiumAndroidDriver._loop_with_timeout(self._remove_all_pipes, DRT_START_STOP_TIMEOUT_SECS):
+            if not ChromiumAndroidDriver._loop_with_timeout(self._remove_all_pipes, DRIVER_START_STOP_TIMEOUT_SECS):
                 raise AssertionError('Failed to remove fifo files. May be locked.')
 
     def _command_from_driver_input(self, driver_input):
@@ -927,8 +1008,3 @@
                 if last_char in ('#', '$'):
                     return
             last_char = current_char
-
-    def _adb_command(self):
-        if not self._adb_command_base:
-            self._adb_command_base = [self._port.path_to_adb(), '-s', self._device_serial]
-        return self._adb_command_base
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
index f34bbcd..62995b1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
@@ -42,71 +42,100 @@
 from webkitpy.layout_tests.port import driver_unittest
 from webkitpy.tool.mocktool import MockOptions
 
+# Any "adb" commands will be interpret by this class instead of executing actual
+# commansd on the file system, which we don't want to do.
+class MockAndroidDebugBridge:
+    def __init__(self, device_count):
+        self._device_count = device_count
+        self._last_command = None
 
-class MockRunCommand(object):
-    def __init__(self):
-        self._mock_logcat = ''
-        self._mock_devices_output = ''
-        self._mock_devices = []
-        self._mock_ls_tombstones = ''
+    # Local public methods.
 
-    def mock_run_command_fn(self, args):
-        if not args[0].endswith('adb'):
-            return ''
-        if args[1] == 'devices':
-            return self._mock_devices_output
-        if args[1] == 'version':
+    def run_command(self, args):
+        self._last_command = ' '.join(args)
+        if args[0].startswith('path'):
+            if args[0] == 'path1':
+                return ''
+            if args[0] == 'path2':
+                return 'version 1.1'
+
             return 'version 1.0'
 
-        assert len(args) > 3
-        assert args[1] == '-s'
-        assert args[2] in self._mock_devices
-        if args[3] == 'shell':
-            if args[4:] == ['ls', '-n', '/data/tombstones']:
-                return self._mock_ls_tombstones
-            elif args[4] == 'cat':
-                return args[5] + '\nmock_contents\n'
-        elif args[3] == 'logcat':
-            return self._mock_logcat
+        if args[0] == 'adb':
+            if len(args) > 1 and args[1] == 'version':
+                return 'version 1.0'
+            if len(args) > 1 and args[1] == 'devices':
+                return self._get_device_output()
+            if len(args) > 3 and args[3] == 'command':
+                return 'mockoutput'
+
         return ''
 
-    def mock_no_device(self):
-        self._mock_devices = []
-        self._mock_devices_output = 'List of devices attached'
+    def last_command(self):
+        return self._last_command
 
-    def mock_one_device(self):
-        self._mock_devices = ['123456789ABCDEF0']
-        self._mock_devices_output = ('List of devices attached\n'
-                                     '%s\tdevice\n' % self._mock_devices[0])
+    # Local private methods.
 
-    def mock_two_devices(self):
-        self._mock_devices = ['123456789ABCDEF0', '23456789ABCDEF01']
-        self._mock_devices_output = ('* daemon not running. starting it now on port 5037 *'
-                                     '* daemon started successfully *'
-                                     'List of devices attached\n'
-                                     '%s\tdevice\n'
-                                     '%s\tdevice\n' % (self._mock_devices[0], self._mock_devices[1]))
+    def _get_device_output(self):
+        serials = ['123456789ABCDEF0', '123456789ABCDEF1', '123456789ABCDEF2',
+                   '123456789ABCDEF3', '123456789ABCDEF4', '123456789ABCDEF5']
+        output = 'List of devices attached\n'
+        for serial in serials[:self._device_count]:
+          output += '%s\tdevice\n' % serial
+        return output
 
-    def mock_no_tombstone_dir(self):
-        self._mock_ls_tombstones = '/data/tombstones: No such file or directory'
 
-    def mock_no_tombstone_file(self):
-        self._mock_ls_tombstones = ''
+class AndroidCommandsTest(unittest.TestCase):
+    def setUp(self):
+        chromium_android.AndroidCommands._adb_command_path = None
+        chromium_android.AndroidCommands._adb_command_path_options = ['adb']
 
-    def mock_ten_tombstones(self):
-        self._mock_ls_tombstones = ('-rw------- 1000     1000       218643 2012-04-26 18:15 tombstone_00\n'
-                                    '-rw------- 1000     1000       241695 2012-04-26 18:15 tombstone_01\n'
-                                    '-rw------- 1000     1000       219472 2012-04-26 18:16 tombstone_02\n'
-                                    '-rw------- 1000     1000        45316 2012-04-27 16:33 tombstone_03\n'
-                                    '-rw------- 1000     1000        82022 2012-04-23 16:57 tombstone_04\n'
-                                    '-rw------- 1000     1000        82015 2012-04-23 16:57 tombstone_05\n'
-                                    '-rw------- 1000     1000        81974 2012-04-23 16:58 tombstone_06\n'
-                                    '-rw------- 1000     1000       237409 2012-04-26 17:41 tombstone_07\n'
-                                    '-rw------- 1000     1000       276089 2012-04-26 18:15 tombstone_08\n'
-                                    '-rw------- 1000     1000       219618 2012-04-26 18:15 tombstone_09\n')
+    def make_executive(self, device_count):
+        self._mock_executive = MockAndroidDebugBridge(device_count)
+        return MockExecutive2(run_command_fn=self._mock_executive.run_command)
 
-    def mock_logcat(self, content):
-        self._mock_logcat = content
+    def make_android_commands(self, device_count, serial):
+        return chromium_android.AndroidCommands(self.make_executive(device_count), serial)
+
+    # The "adb" binary with the latest version should be used.
+    def serial_test_adb_command_path(self):
+        executive = self.make_executive(0)
+
+        chromium_android.AndroidCommands.set_adb_command_path_options(['path1', 'path2', 'path3'])
+        self.assertEqual('path2', chromium_android.AndroidCommands.adb_command_path(executive))
+
+    # The get_devices() method should throw if there aren't any devices. Otherwise it returns an array.
+    def test_get_devices(self):
+        self.assertRaises(AssertionError, chromium_android.AndroidCommands.get_devices, self.make_executive(0))
+        self.assertEquals(1, len(chromium_android.AndroidCommands.get_devices(self.make_executive(1))))
+        self.assertEquals(5, len(chromium_android.AndroidCommands.get_devices(self.make_executive(5))))
+
+    # The used adb command should include the device's serial number, and get_serial() should reflect this.
+    def test_adb_command_and_get_serial(self):
+        android_commands = self.make_android_commands(1, '123456789ABCDEF0')
+        self.assertEquals(['adb', '-s', '123456789ABCDEF0'], android_commands.adb_command())
+        self.assertEquals('123456789ABCDEF0', android_commands.get_serial())
+
+    # Running an adb command should return the command's output.
+    def test_run_command(self):
+        android_commands = self.make_android_commands(1, '123456789ABCDEF0')
+
+        output = android_commands.run(['command'])
+        self.assertEquals('adb -s 123456789ABCDEF0 command', self._mock_executive.last_command())
+        self.assertEquals('mockoutput', output)
+
+    # Test that the convenience methods create the expected commands.
+    def test_convenience_methods(self):
+        android_commands = self.make_android_commands(1, '123456789ABCDEF0')
+
+        android_commands.file_exists('/tombstones')
+        self.assertEquals('adb -s 123456789ABCDEF0 shell ls /tombstones', self._mock_executive.last_command())
+
+        android_commands.push('foo', 'bar')
+        self.assertEquals('adb -s 123456789ABCDEF0 push foo bar', self._mock_executive.last_command())
+
+        android_commands.pull('bar', 'foo')
+        self.assertEquals('adb -s 123456789ABCDEF0 pull bar foo', self._mock_executive.last_command())
 
 
 class ChromiumAndroidPortTest(chromium_port_testcase.ChromiumPortTestCase):
@@ -115,232 +144,126 @@
 
     def make_port(self, **kwargs):
         port = super(ChromiumAndroidPortTest, self).make_port(**kwargs)
-        self.mock_run_command = MockRunCommand()
-        self.mock_run_command.mock_one_device()
-        port._executive = MockExecutive2(run_command_fn=self.mock_run_command.mock_run_command_fn)
+        port._mock_adb = MockAndroidDebugBridge(kwargs.get('device_count', 1))
+        port._executive = MockExecutive2(run_command_fn=port._mock_adb.run_command)
         return port
 
-    def test_attributes(self):
-        port = self.make_port()
-        self.assertEqual(port.baseline_path(), port._webkit_baseline_path('chromium-android'))
+    # Test that the right driver details will be set for DumpRenderTree vs. content_shell
+    def test_driver_details(self):
+        port_dump_render_tree = self.make_port()
+        port_content_shell = self.make_port(options=optparse.Values({'driver_name': 'content_shell'}))
 
+        self.assertIsInstance(port_dump_render_tree._driver_details, chromium_android.DumpRenderTreeDriverDetails)
+        self.assertIsInstance(port_content_shell._driver_details, chromium_android.ContentShellDriverDetails)
+
+    # Test that the number of child processes to create depends on the devices.
+    def test_default_child_processes(self):
+        port_default = self.make_port(device_count=5)
+        port_fixed_device = self.make_port(device_count=5, options=optparse.Values({'adb_device': '123456789ABCDEF9'}))
+
+        self.assertEquals(5, port_default.default_child_processes())
+        self.assertEquals(1, port_fixed_device.default_child_processes())
+
+    # Test that an HTTP server indeed is required by Android (as we serve all tests over them)
+    def test_requires_http_server(self):
+        self.assertTrue(self.make_port(device_count=1).requires_http_server())
+
+    # Disable this test because Android introduces its own TestExpectations file.
+    def test_expectations_files(self):
+        pass
+
+    # Test that Chromium Android still uses a port-specific TestExpectations file.
+    def test_uses_android_specific_test_expectations(self):
+        port = self.make_port()
+
+        android_count = len(port._port_specific_expectations_files())
+        chromium_count = len(super(chromium_android.ChromiumAndroidPort, port)._port_specific_expectations_files())
+
+        self.assertEquals(android_count - 1, chromium_count)
+
+    # Tests the default timeouts for Android, which are different than the rest of Chromium.
     def test_default_timeout_ms(self):
         self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Release'})).default_timeout_ms(), 10000)
         self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Debug'})).default_timeout_ms(), 10000)
 
-    def test_expectations_files(self):
-        # FIXME: override this test temporarily while we're still upstreaming the android port and
-        # using a custom expectations file.
-        pass
-
-    def test_get_devices_no_device(self):
-        port = self.make_port()
-        self.mock_run_command.mock_no_device()
-        self.assertRaises(AssertionError, port._get_devices)
-
-    def test_get_devices_one_device(self):
-        port = self.make_port()
-        self.mock_run_command.mock_one_device()
-        self.assertEqual(self.mock_run_command._mock_devices, port._get_devices())
-        self.assertEqual(1, port.default_child_processes())
-
-    def test_get_devices_two_devices(self):
-        port = self.make_port()
-        self.mock_run_command.mock_two_devices()
-        self.assertEqual(self.mock_run_command._mock_devices, port._get_devices())
-        self.assertEqual(2, port.default_child_processes())
-
-    def test_get_device_serial_no_device(self):
-        port = self.make_port()
-        self.mock_run_command.mock_no_device()
-        self.assertRaises(AssertionError, port._get_device_serial, 0)
-
-    def test_get_device_serial_one_device(self):
-        port = self.make_port()
-        self.mock_run_command.mock_one_device()
-        self.assertEqual(self.mock_run_command._mock_devices[0], port._get_device_serial(0))
-        self.assertRaises(AssertionError, port._get_device_serial, 1)
-
-    def test_get_device_serial_two_devices(self):
-        port = self.make_port()
-        self.mock_run_command.mock_two_devices()
-        self.assertEqual(self.mock_run_command._mock_devices[0], port._get_device_serial(0))
-        self.assertEqual(self.mock_run_command._mock_devices[1], port._get_device_serial(1))
-        self.assertRaises(AssertionError, port._get_device_serial, 2)
-
-    def test_must_require_http_server(self):
-        port = self.make_port()
-        self.assertEqual(port.requires_http_server(), True)
-
 
 class ChromiumAndroidDriverTest(unittest.TestCase):
     def setUp(self):
-        self.mock_run_command = MockRunCommand()
-        self.mock_run_command.mock_one_device()
-        self.port = chromium_android.ChromiumAndroidPort(
-                MockSystemHost(executive=MockExecutive2(run_command_fn=self.mock_run_command.mock_run_command_fn)),
-                'chromium-android')
-        self.driver = chromium_android.ChromiumAndroidDriver(self.port, worker_number=0, pixel_tests=True)
+        self._mock_adb = MockAndroidDebugBridge(1)
+        self._mock_executive = MockExecutive2(run_command_fn=self._mock_adb.run_command)
+        self._port = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=self._mock_executive), 'chromium-android')
+        self._driver = chromium_android.ChromiumAndroidDriver(self._port, worker_number=0,
+            pixel_tests=True, driver_details=chromium_android.ContentShellDriverDetails())
 
-    def test_get_last_stacktrace(self):
-        self.mock_run_command.mock_no_tombstone_dir()
-        self.assertEqual(self.driver._get_last_stacktrace(), '')
-
-        self.mock_run_command.mock_no_tombstone_file()
-        self.assertEqual(self.driver._get_last_stacktrace(), '')
-
-        self.mock_run_command.mock_ten_tombstones()
-        self.assertEqual(self.driver._get_last_stacktrace(),
-                          '-rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03\n'
-                          '/data/tombstones/tombstone_03\nmock_contents\n')
-
-    def test_get_crash_log(self):
-        self.mock_run_command.mock_logcat('logcat contents\n')
-        self.mock_run_command.mock_ten_tombstones()
-        self.driver._crashed_process_name = 'foo'
-        self.driver._crashed_pid = 1234
-        self.assertEqual(self.driver._get_crash_log('out bar\nout baz\n', 'err bar\nerr baz\n', newer_than=None),
-            ('err bar\n'
-             'err baz\n'
-             '********* [123456789ABCDEF0] Tombstone file:\n'
-             '-rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03\n'
-             '/data/tombstones/tombstone_03\n'
-             'mock_contents\n',
-             u'crash log for foo (pid 1234):\n'
-             u'STDOUT: out bar\n'
-             u'STDOUT: out baz\n'
-             u'STDOUT: ********* [123456789ABCDEF0] Logcat:\n'
-             u'STDOUT: logcat contents\n'
-             u'STDERR: err bar\n'
-             u'STDERR: err baz\n'
-             u'STDERR: ********* [123456789ABCDEF0] Tombstone file:\n'
-             u'STDERR: -rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03\n'
-             u'STDERR: /data/tombstones/tombstone_03\n'
-             u'STDERR: mock_contents\n'))
-
-        self.driver._crashed_process_name = None
-        self.driver._crashed_pid = None
-        self.assertEqual(self.driver._get_crash_log(None, None, newer_than=None),
-            ('********* [123456789ABCDEF0] Tombstone file:\n'
-             '-rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03\n'
-             '/data/tombstones/tombstone_03\n'
-             'mock_contents\n',
-             u'crash log for <unknown process name> (pid <unknown>):\n'
-             u'STDOUT: ********* [123456789ABCDEF0] Logcat:\n'
-             u'STDOUT: logcat contents\n'
-             u'STDERR: ********* [123456789ABCDEF0] Tombstone file:\n'
-             u'STDERR: -rw------- 1000 1000 45316 2012-04-27 16:33 tombstone_03\n'
-             u'STDERR: /data/tombstones/tombstone_03\n'
-             u'STDERR: mock_contents\n'))
-
+    # The cmd_line() method in the Android port is used for starting a shell, not the test runner.
     def test_cmd_line(self):
-        cmd_line = self.driver.cmd_line(True, ['anything'])
-        self.assertEqual(['adb', '-s', self.mock_run_command._mock_devices[0], 'shell'], cmd_line)
+        self.assertEquals(['adb', '-s', '123456789ABCDEF0', 'shell'], self._driver.cmd_line(False, []))
 
-    def test_drt_cmd_line(self):
-        cmd_line = self.driver._drt_cmd_line(True, ['--a'])
-        self.assertIn('--a', cmd_line)
-        self.assertIn('--create-stdin-fifo', cmd_line)
-        self.assertIn('--separate-stderr-fifo', cmd_line)
-
+    # Test that the Chromium Android port can interpret Android's shell output.
     def test_read_prompt(self):
-        self.driver._server_process = driver_unittest.MockServerProcess(lines=['root@android:/ # '])
-        self.assertIsNone(self.driver._read_prompt(time.time() + 1))
-        self.driver._server_process = driver_unittest.MockServerProcess(lines=['$ '])
-        self.assertIsNone(self.driver._read_prompt(time.time() + 1))
-
-    def test_command_from_driver_input(self):
-        driver_input = driver.DriverInput('foo/bar/test.html', 10, 'checksum', True)
-        expected_command = "/data/local/tmp/third_party/WebKit/LayoutTests/foo/bar/test.html'--pixel-test'checksum\n"
-        if (sys.platform != "cygwin"):
-            self.assertEqual(self.driver._command_from_driver_input(driver_input), expected_command)
-
-        driver_input = driver.DriverInput('http/tests/foo/bar/test.html', 10, 'checksum', True)
-        expected_command = "http://127.0.0.1:8000/foo/bar/test.html'--pixel-test'checksum\n"
-        self.assertEqual(self.driver._command_from_driver_input(driver_input), expected_command)
-
-    def test_pid_from_android_ps_output(self):
-        # FIXME: Use a larger blob of ps output.
-        ps_output = """u0_a72    21630 125   947920 59364 ffffffff 400beee4 S org.chromium.native_test"""
-        pid = self.driver._pid_from_android_ps_output(ps_output, "org.chromium.native_test")
-        self.assertEqual(pid, 21630)
+        self._driver._server_process = driver_unittest.MockServerProcess(lines=['root@android:/ # '])
+        self.assertIsNone(self._driver._read_prompt(time.time() + 1))
+        self._driver._server_process = driver_unittest.MockServerProcess(lines=['$ '])
+        self.assertIsNone(self._driver._read_prompt(time.time() + 1))
 
 
-class AndroidPerfTest(unittest.TestCase):
-    def test_perf_output_regexp(self):
-        perf_output = """[kernel.kallsyms] with build id 5a20f6299bdb955a2f07711bb7f65cd706fe7469 not found, continuing without symbols
-Failed to open /tmp/perf-14168.map, continuing without symbols
-Kernel address maps (/proc/{kallsyms,modules}) were restricted.
-
-Check /proc/sys/kernel/kptr_restrict before running 'perf record'.
-
-As no suitable kallsyms nor vmlinux was found, kernel samples
-can't be resolved.
-
-Samples in kernel modules can't be resolved as well.
-
-# Events: 31K cycles
-#
-# Overhead          Command                Shared Object
-# ........  ...............  ...........................  .....................................................................................................................................................................
-#
-    16.18%   DumpRenderTree  perf-14168.map               [.] 0x21270ac0cf43
-    12.72%   DumpRenderTree  DumpRenderTree               [.] v8::internal::JSObject::GetElementWithInterceptor(v8::internal::Object*, unsigned int)
-     8.28%   DumpRenderTree  DumpRenderTree               [.] v8::internal::LoadPropertyWithInterceptorOnly(v8::internal::Arguments, v8::internal::Isolate*)
-     5.60%   DumpRenderTree  DumpRenderTree               [.] WTF::AtomicString WebCore::v8StringToWebCoreString<WTF::AtomicString>(v8::Handle<v8::String>, WebCore::ExternalMode)
-     4.60%   DumpRenderTree  DumpRenderTree               [.] WebCore::WeakReferenceMap<void, v8::Object>::get(void*)
-     3.99%   DumpRenderTree  DumpRenderTree               [.] _ZNK3WTF7HashMapIPNS_16AtomicStringImplEPN7WebCore7ElementENS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS8_IS5_EEE3getERKS2_.isra.98
-     3.69%   DumpRenderTree  DumpRenderTree               [.] WebCore::DocumentV8Internal::getElementByIdCallback(v8::Arguments const&)
-     3.23%   DumpRenderTree  DumpRenderTree               [.] WebCore::V8ParameterBase::prepareBase()
-     2.83%   DumpRenderTree  DumpRenderTree               [.] WTF::AtomicString::add(unsigned short const*, unsigned int)
-     2.73%   DumpRenderTree  DumpRenderTree               [.] WebCore::DocumentV8Internal::getElementsByTagNameCallback(v8::Arguments const&)
-     2.47%   DumpRenderTree  DumpRenderTree               [.] _ZN2v86Object27GetPointerFromInternalFieldEi.constprop.439
-     2.43%   DumpRenderTree  DumpRenderTree               [.] v8::internal::Isolate::SetCurrentVMState(v8::internal::StateTag)
-"""
-        expected_first_ten_lines = """    16.18%   DumpRenderTree  perf-14168.map               [.] 0x21270ac0cf43
-    12.72%   DumpRenderTree  DumpRenderTree               [.] v8::internal::JSObject::GetElementWithInterceptor(v8::internal::Object*, unsigned int)
-     8.28%   DumpRenderTree  DumpRenderTree               [.] v8::internal::LoadPropertyWithInterceptorOnly(v8::internal::Arguments, v8::internal::Isolate*)
-     5.60%   DumpRenderTree  DumpRenderTree               [.] WTF::AtomicString WebCore::v8StringToWebCoreString<WTF::AtomicString>(v8::Handle<v8::String>, WebCore::ExternalMode)
-     4.60%   DumpRenderTree  DumpRenderTree               [.] WebCore::WeakReferenceMap<void, v8::Object>::get(void*)
-     3.99%   DumpRenderTree  DumpRenderTree               [.] _ZNK3WTF7HashMapIPNS_16AtomicStringImplEPN7WebCore7ElementENS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS8_IS5_EEE3getERKS2_.isra.98
-     3.69%   DumpRenderTree  DumpRenderTree               [.] WebCore::DocumentV8Internal::getElementByIdCallback(v8::Arguments const&)
-     3.23%   DumpRenderTree  DumpRenderTree               [.] WebCore::V8ParameterBase::prepareBase()
-     2.83%   DumpRenderTree  DumpRenderTree               [.] WTF::AtomicString::add(unsigned short const*, unsigned int)
-     2.73%   DumpRenderTree  DumpRenderTree               [.] WebCore::DocumentV8Internal::getElementsByTagNameCallback(v8::Arguments const&)
-"""
-        host = MockSystemHost()
-        profiler = chromium_android.AndroidPerf(host, '/bin/executable', '/tmp/output', 'adb-path', 'device-serial', '/tmp/symfs', '/tmp/kallsyms', 'foo')
-        self.assertEqual(profiler._first_ten_lines_of_profile(perf_output), expected_first_ten_lines)
-
-
-class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase):
+class ChromiumAndroidDriverTwoDriverTest(unittest.TestCase):
+    # Test two drivers getting the right serial numbers, and that we disregard per-test arguments.
     def test_two_drivers(self):
-        mock_run_command = MockRunCommand()
-        mock_run_command.mock_two_devices()
-        port = chromium_android.ChromiumAndroidPort(
-                MockSystemHost(executive=MockExecutive2(run_command_fn=mock_run_command.mock_run_command_fn)),
-                'chromium-android')
-        driver0 = chromium_android.ChromiumAndroidDriver(port, worker_number=0, pixel_tests=True)
-        driver1 = chromium_android.ChromiumAndroidDriver(port, worker_number=1, pixel_tests=True)
+        mock_adb = MockAndroidDebugBridge(2)
+        mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
 
-        cmd_line0 = driver0.cmd_line(True, ['anything'])
-        self.assertEqual(['adb', '-s', mock_run_command._mock_devices[0], 'shell'], cmd_line0)
+        port = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive), 'chromium-android')
+        driver0 = chromium_android.ChromiumAndroidDriver(port, worker_number=0, pixel_tests=True,
+            driver_details=chromium_android.DumpRenderTreeDriverDetails())
+        driver1 = chromium_android.ChromiumAndroidDriver(port, worker_number=1, pixel_tests=True,
+            driver_details=chromium_android.DumpRenderTreeDriverDetails())
 
-        cmd_line1 = driver1.cmd_line(True, ['anything'])
-        self.assertEqual(['adb', '-s', mock_run_command._mock_devices[1], 'shell'], cmd_line1)
+        self.assertEqual(['adb', '-s', '123456789ABCDEF0', 'shell'], driver0.cmd_line(True, []))
+        self.assertEqual(['adb', '-s', '123456789ABCDEF1', 'shell'], driver1.cmd_line(True, ['anything']))
 
 
 class ChromiumAndroidTwoPortsTest(unittest.TestCase):
+    # Test that the driver's command line indeed goes through to the driver.
     def test_options_with_two_ports(self):
-        options = MockOptions(additional_drt_flag=['--foo=bar', '--foo=baz'])
-        mock_run_command = MockRunCommand()
-        mock_run_command.mock_two_devices()
-        port0 = chromium_android.ChromiumAndroidPort(
-                MockSystemHost(executive=MockExecutive2(run_command_fn=mock_run_command.mock_run_command_fn)),
-                'chromium-android', options=options)
-        port1 = chromium_android.ChromiumAndroidPort(
-                MockSystemHost(executive=MockExecutive2(run_command_fn=mock_run_command.mock_run_command_fn)),
-                'chromium-android', options=options)
-        cmd_line = port1.driver_cmd_line()
-        self.assertEqual(cmd_line.count('--encode-binary'), 1)
-        self.assertEqual(cmd_line.count('--enable-hardware-gpu'), 1)
+        mock_adb = MockAndroidDebugBridge(2)
+        mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
+
+        port0 = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive),
+            'chromium-android', options=MockOptions(additional_drt_flag=['--foo=bar']))
+        port1 = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive),
+            'chromium-android', options=MockOptions(driver_name='content_shell'))
+
+        self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar'))
+        self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo'))
+
+
+class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase):
+    # Test two drivers getting the right serial numbers, and that we disregard per-test arguments.
+    def test_two_drivers(self):
+        mock_adb = MockAndroidDebugBridge(2)
+        mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
+
+        port = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive), 'chromium-android')
+        driver0 = chromium_android.ChromiumAndroidDriver(port, worker_number=0, pixel_tests=True,
+            driver_details=chromium_android.ContentShellDriverDetails())
+        driver1 = chromium_android.ChromiumAndroidDriver(port, worker_number=1, pixel_tests=True,
+            driver_details=chromium_android.ContentShellDriverDetails())
+
+        self.assertEqual(['adb', '-s', '123456789ABCDEF0', 'shell'], driver0.cmd_line(True, []))
+        self.assertEqual(['adb', '-s', '123456789ABCDEF1', 'shell'], driver1.cmd_line(True, []))
+
+
+class ChromiumAndroidTwoPortsTest(unittest.TestCase):
+    # Test that the driver's command line indeed goes through to the driver.
+    def test_options_with_two_ports(self):
+        mock_adb = MockAndroidDebugBridge(2)
+        mock_executive = MockExecutive2(run_command_fn=mock_adb.run_command)
+
+        port0 = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive),
+            'chromium-android', options=MockOptions(additional_drt_flag=['--foo=bar']))
+        port1 = chromium_android.ChromiumAndroidPort(MockSystemHost(executive=mock_executive),
+            'chromium-android', options=MockOptions(driver_name='content_shell'))
+
+        self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar'))
+        self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo'))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index 1d88db7..ff4f559 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -27,9 +27,11 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import logging
+import re
 
 from webkitpy.common.webkit_finder import WebKitFinder
 from webkitpy.layout_tests.port import chromium
+from webkitpy.layout_tests.port import chromium_win
 from webkitpy.layout_tests.port import config
 
 
@@ -39,21 +41,10 @@
 class ChromiumLinuxPort(chromium.ChromiumPort):
     port_name = 'chromium-linux'
 
-    SUPPORTED_ARCHITECTURES = ('x86', 'x86_64')
+    SUPPORTED_VERSIONS = ('x86', 'x86_64')
 
-    FALLBACK_PATHS = {
-        'x86_64': [
-            'chromium-linux',
-            'chromium-win',
-            'chromium',
-        ],
-        'x86': [
-            'chromium-linux-x86',
-            'chromium-linux',
-            'chromium-win',
-            'chromium',
-        ],
-    }
+    FALLBACK_PATHS = { 'x86_64': [ 'chromium-linux' ] + chromium_win.ChromiumWinPort.latest_platform_fallback_path() }
+    FALLBACK_PATHS['x86'] = ['chromium-linux-x86'] + FALLBACK_PATHS['x86_64']
 
     DEFAULT_BUILD_DIRECTORIES = ('sconsbuild', 'out')
 
@@ -74,11 +65,11 @@
         file_output = ''
         if filesystem.exists(driver_path):
             # The --dereference flag tells file to follow symlinks
-            file_output = executive.run_command(['file', '--dereference', driver_path], return_stderr=True)
+            file_output = executive.run_command(['file', '--brief', '--dereference', driver_path], return_stderr=True)
 
-        if 'ELF 32-bit LSB executable' in file_output:
+        if re.match(r'ELF 32-bit LSB\s+executable', file_output):
             return 'x86'
-        if 'ELF 64-bit LSB executable' in file_output:
+        if re.match(r'ELF 64-bit LSB\s+executable', file_output):
             return 'x86_64'
         if file_output:
             _log.warning('Could not determine architecture from "file" output: %s' % file_output)
@@ -99,7 +90,7 @@
         chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
         (base, arch) = port_name.rsplit('-', 1)
         assert base == 'chromium-linux'
-        assert arch in self.SUPPORTED_ARCHITECTURES
+        assert arch in self.SUPPORTED_VERSIONS
         assert port_name in ('chromium-linux', 'chromium-linux-x86', 'chromium-linux-x86_64')
         self._version = 'lucid'  # We only support lucid right now.
         self._architecture = arch
@@ -148,10 +139,13 @@
         return 'wdiff is not installed; please install using "sudo apt-get install wdiff"'
 
     def _path_to_apache(self):
-        if self._is_redhat_based():
-            return '/usr/sbin/httpd'
-        else:
-            return '/usr/sbin/apache2'
+        # The Apache binary path can vary depending on OS and distribution
+        # See http://wiki.apache.org/httpd/DistrosDefaultLayout
+        for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
+            if self._filesystem.exists(path):
+                return path
+        _log.error("Could not find apache. Not installed or unknown path.")
+        return None
 
     def _path_to_lighttpd(self):
         return "/usr/sbin/lighttpd"
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py
index 308d02f..2af4fd8 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py
@@ -63,7 +63,7 @@
                                  expected_architecture='x86_64')
         self.assert_architecture(file_output='ELF 32-bit LSB executable',
                                  expected_architecture='x86')
-        self.assert_architecture(file_output='ELF 64-bit LSB executable',
+        self.assert_architecture(file_output='ELF 64-bit LSB      executable',
                                  expected_architecture='x86_64')
 
     def test_check_illegal_port_names(self):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index 39de529..8085a32 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -38,33 +38,17 @@
 
 
 class ChromiumMacPort(chromium.ChromiumPort):
-    SUPPORTED_OS_VERSIONS = ('snowleopard', 'lion', 'mountainlion', 'future')
+    SUPPORTED_VERSIONS = ('snowleopard', 'lion', 'mountainlion')
     port_name = 'chromium-mac'
 
-    FALLBACK_PATHS = {
-        'snowleopard': [
-            'chromium-mac-snowleopard',
-            'chromium-mac-lion',
-            'chromium-mac',
-            'chromium',
-        ],
-        'lion': [
-            'chromium-mac-lion',
-            'chromium-mac',
-            'chromium',
-        ],
-        'mountainlion': [
-            'chromium-mac',
-            'chromium',
-        ],
-        'future': [
-            'chromium-mac',
-            'chromium',
-        ],
-    }
+    FALLBACK_PATHS = { 'mountainlion': [ 'chromium-mac' ]}
+    FALLBACK_PATHS['lion'] = ['chromium-mac-lion'] + FALLBACK_PATHS['mountainlion']
+    FALLBACK_PATHS['snowleopard'] = ['chromium-mac-snowleopard'] + FALLBACK_PATHS['lion']
 
     DEFAULT_BUILD_DIRECTORIES = ('xcodebuild', 'out')
 
+    CONTENT_SHELL_NAME = 'Content Shell'
+
     @classmethod
     def determine_full_port_name(cls, host, options, port_name):
         if port_name.endswith('-mac'):
@@ -74,7 +58,7 @@
     def __init__(self, host, port_name, **kwargs):
         chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
         self._version = port_name[port_name.index('chromium-mac-') + len('chromium-mac-'):]
-        assert self._version in self.SUPPORTED_OS_VERSIONS
+        assert self._version in self.SUPPORTED_VERSIONS
 
     def _modules_to_search_for_symbols(self):
         return [self._build_path('ffmpegsumo.so')]
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
index bf2ff8f..15476f8 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
@@ -44,7 +44,7 @@
         self.assertEqual(expected, port.name())
 
     def test_versions(self):
-        self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-mountainlion', 'chromium-mac-future'))
+        self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-mountainlion'))
 
         self.assert_name(None, 'snowleopard', 'chromium-mac-snowleopard')
         self.assert_name('chromium-mac', 'snowleopard', 'chromium-mac-snowleopard')
@@ -53,13 +53,8 @@
 
         self.assert_name(None, 'lion', 'chromium-mac-lion')
         self.assert_name(None, 'mountainlion', 'chromium-mac-mountainlion')
-        self.assert_name(None, 'future', 'chromium-mac-future')
 
         self.assert_name('chromium-mac', 'lion', 'chromium-mac-lion')
-        self.assert_name('chromium-mac-future', 'snowleopard', 'chromium-mac-future')
-        self.assert_name('chromium-mac-future', 'lion', 'chromium-mac-future')
-        self.assert_name('chromium-mac-future', 'mountainlion', 'chromium-mac-future')
-
         self.assertRaises(AssertionError, self.assert_name, None, 'tiger', 'should-raise-assertion-so-this-value-does-not-matter')
 
     def test_baseline_path(self):
@@ -72,9 +67,6 @@
         port = self.make_port(port_name='chromium-mac-mountainlion')
         self.assertEqual(port.baseline_path(), port._webkit_baseline_path('chromium-mac'))
 
-        port = self.make_port(port_name='chromium-mac-future')
-        self.assertEqual(port.baseline_path(), port._webkit_baseline_path('chromium-mac'))
-
     def test_operating_system(self):
         self.assertEqual('mac', self.make_port().operating_system())
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py
index f151ced..9db9b90 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py
@@ -73,8 +73,6 @@
         """Validate the complete set of configurations this port knows about."""
         port = self.make_port()
         self.assertEqual(set(port.all_test_configurations()), set([
-            TestConfiguration('icecreamsandwich', 'x86', 'debug'),
-            TestConfiguration('icecreamsandwich', 'x86', 'release'),
             TestConfiguration('snowleopard', 'x86', 'debug'),
             TestConfiguration('snowleopard', 'x86', 'release'),
             TestConfiguration('lion', 'x86', 'debug'),
@@ -177,24 +175,24 @@
         port.port_name = 'chromium'
 
         generic_path = port.path_to_generic_test_expectations_file()
-        expectations_path = port.path_to_test_expectations_file()
         chromium_overrides_path = port.path_from_chromium_base(
             'webkit', 'tools', 'layout_tests', 'test_expectations.txt')
+        never_fix_tests_path = port._filesystem.join(port.layout_tests_dir(), 'NeverFixTests')
         skia_overrides_path = port.path_from_chromium_base(
             'skia', 'skia_test_expectations.txt')
 
         port._filesystem.write_text_file(skia_overrides_path, 'dummay text')
 
         port._options.builder_name = 'DUMMY_BUILDER_NAME'
-        self.assertEqual(port.expectations_files(), [generic_path, expectations_path, skia_overrides_path, chromium_overrides_path])
+        self.assertEqual(port.expectations_files(), [generic_path, skia_overrides_path, never_fix_tests_path, chromium_overrides_path])
 
         port._options.builder_name = 'builder (deps)'
-        self.assertEqual(port.expectations_files(), [generic_path, expectations_path, skia_overrides_path, chromium_overrides_path])
+        self.assertEqual(port.expectations_files(), [generic_path, skia_overrides_path, never_fix_tests_path, chromium_overrides_path])
 
         # A builder which does NOT observe the Chromium test_expectations,
         # but still observes the Skia test_expectations...
         port._options.builder_name = 'builder'
-        self.assertEqual(port.expectations_files(), [generic_path, expectations_path, skia_overrides_path])
+        self.assertEqual(port.expectations_files(), [generic_path, skia_overrides_path, never_fix_tests_path])
 
     def test_expectations_ordering(self):
         # since we don't implement self.port_name in ChromiumPort.
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 31e10c5..44ee3e8 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -43,17 +43,8 @@
     # FIXME: Figure out how to unify this with base.TestConfiguration.all_systems()?
     SUPPORTED_VERSIONS = ('xp', 'win7')
 
-    FALLBACK_PATHS = {
-        'xp': [
-            'chromium-win-xp',
-            'chromium-win',
-            'chromium',
-        ],
-        'win7': [
-            'chromium-win',
-            'chromium',
-        ],
-    }
+    FALLBACK_PATHS = { 'win7': [ 'chromium-win' ]}
+    FALLBACK_PATHS['xp'] = ['chromium-win-xp'] + FALLBACK_PATHS['win7']
 
     DEFAULT_BUILD_DIRECTORIES = ('build', 'out')
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/config.py b/Tools/Scripts/webkitpy/layout_tests/port/config.py
index 8c89353..85e517f 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/config.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/config.py
@@ -26,9 +26,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-"""Wrapper objects for WebKit-specific utility routines."""
-
-# FIXME: This file needs to be unified with common/config/ports.py .
+# FIXME: Remove this file altogether. It's useless in a Blink checkout.
 
 import logging
 
@@ -37,22 +35,6 @@
 
 _log = logging.getLogger(__name__)
 
-#
-# FIXME: This is used to record if we've already hit the filesystem to look
-# for a default configuration. We cache this to speed up the unit tests,
-# but this can be reset with clear_cached_configuration(). This should be
-# replaced with us consistently using MockConfigs() for tests that don't
-# hit the filesystem at all and provide a reliable value.
-#
-_have_determined_configuration = False
-_configuration = "Release"
-
-
-def clear_cached_configuration():
-    global _have_determined_configuration, _configuration
-    _have_determined_configuration = False
-    _configuration = "Release"
-
 
 class Config(object):
     _FLAGS_FROM_CONFIGURATIONS = {
@@ -80,16 +62,7 @@
             flags.append('--' + self._port_implementation)
 
         if not self._build_directories.get(configuration):
-            args = ["perl", self._webkit_finder.path_to_script("webkit-build-directory")] + flags
-            output = self._executive.run_command(args, cwd=self._webkit_finder.webkit_base(), return_stderr=False).rstrip()
-            parts = output.split("\n")
-            self._build_directories[configuration] = parts[0]
-
-            if len(parts) == 2:
-                default_configuration = parts[1][len(parts[0]):]
-                if default_configuration.startswith("/"):
-                    default_configuration = default_configuration[1:]
-                self._build_directories[default_configuration] = parts[1]
+            self._build_directories[configuration] = self._webkit_finder.path_from_webkit_base('out', configuration)
 
         return self._build_directories[configuration]
 
@@ -97,45 +70,4 @@
         return self._FLAGS_FROM_CONFIGURATIONS[configuration]
 
     def default_configuration(self):
-        """Returns the default configuration for the user.
-
-        Returns the value set by 'set-webkit-configuration', or "Release"
-        if that has not been set. This mirrors the logic in webkitdirs.pm."""
-        if not self._default_configuration:
-            self._default_configuration = self._determine_configuration()
-        if not self._default_configuration:
-            self._default_configuration = 'Release'
-        if self._default_configuration not in self._FLAGS_FROM_CONFIGURATIONS:
-            _log.warn("Configuration \"%s\" is not a recognized value.\n" % self._default_configuration)
-            _log.warn("Scripts may fail.  See 'set-webkit-configuration --help'.")
-        return self._default_configuration
-
-    def _determine_configuration(self):
-        # This mirrors the logic in webkitdirs.pm:determineConfiguration().
-        #
-        # FIXME: See the comment at the top of the file regarding unit tests
-        # and our use of global mutable static variables.
-        # FIXME: We should just @memoize this method and then this will only
-        # be read once per object lifetime (which should be sufficiently fast).
-        global _have_determined_configuration, _configuration
-        if not _have_determined_configuration:
-            contents = self._read_configuration()
-            if not contents:
-                contents = "Release"
-            if contents == "Deployment":
-                contents = "Release"
-            if contents == "Development":
-                contents = "Debug"
-            _configuration = contents
-            _have_determined_configuration = True
-        return _configuration
-
-    def _read_configuration(self):
-        try:
-            configuration_path = self._filesystem.join(self.build_directory(None), "Configuration")
-            if not self._filesystem.exists(configuration_path):
-                return None
-        except:
-            return None
-
-        return self._filesystem.read_text_file(configuration_path).rstrip()
+        return 'Release'
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/config_standalone.py b/Tools/Scripts/webkitpy/layout_tests/port/config_standalone.py
deleted file mode 100644
index 274a07b..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/config_standalone.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""FIXME: This script is used by
-config_unittest.test_default_configuration__standalone() to read the
-default configuration to work around any possible caching / reset bugs. See
-https://bugs.webkit.org/show_bug?id=49360 for the motivation. We can remove
-this test when we remove the global configuration cache in config.py."""
-
-import os
-import sys
-
-
-# Ensure that webkitpy is in PYTHONPATH.
-this_dir = os.path.abspath(sys.path[0])
-up = os.path.dirname
-script_dir = up(up(up(this_dir)))
-if script_dir not in sys.path:
-    sys.path.append(script_dir)
-
-from webkitpy.common.system import executive
-from webkitpy.common.system import executive_mock
-from webkitpy.common.system import filesystem
-from webkitpy.common.system import filesystem_mock
-
-import config
-
-
-def main(argv=None):
-    if not argv:
-        argv = sys.argv
-
-    if len(argv) == 3 and argv[1] == '--mock':
-        e = executive_mock.MockExecutive2(output='foo\nfoo/%s' % argv[2])
-        fs = filesystem_mock.MockFileSystem({'foo/Configuration': argv[2]})
-    else:
-        e = executive.Executive()
-        fs = filesystem.FileSystem()
-
-    c = config.Config(e, fs)
-    print c.default_configuration()
-
-if __name__ == '__main__':
-    main()
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py
deleted file mode 100644
index 27c83ee..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import sys
-import unittest2 as unittest
-
-from webkitpy.common.system.executive import Executive, ScriptError
-from webkitpy.common.system.executive_mock import MockExecutive2
-from webkitpy.common.system.filesystem import FileSystem
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.common.webkit_finder import WebKitFinder
-
-import config
-
-
-class ConfigTest(unittest.TestCase):
-    def setUp(self):
-        config.clear_cached_configuration()
-
-    def tearDown(self):
-        config.clear_cached_configuration()
-
-    def make_config(self, output='', files=None, exit_code=0, exception=None, run_command_fn=None, stderr='', port_implementation=None):
-        e = MockExecutive2(output=output, exit_code=exit_code, exception=exception, run_command_fn=run_command_fn, stderr=stderr)
-        fs = MockFileSystem(files)
-        return config.Config(e, fs, port_implementation=port_implementation)
-
-    def assert_configuration(self, contents, expected):
-        # This tests that a configuration file containing
-        # _contents_ ends up being interpreted as _expected_.
-        output = 'foo\nfoo/%s' % contents
-        c = self.make_config(output, {'foo/Configuration': contents})
-        self.assertEqual(c.default_configuration(), expected)
-
-    def test_build_directory(self):
-        # --top-level
-        def mock_webkit_build_directory(arg_list):
-            if arg_list == ['--top-level']:
-                return '/WebKitBuild/'
-            elif arg_list == ['--configuration', '--debug']:
-                return '/WebKitBuild/Debug'
-            elif arg_list == ['--configuration', '--release']:
-                return '/WebKitBuild/Release'
-            elif arg_list == []:
-                return '/WebKitBuild/\n/WebKitBuild//Debug\n'
-            return 'Error'
-
-        def mock_run_command(arg_list):
-            if 'webkit-build-directory' in arg_list[1]:
-                return mock_webkit_build_directory(arg_list[2:])
-            return 'Error'
-
-        c = self.make_config(run_command_fn=mock_run_command)
-        self.assertEqual(c.build_directory(None), '/WebKitBuild/')
-
-        # Test again to check caching
-        self.assertEqual(c.build_directory(None), '/WebKitBuild/')
-
-        # Test other values
-        self.assertTrue(c.build_directory('Release').endswith('/Release'))
-        self.assertTrue(c.build_directory('Debug').endswith('/Debug'))
-        self.assertRaises(KeyError, c.build_directory, 'Unknown')
-
-        # Test that stderr output from webkit-build-directory won't mangle the build dir
-        c = self.make_config(output='/WebKitBuild/', stderr="mock stderr output from webkit-build-directory")
-        self.assertEqual(c.build_directory(None), '/WebKitBuild/')
-
-    def test_build_directory_passes_port_implementation(self):
-        def mock_run_command(arg_list):
-            self.assetEquals('--gtk' in arg_list)
-            return '/tmp'
-
-        c = self.make_config(run_command_fn=mock_run_command, port_implementation='gtk')
-
-    def test_default_configuration__release(self):
-        self.assert_configuration('Release', 'Release')
-
-    def test_default_configuration__debug(self):
-        self.assert_configuration('Debug', 'Debug')
-
-    def test_default_configuration__deployment(self):
-        self.assert_configuration('Deployment', 'Release')
-
-    def test_default_configuration__development(self):
-        self.assert_configuration('Development', 'Debug')
-
-    def test_default_configuration__notfound(self):
-        # This tests what happens if the default configuration file doesn't exist.
-        c = self.make_config(output='foo\nfoo/Release', files={'foo/Configuration': None})
-        self.assertEqual(c.default_configuration(), "Release")
-
-    def test_default_configuration__unknown(self):
-        # Ignore the warning about an unknown configuration value.
-        oc = OutputCapture()
-        oc.capture_output()
-        self.assert_configuration('Unknown', 'Unknown')
-        oc.restore_output()
-
-    def test_default_configuration__standalone(self):
-        # FIXME: This test runs a standalone python script to test
-        # reading the default configuration to work around any possible
-        # caching / reset bugs. See https://bugs.webkit.org/show_bug.cgi?id=49360
-        # for the motivation. We can remove this test when we remove the
-        # global configuration cache in config.py.
-        e = Executive()
-        fs = FileSystem()
-        c = config.Config(e, fs)
-        script = WebKitFinder(fs).path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'layout_tests', 'port', 'config_standalone.py')
-
-        # Note: don't use 'Release' here, since that's the normal default.
-        expected = 'Debug'
-
-        args = [sys.executable, script, '--mock', expected]
-        actual = e.run_command(args).rstrip()
-        self.assertEqual(actual, expected)
-
-    def test_default_configuration__no_perl(self):
-        # We need perl to run webkit-build-directory to find out where the
-        # default configuration file is. See what happens if perl isn't
-        # installed. (We should get the default value, 'Release').
-        c = self.make_config(exception=OSError)
-        actual = c.default_configuration()
-        self.assertEqual(actual, 'Release')
-
-    def test_default_configuration__scripterror(self):
-        # We run webkit-build-directory to find out where the default
-        # configuration file is. See what happens if that script fails.
-        # (We should get the default value, 'Release').
-        c = self.make_config(exception=ScriptError())
-        actual = c.default_configuration()
-        self.assertEqual(actual, 'Release')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py
deleted file mode 100644
index 0896634..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py
+++ /dev/null
@@ -1,136 +0,0 @@
-# Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved.
-# Copyright (C) 2011 Samsung Electronics. All rights reserved.
-# Copyright (C) 2012 Intel Corporation
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""WebKit Efl implementation of the Port interface."""
-
-import os
-
-from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-from webkitpy.layout_tests.port.base import Port
-from webkitpy.layout_tests.port.pulseaudio_sanitizer import PulseAudioSanitizer
-from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver
-
-
-class EflPort(Port):
-    port_name = 'efl'
-
-    def __init__(self, *args, **kwargs):
-        super(EflPort, self).__init__(*args, **kwargs)
-
-        self._jhbuild_wrapper_path = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--efl', 'run']
-
-        self.set_option_default('wrapper', ' '.join(self._jhbuild_wrapper_path))
-        self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix')
-
-        self._pulseaudio_sanitizer = PulseAudioSanitizer()
-
-    def _port_flag_for_scripts(self):
-        return "--efl"
-
-    def setup_test_run(self):
-        super(EflPort, self).setup_test_run()
-        self._pulseaudio_sanitizer.unload_pulseaudio_module()
-
-    def setup_environ_for_server(self, server_name=None):
-        env = super(EflPort, self).setup_environ_for_server(server_name)
-
-        # If DISPLAY environment variable is unset in the system
-        # e.g. on build bot, remove DISPLAY variable from the dictionary
-        if not 'DISPLAY' in os.environ:
-            del env['DISPLAY']
-
-        env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
-        env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib')
-
-        # Silence GIO warnings about using the "memory" GSettings backend.
-        env['GSETTINGS_BACKEND'] = 'memory'
-
-        if self.webprocess_cmd_prefix:
-            env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix
-
-        return env
-
-    def default_timeout_ms(self):
-        # Tests run considerably slower under gdb
-        # or valgrind.
-        if self.get_option('webprocess_cmd_prefix'):
-            return 350 * 1000
-        return super(EflPort, self).default_timeout_ms()
-
-    def clean_up_test_run(self):
-        super(EflPort, self).clean_up_test_run()
-        self._pulseaudio_sanitizer.restore_pulseaudio_module()
-
-    def _generate_all_test_configurations(self):
-        return [TestConfiguration(version=self._version, architecture='x86', build_type=build_type) for build_type in self.ALL_BUILD_TYPES]
-
-    def _driver_class(self):
-        return XvfbDriver
-
-    def _path_to_driver(self):
-        return self._build_path('bin', self.driver_name())
-
-    def _path_to_image_diff(self):
-        return self._build_path('bin', 'ImageDiff')
-
-    def _image_diff_command(self, *args, **kwargs):
-        return self._jhbuild_wrapper_path + super(EflPort, self)._image_diff_command(*args, **kwargs)
-
-    def _path_to_webcore_library(self):
-        static_path = self._build_path('lib', 'libwebcore_efl.a')
-        dyn_path = self._build_path('lib', 'libwebcore_efl.so')
-        return static_path if self._filesystem.exists(static_path) else dyn_path
-
-    def _search_paths(self):
-        search_paths = []
-        if self.get_option('webkit_test_runner'):
-            search_paths.append(self.port_name + '-wk2')
-            search_paths.append('wk2')
-        else:
-            search_paths.append(self.port_name + '-wk1')
-        search_paths.append(self.port_name)
-        return search_paths
-
-    def default_baseline_search_path(self):
-        return map(self._webkit_baseline_path, self._search_paths())
-
-    def _port_specific_expectations_files(self):
-        # FIXME: We should be able to use the default algorithm here.
-        return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self._search_paths()]))
-
-    def show_results_html_file(self, results_filename):
-        # FIXME: We should find a way to share this implmentation with Gtk,
-        # or teach run-launcher how to call run-safari and move this down to WebKitPort.
-        run_launcher_args = ["file://%s" % results_filename]
-        if self.get_option('webkit_test_runner'):
-            run_launcher_args.append('-2')
-        # FIXME: old-run-webkit-tests also added ["-graphicssystem", "raster", "-style", "windows"]
-        # FIXME: old-run-webkit-tests converted results_filename path for cygwin.
-        self._run_script("run-launcher", run_launcher_args)
-
-    def check_sys_deps(self, needs_http):
-        return super(EflPort, self).check_sys_deps(needs_http) and XvfbDriver.check_xvfb(self)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/efl_unittest.py
deleted file mode 100644
index 503afda..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/efl_unittest.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved.
-# Copyright (C) 2011 Samsung Electronics. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.common.system.executive_mock import MockExecutive
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.layout_tests.port.efl import EflPort
-from webkitpy.layout_tests.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
-from webkitpy.layout_tests.port import port_testcase
-
-
-class EflPortTest(port_testcase.PortTestCase):
-    port_name = 'efl'
-    port_maker = EflPort
-
-    # Additionally mocks out the PulseAudioSanitizer methods.
-    def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
-        port = super(EflPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs)
-        port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
-        return port
-
-    def test_show_results_html_file(self):
-        port = self.make_port()
-        port._executive = MockExecutive(should_log=True)
-        expected_logs = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--efl', 'file://test.html'], cwd=/mock-checkout\n"
-        OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
index 902ee22..e83cdd3 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -45,15 +45,6 @@
         optparse.make_option('--chromium-android', action='store_const', dest='platform',
             const=('chromium-android*' if use_globs else 'chromium-android'),
             help=('Alias for --platform=chromium-android*' if use_globs else 'Alias for --platform=chromium')),
-        optparse.make_option('--efl', action='store_const', dest='platform',
-            const=('efl*' if use_globs else 'efl'),
-            help=('Alias for --platform=efl*' if use_globs else 'Alias for --platform=efl')),
-        optparse.make_option('--gtk', action='store_const', dest='platform',
-            const=('gtk*' if use_globs else 'gtk'),
-            help=('Alias for --platform=gtk*' if use_globs else 'Alias for --platform=gtk')),
-        optparse.make_option('--qt', action='store_const', dest="platform",
-            const=('qt*' if use_globs else 'qt'),
-            help=('Alias for --platform=qt' if use_globs else 'Alias for --platform=qt')),
         ]
 
 
@@ -75,7 +66,7 @@
     configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "Release"
     is_webkit2 = builder_name.find("WK2") != -1
     builder_name = builder_name
-    return optparse.Values({'builder_name': builder_name, 'configuration': configuration, 'webkit_test_runner': is_webkit2})
+    return optparse.Values({'builder_name': builder_name, 'configuration': configuration})
 
 
 class PortFactory(object):
@@ -84,13 +75,8 @@
         'chromium_linux.ChromiumLinuxPort',
         'chromium_mac.ChromiumMacPort',
         'chromium_win.ChromiumWinPort',
-        'efl.EflPort',
-        'gtk.GtkPort',
-        'mac.MacPort',
         'mock_drt.MockDRTPort',
-        'qt.QtPort',
         'test.TestPort',
-        'win.WinPort',
     )
 
     def __init__(self, host):
@@ -101,9 +87,9 @@
         if platform.is_linux() or platform.is_freebsd():
             return 'chromium-linux'
         elif platform.is_mac():
-            return 'mac'
+            return 'chromium-mac'
         elif platform.is_win():
-            return 'win'
+            return 'chromium-win'
         raise NotImplementedError('unknown platform: %s' % platform)
 
     def get(self, port_name=None, options=None, **kwargs):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
index 363b7b9..32f3eb9 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
@@ -36,11 +36,7 @@
 from webkitpy.layout_tests.port import chromium_mac
 from webkitpy.layout_tests.port import chromium_win
 from webkitpy.layout_tests.port import factory
-from webkitpy.layout_tests.port import gtk
-from webkitpy.layout_tests.port import mac
-from webkitpy.layout_tests.port import qt
 from webkitpy.layout_tests.port import test
-from webkitpy.layout_tests.port import win
 
 
 class FactoryTest(unittest.TestCase):
@@ -56,25 +52,6 @@
         port = factory.PortFactory(host).get(port_name, options=options)
         self.assertIsInstance(port, cls)
 
-    def test_mac(self):
-        self.assert_port(port_name='mac-lion', cls=mac.MacPort)
-        self.assert_port(port_name='mac-lion-wk2', cls=mac.MacPort)
-        self.assert_port(port_name='mac', os_name='mac', os_version='lion', cls=mac.MacPort)
-        self.assert_port(port_name=None,  os_name='mac', os_version='lion', cls=mac.MacPort)
-
-    def test_win(self):
-        self.assert_port(port_name='win-xp', cls=win.WinPort)
-        self.assert_port(port_name='win-xp-wk2', cls=win.WinPort)
-        self.assert_port(port_name='win', os_name='win', os_version='xp', cls=win.WinPort)
-        self.assert_port(port_name=None, os_name='win', os_version='xp', cls=win.WinPort)
-        self.assert_port(port_name=None, os_name='win', os_version='xp', options=self.webkit_options, cls=win.WinPort)
-
-    def test_gtk(self):
-        self.assert_port(port_name='gtk', cls=gtk.GtkPort)
-
-    def test_qt(self):
-        self.assert_port(port_name='qt', cls=qt.QtPort)
-
     def test_chromium_mac(self):
         self.assert_port(port_name='chromium-mac', os_name='mac', os_version='snowleopard',
                          cls=chromium_mac.ChromiumMacPort)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
deleted file mode 100644
index d2d799e..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
+++ /dev/null
@@ -1,179 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import subprocess
-
-from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-from webkitpy.layout_tests.port.base import Port
-from webkitpy.layout_tests.port.pulseaudio_sanitizer import PulseAudioSanitizer
-from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver
-
-
-class GtkPort(Port):
-    port_name = "gtk"
-
-    def __init__(self, *args, **kwargs):
-        super(GtkPort, self).__init__(*args, **kwargs)
-        self._pulseaudio_sanitizer = PulseAudioSanitizer()
-
-    def warn_if_bug_missing_in_test_expectations(self):
-        return True
-
-    def _port_flag_for_scripts(self):
-        return "--gtk"
-
-    def _driver_class(self):
-        return XvfbDriver
-
-    def default_timeout_ms(self):
-        if self.get_option('configuration') == 'Debug':
-            return 12 * 1000
-        return 6 * 1000
-
-    def setup_test_run(self):
-        super(GtkPort, self).setup_test_run()
-        self._pulseaudio_sanitizer.unload_pulseaudio_module()
-
-    def clean_up_test_run(self):
-        super(GtkPort, self).clean_up_test_run()
-        self._pulseaudio_sanitizer.restore_pulseaudio_module()
-
-    def setup_environ_for_server(self, server_name=None):
-        environment = super(GtkPort, self).setup_environ_for_server(server_name)
-        environment['GTK_MODULES'] = 'gail'
-        environment['GSETTINGS_BACKEND'] = 'memory'
-        environment['LIBOVERLAY_SCROLLBAR'] = '0'
-        environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('Libraries', 'libTestRunnerInjectedBundle.la')
-        environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('TestNetscapePlugin', '.libs')
-        environment['WEBKIT_INSPECTOR_PATH'] = self._build_path('Programs', 'resources', 'inspector')
-        environment['AUDIO_RESOURCES_PATH'] = self.path_from_webkit_base('Source', 'WebCore', 'platform', 'audio', 'resources')
-        self._copy_value_from_environ_if_set(environment, 'WEBKITOUTPUTDIR')
-        return environment
-
-    def _generate_all_test_configurations(self):
-        configurations = []
-        for build_type in self.ALL_BUILD_TYPES:
-            configurations.append(TestConfiguration(version=self._version, architecture='x86', build_type=build_type))
-        return configurations
-
-    def _path_to_driver(self):
-        return self._build_path('Programs', self.driver_name())
-
-    def _path_to_image_diff(self):
-        return self._build_path('Programs', 'ImageDiff')
-
-    def _path_to_webcore_library(self):
-        gtk_library_names = [
-            "libwebkitgtk-1.0.so",
-            "libwebkitgtk-3.0.so",
-            "libwebkit2gtk-1.0.so",
-        ]
-
-        for library in gtk_library_names:
-            full_library = self._build_path(".libs", library)
-            if self._filesystem.isfile(full_library):
-                return full_library
-        return None
-
-    def _search_paths(self):
-        search_paths = []
-        if self.get_option('webkit_test_runner'):
-            search_paths.extend([self.port_name + '-wk2', 'wk2'])
-        else:
-            search_paths.append(self.port_name + '-wk1')
-        search_paths.append(self.port_name)
-        search_paths.extend(self.get_option("additional_platform_directory", []))
-        return search_paths
-
-    def default_baseline_search_path(self):
-        return map(self._webkit_baseline_path, self._search_paths())
-
-    def _port_specific_expectations_files(self):
-        return [self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in reversed(self._search_paths())]
-
-    # FIXME: We should find a way to share this implmentation with Gtk,
-    # or teach run-launcher how to call run-safari and move this down to Port.
-    def show_results_html_file(self, results_filename):
-        run_launcher_args = ["file://%s" % results_filename]
-        if self.get_option('webkit_test_runner'):
-            run_launcher_args.append('-2')
-        # FIXME: old-run-webkit-tests also added ["-graphicssystem", "raster", "-style", "windows"]
-        # FIXME: old-run-webkit-tests converted results_filename path for cygwin.
-        self._run_script("run-launcher", run_launcher_args)
-
-    def check_sys_deps(self, needs_http):
-        return super(GtkPort, self).check_sys_deps(needs_http) and XvfbDriver.check_xvfb(self)
-
-    def _get_gdb_output(self, coredump_path):
-        cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', str(self._path_to_driver()), coredump_path]
-        proc = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-        stdout, stderr = proc.communicate()
-        errors = [l.strip().decode('utf8', 'ignore') for l in stderr.splitlines()]
-        return (stdout.decode('utf8', 'ignore'), errors)
-
-    def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
-        pid_representation = str(pid or '<unknown>')
-        log_directory = os.environ.get("WEBKIT_CORE_DUMPS_DIRECTORY")
-        errors = []
-        crash_log = ''
-        expected_crash_dump_filename = "core-pid_%s-_-process_%s" % (pid_representation, name)
-
-        def match_filename(filesystem, directory, filename):
-            if pid:
-                return filename == expected_crash_dump_filename
-            return filename.find(name) > -1
-
-        if log_directory:
-            dumps = self._filesystem.files_under(log_directory, file_filter=match_filename)
-            if dumps:
-                # Get the most recent coredump matching the pid and/or process name.
-                coredump_path = list(reversed(sorted(dumps)))[0]
-                if not newer_than or self._filesystem.mtime(coredump_path) > newer_than:
-                    crash_log, errors = self._get_gdb_output(coredump_path)
-
-        stderr_lines = errors + (stderr or '<empty>').decode('utf8', 'ignore').splitlines()
-        errors_str = '\n'.join(('STDERR: ' + l) for l in stderr_lines)
-        if not crash_log:
-            if not log_directory:
-                log_directory = "/path/to/coredumps"
-            core_pattern = os.path.join(log_directory, "core-pid_%p-_-process_%e")
-            crash_log = """\
-Coredump %(expected_crash_dump_filename)s not found. To enable crash logs:
-
-- run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern
-- enable core dumps: ulimit -c unlimited
-- set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(log_directory)s
-
-""" % locals()
-
-        return (stderr, """\
-Crash log for %(name)s (pid %(pid_representation)s):
-
-%(crash_log)s
-%(errors_str)s""" % locals())
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py
deleted file mode 100644
index 7d24bb3..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-import sys
-import os
-
-from webkitpy.common.system.executive_mock import MockExecutive
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.layout_tests.port.gtk import GtkPort
-from webkitpy.layout_tests.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
-from webkitpy.layout_tests.port import port_testcase
-from webkitpy.thirdparty.mock import Mock
-from webkitpy.tool.mocktool import MockOptions
-
-
-class GtkPortTest(port_testcase.PortTestCase):
-    port_name = 'gtk'
-    port_maker = GtkPort
-
-    # Additionally mocks out the PulseAudioSanitizer methods.
-    def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
-        port = super(GtkPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs)
-        port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
-        return port
-
-    def test_default_baseline_search_path(self):
-        port = self.make_port()
-        self.assertEqual(port.default_baseline_search_path(), ['/mock-checkout/LayoutTests/platform/gtk-wk1',
-            '/mock-checkout/LayoutTests/platform/gtk'])
-
-        port = self.make_port(options=MockOptions(webkit_test_runner=True))
-        self.assertEqual(port.default_baseline_search_path(), ['/mock-checkout/LayoutTests/platform/gtk-wk2',
-            '/mock-checkout/LayoutTests/platform/wk2', '/mock-checkout/LayoutTests/platform/gtk'])
-
-    def test_port_specific_expectations_files(self):
-        port = self.make_port()
-        self.assertEqual(port.expectations_files(), ['/mock-checkout/LayoutTests/TestExpectations',
-            '/mock-checkout/LayoutTests/platform/gtk/TestExpectations',
-            '/mock-checkout/LayoutTests/platform/gtk-wk1/TestExpectations'])
-
-        port = self.make_port(options=MockOptions(webkit_test_runner=True))
-        self.assertEqual(port.expectations_files(), ['/mock-checkout/LayoutTests/TestExpectations',
-            '/mock-checkout/LayoutTests/platform/gtk/TestExpectations',
-            '/mock-checkout/LayoutTests/platform/wk2/TestExpectations',
-            '/mock-checkout/LayoutTests/platform/gtk-wk2/TestExpectations'])
-
-    def test_show_results_html_file(self):
-        port = self.make_port()
-        port._executive = MockExecutive(should_log=True)
-        expected_logs = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--gtk', 'file://test.html'], cwd=/mock-checkout\n"
-        OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
-
-    def test_default_timeout_ms(self):
-        self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 6000)
-        self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 12000)
-
-    def test_get_crash_log(self):
-        core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps')
-        core_pattern = os.path.join(core_directory, "core-pid_%p-_-process_%e")
-        mock_empty_crash_log = """\
-Crash log for DumpRenderTree (pid 28529):
-
-Coredump core-pid_28529-_-process_DumpRenderTree not found. To enable crash logs:
-
-- run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern
-- enable core dumps: ulimit -c unlimited
-- set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s
-
-
-STDERR: <empty>""" % locals()
-
-        def _mock_gdb_output(coredump_path):
-            return (mock_empty_crash_log, [])
-
-        port = self.make_port()
-        port._get_gdb_output = mock_empty_crash_log
-        stderr, log = port._get_crash_log("DumpRenderTree", 28529, "", "", newer_than=None)
-        self.assertEqual(stderr, "")
-        self.assertMultiLineEqual(log, mock_empty_crash_log)
-
-        stderr, log = port._get_crash_log("DumpRenderTree", 28529, "", "", newer_than=0.0)
-        self.assertEqual(stderr, "")
-        self.assertMultiLineEqual(log, mock_empty_crash_log)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py b/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py
deleted file mode 100644
index f46cd34..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import re
-
-from webkitpy.common.system.executive import ScriptError
-
-_log = logging.getLogger(__name__)
-
-
-# If other ports/platforms decide to support --leaks, we should see about sharing as much of this code as possible.
-# Right now this code is only used by Apple's MacPort.
-
-class LeakDetector(object):
-    def __init__(self, port):
-        # We should operate on a "platform" not a port here.
-        self._port = port
-        self._executive = port._executive
-        self._filesystem = port._filesystem
-
-    # We exclude the following reported leaks so they do not get in our way when looking for WebKit leaks:
-    # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
-    # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
-    # fixed, it will be listed here until the bot has been updated with the newer frameworks.
-    def _types_to_exlude_from_leaks(self):
-        # Currently we don't have any type excludes from OS leaks, but we will likely again in the future.
-        return []
-
-    def _callstacks_to_exclude_from_leaks(self):
-        callstacks = [
-            "Flash_EnforceLocalSecurity",  # leaks in Flash plug-in code, rdar://problem/4449747
-            "ScanFromString", # <http://code.google.com/p/angleproject/issues/detail?id=249> leak in ANGLE
-        ]
-        if self._port.is_snowleopard():
-            callstacks += [
-                "readMakerNoteProps",  # <rdar://problem/7156432> leak in ImageIO
-                "QTKitMovieControllerView completeUISetup",  # <rdar://problem/7155156> leak in QTKit
-                "getVMInitArgs",  # <rdar://problem/7714444> leak in Java
-                "Java_java_lang_System_initProperties",  # <rdar://problem/7714465> leak in Java
-                "glrCompExecuteKernel",  # <rdar://problem/7815391> leak in graphics driver while using OpenGL
-                "NSNumberFormatter getObjectValue:forString:errorDescription:",  # <rdar://problem/7149350> Leak in NSNumberFormatter
-            ]
-        elif self._port.is_lion():
-            callstacks += [
-                "FigByteFlumeCustomURLCreateWithURL", # <rdar://problem/10461926> leak in CoreMedia
-                "PDFPage\(PDFPageInternal\) pageLayoutIfAvail", # <rdar://problem/10462055> leak in PDFKit
-                "SecTransformExecute", # <rdar://problem/10470667> leak in Security.framework
-                "_NSCopyStyleRefForFocusRingStyleClip", # <rdar://problem/10462031> leak in AppKit
-            ]
-        return callstacks
-
-    def _leaks_args(self, pid):
-        leaks_args = []
-        for callstack in self._callstacks_to_exclude_from_leaks():
-            leaks_args += ['--exclude-callstack=%s' % callstack]
-        for excluded_type in self._types_to_exlude_from_leaks():
-            leaks_args += ['--exclude-type=%s' % excluded_type]
-        leaks_args.append(pid)
-        return leaks_args
-
-    def _parse_leaks_output(self, leaks_output):
-        _, count, bytes = re.search(r'Process (?P<pid>\d+): (?P<count>\d+) leaks? for (?P<bytes>\d+) total', leaks_output).groups()
-        excluded_match = re.search(r'(?P<excluded>\d+) leaks? excluded', leaks_output)
-        excluded = excluded_match.group('excluded') if excluded_match else 0
-        return int(count), int(excluded), int(bytes)
-
-    def leaks_files_in_directory(self, directory):
-        return self._filesystem.glob(self._filesystem.join(directory, "*-leaks.txt"))
-
-    def leaks_file_name(self, process_name, process_pid):
-        # We include the number of files this worker has already written in the name to prevent overwritting previous leak results..
-        return "%s-%s-leaks.txt" % (process_name, process_pid)
-
-    def count_total_bytes_and_unique_leaks(self, leak_files):
-        merge_depth = 5  # ORWT had a --merge-leak-depth argument, but that seems out of scope for the run-webkit-tests tool.
-        args = [
-            '--merge-depth',
-            merge_depth,
-        ] + leak_files
-        try:
-            parse_malloc_history_output = self._port._run_script("parse-malloc-history", args, include_configuration_arguments=False)
-        except ScriptError, e:
-            _log.warn("Failed to parse leaks output: %s" % e.message_with_output())
-            return
-
-        # total: 5,888 bytes (0 bytes excluded).
-        unique_leak_count = len(re.findall(r'^(\d*)\scalls', parse_malloc_history_output, re.MULTILINE))
-        total_bytes_string = re.search(r'^total\:\s(.+)\s\(', parse_malloc_history_output, re.MULTILINE).group(1)
-        return (total_bytes_string, unique_leak_count)
-
-    def count_total_leaks(self, leak_file_paths):
-        total_leaks = 0
-        for leak_file_path in leak_file_paths:
-            # Leaks have been seen to include non-utf8 data, so we use read_binary_file.
-            # See https://bugs.webkit.org/show_bug.cgi?id=71112.
-            leaks_output = self._filesystem.read_binary_file(leak_file_path)
-            count, _, _ = self._parse_leaks_output(leaks_output)
-            total_leaks += count
-        return total_leaks
-
-    def check_for_leaks(self, process_name, process_pid):
-        _log.debug("Checking for leaks in %s" % process_name)
-        try:
-            # Oddly enough, run-leaks (or the underlying leaks tool) does not seem to always output utf-8,
-            # thus we pass decode_output=False.  Without this code we've seen errors like:
-            # "UnicodeDecodeError: 'utf8' codec can't decode byte 0x88 in position 779874: unexpected code byte"
-            leaks_output = self._port._run_script("run-leaks", self._leaks_args(process_pid), include_configuration_arguments=False, decode_output=False)
-        except ScriptError, e:
-            _log.warn("Failed to run leaks tool: %s" % e.message_with_output())
-            return
-
-        # FIXME: We end up parsing this output 3 times.  Once here and twice for summarizing.
-        count, excluded, bytes = self._parse_leaks_output(leaks_output)
-        adjusted_count = count - excluded
-        if not adjusted_count:
-            return
-
-        leaks_filename = self.leaks_file_name(process_name, process_pid)
-        leaks_output_path = self._filesystem.join(self._port.results_directory(), leaks_filename)
-        self._filesystem.write_binary_file(leaks_output_path, leaks_output)
-
-        # FIXME: Ideally we would not be logging from the worker process, but rather pass the leak
-        # information back to the manager and have it log.
-        if excluded:
-            _log.info("%s leaks (%s bytes including %s excluded leaks) were found, details in %s" % (adjusted_count, bytes, excluded, leaks_output_path))
-        else:
-            _log.info("%s leaks (%s bytes) were found, details in %s" % (count, bytes, leaks_output_path))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py
deleted file mode 100644
index f2daec9..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/leakdetector_unittest.py
+++ /dev/null
@@ -1,152 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.layout_tests.port.leakdetector import LeakDetector
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.common.system.executive_mock import MockExecutive
-
-
-class LeakDetectorTest(unittest.TestCase):
-    def _mock_port(self):
-        class MockPort(object):
-            def __init__(self):
-                self._filesystem = MockFileSystem()
-                self._executive = MockExecutive()
-
-        return MockPort()
-
-    def _make_detector(self):
-        return LeakDetector(self._mock_port())
-
-    def test_leaks_args(self):
-        detector = self._make_detector()
-        detector._callstacks_to_exclude_from_leaks = lambda: ['foo bar', 'BAZ']
-        detector._types_to_exlude_from_leaks = lambda: ['abcdefg', 'hi jklmno']
-        expected_args = ['--exclude-callstack=foo bar', '--exclude-callstack=BAZ', '--exclude-type=abcdefg', '--exclude-type=hi jklmno', 1234]
-        self.assertEqual(detector._leaks_args(1234), expected_args)
-
-    example_leaks_output = """Process 5122: 663744 nodes malloced for 78683 KB
-Process 5122: 337301 leaks for 6525216 total leaked bytes.
-Leak: 0x38cb600  size=3072  zone: DefaultMallocZone_0x1d94000   instance of 'NSCFData', type ObjC, implemented in Foundation
-        0xa033f0b8 0x01001384 0x00000b3a 0x00000b3a     ..3.....:...:...
-        0x00000000 0x038cb620 0x00000000 0x00000000     .... ...........
-        0x00000000 0x21000000 0x726c6468 0x00000000     .......!hdlr....
-        0x00000000 0x7269646d 0x6c707061 0x00000000     ....mdirappl....
-        0x00000000 0x04000000 0x736c69c1 0x00000074     .........ilst...
-        0x6f74a923 0x0000006f 0x7461641b 0x00000061     #.too....data...
-        0x00000001 0x76614c00 0x2e323566 0x302e3236     .....Lavf52.62.0
-        0x37000000 0x6d616ea9 0x2f000000 0x61746164     ...7.nam.../data
-        ...
-Leak: 0x2a9c960  size=288  zone: DefaultMallocZone_0x1d94000
-        0x09a1cc47 0x1bda8560 0x3d472cd1 0xfbe9bccd     G...`....,G=....
-        0x8bcda008 0x9e972a91 0xa892cf63 0x2448bdb0     .....*..c.....H$
-        0x4736fc34 0xdbe2d94e 0x25f56688 0x839402a4     4.6GN....f.%....
-        0xd12496b3 0x59c40c12 0x8cfcab2a 0xd20ef9c4     ..$....Y*.......
-        0xe7c56b1b 0x5835af45 0xc69115de 0x6923e4bb     .k..E.5X......#i
-        0x86f15553 0x15d40fa9 0x681288a4 0xc33298a9     SU.........h..2.
-        0x439bb535 0xc4fc743d 0x7dfaaff8 0x2cc49a4a     5..C=t.....}J..,
-        0xdd119df8 0x7e086821 0x3d7d129e 0x2e1b1547     ....!h.~..}=G...
-        ...
-Leak: 0x25102fe0  size=176  zone: DefaultMallocZone_0x1d94000   string 'NSException Data'
-"""
-
-    example_leaks_output_with_exclusions = """
-Process 57064: 865808 nodes malloced for 81032 KB
-Process 57064: 282 leaks for 21920 total leaked bytes.
-Leak: 0x7fc506023960  size=576  zone: DefaultMallocZone_0x107c29000   URLConnectionLoader::LoaderConnectionEventQueue  C++  CFNetwork
-        0x73395460 0x00007fff 0x7488af40 0x00007fff     `T9s....@..t....
-        0x73395488 0x00007fff 0x46eecd74 0x0001ed83     .T9s....t..F....
-        0x0100000a 0x00000000 0x7488bfc0 0x00007fff     ...........t....
-        0x00000000 0x00000000 0x46eecd8b 0x0001ed83     ...........F....
-        0x00000000 0x00000000 0x00000000 0x00000000     ................
-        0x00000000 0x00000000 0x46eecda3 0x0001ed83     ...........F....
-        0x00000000 0x00000000 0x00000000 0x00000000     ................
-        0x00000000 0x00000000 0x46eecdbc 0x0001ed83     ...........F....
-        ...
-Leak: 0x7fc506025980  size=432  zone: DefaultMallocZone_0x107c29000   URLConnectionInstanceData  CFType  CFNetwork
-        0x74862b28 0x00007fff 0x00012b80 0x00000001     (+.t.....+......
-        0x73395310 0x00007fff 0x733953f8 0x00007fff     .S9s.....S9s....
-        0x4d555458 0x00000000 0x00000000 0x00002068     XTUM........h ..
-        0x00000000 0x00000000 0x00000b00 0x00000b00     ................
-        0x00000000 0x00000000 0x060259b8 0x00007fc5     .........Y......
-        0x060259bc 0x00007fc5 0x00000000 0x00000000     .Y..............
-        0x73395418 0x00007fff 0x06025950 0x00007fc5     .T9s....PY......
-        0x73395440 0x00007fff 0x00005013 0x00000001     @T9s.....P......
-        ...
-
-
-Binary Images:
-       0x107ac2000 -        0x107b4aff7 +DumpRenderTree (??? - ???) <5694BE03-A60A-30B2-9D40-27CFFCFB88EE> /Volumes/Data/WebKit-BuildSlave/lion-intel-leaks/build/WebKitBuild/Debug/DumpRenderTree
-       0x107c2f000 -        0x107c58fff +libWebCoreTestSupport.dylib (535.8.0 - compatibility 1.0.0) <E4F7A13E-5807-30F7-A399-62F8395F9106> /Volumes/Data/WebKit-BuildSlave/lion-intel-leaks/build/WebKitBuild/Debug/libWebCoreTestSupport.dylib
-17 leaks excluded (not printed)
-"""
-
-    def test_parse_leaks_output(self):
-        self.assertEqual(self._make_detector()._parse_leaks_output(self.example_leaks_output), (337301, 0, 6525216))
-        self.assertEqual(self._make_detector()._parse_leaks_output(self.example_leaks_output_with_exclusions), (282, 17, 21920))
-
-    def test_leaks_files_in_directory(self):
-        detector = self._make_detector()
-        self.assertEqual(detector.leaks_files_in_directory('/bogus-directory'), [])
-        detector._filesystem = MockFileSystem({
-            '/mock-results/DumpRenderTree-1234-leaks.txt': '',
-            '/mock-results/DumpRenderTree-23423-leaks.txt': '',
-            '/mock-results/DumpRenderTree-823-leaks.txt': '',
-        })
-        self.assertEqual(len(detector.leaks_files_in_directory('/mock-results')), 3)
-
-    def test_count_total_bytes_and_unique_leaks(self):
-        detector = self._make_detector()
-
-        def mock_run_script(name, args, include_configuration_arguments=False):
-            print "MOCK _run_script: %s %s" % (name, args)
-            return """1 calls for 16 bytes: -[NSURLRequest mutableCopyWithZone:] | +[NSObject(NSObject) allocWithZone:] | _internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
-
-147 calls for 9,408 bytes: _CFRuntimeCreateInstance | _ZN3WTF24StringWrapperCFAllocatorL8allocateElmPv StringImplCF.cpp:67 | WTF::fastMalloc(unsigned long) FastMalloc.cpp:268 | malloc | malloc_zone_malloc 
-
-total: 5,888 bytes (0 bytes excluded)."""
-        detector._port._run_script = mock_run_script
-
-        leak_files = ['/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt']
-        expected_stdout = "MOCK _run_script: parse-malloc-history ['--merge-depth', 5, '/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-1235-leaks.txt']\n"
-        results_tuple = OutputCapture().assert_outputs(self, detector.count_total_bytes_and_unique_leaks, [leak_files], expected_stdout=expected_stdout)
-        self.assertEqual(results_tuple, ("5,888 bytes", 2))
-
-    def test_count_total_leaks(self):
-        detector = self._make_detector()
-        detector._filesystem = MockFileSystem({
-            # The \xff is some non-utf8 characters to make sure we don't blow up trying to parse the file.
-            '/mock-results/DumpRenderTree-1234-leaks.txt': '\xff\nProcess 1234: 12 leaks for 40 total leaked bytes.\n\xff\n',
-            '/mock-results/DumpRenderTree-23423-leaks.txt': 'Process 1235: 12341 leaks for 27934 total leaked bytes.\n',
-            '/mock-results/DumpRenderTree-823-leaks.txt': 'Process 12356: 23412 leaks for 18 total leaked bytes.\n',
-        })
-        leak_file_paths = ['/mock-results/DumpRenderTree-1234-leaks.txt', '/mock-results/DumpRenderTree-23423-leaks.txt', '/mock-results/DumpRenderTree-823-leaks.txt']
-        self.assertEqual(detector.count_total_leaks(leak_file_paths), 35765)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac.py b/Tools/Scripts/webkitpy/layout_tests/port/mac.py
deleted file mode 100644
index 031a239..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/mac.py
+++ /dev/null
@@ -1,297 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-# Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import os
-import time
-
-from webkitpy.common.system.crashlogs import CrashLogs
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.layout_tests.port.apple import ApplePort
-from webkitpy.layout_tests.port.leakdetector import LeakDetector
-
-
-_log = logging.getLogger(__name__)
-
-
-class MacPort(ApplePort):
-    port_name = "mac"
-
-    VERSION_FALLBACK_ORDER = ['mac-snowleopard', 'mac-lion', 'mac-mountainlion']
-
-    ARCHITECTURES = ['x86_64', 'x86']
-
-    def __init__(self, host, port_name, **kwargs):
-        ApplePort.__init__(self, host, port_name, **kwargs)
-        self._architecture = self.get_option('architecture')
-
-        if not self._architecture:
-            self._architecture = 'x86_64'
-
-        self._leak_detector = LeakDetector(self)
-        if self.get_option("leaks"):
-            # DumpRenderTree slows down noticably if we run more than about 1000 tests in a batch
-            # with MallocStackLogging enabled.
-            self.set_option_default("batch_size", 1000)
-
-    def default_timeout_ms(self):
-        if self.get_option('guard_malloc'):
-            return 350 * 1000
-        return super(MacPort, self).default_timeout_ms()
-
-    def supports_per_test_timeout(self):
-        return True
-
-    def _build_driver_flags(self):
-        return ['ARCHS=i386'] if self.architecture() == 'x86' else []
-
-    def should_retry_crashes(self):
-        # On Apple Mac, we retry crashes due to https://bugs.webkit.org/show_bug.cgi?id=82233
-        return True
-
-    def default_baseline_search_path(self):
-        name = self._name.replace('-wk2', '')
-        if name.endswith(self.FUTURE_VERSION):
-            fallback_names = [self.port_name]
-        else:
-            fallback_names = self.VERSION_FALLBACK_ORDER[self.VERSION_FALLBACK_ORDER.index(name):-1] + [self.port_name]
-        if self.get_option('webkit_test_runner'):
-            fallback_names = [self._wk2_port_name(), 'wk2'] + fallback_names
-        return map(self._webkit_baseline_path, fallback_names)
-
-    def _port_specific_expectations_files(self):
-        return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self.baseline_search_path()]))
-
-    def setup_environ_for_server(self, server_name=None):
-        env = super(MacPort, self).setup_environ_for_server(server_name)
-        if server_name == self.driver_name():
-            if self.get_option('leaks'):
-                env['MallocStackLogging'] = '1'
-            if self.get_option('guard_malloc'):
-                env['DYLD_INSERT_LIBRARIES'] = '/usr/lib/libgmalloc.dylib'
-        env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
-        return env
-
-    def operating_system(self):
-        return 'mac'
-
-    # Belongs on a Platform object.
-    def is_snowleopard(self):
-        return self._version == "snowleopard"
-
-    # Belongs on a Platform object.
-    def is_lion(self):
-        return self._version == "lion"
-
-    def default_child_processes(self):
-        if self._version == "snowleopard":
-            _log.warning("Cannot run tests in parallel on Snow Leopard due to rdar://problem/10621525.")
-            return 1
-
-        default_count = super(MacPort, self).default_child_processes()
-
-        # FIXME: https://bugs.webkit.org/show_bug.cgi?id=95906  With too many WebProcess WK2 tests get stuck in resource contention.
-        # To alleviate the issue reduce the number of running processes
-        # Anecdotal evidence suggests that a 4 core/8 core logical machine may run into this, but that a 2 core/4 core logical machine does not.
-        if self.get_option('webkit_test_runner') and default_count > 4:
-            default_count = int(.75 * default_count)
-
-        # Make sure we have enough ram to support that many instances:
-        total_memory = self.host.platform.total_bytes_memory()
-        bytes_per_drt = 256 * 1024 * 1024  # Assume each DRT needs 256MB to run.
-        overhead = 2048 * 1024 * 1024  # Assume we need 2GB free for the O/S
-        supportable_instances = max((total_memory - overhead) / bytes_per_drt, 1)  # Always use one process, even if we don't have space for it.
-        if supportable_instances < default_count:
-            _log.warning("This machine could support %s child processes, but only has enough memory for %s." % (default_count, supportable_instances))
-        return min(supportable_instances, default_count)
-
-    def _build_java_test_support(self):
-        java_tests_path = self._filesystem.join(self.layout_tests_dir(), "java")
-        build_java = [self.make_command(), "-C", java_tests_path]
-        if self._executive.run_command(build_java, return_exit_code=True):  # Paths are absolute, so we don't need to set a cwd.
-            _log.error("Failed to build Java support files: %s" % build_java)
-            return False
-        return True
-
-    def check_for_leaks(self, process_name, process_pid):
-        if not self.get_option('leaks'):
-            return
-        # We could use http://code.google.com/p/psutil/ to get the process_name from the pid.
-        self._leak_detector.check_for_leaks(process_name, process_pid)
-
-    def print_leaks_summary(self):
-        if not self.get_option('leaks'):
-            return
-        # We're in the manager process, so the leak detector will not have a valid list of leak files.
-        # FIXME: This is a hack, but we don't have a better way to get this information from the workers yet.
-        # FIXME: This will include too many leaks in subsequent runs until the results directory is cleared!
-        leaks_files = self._leak_detector.leaks_files_in_directory(self.results_directory())
-        if not leaks_files:
-            return
-        total_bytes_string, unique_leaks = self._leak_detector.count_total_bytes_and_unique_leaks(leaks_files)
-        total_leaks = self._leak_detector.count_total_leaks(leaks_files)
-        _log.info("%s total leaks found for a total of %s!" % (total_leaks, total_bytes_string))
-        _log.info("%s unique leaks found!" % unique_leaks)
-
-    def _check_port_build(self):
-        return self._build_java_test_support()
-
-    def _path_to_webcore_library(self):
-        return self._build_path('WebCore.framework/Versions/A/WebCore')
-
-    def show_results_html_file(self, results_filename):
-        # We don't use self._run_script() because we don't want to wait for the script
-        # to exit and we want the output to show up on stdout in case there are errors
-        # launching the browser.
-        self._executive.popen([self.path_to_script('run-safari')] + self._arguments_for_configuration() + ['--no-saved-state', '-NSOpen', results_filename],
-            cwd=self.webkit_base(), stdout=file(os.devnull), stderr=file(os.devnull))
-
-    # FIXME: The next two routines turn off the http locking in order
-    # to work around failures on the bots caused when the slave restarts.
-    # See https://bugs.webkit.org/show_bug.cgi?id=64886 for more info.
-    # The proper fix is to make sure the slave is actually stopping NRWT
-    # properly on restart. Note that by removing the lock file and not waiting,
-    # the result should be that if there is a web server already running,
-    # it'll be killed and this one will be started in its place; this
-    # may lead to weird things happening in the other run. However, I don't
-    # think we're (intentionally) actually running multiple runs concurrently
-    # on any Mac bots.
-
-    def acquire_http_lock(self):
-        pass
-
-    def release_http_lock(self):
-        pass
-
-    def sample_file_path(self, name, pid):
-        return self._filesystem.join(self.results_directory(), "{0}-{1}-sample.txt".format(name, pid))
-
-    def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=None, sleep_fn=None, wait_for_log=True):
-        # Note that we do slow-spin here and wait, since it appears the time
-        # ReportCrash takes to actually write and flush the file varies when there are
-        # lots of simultaneous crashes going on.
-        # FIXME: Should most of this be moved into CrashLogs()?
-        time_fn = time_fn or time.time
-        sleep_fn = sleep_fn or time.sleep
-        crash_log = ''
-        crash_logs = CrashLogs(self.host)
-        now = time_fn()
-        # FIXME: delete this after we're sure this code is working ...
-        _log.debug('looking for crash log for %s:%s' % (name, str(pid)))
-        deadline = now + 5 * int(self.get_option('child_processes', 1))
-        while not crash_log and now <= deadline:
-            crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than)
-            if not wait_for_log:
-                break
-            if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]:
-                sleep_fn(0.1)
-                now = time_fn()
-
-        if not crash_log:
-            return (stderr, None)
-        return (stderr, crash_log)
-
-    def look_for_new_crash_logs(self, crashed_processes, start_time):
-        """Since crash logs can take a long time to be written out if the system is
-           under stress do a second pass at the end of the test run.
-
-           crashes: test_name -> pid, process_name tuple of crashed process
-           start_time: time the tests started at.  We're looking for crash
-               logs after that time.
-        """
-        crash_logs = {}
-        for (test_name, process_name, pid) in crashed_processes:
-            # Passing None for output.  This is a second pass after the test finished so
-            # if the output had any logging we would have already collected it.
-            crash_log = self._get_crash_log(process_name, pid, None, None, start_time, wait_for_log=False)[1]
-            if not crash_log:
-                continue
-            crash_logs[test_name] = crash_log
-        return crash_logs
-
-    def look_for_new_samples(self, unresponsive_processes, start_time):
-        sample_files = {}
-        for (test_name, process_name, pid) in unresponsive_processes:
-            sample_file = self.sample_file_path(process_name, pid)
-            if not self._filesystem.isfile(sample_file):
-                continue
-            sample_files[test_name] = sample_file
-        return sample_files
-
-    def sample_process(self, name, pid):
-        try:
-            hang_report = self.sample_file_path(name, pid)
-            self._executive.run_command([
-                "/usr/bin/sample",
-                pid,
-                10,
-                10,
-                "-file",
-                hang_report,
-            ])
-        except ScriptError as e:
-            _log.warning('Unable to sample process:' + str(e))
-
-    def _path_to_helper(self):
-        binary_name = 'LayoutTestHelper'
-        return self._build_path(binary_name)
-
-    def start_helper(self):
-        helper_path = self._path_to_helper()
-        if helper_path:
-            _log.debug("Starting layout helper %s" % helper_path)
-            self._helper = self._executive.popen([helper_path],
-                stdin=self._executive.PIPE, stdout=self._executive.PIPE, stderr=None)
-            is_ready = self._helper.stdout.readline()
-            if not is_ready.startswith('ready'):
-                _log.error("LayoutTestHelper failed to be ready")
-
-    def stop_helper(self):
-        if self._helper:
-            _log.debug("Stopping LayoutTestHelper")
-            try:
-                self._helper.stdin.write("x\n")
-                self._helper.stdin.close()
-                self._helper.wait()
-            except IOError, e:
-                _log.debug("IOError raised while stopping helper: %s" % str(e))
-            self._helper = None
-
-    def make_command(self):
-        return self.xcrun_find('make', '/usr/bin/make')
-
-    def nm_command(self):
-        return self.xcrun_find('nm', 'nm')
-
-    def xcrun_find(self, command, fallback):
-        try:
-            return self._executive.run_command(['xcrun', '-find', command]).rstrip()
-        except ScriptError:
-            _log.warn("xcrun failed; falling back to '%s'." % fallback)
-            return fallback
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
deleted file mode 100644
index 3faf9c1..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
+++ /dev/null
@@ -1,257 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.layout_tests.port.mac import MacPort
-from webkitpy.layout_tests.port import port_testcase
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.tool.mocktool import MockOptions
-from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, MockProcess, ScriptError
-from webkitpy.common.system.systemhost_mock import MockSystemHost
-
-
-class MacTest(port_testcase.PortTestCase):
-    os_name = 'mac'
-    os_version = 'lion'
-    port_name = 'mac-lion'
-    port_maker = MacPort
-
-    def assert_skipped_file_search_paths(self, port_name, expected_paths, use_webkit2=False):
-        port = self.make_port(port_name=port_name, options=MockOptions(webkit_test_runner=use_webkit2))
-        self.assertEqual(port._skipped_file_search_paths(), expected_paths)
-
-    def test_default_timeout_ms(self):
-        super(MacTest, self).test_default_timeout_ms()
-        self.assertEqual(self.make_port(options=MockOptions(guard_malloc=True)).default_timeout_ms(), 350000)
-
-
-    example_skipped_file = u"""
-# <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events
-fast/events/mouseout-on-window.html
-
-# <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
-fast/events/attempt-scroll-with-no-scrollbars.html
-
-# see bug <rdar://problem/5646437> REGRESSION (r28015): svg/batik/text/smallFonts fails
-svg/batik/text/smallFonts.svg
-
-# Java tests don't work on WK2
-java/
-"""
-    example_skipped_tests = [
-        "fast/events/mouseout-on-window.html",
-        "fast/events/attempt-scroll-with-no-scrollbars.html",
-        "svg/batik/text/smallFonts.svg",
-        "java",
-    ]
-
-    def test_tests_from_skipped_file_contents(self):
-        port = self.make_port()
-        self.assertEqual(port._tests_from_skipped_file_contents(self.example_skipped_file), self.example_skipped_tests)
-
-    def assert_name(self, port_name, os_version_string, expected):
-        host = MockSystemHost(os_name='mac', os_version=os_version_string)
-        port = self.make_port(host=host, port_name=port_name)
-        self.assertEqual(expected, port.name())
-
-    def test_tests_for_other_platforms(self):
-        platforms = ['mac', 'chromium-linux', 'mac-snowleopard']
-        port = self.make_port(port_name='mac-snowleopard')
-        platform_dir_paths = map(port._webkit_baseline_path, platforms)
-        # Replace our empty mock file system with one which has our expected platform directories.
-        port._filesystem = MockFileSystem(dirs=platform_dir_paths)
-
-        dirs_to_skip = port._tests_for_other_platforms()
-        self.assertIn('platform/chromium-linux', dirs_to_skip)
-        self.assertNotIn('platform/mac', dirs_to_skip)
-        self.assertNotIn('platform/mac-snowleopard', dirs_to_skip)
-
-    def test_version(self):
-        port = self.make_port()
-        self.assertTrue(port.version())
-
-    def test_versions(self):
-        # Note: these tests don't need to be exhaustive as long as we get path coverage.
-        self.assert_name('mac', 'snowleopard', 'mac-snowleopard')
-        self.assert_name('mac-snowleopard', 'leopard', 'mac-snowleopard')
-        self.assert_name('mac-snowleopard', 'lion', 'mac-snowleopard')
-
-        self.assert_name('mac', 'lion', 'mac-lion')
-        self.assert_name('mac-lion', 'lion', 'mac-lion')
-
-        self.assert_name('mac', 'mountainlion', 'mac-mountainlion')
-        self.assert_name('mac-mountainlion', 'lion', 'mac-mountainlion')
-
-        self.assert_name('mac', 'future', 'mac-future')
-        self.assert_name('mac-future', 'future', 'mac-future')
-
-        self.assertRaises(AssertionError, self.assert_name, 'mac-tiger', 'leopard', 'mac-leopard')
-
-    def test_setup_environ_for_server(self):
-        port = self.make_port(options=MockOptions(leaks=True, guard_malloc=True))
-        env = port.setup_environ_for_server(port.driver_name())
-        self.assertEqual(env['MallocStackLogging'], '1')
-        self.assertEqual(env['DYLD_INSERT_LIBRARIES'], '/usr/lib/libgmalloc.dylib')
-
-    def _assert_search_path(self, port_name, baseline_path, search_paths, use_webkit2=False):
-        port = self.make_port(port_name=port_name, options=MockOptions(webkit_test_runner=use_webkit2))
-        absolute_search_paths = map(port._webkit_baseline_path, search_paths)
-        self.assertEqual(port.baseline_path(), port._webkit_baseline_path(baseline_path))
-        self.assertEqual(port.baseline_search_path(), absolute_search_paths)
-
-    def test_baseline_search_path(self):
-        # Note that we don't need total coverage here, just path coverage, since this is all data driven.
-        self._assert_search_path('mac-snowleopard', 'mac-snowleopard', ['mac-snowleopard', 'mac-lion', 'mac'])
-        self._assert_search_path('mac-lion', 'mac-lion', ['mac-lion', 'mac'])
-        self._assert_search_path('mac-mountainlion', 'mac', ['mac'])
-        self._assert_search_path('mac-future', 'mac', ['mac'])
-        self._assert_search_path('mac-snowleopard', 'mac-wk2', ['mac-wk2', 'wk2', 'mac-snowleopard', 'mac-lion', 'mac'], use_webkit2=True)
-        self._assert_search_path('mac-lion', 'mac-wk2', ['mac-wk2', 'wk2', 'mac-lion', 'mac'], use_webkit2=True)
-        self._assert_search_path('mac-mountainlion', 'mac-wk2', ['mac-wk2', 'wk2', 'mac'], use_webkit2=True)
-        self._assert_search_path('mac-future', 'mac-wk2', ['mac-wk2', 'wk2', 'mac'], use_webkit2=True)
-
-    def test_show_results_html_file(self):
-        port = self.make_port()
-        # Delay setting a should_log executive to avoid logging from MacPort.__init__.
-        port._executive = MockExecutive(should_log=True)
-        expected_logs = "MOCK popen: ['Tools/Scripts/run-safari', '--release', '--no-saved-state', '-NSOpen', 'test.html'], cwd=/mock-checkout\n"
-        OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
-
-    def test_operating_system(self):
-        self.assertEqual('mac', self.make_port().operating_system())
-
-    def test_default_child_processes(self):
-        port = self.make_port(port_name='mac-lion')
-        # MockPlatformInfo only has 2 mock cores.  The important part is that 2 > 1.
-        self.assertEqual(port.default_child_processes(), 2)
-
-        bytes_for_drt = 200 * 1024 * 1024
-        port.host.platform.total_bytes_memory = lambda: bytes_for_drt
-        expected_logs = "This machine could support 2 child processes, but only has enough memory for 1.\n"
-        child_processes = OutputCapture().assert_outputs(self, port.default_child_processes, (), expected_logs=expected_logs)
-        self.assertEqual(child_processes, 1)
-
-        # Make sure that we always use one process, even if we don't have the memory for it.
-        port.host.platform.total_bytes_memory = lambda: bytes_for_drt - 1
-        expected_logs = "This machine could support 2 child processes, but only has enough memory for 1.\n"
-        child_processes = OutputCapture().assert_outputs(self, port.default_child_processes, (), expected_logs=expected_logs)
-        self.assertEqual(child_processes, 1)
-
-        # SnowLeopard has a CFNetwork bug which causes crashes if we execute more than one copy of DRT at once.
-        port = self.make_port(port_name='mac-snowleopard')
-        expected_logs = "Cannot run tests in parallel on Snow Leopard due to rdar://problem/10621525.\n"
-        child_processes = OutputCapture().assert_outputs(self, port.default_child_processes, (), expected_logs=expected_logs)
-        self.assertEqual(child_processes, 1)
-
-    def test_get_crash_log(self):
-        # Mac crash logs are tested elsewhere, so here we just make sure we don't crash.
-        def fake_time_cb():
-            times = [0, 20, 40]
-            return lambda: times.pop(0)
-        port = self.make_port(port_name='mac-snowleopard')
-        port._get_crash_log('DumpRenderTree', 1234, '', '', 0,
-            time_fn=fake_time_cb(), sleep_fn=lambda delay: None)
-
-    def test_helper_starts(self):
-        host = MockSystemHost(MockExecutive())
-        port = self.make_port(host)
-        oc = OutputCapture()
-        oc.capture_output()
-        host.executive._proc = MockProcess('ready\n')
-        port.start_helper()
-        port.stop_helper()
-        oc.restore_output()
-
-        # make sure trying to stop the helper twice is safe.
-        port.stop_helper()
-
-    def test_helper_fails_to_start(self):
-        host = MockSystemHost(MockExecutive())
-        port = self.make_port(host)
-        oc = OutputCapture()
-        oc.capture_output()
-        port.start_helper()
-        port.stop_helper()
-        oc.restore_output()
-
-    def test_helper_fails_to_stop(self):
-        host = MockSystemHost(MockExecutive())
-        host.executive._proc = MockProcess()
-
-        def bad_waiter():
-            raise IOError('failed to wait')
-        host.executive._proc.wait = bad_waiter
-
-        port = self.make_port(host)
-        oc = OutputCapture()
-        oc.capture_output()
-        port.start_helper()
-        port.stop_helper()
-        oc.restore_output()
-
-    def test_sample_process(self):
-
-        def logging_run_command(args):
-            print args
-
-        port = self.make_port()
-        port._executive = MockExecutive2(run_command_fn=logging_run_command)
-        expected_stdout = "['/usr/bin/sample', 42, 10, 10, '-file', '/mock-build/layout-test-results/test-42-sample.txt']\n"
-        OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout)
-
-    def test_sample_process_throws_exception(self):
-
-        def throwing_run_command(args):
-            raise ScriptError("MOCK script error")
-
-        port = self.make_port()
-        port._executive = MockExecutive2(run_command_fn=throwing_run_command)
-        OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42])
-
-    def test_32bit(self):
-        port = self.make_port(options=MockOptions(architecture='x86'))
-
-        def run_script(script, args=None, env=None):
-            self.args = args
-
-        port._run_script = run_script
-        self.assertEqual(port.architecture(), 'x86')
-        port._build_driver()
-        self.assertEqual(self.args, ['ARCHS=i386'])
-
-    def test_64bit(self):
-        # Apple Mac port is 64-bit by default
-        port = self.make_port()
-        self.assertEqual(port.architecture(), 'x86_64')
-
-        def run_script(script, args=None, env=None):
-            self.args = args
-
-        port._run_script = run_script
-        port._build_driver()
-        self.assertEqual(self.args, [])
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
index bd285ef..c882868 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
@@ -48,7 +48,7 @@
     def make_port(self, options=mock_options):
         host = MockSystemHost()
         test.add_unit_tests_to_mock_filesystem(host.filesystem)
-        return mock_drt.MockDRTPort(host, port_name='mock-mac-lion', options=options)
+        return mock_drt.MockDRTPort(host, port_name='mock-chromium-mac', options=options)
 
     def test_port_name_in_constructor(self):
         self.assertTrue(mock_drt.MockDRTPort(MockSystemHost(), port_name='mock-test'))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
index df480d4..2573608 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py
@@ -99,11 +99,11 @@
         self.assertEqual(port.default_max_locked_shards(), 1)
 
     def test_default_timeout_ms(self):
-        self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 35000)
-        self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 35000)
+        self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 6000)
+        self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 12000)
 
     def test_default_pixel_tests(self):
-        self.assertEqual(self.make_port().default_pixel_tests(), False)
+        self.assertEqual(self.make_port().default_pixel_tests(), True)
 
     def test_driver_cmd_line(self):
         port = self.make_port()
@@ -219,7 +219,7 @@
 
     def integration_test_image_diff(self):
         port = self.make_port()
-        # FIXME: This test will never run since we are using a MockFilesystem for these tests!?!?
+        # FIXME: This test will never run since we are using MockFileSystem for these tests!?!?
         if not port.check_image_diff():
             # The port hasn't been built - don't run the tests.
             return
@@ -425,7 +425,6 @@
             port._filesystem.write_text_file(path, '')
         ordered_dict = port.expectations_dict()
         self.assertEqual(port.path_to_generic_test_expectations_file(), ordered_dict.keys()[0])
-        self.assertEqual(port.path_to_test_expectations_file(), ordered_dict.keys()[1])
 
         options = MockOptions(additional_expectations=['/tmp/foo', '/tmp/bar'])
         port = self.make_port(options=options)
@@ -437,20 +436,6 @@
         self.assertEqual(ordered_dict.keys()[-2:], options.additional_expectations)  # pylint: disable=E1101
         self.assertEqual(ordered_dict.values()[-2:], ['foo', 'bar'])
 
-    def test_path_to_test_expectations_file(self):
-        port = TestWebKitPort()
-        port._options = MockOptions(webkit_test_runner=False)
-        self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations')
-
-        port = TestWebKitPort()
-        port._options = MockOptions(webkit_test_runner=True)
-        self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations')
-
-        port = TestWebKitPort()
-        port.host.filesystem.files['/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations'] = 'some content'
-        port._options = MockOptions(webkit_test_runner=False)
-        self.assertEqual(port.path_to_test_expectations_file(), '/mock-checkout/LayoutTests/platform/testwebkitport/TestExpectations')
-
     def test_skipped_directories_for_symbols(self):
         # This first test confirms that the commonly found symbols result in the expected skipped directories.
         symbols_string = " ".join(["GraphicsLayer", "WebCoreHas3DRendering", "isXHTMLMPDocument", "fooSymbol"])
@@ -475,7 +460,7 @@
 000000000124f670 s __ZZN7WebCore13GraphicsLayer13addChildBelowEPS0_S1_E19__PRETTY_FUNCTION__
 """
         # Note 'compositing' is not in the list of skipped directories (hence the parsing of GraphicsLayer worked):
-        expected_directories = set(['mathml', 'transforms/3d', 'compositing/webgl', 'fast/canvas/webgl', 'animations/3d', 'webgl', 'mhtml', 'http/tests/canvas/webgl', 'fast/css/variables', 'inspector/styles/variables'])
+        expected_directories = set(['mathml', 'compositing/webgl', 'fast/canvas/webgl', 'webgl', 'mhtml', 'http/tests/canvas/webgl', 'fast/css/variables', 'inspector/styles/variables'])
         result_directories = set(TestWebKitPort(symbols_string=symbols_string)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html']))
         self.assertEqual(result_directories, expected_directories)
 
@@ -513,9 +498,6 @@
         port = TestWebKitPort(port_name="testwebkitport-version")
         self.assertEqual(platform_dirs(port), ['LayoutTests', 'testwebkitport', 'testwebkitport-version'])
 
-        port = TestWebKitPort(port_name="testwebkitport-version-wk2")
-        self.assertEqual(platform_dirs(port), ['LayoutTests', 'testwebkitport', 'testwebkitport-version', 'wk2', 'testwebkitport-wk2'])
-
         port = TestWebKitPort(port_name="testwebkitport-version",
                               options=MockOptions(additional_platform_directory=["internal-testwebkitport"]))
         self.assertEqual(platform_dirs(port), ['LayoutTests', 'testwebkitport', 'testwebkitport-version', 'internal-testwebkitport'])
@@ -533,40 +515,6 @@
         port = TestWebKitPort(host=host)
         self.assertEqual(''.join(port.expectations_dict().values()), 'BUG_TESTEXPECTATIONS SKIP : fast/html/article-element.html = FAIL\n')
 
-    def test_build_driver(self):
-        output = OutputCapture()
-        port = TestWebKitPort()
-        # Delay setting _executive to avoid logging during construction
-        port._executive = MockExecutive(should_log=True)
-        port._options = MockOptions(configuration="Release")  # This should not be necessary, but I think TestWebKitPort is actually reading from disk (and thus detects the current configuration).
-        expected_logs = "MOCK run_command: ['Tools/Scripts/build-dumprendertree', '--release'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'MOCK_ENVIRON_COPY': '1'}\n"
-        self.assertTrue(output.assert_outputs(self, port._build_driver, expected_logs=expected_logs))
-
-        # Make sure when passed --webkit-test-runner we build the right tool.
-        port._options = MockOptions(webkit_test_runner=True, configuration="Release")
-        expected_logs = "MOCK run_command: ['Tools/Scripts/build-dumprendertree', '--release'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'MOCK_ENVIRON_COPY': '1'}\nMOCK run_command: ['Tools/Scripts/build-webkittestrunner', '--release'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'MOCK_ENVIRON_COPY': '1'}\n"
-        self.assertTrue(output.assert_outputs(self, port._build_driver, expected_logs=expected_logs))
-
-        # Make sure we show the build log when --verbose is passed, which we simulate by setting the logging level to DEBUG.
-        output.set_log_level(logging.DEBUG)
-        port._options = MockOptions(configuration="Release")
-        expected_logs = """MOCK run_command: ['Tools/Scripts/build-dumprendertree', '--release'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'MOCK_ENVIRON_COPY': '1'}
-Output of ['Tools/Scripts/build-dumprendertree', '--release']:
-MOCK output of child process
-"""
-        self.assertTrue(output.assert_outputs(self, port._build_driver, expected_logs=expected_logs))
-        output.set_log_level(logging.INFO)
-
-        # Make sure that failure to build returns False.
-        port._executive = MockExecutive(should_log=True, should_throw=True)
-        # Because WK2 currently has to build both webkittestrunner and DRT, if DRT fails, that's the only one it tries.
-        expected_logs = """MOCK run_command: ['Tools/Scripts/build-dumprendertree', '--release'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'MOCK_ENVIRON_COPY': '1'}
-MOCK ScriptError
-
-MOCK output of child process
-"""
-        self.assertFalse(output.assert_outputs(self, port._build_driver, expected_logs=expected_logs))
-
     def _assert_config_file_for_platform(self, port, platform, config_file):
         self.assertEqual(port._apache_config_file_name_for_platform(platform), config_file)
 
@@ -627,30 +575,6 @@
         finally:
             os.environ = saved_environ.copy()
 
-    def test_check_build(self):
-        port = self.make_port(options=MockOptions(build=True))
-        self.build_called = False
-
-        def build_driver_called():
-            self.build_called = True
-            return True
-
-        port._build_driver = build_driver_called
-        port.check_build(False)
-        self.assertTrue(self.build_called)
-
-        port = self.make_port(options=MockOptions(root='/tmp', build=True))
-        self.build_called = False
-        port._build_driver = build_driver_called
-        port.check_build(False)
-        self.assertFalse(self.build_called, None)
-
-        port = self.make_port(options=MockOptions(build=False))
-        self.build_called = False
-        port._build_driver = build_driver_called
-        port.check_build(False)
-        self.assertFalse(self.build_called, None)
-
     def test_additional_platform_directory(self):
         port = self.make_port(options=MockOptions(additional_platform_directory=['/tmp/foo']))
         self.assertEqual(port.baseline_search_path()[0], '/tmp/foo')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer.py b/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer.py
deleted file mode 100644
index 465b921..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-# Copyrigth (C) 2012 Intel Corporation
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import os
-import subprocess
-
-
-_log = logging.getLogger(__name__)
-
-
-# Shared by GTK and EFL for pulseaudio sanitizing before running tests.
-class PulseAudioSanitizer:
-    def unload_pulseaudio_module(self):
-        # Unload pulseaudio's module-stream-restore, since it remembers
-        # volume settings from different runs, and could affect
-        # multimedia tests results
-        self._pa_module_index = -1
-        with open(os.devnull, 'w') as devnull:
-            try:
-                pactl_process = subprocess.Popen(["pactl", "list", "short", "modules"], stdout=subprocess.PIPE, stderr=devnull)
-                pactl_process.wait()
-            except OSError:
-                # pactl might not be available.
-                _log.debug('pactl not found. Please install pulseaudio-utils to avoid some potential media test failures.')
-                return
-        modules_list = pactl_process.communicate()[0]
-        for module in modules_list.splitlines():
-            if module.find("module-stream-restore") >= 0:
-                # Some pulseaudio-utils versions don't provide
-                # the index, just an empty string
-                self._pa_module_index = module.split('\t')[0] or -1
-                try:
-                    # Since they could provide other stuff (not an index
-                    # nor an empty string, let's make sure this is an int.
-                    if int(self._pa_module_index) != -1:
-                        pactl_process = subprocess.Popen(["pactl", "unload-module", self._pa_module_index])
-                        pactl_process.wait()
-                        if pactl_process.returncode == 0:
-                            _log.debug('Unloaded module-stream-restore successfully')
-                        else:
-                            _log.debug('Unloading module-stream-restore failed')
-                except ValueError:
-                        # pactl should have returned an index if the module is found
-                        _log.debug('Unable to parse module index. Please check if your pulseaudio-utils version is too old.')
-                return
-
-    def restore_pulseaudio_module(self):
-        # If pulseaudio's module-stream-restore was previously unloaded,
-        # restore it back. We shouldn't need extra checks here, since an
-        # index != -1 here means we successfully unloaded it previously.
-        if self._pa_module_index != -1:
-            with open(os.devnull, 'w') as devnull:
-                pactl_process = subprocess.Popen(["pactl", "load-module", "module-stream-restore"], stdout=devnull, stderr=devnull)
-                pactl_process.wait()
-                if pactl_process.returncode == 0:
-                    _log.debug('Restored module-stream-restore successfully')
-                else:
-                    _log.debug('Restoring module-stream-restore failed')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer_mock.py b/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer_mock.py
deleted file mode 100644
index 88a962a..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer_mock.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyrigth (C) 2013 Zan Dobersek <zandobersek@gmail.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-class PulseAudioSanitizerMock:
-    def unload_pulseaudio_module(self):
-        pass
-
-    def restore_pulseaudio_module(self):
-        pass
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py
deleted file mode 100644
index 4840725..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py
+++ /dev/null
@@ -1,192 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""QtWebKit implementation of the Port interface."""
-
-import glob
-import logging
-import re
-import sys
-import os
-
-from webkitpy.common.memoized import memoized
-from webkitpy.layout_tests.models.test_configuration import TestConfiguration
-from webkitpy.layout_tests.port.base import Port
-from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver
-
-_log = logging.getLogger(__name__)
-
-
-class QtPort(Port):
-    ALL_VERSIONS = ['linux', 'win', 'mac']
-    port_name = "qt"
-
-    def _wk2_port_name(self):
-        return "qt-5.0-wk2"
-
-    def _port_flag_for_scripts(self):
-        return "--qt"
-
-    @classmethod
-    def determine_full_port_name(cls, host, options, port_name):
-        if port_name and port_name != cls.port_name:
-            return port_name
-        return port_name + '-' + host.platform.os_name
-
-    # sys_platform exists only for unit testing.
-    def __init__(self, host, port_name, **kwargs):
-        super(QtPort, self).__init__(host, port_name, **kwargs)
-
-        # FIXME: This will allow Port.baseline_search_path
-        # to do the right thing, but doesn't include support for qt-4.8 or qt-arm (seen in LayoutTests/platform) yet.
-        self._operating_system = port_name.replace('qt-', '')
-
-        # FIXME: Why is this being set at all?
-        self._version = self.operating_system()
-
-    def _generate_all_test_configurations(self):
-        configurations = []
-        for version in self.ALL_VERSIONS:
-            for build_type in self.ALL_BUILD_TYPES:
-                configurations.append(TestConfiguration(version=version, architecture='x86', build_type=build_type))
-        return configurations
-
-    def _build_driver(self):
-        # The Qt port builds DRT as part of the main build step
-        return True
-
-    def supports_per_test_timeout(self):
-        return True
-
-    def _path_to_driver(self):
-        return self._build_path('bin/%s' % self.driver_name())
-
-    def _path_to_image_diff(self):
-        return self._build_path('bin/ImageDiff')
-
-    def _path_to_webcore_library(self):
-        if self.operating_system() == 'mac':
-            return self._build_path('lib/QtWebKitWidgets.framework/QtWebKitWidgets')
-        else:
-            return self._build_path('lib/libQt5WebKitWidgets.so')
-
-    def _modules_to_search_for_symbols(self):
-        # We search in every library to be reliable in the case of building with CONFIG+=force_static_libs_as_shared.
-        if self.operating_system() == 'mac':
-            frameworks = glob.glob(os.path.join(self._build_path('lib'), '*.framework'))
-            return [os.path.join(framework, os.path.splitext(os.path.basename(framework))[0]) for framework in frameworks]
-        else:
-            suffix = 'dll' if self.operating_system() == 'win' else 'so'
-            return glob.glob(os.path.join(self._build_path('lib'), 'lib*.' + suffix))
-
-    @memoized
-    def qt_version(self):
-        version = ''
-        try:
-            for line in self._executive.run_command(['qmake', '-v']).split('\n'):
-                match = re.search('Qt\sversion\s(?P<version>\d\.\d)', line)
-                if match:
-                    version = match.group('version')
-                    break
-        except OSError:
-            version = '4.8'
-        return version
-
-    def _search_paths(self):
-        #                 qt-5.0-mac-wk2
-        #                /
-        # qt-5.0-wk1    qt-5.0-wk2
-        #            \/
-        #         qt-5.0
-        #                \
-        #    (qt-linux|qt-mac|qt-win)
-        #                |
-        #               qt
-        search_paths = []
-        version = self.qt_version()
-        if '5.0' in version:
-            if self.get_option('webkit_test_runner'):
-                if self.operating_system() == 'mac':
-                    search_paths.append('qt-5.0-mac-wk2')
-                search_paths.append('qt-5.0-wk2')
-            else:
-                search_paths.append('qt-5.0-wk1')
-        search_paths.append('qt-5.0')
-
-        search_paths.append(self.port_name + '-' + self.operating_system())
-        search_paths.append(self.port_name)
-        return search_paths
-
-    def default_baseline_search_path(self):
-        return map(self._webkit_baseline_path, self._search_paths())
-
-    def _port_specific_expectations_files(self):
-        paths = self._search_paths()
-        if self.get_option('webkit_test_runner'):
-            paths.append('wk2')
-
-        # expectations_files() uses the directories listed in _search_paths reversed.
-        # e.g. qt -> qt-linux -> qt-5.0 -> qt-5.0-wk1
-        return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in paths]))
-
-    def setup_environ_for_server(self, server_name=None):
-        clean_env = super(QtPort, self).setup_environ_for_server(server_name)
-        clean_env['QTWEBKIT_PLUGIN_PATH'] = self._build_path('lib/plugins')
-        self._copy_value_from_environ_if_set(clean_env, 'QT_DRT_WEBVIEW_MODE')
-        self._copy_value_from_environ_if_set(clean_env, 'DYLD_IMAGE_SUFFIX')
-        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_LOG')
-        self._copy_value_from_environ_if_set(clean_env, 'DISABLE_NI_WARNING')
-        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_PAUSE_UI_PROCESS')
-        self._copy_value_from_environ_if_set(clean_env, 'QT_QPA_PLATFORM_PLUGIN_PATH')
-        self._copy_value_from_environ_if_set(clean_env, 'QT_WEBKIT_DISABLE_UIPROCESS_DUMPPIXELS')
-        return clean_env
-
-    # FIXME: We should find a way to share this implmentation with Gtk,
-    # or teach run-launcher how to call run-safari and move this down to Port.
-    def show_results_html_file(self, results_filename):
-        run_launcher_args = []
-        if self.get_option('webkit_test_runner'):
-            run_launcher_args.append('-2')
-        run_launcher_args.append("file://%s" % results_filename)
-        self._run_script("run-launcher", run_launcher_args)
-
-    def operating_system(self):
-        return self._operating_system
-
-    def check_sys_deps(self, needs_http):
-        result = super(QtPort, self).check_sys_deps(needs_http)
-        if not 'WEBKIT_TESTFONTS' in os.environ:
-            _log.error('\nThe WEBKIT_TESTFONTS environment variable is not defined or not set properly.')
-            _log.error('You must set it before running the tests.')
-            _log.error('Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts')
-            return False
-        return result
-
-    # Qt port is not ready for parallel testing, see https://bugs.webkit.org/show_bug.cgi?id=77730 for details.
-    def default_child_processes(self):
-        return 1
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py
deleted file mode 100644
index 2adfbc1..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py
+++ /dev/null
@@ -1,123 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-import os
-from copy import deepcopy
-
-from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import port_testcase
-from webkitpy.layout_tests.port.qt import QtPort
-from webkitpy.tool.mocktool import MockOptions
-
-
-class QtPortTest(port_testcase.PortTestCase):
-    port_name = 'qt-mac'
-    port_maker = QtPort
-    search_paths_cases = [
-        {'search_paths':['qt-5.0-mac-wk2', 'qt-5.0-wk2', 'qt-5.0', 'qt-mac', 'qt'], 'os_name':'mac', 'use_webkit2':True, 'qt_version':'5.0'},
-        {'search_paths':['qt-5.0-wk2', 'qt-5.0', 'qt-win', 'qt'], 'os_name':'win', 'use_webkit2':True, 'qt_version':'5.0'},
-        {'search_paths':['qt-5.0-wk2', 'qt-5.0', 'qt-linux', 'qt'], 'os_name':'linux', 'use_webkit2':True, 'qt_version':'5.0'},
-
-        {'search_paths':['qt-5.0-wk1', 'qt-5.0', 'qt-mac', 'qt'], 'os_name':'mac', 'use_webkit2':False, 'qt_version':'5.0'},
-        {'search_paths':['qt-5.0-wk1', 'qt-5.0', 'qt-win', 'qt'], 'os_name':'win', 'use_webkit2':False, 'qt_version':'5.0'},
-        {'search_paths':['qt-5.0-wk1', 'qt-5.0', 'qt-linux', 'qt'], 'os_name':'linux', 'use_webkit2':False, 'qt_version':'5.0'},
-    ]
-
-    def _assert_search_path(self, search_paths, os_name, use_webkit2=False, qt_version='5.0'):
-        # FIXME: Port constructors should not "parse" the port name, but
-        # rather be passed components (directly or via setters).  Once
-        # we fix that, this method will need a re-write.
-        host = MockSystemHost(os_name=os_name)
-        host.executive = MockExecutive2(self._qt_version(qt_version))
-        port_name = 'qt-' + os_name
-        port = self.make_port(host=host, qt_version=qt_version, port_name=port_name,
-                              options=MockOptions(webkit_test_runner=use_webkit2, platform='qt'))
-        absolute_search_paths = map(port._webkit_baseline_path, search_paths)
-        self.assertEqual(port.baseline_search_path(), absolute_search_paths)
-
-    def _assert_expectations_files(self, search_paths, os_name, use_webkit2=False, qt_version='5.0'):
-        # FIXME: Port constructors should not "parse" the port name, but
-        # rather be passed components (directly or via setters).  Once
-        # we fix that, this method will need a re-write.
-        host = MockSystemHost(os_name=os_name)
-        host.executive = MockExecutive2(self._qt_version(qt_version))
-        port_name = 'qt-' + os_name
-        port = self.make_port(host=host, qt_version=qt_version, port_name=port_name,
-                              options=MockOptions(webkit_test_runner=use_webkit2, platform='qt'))
-        self.assertEqual(port.expectations_files(), search_paths)
-
-    def _qt_version(self, qt_version):
-        if qt_version in '5.0':
-            return 'QMake version 2.01a\nUsing Qt version 5.0.0 in /usr/local/Trolltech/Qt-5.0.0/lib'
-
-    def test_baseline_search_path(self):
-        for case in self.search_paths_cases:
-            self._assert_search_path(**case)
-
-    def test_expectations_files(self):
-        for case in self.search_paths_cases:
-            expectations_case = deepcopy(case)
-            if expectations_case['use_webkit2']:
-                expectations_case['search_paths'].append("wk2")
-            expectations_case['search_paths'].append('')
-            expectations_case['search_paths'].reverse()
-            expectations_case['search_paths'] = map(lambda path: '/mock-checkout/LayoutTests/TestExpectations' if not path else '/mock-checkout/LayoutTests/platform/%s/TestExpectations' % (path), expectations_case['search_paths'])
-            self._assert_expectations_files(**expectations_case)
-
-    def test_show_results_html_file(self):
-        port = self.make_port()
-        port._executive = MockExecutive(should_log=True)
-        expected_logs = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--qt', 'file://test.html'], cwd=/mock-checkout\n"
-        OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_logs=expected_logs)
-
-    def test_setup_environ_for_server(self):
-        port = self.make_port()
-        env = port.setup_environ_for_server(port.driver_name())
-        self.assertEqual(env['QTWEBKIT_PLUGIN_PATH'], '/mock-build/lib/plugins')
-
-    def test_operating_system(self):
-        self.assertEqual('linux', self.make_port(port_name='qt-linux', os_name='linux').operating_system())
-        self.assertEqual('mac', self.make_port(os_name='mac').operating_system())
-        self.assertEqual('win', self.make_port(port_name='qt-win', os_name='win').operating_system())
-
-    def test_check_sys_deps(self):
-        port = self.make_port()
-
-        # Success
-        os.environ['WEBKIT_TESTFONTS'] = '/tmp/foo'
-        port._executive = MockExecutive2(exit_code=0)
-        self.assertTrue(port.check_sys_deps(needs_http=False))
-
-        # Failure
-        del os.environ['WEBKIT_TESTFONTS']
-        port._executive = MockExecutive2(exit_code=1,
-            output='testing output failure')
-        self.assertFalse(port.check_sys_deps(needs_http=False))
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py
index c622cc2..b7f633c 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -366,7 +366,7 @@
         Port.__init__(self, host, port_name or TestPort.default_port_name, **kwargs)
         self._tests = unit_test_list()
         self._flakes = set()
-        self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/TestExpectations'
+        self._generic_expectations_path = LAYOUT_TEST_DIR + '/TestExpectations'
         self._results_directory = None
 
         self._operating_system = 'mac'
@@ -385,6 +385,9 @@
         }
         self._version = version_map[self._name]
 
+    def buildbot_archives_baselines(self):
+        return self._name != 'test-win-xp'
+
     def default_pixel_tests(self):
         return True
 
@@ -400,7 +403,7 @@
             'test-win-win7': ['test-win-win7'],
             'test-win-vista': ['test-win-vista', 'test-win-win7'],
             'test-win-xp': ['test-win-xp', 'test-win-vista', 'test-win-win7'],
-            'test-linux-x86_64': ['test-linux', 'test-win-win7'],
+            'test-linux-x86_64': ['test-linux-x86_64', 'test-win-win7'],
         }
         return [self._webkit_baseline_path(d) for d in search_paths[self.name()]]
 
@@ -496,8 +499,8 @@
     def _path_to_apache_config_file(self):
         return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'httpd.conf')
 
-    def path_to_test_expectations_file(self):
-        return self._expectations_path
+    def path_to_generic_test_expectations_file(self):
+        return self._generic_expectations_path
 
     def all_test_configurations(self):
         """Returns a sequence of the TestConfigurations the port supports."""
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/win.py b/Tools/Scripts/webkitpy/layout_tests/port/win.py
deleted file mode 100644
index 6adbf75..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/win.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import re
-import sys
-
-from webkitpy.common.system.systemhost import SystemHost
-from webkitpy.common.system.executive import ScriptError, Executive
-from webkitpy.common.system.path import abspath_to_uri
-from webkitpy.layout_tests.port.apple import ApplePort
-
-
-_log = logging.getLogger(__name__)
-
-
-class WinPort(ApplePort):
-    port_name = "win"
-
-    VERSION_FALLBACK_ORDER = ["win-xp", "win-vista", "win-7sp0", "win-win7"]
-
-    ARCHITECTURES = ['x86']
-
-    def do_text_results_differ(self, expected_text, actual_text):
-        # Sanity was restored in WK2, so we don't need this hack there.
-        if self.get_option('webkit_test_runner'):
-            return ApplePort.do_text_results_differ(self, expected_text, actual_text)
-
-        # This is a hack (which dates back to ORWT).
-        # Windows does not have an EDITING DELEGATE, so we strip any EDITING DELEGATE
-        # messages to make more of the tests pass.
-        # It's possible more of the ports might want this and this could move down into WebKitPort.
-        delegate_regexp = re.compile("^EDITING DELEGATE: .*?\n", re.MULTILINE)
-        expected_text = delegate_regexp.sub("", expected_text)
-        actual_text = delegate_regexp.sub("", actual_text)
-        return expected_text != actual_text
-
-    def default_baseline_search_path(self):
-        name = self._name.replace('-wk2', '')
-        if name.endswith(self.FUTURE_VERSION):
-            fallback_names = [self.port_name]
-        else:
-            fallback_names = self.VERSION_FALLBACK_ORDER[self.VERSION_FALLBACK_ORDER.index(name):-1] + [self.port_name]
-        # FIXME: The AppleWin port falls back to AppleMac for some results.  Eventually we'll have a shared 'apple' port.
-        if self.get_option('webkit_test_runner'):
-            fallback_names.insert(0, 'win-wk2')
-            fallback_names.append('mac-wk2')
-            # Note we do not add 'wk2' here, even though it's included in _skipped_search_paths().
-        # FIXME: Perhaps we should get this list from MacPort?
-        fallback_names.extend(['mac-lion', 'mac'])
-        return map(self._webkit_baseline_path, fallback_names)
-
-    def operating_system(self):
-        return 'win'
-
-    def show_results_html_file(self, results_filename):
-        self._run_script('run-safari', [abspath_to_uri(SystemHost().platform, results_filename)])
-
-    # FIXME: webkitperl/httpd.pm installs /usr/lib/apache/libphp4.dll on cycwin automatically
-    # as part of running old-run-webkit-tests.  That's bad design, but we may need some similar hack.
-    # We might use setup_environ_for_server for such a hack (or modify apache_http_server.py).
-
-    def _runtime_feature_list(self):
-        supported_features_command = [self._path_to_driver(), '--print-supported-features']
-        try:
-            output = self._executive.run_command(supported_features_command, error_handler=Executive.ignore_error)
-        except OSError, e:
-            _log.warn("Exception running driver: %s, %s.  Driver must be built before calling WebKitPort.test_expectations()." % (supported_features_command, e))
-            return None
-
-        # Note: win/DumpRenderTree.cpp does not print a leading space before the features_string.
-        match_object = re.match("SupportedFeatures:\s*(?P<features_string>.*)\s*", output)
-        if not match_object:
-            return None
-        return match_object.group('features_string').split(' ')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
deleted file mode 100644
index e77687c..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import StringIO
-import unittest2 as unittest
-
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import port_testcase
-from webkitpy.layout_tests.port.win import WinPort
-from webkitpy.tool.mocktool import MockOptions
-
-
-class WinPortTest(port_testcase.PortTestCase):
-    os_name = 'win'
-    os_version = 'xp'
-    port_name = 'win-xp'
-    port_maker = WinPort
-
-    def test_show_results_html_file(self):
-        port = self.make_port()
-        port._executive = MockExecutive(should_log=True)
-        capture = OutputCapture()
-        capture.capture_output()
-        port.show_results_html_file('test.html')
-        _, _, logs = capture.restore_output()
-        # We can't know for sure what path will be produced by cygpath, but we can assert about
-        # everything else.
-        self.assertTrue(logs.startswith("MOCK run_command: ['Tools/Scripts/run-safari', '--release', '"))
-        self.assertTrue(logs.endswith("test.html'], cwd=/mock-checkout\n"))
-
-    def _assert_search_path(self, expected_search_paths, version, use_webkit2=False):
-        port = self.make_port(port_name='win', os_version=version, options=MockOptions(webkit_test_runner=use_webkit2))
-        absolute_search_paths = map(port._webkit_baseline_path, expected_search_paths)
-        self.assertEqual(port.baseline_search_path(), absolute_search_paths)
-
-    def test_baseline_search_path(self):
-        self._assert_search_path(['win-xp', 'win-vista', 'win-7sp0', 'win', 'mac-lion', 'mac'], 'xp')
-        self._assert_search_path(['win-vista', 'win-7sp0', 'win', 'mac-lion', 'mac'], 'vista')
-        self._assert_search_path(['win-7sp0', 'win', 'mac-lion', 'mac'], '7sp0')
-
-        self._assert_search_path(['win-wk2', 'win-xp', 'win-vista', 'win-7sp0', 'win', 'mac-wk2', 'mac-lion', 'mac'], 'xp', use_webkit2=True)
-        self._assert_search_path(['win-wk2', 'win-vista', 'win-7sp0', 'win', 'mac-wk2', 'mac-lion', 'mac'], 'vista', use_webkit2=True)
-        self._assert_search_path(['win-wk2', 'win-7sp0', 'win', 'mac-wk2', 'mac-lion', 'mac'], '7sp0', use_webkit2=True)
-
-    def _assert_version(self, port_name, expected_version):
-        host = MockSystemHost(os_name='win', os_version=expected_version)
-        port = WinPort(host, port_name=port_name)
-        self.assertEqual(port.version(), expected_version)
-
-    def test_versions(self):
-        self._assert_version('win-xp', 'xp')
-        self._assert_version('win-vista', 'vista')
-        self._assert_version('win-7sp0', '7sp0')
-        self.assertRaises(AssertionError, self._assert_version, 'win-me', 'xp')
-
-    def test_compare_text(self):
-        expected = "EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\nfoo\nEDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"
-        port = self.make_port()
-        self.assertFalse(port.do_text_results_differ(expected, "foo\n"))
-        self.assertTrue(port.do_text_results_differ(expected, "foo"))
-        self.assertTrue(port.do_text_results_differ(expected, "bar"))
-
-        # This hack doesn't exist in WK2.
-        port._options = MockOptions(webkit_test_runner=True)
-        self.assertTrue(port.do_text_results_differ(expected, "foo\n"))
-
-    def test_operating_system(self):
-        self.assertEqual('win', self.make_port().operating_system())
-
-    def test_runtime_feature_list(self):
-        port = self.make_port()
-        port._executive.run_command = lambda command, cwd=None, error_handler=None: "Nonsense"
-        # runtime_features_list returns None when its results are meaningless (it couldn't run DRT or parse the output, etc.)
-        self.assertEqual(port._runtime_feature_list(), None)
-        port._executive.run_command = lambda command, cwd=None, error_handler=None: "SupportedFeatures:foo bar"
-        self.assertEqual(port._runtime_feature_list(), ['foo', 'bar'])
-
-    def test_expectations_files(self):
-        self.assertEqual(len(self.make_port().expectations_files()), 3)
-        self.assertEqual(len(self.make_port(options=MockOptions(webkit_test_runner=True, configuration='Release')).expectations_files()), 5)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py
deleted file mode 100644
index 71ea8dd..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the Google name nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import os
-import re
-import time
-
-from webkitpy.layout_tests.port.server_process import ServerProcess
-from webkitpy.layout_tests.port.driver import Driver
-from webkitpy.common.system.file_lock import FileLock
-
-_log = logging.getLogger(__name__)
-
-
-class XvfbDriver(Driver):
-    @staticmethod
-    def check_xvfb(port):
-        xvfb_found = port.host.executive.run_command(['which', 'Xvfb'], return_exit_code=True) is 0
-        if not xvfb_found:
-            _log.error("No Xvfb found. Cannot run layout tests.")
-        return xvfb_found
-
-    def __init__(self, *args, **kwargs):
-        Driver.__init__(self, *args, **kwargs)
-        self._guard_lock = None
-        self._startup_delay_secs = 1.0
-
-    def _next_free_display(self):
-        running_pids = self._port.host.executive.run_command(['ps', '-eo', 'comm,command'])
-        reserved_screens = set()
-        for pid in running_pids.split('\n'):
-            match = re.match('(X|Xvfb|Xorg)\s+.*\s:(?P<screen_number>\d+)', pid)
-            if match:
-                reserved_screens.add(int(match.group('screen_number')))
-        for i in range(99):
-            if i not in reserved_screens:
-                _guard_lock_file = self._port.host.filesystem.join('/tmp', 'WebKitXvfb.lock.%i' % i)
-                self._guard_lock = self._port.host.make_file_lock(_guard_lock_file)
-                if self._guard_lock.acquire_lock():
-                    return i
-
-    def _start(self, pixel_tests, per_test_args):
-        self.stop()
-
-        # Use even displays for pixel tests and odd ones otherwise. When pixel tests are disabled,
-        # DriverProxy creates two drivers, one for normal and the other for ref tests. Both have
-        # the same worker number, so this prevents them from using the same Xvfb instance.
-        display_id = self._next_free_display()
-        self._lock_file = "/tmp/.X%d-lock" % display_id
-
-        run_xvfb = ["Xvfb", ":%d" % display_id, "-screen",  "0", "800x600x24", "-nolisten", "tcp"]
-        with open(os.devnull, 'w') as devnull:
-            self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull)
-
-        # Crashes intend to occur occasionally in the first few tests that are run through each
-        # worker because the Xvfb display isn't ready yet. Halting execution a bit should avoid that.
-        time.sleep(self._startup_delay_secs)
-
-        server_name = self._port.driver_name()
-        environment = self._port.setup_environ_for_server(server_name)
-        # We must do this here because the DISPLAY number depends on _worker_number
-        environment['DISPLAY'] = ":%d" % display_id
-        self._driver_tempdir = self._port._filesystem.mkdtemp(prefix='%s-' % self._port.driver_name())
-        environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
-        environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-
-        # Currently on WebKit2, there is no API for setting the application
-        # cache directory. Each worker should have it's own and it should be
-        # cleaned afterwards, so we set it to inside the temporary folder by
-        # prepending XDG_CACHE_HOME with DUMPRENDERTREE_TEMP.
-        environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
-
-        self._crashed_process_name = None
-        self._crashed_pid = None
-        self._server_process = self._port._server_process_constructor(self._port, server_name, self.cmd_line(pixel_tests, per_test_args), environment)
-        self._server_process.start()
-
-    def stop(self):
-        super(XvfbDriver, self).stop()
-        if self._guard_lock:
-            self._guard_lock.release_lock()
-            self._guard_lock = None
-        if getattr(self, '_xvfb_process', None):
-            self._port.host.executive.kill_process(self._xvfb_process.pid)
-            self._xvfb_process = None
-            if self._port.host.filesystem.exists(self._lock_file):
-                self._port.host.filesystem.remove(self._lock_file)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py
deleted file mode 100644
index 4c5d338..0000000
--- a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver_unittest.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import unittest2 as unittest
-
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.common.system.executive_mock import MockExecutive2
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import Port
-from webkitpy.layout_tests.port.server_process_mock import MockServerProcess
-from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver
-from webkitpy.tool.mocktool import MockOptions
-
-_log = logging.getLogger(__name__)
-
-
-class XvfbDriverTest(unittest.TestCase):
-    def make_driver(self, worker_number=0, xorg_running=False, executive=None):
-        port = Port(MockSystemHost(log_executive=True, executive=executive), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
-        port._config.build_directory = lambda configuration: "/mock-build"
-        port._server_process_constructor = MockServerProcess
-        if xorg_running:
-            port._executive._running_pids['Xorg'] = 108
-
-        driver = XvfbDriver(port, worker_number=worker_number, pixel_tests=True)
-        driver._startup_delay_secs = 0
-        return driver
-
-    def cleanup_driver(self, driver):
-        # Setting _xvfb_process member to None is necessary as the Driver object is stopped on deletion,
-        # killing the Xvfb process if present. Thus, this method should only be called from tests that do not
-        # intend to test the behavior of XvfbDriver.stop.
-        driver._xvfb_process = None
-
-    def assertDriverStartSuccessful(self, driver, expected_logs, expected_display, pixel_tests=False):
-        OutputCapture().assert_outputs(self, driver.start, [pixel_tests, []], expected_logs=expected_logs)
-        self.assertTrue(driver._server_process.started)
-        self.assertEqual(driver._server_process.env["DISPLAY"], expected_display)
-
-    def test_start_no_pixel_tests(self):
-        driver = self.make_driver()
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0")
-        self.cleanup_driver(driver)
-
-    def test_start_pixel_tests(self):
-        driver = self.make_driver()
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
-        self.cleanup_driver(driver)
-
-    def test_start_arbitrary_worker_number(self):
-        driver = self.make_driver(worker_number=17)
-        expected_logs = "MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
-        self.cleanup_driver(driver)
-
-    def test_next_free_display(self):
-        output = "Xorg            /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none\nXvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp"
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 2)
-        self.cleanup_driver(driver)
-        output = "X               /usr/bin/X :0 vt7 -nolisten tcp -auth /var/run/xauth/A:0-8p7Ybb"
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 1)
-        self.cleanup_driver(driver)
-        output = "Xvfb            Xvfb :0 -screen 0 800x600x24 -nolisten tcp"
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 1)
-        self.cleanup_driver(driver)
-        output = "Xvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :0 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :3 -screen 0 800x600x24 -nolisten tcp"
-        executive = MockExecutive2(output)
-        driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 2)
-        self.cleanup_driver(driver)
-
-    def test_start_next_worker(self):
-        driver = self.make_driver()
-        driver._next_free_display = lambda: 0
-        expected_logs = "MOCK popen: ['Xvfb', ':0', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
-        self.cleanup_driver(driver)
-        driver = self.make_driver()
-        driver._next_free_display = lambda: 3
-        expected_logs = "MOCK popen: ['Xvfb', ':3', '-screen', '0', '800x600x24', '-nolisten', 'tcp']\n"
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":3", pixel_tests=True)
-        self.cleanup_driver(driver)
-
-    def test_stop(self):
-        filesystem = MockFileSystem(files={'/tmp/.X42-lock': '1234\n'})
-        port = Port(MockSystemHost(log_executive=True, filesystem=filesystem), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
-        port._executive.kill_process = lambda x: _log.info("MOCK kill_process pid: " + str(x))
-        driver = XvfbDriver(port, worker_number=0, pixel_tests=True)
-
-        class FakeXvfbProcess(object):
-            pid = 1234
-
-        driver._xvfb_process = FakeXvfbProcess()
-        driver._lock_file = '/tmp/.X42-lock'
-
-        expected_logs = "MOCK kill_process pid: 1234\n"
-        OutputCapture().assert_outputs(self, driver.stop, [], expected_logs=expected_logs)
-
-        self.assertIsNone(driver._xvfb_process)
-        self.assertFalse(port._filesystem.exists(driver._lock_file))
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index b211b97..8218052 100644
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -109,11 +109,6 @@
             help="Run Android layout tests on these devices."),
     ]))
 
-    option_group_definitions.append(("EFL-specific Options", [
-        optparse.make_option("--webprocess-cmd-prefix", type="string",
-            default=False, help="Prefix used when spawning the Web process (Debug mode only)"),
-    ]))
-
     option_group_definitions.append(("WebKit Options", [
         optparse.make_option("--gc-between-tests", action="store_true", default=False,
             help="Force garbage collection between each test"),
@@ -125,8 +120,6 @@
             help="Enable Guard Malloc (Mac OS X only)"),
         optparse.make_option("--threaded", action="store_true", default=False,
             help="Run a concurrent JavaScript thread with each test"),
-        optparse.make_option("--webkit-test-runner", "-2", action="store_true",
-            help="Use WebKitTestRunner rather than DumpRenderTree."),
         # FIXME: We should merge this w/ --build-directory and only have one flag.
         optparse.make_option("--root", action="store",
             help="Path to a directory containing the executables needed to run tests."),
@@ -178,6 +171,8 @@
                  "Specify multiple times to add multiple flags."),
         optparse.make_option("--driver-name", type="string",
             help="Alternative DumpRenderTree binary to use"),
+        optparse.make_option("--content-shell", action="store_true",
+            help="Use Content Shell instead of DumpRenderTree"),
         optparse.make_option("--additional-platform-directory", action="append",
             default=[], help="Additional directory where to look for test "
                  "baselines (will take precendence over platform baselines). "
@@ -222,6 +217,11 @@
                  "running. (Example: --wrapper='valgrind --smc-check=all')"),
         optparse.make_option("-i", "--ignore-tests", action="append", default=[],
             help="directories or test to ignore (may specify multiple times)"),
+        optparse.make_option("--ignore-flaky-tests", action="store", default="default",
+            help=("Control whether tests that are flaky on the bots get ignored."
+                "'default' == Don't use the bot data."
+                "'very-flaky' == Ignore any tests that flaked more than once on the bot."
+                "'maybe-flaky' == Ignore any tests that flaked once on the bot.")),
         optparse.make_option("--test-list", action="append",
             help="read list of tests to run from file", metavar="FILE"),
         optparse.make_option("--skipped", action="store", default="default",
diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py
index aa6e59d..a38d45e 100644
--- a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py
@@ -26,7 +26,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-"""Integration tests for the new-run-webkit-httpd and new-run-webkit-websocketserver scripts"""
+"""Integration tests for the run-blink-httpd and run-blink-websocketserver scripts"""
 
 # FIXME: Rename this file to something more descriptive.
 
@@ -131,15 +131,15 @@
 
 
 class HTTPServerTest(BaseTest):
-    """Tests that new-run-webkit-http must pass."""
+    """Tests that run-blink-http must pass."""
 
     PORTS = (8000, 8080, 8443)
-    SCRIPT_NAME = 'new-run-webkit-httpd'
+    SCRIPT_NAME = 'run-blink-httpd'
 
 
 class WebsocketserverTest(BaseTest):
-    """Tests that new-run-webkit-websocketserver must pass."""
+    """Tests that run-blink-websocketserver must pass."""
 
     # FIXME: test TLS at some point?
     PORTS = (8880, )
-    SCRIPT_NAME = 'new-run-webkit-websocketserver'
+    SCRIPT_NAME = 'run-blink-websocketserver'
diff --git a/Tools/Scripts/webkitpy/layout_tests/views/printing.py b/Tools/Scripts/webkitpy/layout_tests/views/printing.py
index c0374f0..a42b7ed 100644
--- a/Tools/Scripts/webkitpy/layout_tests/views/printing.py
+++ b/Tools/Scripts/webkitpy/layout_tests/views/printing.py
@@ -356,7 +356,7 @@
             self._print_default(' base: %s' % base)
             self._print_default(' args: %s' % args)
 
-        for extension in ('.txt', '.png', '.wav', '.webarchive'):
+        for extension in ('.txt', '.png', '.wav'):
             self._print_baseline(test_name, extension)
 
         self._print_default('  exp: %s' % exp_str)
diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
index b3e22e7..b5bc338 100644
--- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
+++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
@@ -114,8 +114,6 @@
                 help="Don't launch a browser with results after the tests are done"),
             optparse.make_option("--test-results-server",
                 help="Upload the generated JSON file to the specified server when --output-json-path is present."),
-            optparse.make_option("--webkit-test-runner", "-2", action="store_true",
-                help="Use WebKitTestRunner rather than DumpRenderTree."),
             optparse.make_option("--replay", dest="replay", action="store_true", default=False,
                 help="Run replay tests."),
             optparse.make_option("--force", dest="use_skipped_list", action="store_false", default=True,
@@ -129,6 +127,8 @@
                      "Specify multiple times to add multiple flags."),
             optparse.make_option("--driver-name", type="string",
                 help="Alternative DumpRenderTree binary to use"),
+            optparse.make_option("--content-shell", action="store_true",
+                help="Use Content Shell instead of DumpRenderTree"),
             optparse.make_option("--repeat", default=1, type="int",
                 help="Specify number of times to run test set (default: 1)."),
             optparse.make_option("--test-runner-count", default=DEFAULT_TEST_RUNNER_COUNT, type="int",
diff --git a/Tools/Scripts/webkitpy/pylintrc b/Tools/Scripts/webkitpy/pylintrc
index caadcfb..b3df526 100644
--- a/Tools/Scripts/webkitpy/pylintrc
+++ b/Tools/Scripts/webkitpy/pylintrc
@@ -26,6 +26,8 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+# FIXME: remove this whitespace diff.
+#
 [MASTER]
 
 # Specify a configuration file.
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py
index 81f5cbb..69df432 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1124,6 +1124,8 @@
         self.virtual_method_line_number = None
         self.has_virtual_destructor = False
         self.brace_depth = 0
+        self.unsigned_bitfields = []
+        self.bool_bitfields = []
 
 
 class _ClassState(object):
@@ -1400,9 +1402,42 @@
                   'The class %s probably needs a virtual destructor due to '
                   'having virtual method(s), one declared at line %d.'
                   % (classinfo.name, classinfo.virtual_method_line_number))
+        # Look for mixed bool and unsigned bitfields.
+        if (classinfo.bool_bitfields and classinfo.unsigned_bitfields):
+            bool_list = ', '.join(classinfo.bool_bitfields)
+            unsigned_list = ', '.join(classinfo.unsigned_bitfields)
+            error(classinfo.line_number, 'runtime/bitfields', 5,
+                  'The class %s contains mixed unsigned and bool bitfields, '
+                  'which will pack into separate words on the MSVC compiler.\n'
+                  'Bool bitfields are [%s].\nUnsigned bitfields are [%s].\n'
+                  'Consider converting bool bitfields to unsigned.'
+                  % (classinfo.name, bool_list, unsigned_list))
     else:
         classinfo.brace_depth = brace_depth
 
+    well_typed_bitfield = False;
+    # Look for bool <name> : 1 declarations.
+    args = search(r'\bbool\s+(\S*)\s*:\s*\d+\s*;', line)
+    if args:
+        classinfo.bool_bitfields.append('%d: %s' % (line_number, args.group(1)))
+        well_typed_bitfield = True;
+
+    # Look for unsigned <name> : n declarations.
+    args = search(r'\bunsigned\s+(?:int\s+)?(\S+)\s*:\s*\d+\s*;', line)
+    if args:
+        classinfo.unsigned_bitfields.append('%d: %s' % (line_number, args.group(1)))
+        well_typed_bitfield = True;
+
+    # Look for other bitfield declarations. We don't care about those in
+    # size-matching structs.
+    if not (well_typed_bitfield or classinfo.name.startswith('SameSizeAs') or
+            classinfo.name.startswith('Expected')):
+        args = match(r'\s*(\S+)\s+(\S+)\s*:\s*\d+\s*;', line)
+        if args:
+            error(line_number, 'runtime/bitfields', 4,
+                  'Member %s of class %s defined as a bitfield of type %s. '
+                  'Please declare all bitfields as unsigned.'
+                  % (args.group(2), classinfo.name, args.group(1)))
 
 def check_spacing_for_function_call(line, line_number, error):
     """Checks for the correctness of various spacing around function calls.
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 8de99df..20a0b79 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -2448,6 +2448,86 @@
         self.assert_lint('long int a : 30;', errmsg)
         self.assert_lint('int a = 1 ? 0 : 30;', '')
 
+    # A mixture of unsigned and bool bitfields in a class will generate a warning.
+    def test_mixing_unsigned_bool_bitfields(self):
+        def errmsg(bool_bitfields, unsigned_bitfields, name):
+            bool_list = ', '.join(bool_bitfields)
+            unsigned_list = ', '.join(unsigned_bitfields)
+            return ('The class %s contains mixed unsigned and bool bitfields, '
+                    'which will pack into separate words on the MSVC compiler.\n'
+                    'Bool bitfields are [%s].\nUnsigned bitfields are [%s].\n'
+                    'Consider converting bool bitfields to unsigned.  [runtime/bitfields] [5]'
+                    % (name, bool_list, unsigned_list))
+
+        def build_test_case(bitfields, name, will_warn, extra_warnings=[]):
+            bool_bitfields = []
+            unsigned_bitfields = []
+            test_string = 'class %s {\n' % (name,)
+            line = 2
+            for bitfield in bitfields:
+                test_string += '    %s %s : %d;\n' % bitfield
+                if bitfield[0] == 'bool':
+                    bool_bitfields.append('%d: %s' % (line, bitfield[1]))
+                elif bitfield[0].startswith('unsigned'):
+                    unsigned_bitfields.append('%d: %s' % (line, bitfield[1]))
+                line += 1
+            test_string += '}\n'
+            error = ''
+            if will_warn:
+                error = errmsg(bool_bitfields, unsigned_bitfields, name)
+            if extra_warnings and error:
+                error = extra_warnings + [error]
+            self.assert_multi_line_lint(test_string, error)
+
+        build_test_case([('bool', 'm_boolMember', 4), ('unsigned', 'm_unsignedMember', 3)],
+                        'MyClass', True)
+        build_test_case([('bool', 'm_boolMember', 4), ('bool', 'm_anotherBool', 3)],
+                        'MyClass', False)
+        build_test_case([('unsigned', 'm_unsignedMember', 4), ('unsigned', 'm_anotherUnsigned', 3)],
+                        'MyClass', False)
+
+        build_test_case([('bool', 'm_boolMember', 4), ('bool', 'm_anotherbool', 3),
+                         ('bool', 'm_moreBool', 1), ('bool', 'm_lastBool', 1),
+                         ('unsigned int', 'm_tokenUnsigned', 4)],
+                        'MyClass', True, ['Omit int when using unsigned  [runtime/unsigned] [1]'])
+
+        self.assert_multi_line_lint('class NoProblemsHere {\n'
+                                    '    bool m_boolMember;\n'
+                                    '    unsigned m_unsignedMember;\n'
+                                    '    unsigned m_bitField1 : 1;\n'
+                                    '    unsigned m_bitField4 : 4;\n'
+                                    '}\n', '')
+
+    # Bitfields which are not declared unsigned or bool will generate a warning.
+    def test_unsigned_bool_bitfields(self):
+        def errmsg(member, name, bit_type):
+            return ('Member %s of class %s defined as a bitfield of type %s. '
+                    'Please declare all bitfields as unsigned.  [runtime/bitfields] [4]'
+                    % (member, name, bit_type))
+
+        def warning_bitfield_test(member, name, bit_type, bits):
+            self.assert_multi_line_lint('class %s {\n%s %s: %d;\n}\n'
+                                        % (name, bit_type, member, bits),
+                                        errmsg(member, name, bit_type))
+
+        def safe_bitfield_test(member, name, bit_type, bits):
+            self.assert_multi_line_lint('class %s {\n%s %s: %d;\n}\n'
+                                        % (name, bit_type, member, bits),
+                                        '')
+
+        warning_bitfield_test('a', 'A', 'int32_t', 25)
+        warning_bitfield_test('m_someField', 'SomeClass', 'signed', 4)
+        warning_bitfield_test('m_someField', 'SomeClass', 'SomeEnum', 2)
+
+        safe_bitfield_test('a', 'A', 'unsigned', 22)
+        safe_bitfield_test('m_someField', 'SomeClass', 'bool', 1)
+        safe_bitfield_test('m_someField', 'SomeClass', 'unsigned', 2)
+
+        # Declarations in 'Expected' or 'SameSizeAs' classes are OK.
+        warning_bitfield_test('m_bitfields', 'SomeClass', 'int32_t', 32)
+        safe_bitfield_test('m_bitfields', 'ExpectedSomeClass', 'int32_t', 32)
+        safe_bitfield_test('m_bitfields', 'SameSizeAsSomeClass', 'int32_t', 32)
+
 class CleansedLinesTest(unittest.TestCase):
     def test_init(self):
         lines = ['Line 1',
diff --git a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
index 67f3841..f226348 100644
--- a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
+++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -49,14 +49,12 @@
 
     def _determine_port_from_expectations_path(self, host, expectations_path):
         # Pass a configuration to avoid calling default_configuration() when initializing the port (takes 0.5 seconds on a Mac Pro!).
-        options_wk1 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': False})
-        options_wk2 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': True})
+        options = optparse.Values({'configuration': 'Release'})
         for port_name in host.port_factory.all_port_names():
-            ports = [host.port_factory.get(port_name, options=options_wk1), host.port_factory.get(port_name, options=options_wk2)]
-            for port in ports:
-                for test_expectation_file in port.expectations_files():
-                    if test_expectation_file.replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
-                        return port
+            port = host.port_factory.get(port_name, options=options)
+            for test_expectation_file in port.expectations_files():
+                if test_expectation_file.replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
+                    return port
         return None
 
     def __init__(self, file_path, handle_style_error, host=None):
diff --git a/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
index 43ef836..86e882e 100644
--- a/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -75,13 +75,9 @@
     def test_determine_port_from_expectations_path(self):
         self._expect_port_for_expectations_path(None, '/')
         self._expect_port_for_expectations_path(None, 'LayoutTests/chromium-mac/TestExpectations')
-        self._expect_port_for_expectations_path('chromium', 'LayoutTests/platform/chromium/TestExpectations')
+        self._expect_port_for_expectations_path(None, 'LayoutTests/platform/chromium/TestExpectations')
+        self._expect_port_for_expectations_path('chromium', 'LayoutTests/TestExpectations')
         self._expect_port_for_expectations_path(None, '/mock-checkout/LayoutTests/platform/win/TestExpectations')
-        self._expect_port_for_expectations_path('win', 'LayoutTests/platform/win/TestExpectations')
-        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl/TestExpectations')
-        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk1/TestExpectations')
-        self._expect_port_for_expectations_path('efl', 'LayoutTests/platform/efl-wk2/TestExpectations')
-        self._expect_port_for_expectations_path('qt', 'LayoutTests/platform/qt-win/TestExpectations')
         # FIXME: check-webkit-style doesn't know how to create port objects for all Qt version (4.8, 5.0) and
         # will only check files based on the installed version of Qt.
         #self._expect_port_for_expectations_path('qt', 'LayoutTests/platform/qt-5.0-wk2/TestExpectations')
diff --git a/Tools/Scripts/webkitpy/thirdparty/__init__.py b/Tools/Scripts/webkitpy/thirdparty/__init__.py
index 601e2fb..da25c35 100644
--- a/Tools/Scripts/webkitpy/thirdparty/__init__.py
+++ b/Tools/Scripts/webkitpy/thirdparty/__init__.py
@@ -85,12 +85,6 @@
             self._install_pylint()
         elif '.coverage' in fullname:
             self._install_coverage()
-        elif '.eliza' in fullname:
-            self._install_eliza()
-        elif '.irc' in fullname:
-            self._install_irc()
-        elif '.buildbot' in fullname:
-            self._install_buildbot()
         elif '.webpagereplay' in fullname:
             self._install_webpagereplay()
 
@@ -119,44 +113,10 @@
 
     # autoinstalled.buildbot is used by BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
     # and should ideally match the version of BuildBot used at build.webkit.org.
-    def _install_buildbot(self):
-        # The buildbot package uses jinja2, for example, in buildbot/status/web/base.py.
-        # buildbot imports jinja2 directly (as though it were installed on the system),
-        # so the search path needs to include jinja2.  We put jinja2 in
-        # its own directory so that we can include it in the search path
-        # without including other modules as a side effect.
-        jinja_dir = self._fs.join(_AUTOINSTALLED_DIR, "jinja2")
-        installer = AutoInstaller(append_to_search_path=True, target_dir=jinja_dir)
-        did_install_something = installer.install(url="http://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz#md5=1c49a8825c993bfdcf55bb36897d28a2",
-                                                url_subpath="Jinja2-2.6/jinja2")
-
-        SQLAlchemy_dir = self._fs.join(_AUTOINSTALLED_DIR, "sqlalchemy")
-        installer = AutoInstaller(append_to_search_path=True, target_dir=SQLAlchemy_dir)
-        did_install_something |= installer.install(url="http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.7.7.tar.gz#md5=ddf6df7e014cea318fa981364f3f93b9",
-                                                 url_subpath="SQLAlchemy-0.7.7/lib/sqlalchemy")
-
-        did_install_something |= self._install("http://pypi.python.org/packages/source/b/buildbot/buildbot-0.8.6p1.tar.gz#md5=b6727d2810c692062c657492bcbeac6a", "buildbot-0.8.6p1/buildbot")
-        return did_install_something
-
     def _install_coverage(self):
         self._ensure_autoinstalled_dir_is_in_sys_path()
         return self._install(url="http://pypi.python.org/packages/source/c/coverage/coverage-3.5.1.tar.gz#md5=410d4c8155a4dab222f2bc51212d4a24", url_subpath="coverage-3.5.1/coverage")
 
-    def _install_eliza(self):
-        return self._install(url="http://www.adambarth.com/webkit/eliza", target_name="eliza.py")
-
-    def _install_irc(self):
-        # Since irclib and ircbot are two top-level packages, we need to import
-        # them separately.  We group them into an irc package for better
-        # organization purposes.
-        irc_dir = self._fs.join(_AUTOINSTALLED_DIR, "irc")
-        installer = AutoInstaller(target_dir=irc_dir)
-        did_install_something = installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip",
-                                                url_subpath="irclib.py")
-        did_install_something |= installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip",
-                          url_subpath="ircbot.py")
-        return did_install_something
-
     def _install_unittest2(self):
         self._ensure_autoinstalled_dir_is_in_sys_path()
         return self._install(url="http://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz#md5=a0af5cac92bbbfa0c3b0e99571390e0f", url_subpath="unittest2-0.5.1/unittest2")
diff --git a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
index f687ae0..adeed74 100644
--- a/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
+++ b/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py
@@ -29,40 +29,12 @@
 import sys
 import unittest2 as unittest
 
-from webkitpy.thirdparty import AutoinstallImportHook
-
 
 class ThirdpartyTest(unittest.TestCase):
-    def test_import_hook(self):
-        # Add another import hook and make sure we get called.
-        class MockImportHook(AutoinstallImportHook):
-            def __init__(self):
-                AutoinstallImportHook.__init__(self)
-                self.eliza_installed = False
-
-            def _install_eliza(self):
-                self.eliza_installed = True
-
-        mock_import_hook = MockImportHook()
-        try:
-            # The actual AutoinstallImportHook should be installed before us,
-            # so these modules will get installed before MockImportHook runs.
-            sys.meta_path.append(mock_import_hook)
-            # unused-variable, import failures - pylint: disable-msg=W0612,E0611,F0401
-            from webkitpy.thirdparty.autoinstalled import eliza
-            self.assertTrue(mock_import_hook.eliza_installed)
-
-        finally:
-            sys.meta_path.remove(mock_import_hook)
-
     def test_imports(self):
         # This method tests that we can actually import everything.
         # unused-variable, import failures - pylint: disable-msg=W0612,E0611,F0401
-        import webkitpy.thirdparty.autoinstalled.buildbot
         import webkitpy.thirdparty.autoinstalled.coverage
-        import webkitpy.thirdparty.autoinstalled.eliza
-        import webkitpy.thirdparty.autoinstalled.irc.ircbot
-        import webkitpy.thirdparty.autoinstalled.irc.irclib
         import webkitpy.thirdparty.autoinstalled.mechanize
         import webkitpy.thirdparty.autoinstalled.pylint
         import webkitpy.thirdparty.autoinstalled.webpagereplay
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
index 60fb33d..8235666 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_base.py
@@ -39,6 +39,8 @@
 # writing/reading.
 
 
+import socket
+
 from mod_pywebsocket import util
 
 
@@ -109,20 +111,34 @@
             ConnectionTerminatedException: when read returns empty string.
         """
 
-        bytes = self._request.connection.read(length)
-        if not bytes:
+        try:
+            read_bytes = self._request.connection.read(length)
+            if not read_bytes:
+                raise ConnectionTerminatedException(
+                    'Receiving %d byte failed. Peer (%r) closed connection' %
+                    (length, (self._request.connection.remote_addr,)))
+            return read_bytes
+        except socket.error, e:
+            # Catch a socket.error. Because it's not a child class of the
+            # IOError prior to Python 2.6, we cannot omit this except clause.
+            # Use %s rather than %r for the exception to use human friendly
+            # format.
             raise ConnectionTerminatedException(
-                'Receiving %d byte failed. Peer (%r) closed connection' %
-                (length, (self._request.connection.remote_addr,)))
-        return bytes
+                'Receiving %d byte failed. socket.error (%s) occurred' %
+                (length, e))
+        except IOError, e:
+            # Also catch an IOError because mod_python throws it.
+            raise ConnectionTerminatedException(
+                'Receiving %d byte failed. IOError (%s) occurred' %
+                (length, e))
 
-    def _write(self, bytes):
+    def _write(self, bytes_to_write):
         """Writes given bytes to connection. In case we catch any exception,
         prepends remote address to the exception message and raise again.
         """
 
         try:
-            self._request.connection.write(bytes)
+            self._request.connection.write(bytes_to_write)
         except Exception, e:
             util.prepend_message_to_exception(
                     'Failed to send message to %r: ' %
@@ -138,12 +154,12 @@
             ConnectionTerminatedException: when read returns empty string.
         """
 
-        bytes = []
+        read_bytes = []
         while length > 0:
-            new_bytes = self._read(length)
-            bytes.append(new_bytes)
-            length -= len(new_bytes)
-        return ''.join(bytes)
+            new_read_bytes = self._read(length)
+            read_bytes.append(new_read_bytes)
+            length -= len(new_read_bytes)
+        return ''.join(read_bytes)
 
     def _read_until(self, delim_char):
         """Reads bytes until we encounter delim_char. The result will not
@@ -153,13 +169,13 @@
             ConnectionTerminatedException: when read returns empty string.
         """
 
-        bytes = []
+        read_bytes = []
         while True:
             ch = self._read(1)
             if ch == delim_char:
                 break
-            bytes.append(ch)
-        return ''.join(bytes)
+            read_bytes.append(ch)
+        return ''.join(read_bytes)
 
 
 # vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
index bd158fa..a8a49e3 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py
@@ -280,7 +280,7 @@
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
         unmask_start = time.time()
 
-    bytes = masker.mask(raw_payload_bytes)
+    unmasked_bytes = masker.mask(raw_payload_bytes)
 
     if logger.isEnabledFor(common.LOGLEVEL_FINE):
         logger.log(
@@ -288,7 +288,7 @@
             'Done unmasking payload data at %s MB/s',
             payload_length / (time.time() - unmask_start) / 1000 / 1000)
 
-    return opcode, bytes, fin, rsv1, rsv2, rsv3
+    return opcode, unmasked_bytes, fin, rsv1, rsv2, rsv3
 
 
 class FragmentedFrameBuilder(object):
@@ -389,9 +389,6 @@
     def __init__(self):
         """Constructs StreamOptions."""
 
-        # Enables deflate-stream extension.
-        self.deflate_stream = False
-
         # Filters applied to frames.
         self.outgoing_frame_filters = []
         self.incoming_frame_filters = []
@@ -403,9 +400,6 @@
         self.encode_text_message_to_utf8 = True
         self.mask_send = False
         self.unmask_receive = True
-        # RFC6455 disallows fragmented control frames, but mux extension
-        # relaxes the restriction.
-        self.allow_fragmented_control_frame = False
 
 
 class Stream(StreamBase):
@@ -426,10 +420,6 @@
 
         self._options = options
 
-        if self._options.deflate_stream:
-            self._logger.debug('Setup filter for deflate-stream')
-            self._request = util.DeflateRequest(self._request)
-
         self._request.client_terminated = False
         self._request.server_terminated = False
 
@@ -463,10 +453,10 @@
                            unmask_receive=self._options.unmask_receive)
 
     def _receive_frame_as_frame_object(self):
-        opcode, bytes, fin, rsv1, rsv2, rsv3 = self._receive_frame()
+        opcode, unmasked_bytes, fin, rsv1, rsv2, rsv3 = self._receive_frame()
 
         return Frame(fin=fin, rsv1=rsv1, rsv2=rsv2, rsv3=rsv3,
-                     opcode=opcode, payload=bytes)
+                     opcode=opcode, payload=unmasked_bytes)
 
     def receive_filtered_frame(self):
         """Receives a frame and applies frame filters and message filters.
@@ -602,8 +592,7 @@
             else:
                 # Start of fragmentation frame
 
-                if (not self._options.allow_fragmented_control_frame and
-                    common.is_control_opcode(frame.opcode)):
+                if common.is_control_opcode(frame.opcode):
                     raise InvalidFrameException(
                         'Control frames must not be fragmented')
 
@@ -647,8 +636,9 @@
                 self._request.ws_close_code,
                 self._request.ws_close_reason)
 
-        # Drain junk data after the close frame if necessary.
-        self._drain_received_data()
+        # As we've received a close frame, no more data is coming over the
+        # socket. We can now safely close the socket without worrying about
+        # RST sending.
 
         if self._request.server_terminated:
             self._logger.debug(
@@ -672,7 +662,7 @@
                 reason = ''
         self._send_closing_handshake(code, reason)
         self._logger.debug(
-            'Sent ack for client-initiated closing handshake '
+            'Acknowledged closing handshake initiated by the peer '
             '(code=%r, reason=%r)', code, reason)
 
     def _process_ping_message(self, message):
@@ -815,13 +805,15 @@
 
         self._write(frame)
 
-    def close_connection(self, code=common.STATUS_NORMAL_CLOSURE, reason=''):
+    def close_connection(self, code=common.STATUS_NORMAL_CLOSURE, reason='',
+                         wait_response=True):
         """Closes a WebSocket connection.
 
         Args:
             code: Status code for close frame. If code is None, a close
                 frame with empty body will be sent.
             reason: string representing close reason.
+            wait_response: True when caller want to wait the response.
         Raises:
             BadOperationException: when reason is specified with code None
             or reason is not an instance of both str and unicode.
@@ -844,11 +836,11 @@
 
         self._send_closing_handshake(code, reason)
         self._logger.debug(
-            'Sent server-initiated closing handshake (code=%r, reason=%r)',
+            'Initiated closing handshake (code=%r, reason=%r)',
             code, reason)
 
         if (code == common.STATUS_GOING_AWAY or
-            code == common.STATUS_PROTOCOL_ERROR):
+            code == common.STATUS_PROTOCOL_ERROR) or not wait_response:
             # It doesn't make sense to wait for a close frame if the reason is
             # protocol error or that the server is going away. For some of
             # other reasons, it might not make sense to wait for a close frame,
@@ -891,25 +883,5 @@
 
         return self._original_opcode
 
-    def _drain_received_data(self):
-        """Drains unread data in the receive buffer to avoid sending out TCP
-        RST packet. This is because when deflate-stream is enabled, some
-        DEFLATE block for flushing data may follow a close frame. If any data
-        remains in the receive buffer of a socket when the socket is closed,
-        it sends out TCP RST packet to the other peer.
-
-        Since mod_python's mp_conn object doesn't support non-blocking read,
-        we perform this only when pywebsocket is running in standalone mode.
-        """
-
-        # If self._options.deflate_stream is true, self._request is
-        # DeflateRequest, so we can get wrapped request object by
-        # self._request._request.
-        #
-        # Only _StandaloneRequest has _drain_received_data method.
-        if (self._options.deflate_stream and
-            ('_drain_received_data' in dir(self._request._request))):
-            self._request._request._drain_received_data()
-
 
 # vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
index 2388379..afa1233 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/common.py
@@ -101,10 +101,10 @@
 SEC_WEBSOCKET_LOCATION_HEADER = 'Sec-WebSocket-Location'
 
 # Extensions
-DEFLATE_STREAM_EXTENSION = 'deflate-stream'
 DEFLATE_FRAME_EXTENSION = 'deflate-frame'
 PERFRAME_COMPRESSION_EXTENSION = 'perframe-compress'
 PERMESSAGE_COMPRESSION_EXTENSION = 'permessage-compress'
+PERMESSAGE_DEFLATE_EXTENSION = 'permessage-deflate'
 X_WEBKIT_DEFLATE_FRAME_EXTENSION = 'x-webkit-deflate-frame'
 X_WEBKIT_PERMESSAGE_COMPRESSION_EXTENSION = 'x-webkit-permessage-compress'
 MUX_EXTENSION = 'mux_DO_NOT_USE'
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
index 25905f1..96c91e0 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py
@@ -255,6 +255,9 @@
         try:
             do_extra_handshake_(request)
         except handshake.AbortedByUserException, e:
+            # Re-raise to tell the caller of this function to finish this
+            # connection without sending any error.
+            self._logger.debug('%s', util.get_stack_trace())
             raise
         except Exception, e:
             util.prepend_message_to_exception(
@@ -294,11 +297,12 @@
                 request.ws_stream.close_connection()
         # Catch non-critical exceptions the handler didn't handle.
         except handshake.AbortedByUserException, e:
-            self._logger.debug('%s', e)
+            self._logger.debug('%s', util.get_stack_trace())
             raise
         except msgutil.BadOperationException, e:
             self._logger.debug('%s', e)
-            request.ws_stream.close_connection(common.STATUS_ABNORMAL_CLOSURE)
+            request.ws_stream.close_connection(
+                common.STATUS_INTERNAL_ENDPOINT_ERROR)
         except msgutil.InvalidFrameException, e:
             # InvalidFrameException must be caught before
             # ConnectionTerminatedException that catches InvalidFrameException.
@@ -314,6 +318,8 @@
         except msgutil.ConnectionTerminatedException, e:
             self._logger.debug('%s', e)
         except Exception, e:
+            # Any other exceptions are forwarded to the caller of this
+            # function.
             util.prepend_message_to_exception(
                 '%s raised exception for %s: ' % (
                     _TRANSFER_DATA_HANDLER_NAME, request.ws_resource),
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
index 03dbf9e..4cb8edf 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
@@ -34,83 +34,114 @@
 
 
 _available_processors = {}
+_compression_extension_names = []
 
 
 class ExtensionProcessorInterface(object):
 
+    def __init__(self, request):
+        self._request = request
+        self._active = True
+
+    def request(self):
+        return self._request
+
     def name(self):
         return None
 
-    def get_extension_response(self):
-        return None
-
-    def setup_stream_options(self, stream_options):
+    def check_consistency_with_other_processors(self, processors):
         pass
 
+    def set_active(self, active):
+        self._active = active
 
-class DeflateStreamExtensionProcessor(ExtensionProcessorInterface):
-    """WebSocket DEFLATE stream extension processor.
+    def is_active(self):
+        return self._active
 
-    Specification:
-    Section 9.2.1 in
-    http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10
-    """
-
-    def __init__(self, request):
-        self._logger = util.get_class_logger(self)
-
-        self._request = request
-
-    def name(self):
-        return common.DEFLATE_STREAM_EXTENSION
+    def _get_extension_response_internal(self):
+        return None
 
     def get_extension_response(self):
-        if len(self._request.get_parameter_names()) != 0:
-            return None
+        if self._active:
+            response = self._get_extension_response_internal()
+            if response is None:
+                self._active = False
+            return response
+        return None
 
-        self._logger.debug(
-            'Enable %s extension', common.DEFLATE_STREAM_EXTENSION)
-
-        return common.ExtensionParameter(common.DEFLATE_STREAM_EXTENSION)
+    def _setup_stream_options_internal(self, stream_options):
+        pass
 
     def setup_stream_options(self, stream_options):
-        stream_options.deflate_stream = True
+        if self._active:
+            self._setup_stream_options_internal(stream_options)
 
 
-_available_processors[common.DEFLATE_STREAM_EXTENSION] = (
-    DeflateStreamExtensionProcessor)
-
-
-def _log_compression_ratio(logger, original_bytes, total_original_bytes,
-                           filtered_bytes, total_filtered_bytes):
+def _log_outgoing_compression_ratio(
+        logger, original_bytes, filtered_bytes, average_ratio):
     # Print inf when ratio is not available.
     ratio = float('inf')
-    average_ratio = float('inf')
     if original_bytes != 0:
         ratio = float(filtered_bytes) / original_bytes
-    if total_original_bytes != 0:
-        average_ratio = (
-            float(total_filtered_bytes) / total_original_bytes)
-    logger.debug('Outgoing compress ratio: %f (average: %f)' %
-        (ratio, average_ratio))
+
+    logger.debug('Outgoing compression ratio: %f (average: %f)' %
+            (ratio, average_ratio))
 
 
-def _log_decompression_ratio(logger, received_bytes, total_received_bytes,
-                             filtered_bytes, total_filtered_bytes):
+def _log_incoming_compression_ratio(
+        logger, received_bytes, filtered_bytes, average_ratio):
     # Print inf when ratio is not available.
     ratio = float('inf')
-    average_ratio = float('inf')
-    if received_bytes != 0:
+    if filtered_bytes != 0:
         ratio = float(received_bytes) / filtered_bytes
-    if total_filtered_bytes != 0:
-        average_ratio = (
-            float(total_received_bytes) / total_filtered_bytes)
-    logger.debug('Incoming compress ratio: %f (average: %f)' %
-        (ratio, average_ratio))
+
+    logger.debug('Incoming compression ratio: %f (average: %f)' %
+            (ratio, average_ratio))
+
+
+def _parse_window_bits(bits):
+    """Return parsed integer value iff the given string conforms to the
+    grammar of the window bits extension parameters.
+    """
+
+    if bits is None:
+        raise ValueError('Value is required')
+
+    # For non integer values such as "10.0", ValueError will be raised.
+    int_bits = int(bits)
+
+    # First condition is to drop leading zero case e.g. "08".
+    if bits != str(int_bits) or int_bits < 8 or int_bits > 15:
+        raise ValueError('Invalid value: %r' % bits)
+
+    return int_bits
+
+
+class _AverageRatioCalculator(object):
+    """Stores total bytes of original and result data, and calculates average
+    result / original ratio.
+    """
+
+    def __init__(self):
+        self._total_original_bytes = 0
+        self._total_result_bytes = 0
+
+    def add_original_bytes(self, value):
+        self._total_original_bytes += value
+
+    def add_result_bytes(self, value):
+        self._total_result_bytes += value
+
+    def get_average_ratio(self):
+        if self._total_original_bytes != 0:
+            return (float(self._total_result_bytes) /
+                    self._total_original_bytes)
+        else:
+            return float('inf')
 
 
 class DeflateFrameExtensionProcessor(ExtensionProcessorInterface):
-    """WebSocket Per-frame DEFLATE extension processor.
+    """deflate-frame extension processor.
 
     Specification:
     http://tools.ietf.org/html/draft-tyoshino-hybi-websocket-perframe-deflate
@@ -120,34 +151,38 @@
     _NO_CONTEXT_TAKEOVER_PARAM = 'no_context_takeover'
 
     def __init__(self, request):
+        ExtensionProcessorInterface.__init__(self, request)
         self._logger = util.get_class_logger(self)
 
-        self._request = request
-
         self._response_window_bits = None
         self._response_no_context_takeover = False
         self._bfinal = False
 
-        # Counters for statistics.
+        # Calculates
+        #     (Total outgoing bytes supplied to this filter) /
+        #     (Total bytes sent to the network after applying this filter)
+        self._outgoing_average_ratio_calculator = _AverageRatioCalculator()
 
-        # Total number of outgoing bytes supplied to this filter.
-        self._total_outgoing_payload_bytes = 0
-        # Total number of bytes sent to the network after applying this filter.
-        self._total_filtered_outgoing_payload_bytes = 0
-
-        # Total number of bytes received from the network.
-        self._total_incoming_payload_bytes = 0
-        # Total number of incoming bytes obtained after applying this filter.
-        self._total_filtered_incoming_payload_bytes = 0
+        # Calculates
+        #     (Total bytes received from the network) /
+        #     (Total incoming bytes obtained after applying this filter)
+        self._incoming_average_ratio_calculator = _AverageRatioCalculator()
 
     def name(self):
         return common.DEFLATE_FRAME_EXTENSION
 
-    def get_extension_response(self):
+    def _get_extension_response_internal(self):
         # Any unknown parameter will be just ignored.
 
-        window_bits = self._request.get_parameter_value(
-            self._WINDOW_BITS_PARAM)
+        window_bits = None
+        if self._request.has_parameter(self._WINDOW_BITS_PARAM):
+            window_bits = self._request.get_parameter_value(
+                self._WINDOW_BITS_PARAM)
+            try:
+                window_bits = _parse_window_bits(window_bits)
+            except ValueError, e:
+                return None
+
         no_context_takeover = self._request.has_parameter(
             self._NO_CONTEXT_TAKEOVER_PARAM)
         if (no_context_takeover and
@@ -155,18 +190,10 @@
                 self._NO_CONTEXT_TAKEOVER_PARAM) is not None):
             return None
 
-        if window_bits is not None:
-            try:
-                window_bits = int(window_bits)
-            except ValueError, e:
-                return None
-            if window_bits < 8 or window_bits > 15:
-                return None
-
-        self._deflater = util._RFC1979Deflater(
+        self._rfc1979_deflater = util._RFC1979Deflater(
             window_bits, no_context_takeover)
 
-        self._inflater = util._RFC1979Inflater()
+        self._rfc1979_inflater = util._RFC1979Inflater()
 
         self._compress_outgoing = True
 
@@ -191,7 +218,7 @@
 
         return response
 
-    def setup_stream_options(self, stream_options):
+    def _setup_stream_options_internal(self, stream_options):
 
         class _OutgoingFilter(object):
 
@@ -235,25 +262,28 @@
         """
 
         original_payload_size = len(frame.payload)
-        self._total_outgoing_payload_bytes += original_payload_size
+        self._outgoing_average_ratio_calculator.add_original_bytes(
+                original_payload_size)
 
         if (not self._compress_outgoing or
             common.is_control_opcode(frame.opcode)):
-            self._total_filtered_outgoing_payload_bytes += (
-                original_payload_size)
+            self._outgoing_average_ratio_calculator.add_result_bytes(
+                    original_payload_size)
             return
 
-        frame.payload = self._deflater.filter(
+        frame.payload = self._rfc1979_deflater.filter(
             frame.payload, bfinal=self._bfinal)
         frame.rsv1 = 1
 
         filtered_payload_size = len(frame.payload)
-        self._total_filtered_outgoing_payload_bytes += filtered_payload_size
+        self._outgoing_average_ratio_calculator.add_result_bytes(
+                filtered_payload_size)
 
-        _log_compression_ratio(self._logger, original_payload_size,
-                               self._total_outgoing_payload_bytes,
-                               filtered_payload_size,
-                               self._total_filtered_outgoing_payload_bytes)
+        _log_outgoing_compression_ratio(
+                self._logger,
+                original_payload_size,
+                filtered_payload_size,
+                self._outgoing_average_ratio_calculator.get_average_ratio())
 
     def _incoming_filter(self, frame):
         """Transform incoming frames. This method is called only by
@@ -261,33 +291,35 @@
         """
 
         received_payload_size = len(frame.payload)
-        self._total_incoming_payload_bytes += received_payload_size
+        self._incoming_average_ratio_calculator.add_result_bytes(
+                received_payload_size)
 
         if frame.rsv1 != 1 or common.is_control_opcode(frame.opcode):
-            self._total_filtered_incoming_payload_bytes += (
-                received_payload_size)
+            self._incoming_average_ratio_calculator.add_original_bytes(
+                    received_payload_size)
             return
 
-        frame.payload = self._inflater.filter(frame.payload)
+        frame.payload = self._rfc1979_inflater.filter(frame.payload)
         frame.rsv1 = 0
 
         filtered_payload_size = len(frame.payload)
-        self._total_filtered_incoming_payload_bytes += filtered_payload_size
+        self._incoming_average_ratio_calculator.add_original_bytes(
+                filtered_payload_size)
 
-        _log_decompression_ratio(self._logger, received_payload_size,
-                                 self._total_incoming_payload_bytes,
-                                 filtered_payload_size,
-                                 self._total_filtered_incoming_payload_bytes)
+        _log_incoming_compression_ratio(
+                self._logger,
+                received_payload_size,
+                filtered_payload_size,
+                self._incoming_average_ratio_calculator.get_average_ratio())
 
 
 _available_processors[common.DEFLATE_FRAME_EXTENSION] = (
     DeflateFrameExtensionProcessor)
+_compression_extension_names.append(common.DEFLATE_FRAME_EXTENSION)
 
-
-# Adding vendor-prefixed deflate-frame extension.
-# TODO(bashi): Remove this after WebKit stops using vendor prefix.
 _available_processors[common.X_WEBKIT_DEFLATE_FRAME_EXTENSION] = (
     DeflateFrameExtensionProcessor)
+_compression_extension_names.append(common.X_WEBKIT_DEFLATE_FRAME_EXTENSION)
 
 
 def _parse_compression_method(data):
@@ -306,13 +338,13 @@
 
 
 class CompressionExtensionProcessorBase(ExtensionProcessorInterface):
-    """Base class for Per-frame and Per-message compression extension."""
+    """Base class for perframe-compress and permessage-compress extension."""
 
     _METHOD_PARAM = 'method'
 
     def __init__(self, request):
+        ExtensionProcessorInterface.__init__(self, request)
         self._logger = util.get_class_logger(self)
-        self._request = request
         self._compression_method_name = None
         self._compression_processor = None
         self._compression_processor_hook = None
@@ -357,7 +389,7 @@
         self._compression_processor = compression_processor
         return processor_response
 
-    def get_extension_response(self):
+    def _get_extension_response_internal(self):
         processor_response = self._get_compression_processor_response()
         if processor_response is None:
             return None
@@ -372,7 +404,7 @@
             (self._request.name(), self._compression_method_name))
         return response
 
-    def setup_stream_options(self, stream_options):
+    def _setup_stream_options_internal(self, stream_options):
         if self._compression_processor is None:
             return
         self._compression_processor.setup_stream_options(stream_options)
@@ -384,8 +416,8 @@
         return self._compression_processor
 
 
-class PerFrameCompressionExtensionProcessor(CompressionExtensionProcessorBase):
-    """WebSocket Per-frame compression extension processor.
+class PerFrameCompressExtensionProcessor(CompressionExtensionProcessorBase):
+    """perframe-compress processor.
 
     Specification:
     http://tools.ietf.org/html/draft-ietf-hybi-websocket-perframe-compression
@@ -406,56 +438,66 @@
 
 
 _available_processors[common.PERFRAME_COMPRESSION_EXTENSION] = (
-    PerFrameCompressionExtensionProcessor)
+    PerFrameCompressExtensionProcessor)
+_compression_extension_names.append(common.PERFRAME_COMPRESSION_EXTENSION)
 
 
-class DeflateMessageProcessor(ExtensionProcessorInterface):
-    """Per-message deflate processor."""
+class PerMessageDeflateExtensionProcessor(ExtensionProcessorInterface):
+    """permessage-deflate extension processor. It's also used for
+    permessage-compress extension when the deflate method is chosen.
+
+    Specification:
+    http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-08
+    """
 
     _S2C_MAX_WINDOW_BITS_PARAM = 's2c_max_window_bits'
     _S2C_NO_CONTEXT_TAKEOVER_PARAM = 's2c_no_context_takeover'
     _C2S_MAX_WINDOW_BITS_PARAM = 'c2s_max_window_bits'
     _C2S_NO_CONTEXT_TAKEOVER_PARAM = 'c2s_no_context_takeover'
 
-    def __init__(self, request):
-        self._request = request
+    def __init__(self, request, draft08=True):
+        """Construct PerMessageDeflateExtensionProcessor
+
+        Args:
+            draft08: Follow the constraints on the parameters that were not
+                specified for permessage-compress but are specified for
+                permessage-deflate as on
+                draft-ietf-hybi-permessage-compression-08.
+        """
+
+        ExtensionProcessorInterface.__init__(self, request)
         self._logger = util.get_class_logger(self)
 
         self._c2s_max_window_bits = None
         self._c2s_no_context_takeover = False
-        self._bfinal = False
 
-        self._compress_outgoing_enabled = False
-
-        # True if a message is fragmented and compression is ongoing.
-        self._compress_ongoing = False
-
-        # Counters for statistics.
-
-        # Total number of outgoing bytes supplied to this filter.
-        self._total_outgoing_payload_bytes = 0
-        # Total number of bytes sent to the network after applying this filter.
-        self._total_filtered_outgoing_payload_bytes = 0
-
-        # Total number of bytes received from the network.
-        self._total_incoming_payload_bytes = 0
-        # Total number of incoming bytes obtained after applying this filter.
-        self._total_filtered_incoming_payload_bytes = 0
+        self._draft08 = draft08
 
     def name(self):
         return 'deflate'
 
-    def get_extension_response(self):
-        # Any unknown parameter will be just ignored.
+    def _get_extension_response_internal(self):
+        if self._draft08:
+            for name in self._request.get_parameter_names():
+                if name not in [self._S2C_MAX_WINDOW_BITS_PARAM,
+                                self._S2C_NO_CONTEXT_TAKEOVER_PARAM,
+                                self._C2S_MAX_WINDOW_BITS_PARAM]:
+                    self._logger.debug('Unknown parameter: %r', name)
+                    return None
+        else:
+            # Any unknown parameter will be just ignored.
+            pass
 
-        s2c_max_window_bits = self._request.get_parameter_value(
-            self._S2C_MAX_WINDOW_BITS_PARAM)
-        if s2c_max_window_bits is not None:
+        s2c_max_window_bits = None
+        if self._request.has_parameter(self._S2C_MAX_WINDOW_BITS_PARAM):
+            s2c_max_window_bits = self._request.get_parameter_value(
+                    self._S2C_MAX_WINDOW_BITS_PARAM)
             try:
-                s2c_max_window_bits = int(s2c_max_window_bits)
+                s2c_max_window_bits = _parse_window_bits(s2c_max_window_bits)
             except ValueError, e:
-                return None
-            if s2c_max_window_bits < 8 or s2c_max_window_bits > 15:
+                self._logger.debug('Bad %s parameter: %r',
+                                   self._S2C_MAX_WINDOW_BITS_PARAM,
+                                   e)
                 return None
 
         s2c_no_context_takeover = self._request.has_parameter(
@@ -463,14 +505,32 @@
         if (s2c_no_context_takeover and
             self._request.get_parameter_value(
                 self._S2C_NO_CONTEXT_TAKEOVER_PARAM) is not None):
+            self._logger.debug('%s parameter must not have a value: %r',
+                               self._S2C_NO_CONTEXT_TAKEOVER_PARAM,
+                               s2c_no_context_takeover)
             return None
 
-        self._deflater = util._RFC1979Deflater(
+        c2s_max_window_bits = self._request.has_parameter(
+            self._C2S_MAX_WINDOW_BITS_PARAM)
+        if (self._draft08 and
+            c2s_max_window_bits and
+            self._request.get_parameter_value(
+                self._C2S_MAX_WINDOW_BITS_PARAM) is not None):
+            self._logger.debug('%s parameter must not have a value in a '
+                               'client\'s opening handshake: %r',
+                               self._C2S_MAX_WINDOW_BITS_PARAM,
+                               c2s_max_window_bits)
+            return None
+
+        self._rfc1979_deflater = util._RFC1979Deflater(
             s2c_max_window_bits, s2c_no_context_takeover)
 
-        self._inflater = util._RFC1979Inflater()
+        self._rfc1979_inflater = util._RFC1979Inflater()
 
-        self._compress_outgoing_enabled = True
+        self._framer = _PerMessageDeflateFramer(
+            s2c_max_window_bits, s2c_no_context_takeover)
+        self._framer.set_bfinal(False)
+        self._framer.set_compress_outgoing_enabled(True)
 
         response = common.ExtensionParameter(self._request.name())
 
@@ -483,9 +543,15 @@
                 self._S2C_NO_CONTEXT_TAKEOVER_PARAM, None)
 
         if self._c2s_max_window_bits is not None:
+            if self._draft08 and not c2s_max_window_bits:
+                self._logger.debug('Processor is configured to use %s but '
+                                   'the client cannot accept it',
+                                   self._C2S_MAX_WINDOW_BITS_PARAM)
+                return None
             response.add_parameter(
                 self._C2S_MAX_WINDOW_BITS_PARAM,
                 str(self._c2s_max_window_bits))
+
         if self._c2s_no_context_takeover:
             response.add_parameter(
                 self._C2S_NO_CONTEXT_TAKEOVER_PARAM, None)
@@ -502,7 +568,146 @@
 
         return response
 
+    def _setup_stream_options_internal(self, stream_options):
+        self._framer.setup_stream_options(stream_options)
+
+    def set_c2s_max_window_bits(self, value):
+        """If this option is specified, this class adds the c2s_max_window_bits
+        extension parameter to the handshake response, but doesn't reduce the
+        LZ77 sliding window size of its inflater. I.e., you can use this for
+        testing client implementation but cannot reduce memory usage of this
+        class.
+
+        If this method has been called with True and an offer without the
+        c2s_max_window_bits extension parameter is received,
+        - (When processing the permessage-deflate extension) this processor
+          declines the request.
+        - (When processing the permessage-compress extension) this processor
+          accepts the request.
+        """
+
+        self._c2s_max_window_bits = value
+
+    def set_c2s_no_context_takeover(self, value):
+        """If this option is specified, this class adds the
+        c2s_no_context_takeover extension parameter to the handshake response,
+        but doesn't reset inflater for each message. I.e., you can use this for
+        testing client implementation but cannot reduce memory usage of this
+        class.
+        """
+
+        self._c2s_no_context_takeover = value
+
+    def set_bfinal(self, value):
+        self._framer.set_bfinal(value)
+
+    def enable_outgoing_compression(self):
+        self._framer.set_compress_outgoing_enabled(True)
+
+    def disable_outgoing_compression(self):
+        self._framer.set_compress_outgoing_enabled(False)
+
+
+class _PerMessageDeflateFramer(object):
+    """A framer for extensions with per-message DEFLATE feature."""
+
+    def __init__(self, deflate_max_window_bits, deflate_no_context_takeover):
+        self._logger = util.get_class_logger(self)
+
+        self._rfc1979_deflater = util._RFC1979Deflater(
+            deflate_max_window_bits, deflate_no_context_takeover)
+
+        self._rfc1979_inflater = util._RFC1979Inflater()
+
+        self._bfinal = False
+
+        self._compress_outgoing_enabled = False
+
+        # True if a message is fragmented and compression is ongoing.
+        self._compress_ongoing = False
+
+        # Calculates
+        #     (Total outgoing bytes supplied to this filter) /
+        #     (Total bytes sent to the network after applying this filter)
+        self._outgoing_average_ratio_calculator = _AverageRatioCalculator()
+
+        # Calculates
+        #     (Total bytes received from the network) /
+        #     (Total incoming bytes obtained after applying this filter)
+        self._incoming_average_ratio_calculator = _AverageRatioCalculator()
+
+    def set_bfinal(self, value):
+        self._bfinal = value
+
+    def set_compress_outgoing_enabled(self, value):
+        self._compress_outgoing_enabled = value
+
+    def _process_incoming_message(self, message, decompress):
+        if not decompress:
+            return message
+
+        received_payload_size = len(message)
+        self._incoming_average_ratio_calculator.add_result_bytes(
+                received_payload_size)
+
+        message = self._rfc1979_inflater.filter(message)
+
+        filtered_payload_size = len(message)
+        self._incoming_average_ratio_calculator.add_original_bytes(
+                filtered_payload_size)
+
+        _log_incoming_compression_ratio(
+                self._logger,
+                received_payload_size,
+                filtered_payload_size,
+                self._incoming_average_ratio_calculator.get_average_ratio())
+
+        return message
+
+    def _process_outgoing_message(self, message, end, binary):
+        if not binary:
+            message = message.encode('utf-8')
+
+        if not self._compress_outgoing_enabled:
+            return message
+
+        original_payload_size = len(message)
+        self._outgoing_average_ratio_calculator.add_original_bytes(
+            original_payload_size)
+
+        message = self._rfc1979_deflater.filter(
+            message, flush=end, bfinal=self._bfinal)
+
+        filtered_payload_size = len(message)
+        self._outgoing_average_ratio_calculator.add_result_bytes(
+            filtered_payload_size)
+
+        _log_outgoing_compression_ratio(
+                self._logger,
+                original_payload_size,
+                filtered_payload_size,
+                self._outgoing_average_ratio_calculator.get_average_ratio())
+
+        if not self._compress_ongoing:
+            self._outgoing_frame_filter.set_compression_bit()
+        self._compress_ongoing = not end
+        return message
+
+    def _process_incoming_frame(self, frame):
+        if frame.rsv1 == 1 and not common.is_control_opcode(frame.opcode):
+            self._incoming_message_filter.decompress_next_message()
+            frame.rsv1 = 0
+
+    def _process_outgoing_frame(self, frame, compression_bit):
+        if (not compression_bit or
+            common.is_control_opcode(frame.opcode)):
+            return
+
+        frame.rsv1 = 1
+
     def setup_stream_options(self, stream_options):
+        """Creates filters and sets them to the StreamOptions."""
+
         class _OutgoingMessageFilter(object):
 
             def __init__(self, parent):
@@ -565,82 +770,16 @@
 
         stream_options.encode_text_message_to_utf8 = False
 
-    def set_c2s_max_window_bits(self, value):
-        self._c2s_max_window_bits = value
 
-    def set_c2s_no_context_takeover(self, value):
-        self._c2s_no_context_takeover = value
-
-    def set_bfinal(self, value):
-        self._bfinal = value
-
-    def enable_outgoing_compression(self):
-        self._compress_outgoing_enabled = True
-
-    def disable_outgoing_compression(self):
-        self._compress_outgoing_enabled = False
-
-    def _process_incoming_message(self, message, decompress):
-        if not decompress:
-            return message
-
-        received_payload_size = len(message)
-        self._total_incoming_payload_bytes += received_payload_size
-
-        message = self._inflater.filter(message)
-
-        filtered_payload_size = len(message)
-        self._total_filtered_incoming_payload_bytes += filtered_payload_size
-
-        _log_decompression_ratio(self._logger, received_payload_size,
-                                 self._total_incoming_payload_bytes,
-                                 filtered_payload_size,
-                                 self._total_filtered_incoming_payload_bytes)
-
-        return message
-
-    def _process_outgoing_message(self, message, end, binary):
-        if not binary:
-            message = message.encode('utf-8')
-
-        if not self._compress_outgoing_enabled:
-            return message
-
-        original_payload_size = len(message)
-        self._total_outgoing_payload_bytes += original_payload_size
-
-        message = self._deflater.filter(
-            message, flush=end, bfinal=self._bfinal)
-
-        filtered_payload_size = len(message)
-        self._total_filtered_outgoing_payload_bytes += filtered_payload_size
-
-        _log_compression_ratio(self._logger, original_payload_size,
-                               self._total_outgoing_payload_bytes,
-                               filtered_payload_size,
-                               self._total_filtered_outgoing_payload_bytes)
-
-        if not self._compress_ongoing:
-            self._outgoing_frame_filter.set_compression_bit()
-        self._compress_ongoing = not end
-        return message
-
-    def _process_incoming_frame(self, frame):
-        if frame.rsv1 == 1 and not common.is_control_opcode(frame.opcode):
-            self._incoming_message_filter.decompress_next_message()
-            frame.rsv1 = 0
-
-    def _process_outgoing_frame(self, frame, compression_bit):
-        if (not compression_bit or
-            common.is_control_opcode(frame.opcode)):
-            return
-
-        frame.rsv1 = 1
+_available_processors[common.PERMESSAGE_DEFLATE_EXTENSION] = (
+        PerMessageDeflateExtensionProcessor)
+# TODO(tyoshino): Reorganize class names.
+_compression_extension_names.append('deflate')
 
 
-class PerMessageCompressionExtensionProcessor(
+class PerMessageCompressExtensionProcessor(
     CompressionExtensionProcessorBase):
-    """WebSocket Per-message compression extension processor.
+    """permessage-compress extension processor.
 
     Specification:
     http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression
@@ -656,18 +795,13 @@
 
     def _lookup_compression_processor(self, method_desc):
         if method_desc.name() == self._DEFLATE_METHOD:
-            return DeflateMessageProcessor(method_desc)
+            return PerMessageDeflateExtensionProcessor(method_desc, False)
         return None
 
 
 _available_processors[common.PERMESSAGE_COMPRESSION_EXTENSION] = (
-    PerMessageCompressionExtensionProcessor)
-
-
-# Adding vendor-prefixed permessage-compress extension.
-# TODO(bashi): Remove this after WebKit stops using vendor prefix.
-_available_processors[common.X_WEBKIT_PERMESSAGE_COMPRESSION_EXTENSION] = (
-    PerMessageCompressionExtensionProcessor)
+    PerMessageCompressExtensionProcessor)
+_compression_extension_names.append(common.PERMESSAGE_COMPRESSION_EXTENSION)
 
 
 class MuxExtensionProcessor(ExtensionProcessorInterface):
@@ -676,52 +810,85 @@
     _QUOTA_PARAM = 'quota'
 
     def __init__(self, request):
-        self._request = request
+        ExtensionProcessorInterface.__init__(self, request)
+        self._quota = 0
+        self._extensions = []
 
     def name(self):
         return common.MUX_EXTENSION
 
-    def get_extension_response(self, ws_request,
-                               logical_channel_extensions):
-        # Mux extension cannot be used after extensions that depend on
-        # frame boundary, extension data field, or any reserved bits
-        # which are attributed to each frame.
-        for extension in logical_channel_extensions:
-            name = extension.name()
-            if (name == common.PERFRAME_COMPRESSION_EXTENSION or
-                name == common.DEFLATE_FRAME_EXTENSION or
-                name == common.X_WEBKIT_DEFLATE_FRAME_EXTENSION):
-                return None
+    def check_consistency_with_other_processors(self, processors):
+        before_mux = True
+        for processor in processors:
+            name = processor.name()
+            if name == self.name():
+                before_mux = False
+                continue
+            if not processor.is_active():
+                continue
+            if before_mux:
+                # Mux extension cannot be used after extensions
+                # that depend on frame boundary, extension data field, or any
+                # reserved bits which are attributed to each frame.
+                if (name == common.PERFRAME_COMPRESSION_EXTENSION or
+                    name == common.DEFLATE_FRAME_EXTENSION or
+                    name == common.X_WEBKIT_DEFLATE_FRAME_EXTENSION):
+                    self.set_active(False)
+                    return
+            else:
+                # Mux extension should not be applied before any history-based
+                # compression extension.
+                if (name == common.PERFRAME_COMPRESSION_EXTENSION or
+                    name == common.DEFLATE_FRAME_EXTENSION or
+                    name == common.X_WEBKIT_DEFLATE_FRAME_EXTENSION or
+                    name == common.PERMESSAGE_COMPRESSION_EXTENSION or
+                    name == common.X_WEBKIT_PERMESSAGE_COMPRESSION_EXTENSION):
+                    self.set_active(False)
+                    return
 
+    def _get_extension_response_internal(self):
+        self._active = False
         quota = self._request.get_parameter_value(self._QUOTA_PARAM)
-        if quota is None:
-            ws_request.mux_quota = 0
-        else:
+        if quota is not None:
             try:
                 quota = int(quota)
             except ValueError, e:
                 return None
             if quota < 0 or quota >= 2 ** 32:
                 return None
-            ws_request.mux_quota = quota
+            self._quota = quota
 
-        ws_request.mux = True
-        ws_request.mux_extensions = logical_channel_extensions
+        self._active = True
         return common.ExtensionParameter(common.MUX_EXTENSION)
 
-    def setup_stream_options(self, stream_options):
+    def _setup_stream_options_internal(self, stream_options):
         pass
 
+    def set_quota(self, quota):
+        self._quota = quota
+
+    def quota(self):
+        return self._quota
+
+    def set_extensions(self, extensions):
+        self._extensions = extensions
+
+    def extensions(self):
+        return self._extensions
+
 
 _available_processors[common.MUX_EXTENSION] = MuxExtensionProcessor
 
 
 def get_extension_processor(extension_request):
-    global _available_processors
     processor_class = _available_processors.get(extension_request.name())
     if processor_class is None:
         return None
     return processor_class(extension_request)
 
 
+def is_compression_extension(extension_name):
+    return extension_name in _compression_extension_names
+
+
 # vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
index e5c94ca..c993a58 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/_base.py
@@ -84,42 +84,29 @@
         return common.DEFAULT_WEB_SOCKET_PORT
 
 
-def validate_subprotocol(subprotocol, hixie):
+def validate_subprotocol(subprotocol):
     """Validate a value in the Sec-WebSocket-Protocol field.
 
-    See
-    - RFC 6455: Section 4.1., 4.2.2., and 4.3.
-    - HyBi 00: Section 4.1. Opening handshake
-
-    Args:
-         hixie: if True, checks if characters in subprotocol are in range
-                between U+0020 and U+007E. It's required by HyBi 00 but not by
-                RFC 6455.
+    See the Section 4.1., 4.2.2., and 4.3. of RFC 6455.
     """
 
     if not subprotocol:
         raise HandshakeException('Invalid subprotocol name: empty')
-    if hixie:
-        # Parameter should be in the range U+0020 to U+007E.
-        for c in subprotocol:
-            if not 0x20 <= ord(c) <= 0x7e:
-                raise HandshakeException(
-                    'Illegal character in subprotocol name: %r' % c)
-    else:
-        # Parameter should be encoded HTTP token.
-        state = http_header_util.ParsingState(subprotocol)
-        token = http_header_util.consume_token(state)
-        rest = http_header_util.peek(state)
-        # If |rest| is not None, |subprotocol| is not one token or invalid. If
-        # |rest| is None, |token| must not be None because |subprotocol| is
-        # concatenation of |token| and |rest| and is not None.
-        if rest is not None:
-            raise HandshakeException('Invalid non-token string in subprotocol '
-                                     'name: %r' % rest)
+
+    # Parameter should be encoded HTTP token.
+    state = http_header_util.ParsingState(subprotocol)
+    token = http_header_util.consume_token(state)
+    rest = http_header_util.peek(state)
+    # If |rest| is not None, |subprotocol| is not one token or invalid. If
+    # |rest| is None, |token| must not be None because |subprotocol| is
+    # concatenation of |token| and |rest| and is not None.
+    if rest is not None:
+        raise HandshakeException('Invalid non-token string in subprotocol '
+                                 'name: %r' % rest)
 
 
 def parse_host_header(request):
-    fields = request.headers_in['Host'].split(':', 1)
+    fields = request.headers_in[common.HOST_HEADER].split(':', 1)
     if len(fields) == 1:
         return fields[0], get_default_port(request.is_https())
     try:
@@ -132,27 +119,6 @@
     return '%s: %s\r\n' % (name, value)
 
 
-def build_location(request):
-    """Build WebSocket location for request."""
-    location_parts = []
-    if request.is_https():
-        location_parts.append(common.WEB_SOCKET_SECURE_SCHEME)
-    else:
-        location_parts.append(common.WEB_SOCKET_SCHEME)
-    location_parts.append('://')
-    host, port = parse_host_header(request)
-    connection_port = request.connection.local_addr[1]
-    if port != connection_port:
-        raise HandshakeException('Header/connection port mismatch: %d/%d' %
-                                 (port, connection_port))
-    location_parts.append(host)
-    if (port != get_default_port(request.is_https())):
-        location_parts.append(':')
-        location_parts.append(str(port))
-    location_parts.append(request.uri)
-    return ''.join(location_parts)
-
-
 def get_mandatory_header(request, key):
     value = request.headers_in.get(key)
     if value is None:
@@ -180,16 +146,6 @@
                                  request.protocol)
 
 
-def check_header_lines(request, mandatory_headers):
-    check_request_line(request)
-
-    # The expected field names, and the meaning of their corresponding
-    # values, are as follows.
-    #  |Upgrade| and |Connection|
-    for key, expected_value in mandatory_headers:
-        validate_mandatory_header(request, key, expected_value)
-
-
 def parse_token_list(data):
     """Parses a header value which follows 1#token and returns parsed elements
     as a list of strings.
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py
index fc0e2a0..1d54a66 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi.py
@@ -49,6 +49,7 @@
 
 from mod_pywebsocket import common
 from mod_pywebsocket.extensions import get_extension_processor
+from mod_pywebsocket.extensions import is_compression_extension
 from mod_pywebsocket.handshake._base import check_request_line
 from mod_pywebsocket.handshake._base import format_header
 from mod_pywebsocket.handshake._base import get_mandatory_header
@@ -180,43 +181,59 @@
                         processors.append(processor)
             self._request.ws_extension_processors = processors
 
+            # List of extra headers. The extra handshake handler may add header
+            # data as name/value pairs to this list and pywebsocket appends
+            # them to the WebSocket handshake.
+            self._request.extra_headers = []
+
             # Extra handshake handler may modify/remove processors.
             self._dispatcher.do_extra_handshake(self._request)
             processors = filter(lambda processor: processor is not None,
                                 self._request.ws_extension_processors)
 
+            # Ask each processor if there are extensions on the request which
+            # cannot co-exist. When processor decided other processors cannot
+            # co-exist with it, the processor marks them (or itself) as
+            # "inactive". The first extension processor has the right to
+            # make the final call.
+            for processor in reversed(processors):
+                if processor.is_active():
+                    processor.check_consistency_with_other_processors(
+                        processors)
+            processors = filter(lambda processor: processor.is_active(),
+                                processors)
+
             accepted_extensions = []
 
-            # We need to take care of mux extension here. Extensions that
-            # are placed before mux should be applied to logical channels.
+            # We need to take into account of mux extension here.
+            # If mux extension exists:
+            # - Remove processors of extensions for logical channel,
+            #   which are processors located before the mux processor
+            # - Pass extension requests for logical channel to mux processor
+            # - Attach the mux processor to the request. It will be referred
+            #   by dispatcher to see whether the dispatcher should use mux
+            #   handler or not.
             mux_index = -1
             for i, processor in enumerate(processors):
                 if processor.name() == common.MUX_EXTENSION:
                     mux_index = i
                     break
             if mux_index >= 0:
-                mux_processor = processors[mux_index]
-                logical_channel_processors = processors[:mux_index]
-                processors = processors[mux_index+1:]
-
-                for processor in logical_channel_processors:
-                    extension_response = processor.get_extension_response()
-                    if extension_response is None:
-                        # Rejected.
-                        continue
-                    accepted_extensions.append(extension_response)
-                # Pass a shallow copy of accepted_extensions as extensions for
-                # logical channels.
-                mux_response = mux_processor.get_extension_response(
-                    self._request, accepted_extensions[:])
-                if mux_response is not None:
-                    accepted_extensions.append(mux_response)
+                logical_channel_extensions = []
+                for processor in processors[:mux_index]:
+                    logical_channel_extensions.append(processor.request())
+                    processor.set_active(False)
+                self._request.mux_processor = processors[mux_index]
+                self._request.mux_processor.set_extensions(
+                    logical_channel_extensions)
+                processors = filter(lambda processor: processor.is_active(),
+                                    processors)
 
             stream_options = StreamOptions()
 
-            # When there is mux extension, here, |processors| contain only
-            # prosessors for extensions placed after mux.
-            for processor in processors:
+            for index, processor in enumerate(processors):
+                if not processor.is_active():
+                    continue
 
                 extension_response = processor.get_extension_response()
                 if extension_response is None:
@@ -227,6 +244,14 @@
 
                 processor.setup_stream_options(stream_options)
 
+                if not is_compression_extension(processor.name()):
+                    continue
+
+                # Inactivate all of the following compression extensions.
+                for j in xrange(index + 1, len(processors)):
+                    if is_compression_extension(processors[j].name()):
+                        processors[j].set_active(False)
+
             if len(accepted_extensions) > 0:
                 self._request.ws_extensions = accepted_extensions
                 self._logger.debug(
@@ -242,7 +267,7 @@
                     raise HandshakeException(
                         'do_extra_handshake must choose one subprotocol from '
                         'ws_requested_protocols and set it to ws_protocol')
-                validate_subprotocol(self._request.ws_protocol, hixie=False)
+                validate_subprotocol(self._request.ws_protocol)
 
                 self._logger.debug(
                     'Subprotocol accepted: %r',
@@ -375,6 +400,7 @@
 
         response.append('HTTP/1.1 101 Switching Protocols\r\n')
 
+        # WebSocket headers
         response.append(format_header(
             common.UPGRADE_HEADER, common.WEBSOCKET_UPGRADE_TYPE))
         response.append(format_header(
@@ -390,6 +416,11 @@
             response.append(format_header(
                 common.SEC_WEBSOCKET_EXTENSIONS_HEADER,
                 common.format_extensions(self._request.ws_extensions)))
+
+        # Headers not specific for WebSocket
+        for name, value in self._request.extra_headers:
+            response.append(format_header(name, value))
+
         response.append('\r\n')
 
         return ''.join(response)
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
index cc6f8dc..8757717 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py
@@ -51,11 +51,12 @@
 from mod_pywebsocket.stream import StreamHixie75
 from mod_pywebsocket import util
 from mod_pywebsocket.handshake._base import HandshakeException
-from mod_pywebsocket.handshake._base import build_location
-from mod_pywebsocket.handshake._base import check_header_lines
+from mod_pywebsocket.handshake._base import check_request_line
 from mod_pywebsocket.handshake._base import format_header
+from mod_pywebsocket.handshake._base import get_default_port
 from mod_pywebsocket.handshake._base import get_mandatory_header
-from mod_pywebsocket.handshake._base import validate_subprotocol
+from mod_pywebsocket.handshake._base import parse_host_header
+from mod_pywebsocket.handshake._base import validate_mandatory_header
 
 
 _MANDATORY_HEADERS = [
@@ -65,6 +66,56 @@
 ]
 
 
+def _validate_subprotocol(subprotocol):
+    """Checks if characters in subprotocol are in range between U+0020 and
+    U+007E. A value in the Sec-WebSocket-Protocol field need to satisfy this
+    requirement.
+
+    See the Section 4.1. Opening handshake of the spec.
+    """
+
+    if not subprotocol:
+        raise HandshakeException('Invalid subprotocol name: empty')
+
+    # Parameter should be in the range U+0020 to U+007E.
+    for c in subprotocol:
+        if not 0x20 <= ord(c) <= 0x7e:
+            raise HandshakeException(
+                'Illegal character in subprotocol name: %r' % c)
+
+
+def _check_header_lines(request, mandatory_headers):
+    check_request_line(request)
+
+    # The expected field names, and the meaning of their corresponding
+    # values, are as follows.
+    #  |Upgrade| and |Connection|
+    for key, expected_value in mandatory_headers:
+        validate_mandatory_header(request, key, expected_value)
+
+
+def _build_location(request):
+    """Build WebSocket location for request."""
+
+    location_parts = []
+    if request.is_https():
+        location_parts.append(common.WEB_SOCKET_SECURE_SCHEME)
+    else:
+        location_parts.append(common.WEB_SOCKET_SCHEME)
+    location_parts.append('://')
+    host, port = parse_host_header(request)
+    connection_port = request.connection.local_addr[1]
+    if port != connection_port:
+        raise HandshakeException('Header/connection port mismatch: %d/%d' %
+                                 (port, connection_port))
+    location_parts.append(host)
+    if (port != get_default_port(request.is_https())):
+        location_parts.append(':')
+        location_parts.append(str(port))
+    location_parts.append(request.unparsed_uri)
+    return ''.join(location_parts)
+
+
 class Handshaker(object):
     """Opening handshake processor for the WebSocket protocol version HyBi 00.
     """
@@ -101,7 +152,7 @@
 
         # 5.1 Reading the client's opening handshake.
         # dispatcher sets it in self._request.
-        check_header_lines(self._request, _MANDATORY_HEADERS)
+        _check_header_lines(self._request, _MANDATORY_HEADERS)
         self._set_resource()
         self._set_subprotocol()
         self._set_location()
@@ -121,14 +172,14 @@
         subprotocol = self._request.headers_in.get(
             common.SEC_WEBSOCKET_PROTOCOL_HEADER)
         if subprotocol is not None:
-            validate_subprotocol(subprotocol, hixie=True)
+            _validate_subprotocol(subprotocol)
         self._request.ws_protocol = subprotocol
 
     def _set_location(self):
         # |Host|
         host = self._request.headers_in.get(common.HOST_HEADER)
         if host is not None:
-            self._request.ws_location = build_location(self._request)
+            self._request.ws_location = _build_location(self._request)
         # TODO(ukai): check host is this host.
 
     def _set_origin(self):
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
index 2cc62de..c244421 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/headerparserhandler.py
@@ -167,7 +167,9 @@
         handler_root, handler_scan, allow_handlers_outside_root)
 
     for warning in dispatcher.source_warnings():
-        apache.log_error('mod_pywebsocket: %s' % warning, apache.APLOG_WARNING)
+        apache.log_error(
+            'mod_pywebsocket: Warning in source loading: %s' % warning,
+            apache.APLOG_WARNING)
 
     return dispatcher
 
@@ -191,12 +193,16 @@
         # Fallback to default http handler for request paths for which
         # we don't have request handlers.
         if not _dispatcher.get_handler_suite(request.uri):
-            request.log_error('No handler for resource: %r' % request.uri,
-                              apache.APLOG_INFO)
-            request.log_error('Fallback to Apache', apache.APLOG_INFO)
+            request.log_error(
+                'mod_pywebsocket: No handler for resource: %r' % request.uri,
+                apache.APLOG_INFO)
+            request.log_error(
+                'mod_pywebsocket: Fallback to Apache', apache.APLOG_INFO)
             return apache.DECLINED
     except dispatch.DispatchException, e:
-        request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+        request.log_error(
+            'mod_pywebsocket: Dispatch failed for error: %s' % e,
+            apache.APLOG_INFO)
         if not handshake_is_done:
             return e.status
 
@@ -210,26 +216,30 @@
             handshake.do_handshake(
                 request, _dispatcher, allowDraft75=allow_draft75)
         except handshake.VersionException, e:
-            request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+            request.log_error(
+                'mod_pywebsocket: Handshake failed for version error: %s' % e,
+                apache.APLOG_INFO)
             request.err_headers_out.add(common.SEC_WEBSOCKET_VERSION_HEADER,
                                         e.supported_versions)
             return apache.HTTP_BAD_REQUEST
         except handshake.HandshakeException, e:
             # Handshake for ws/wss failed.
             # Send http response with error status.
-            request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+            request.log_error(
+                'mod_pywebsocket: Handshake failed for error: %s' % e,
+                apache.APLOG_INFO)
             return e.status
 
         handshake_is_done = True
         request._dispatcher = _dispatcher
         _dispatcher.transfer_data(request)
     except handshake.AbortedByUserException, e:
-        request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
+        request.log_error('mod_pywebsocket: Aborted: %s' % e, apache.APLOG_INFO)
     except Exception, e:
         # DispatchException can also be thrown if something is wrong in
         # pywebsocket code. It's caught here, then.
 
-        request.log_error('mod_pywebsocket: %s\n%s' %
+        request.log_error('mod_pywebsocket: Exception occurred: %s\n%s' %
                           (e, util.get_stack_trace()),
                           apache.APLOG_ERR)
         # Unknown exceptions before handshake mean Apache must handle its
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
index f0bdd24..7633468 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
@@ -50,6 +50,7 @@
 from mod_pywebsocket import util
 from mod_pywebsocket._stream_base import BadOperationException
 from mod_pywebsocket._stream_base import ConnectionTerminatedException
+from mod_pywebsocket._stream_base import InvalidFrameException
 from mod_pywebsocket._stream_hybi import Frame
 from mod_pywebsocket._stream_hybi import Stream
 from mod_pywebsocket._stream_hybi import StreamOptions
@@ -94,10 +95,12 @@
 _DROP_CODE_INVALID_MUX_CONTROL_BLOCK = 2005
 _DROP_CODE_CHANNEL_ALREADY_EXISTS = 2006
 _DROP_CODE_NEW_CHANNEL_SLOT_VIOLATION = 2007
+_DROP_CODE_UNKNOWN_REQUEST_ENCODING = 2010
 
-_DROP_CODE_UNKNOWN_REQUEST_ENCODING = 3002
 _DROP_CODE_SEND_QUOTA_VIOLATION = 3005
+_DROP_CODE_SEND_QUOTA_OVERFLOW = 3006
 _DROP_CODE_ACKNOWLEDGED = 3008
+_DROP_CODE_BAD_FRAGMENTATION = 3009
 
 
 class MuxUnexpectedException(Exception):
@@ -158,8 +161,7 @@
 
 
 def _create_add_channel_response(channel_id, encoded_handshake,
-                                 encoding=0, rejected=False,
-                                 outer_frame_mask=False):
+                                 encoding=0, rejected=False):
     if encoding != 0 and encoding != 1:
         raise ValueError('Invalid encoding %d' % encoding)
 
@@ -169,12 +171,10 @@
              _encode_channel_id(channel_id) +
              _encode_number(len(encoded_handshake)) +
              encoded_handshake)
-    payload = _encode_channel_id(_CONTROL_CHANNEL_ID) + block
-    return create_binary_frame(payload, mask=outer_frame_mask)
+    return block
 
 
-def _create_drop_channel(channel_id, code=None, message='',
-                         outer_frame_mask=False):
+def _create_drop_channel(channel_id, code=None, message=''):
     if len(message) > 0 and code is None:
         raise ValueError('Code must be specified if message is specified')
 
@@ -187,36 +187,31 @@
         reason_size = _encode_number(len(reason))
         block += reason_size + reason
 
-    payload = _encode_channel_id(_CONTROL_CHANNEL_ID) + block
-    return create_binary_frame(payload, mask=outer_frame_mask)
+    return block
 
 
-def _create_flow_control(channel_id, replenished_quota,
-                         outer_frame_mask=False):
+def _create_flow_control(channel_id, replenished_quota):
     first_byte = _MUX_OPCODE_FLOW_CONTROL << 5
     block = (chr(first_byte) +
              _encode_channel_id(channel_id) +
              _encode_number(replenished_quota))
-    payload = _encode_channel_id(_CONTROL_CHANNEL_ID) + block
-    return create_binary_frame(payload, mask=outer_frame_mask)
+    return block
 
 
-def _create_new_channel_slot(slots, send_quota, outer_frame_mask=False):
+def _create_new_channel_slot(slots, send_quota):
     if slots < 0 or send_quota < 0:
         raise ValueError('slots and send_quota must be non-negative.')
     first_byte = _MUX_OPCODE_NEW_CHANNEL_SLOT << 5
     block = (chr(first_byte) +
              _encode_number(slots) +
              _encode_number(send_quota))
-    payload = _encode_channel_id(_CONTROL_CHANNEL_ID) + block
-    return create_binary_frame(payload, mask=outer_frame_mask)
+    return block
 
 
-def _create_fallback_new_channel_slot(outer_frame_mask=False):
+def _create_fallback_new_channel_slot():
     first_byte = (_MUX_OPCODE_NEW_CHANNEL_SLOT << 5) | 1 # Set the F flag
     block = (chr(first_byte) + _encode_number(0) + _encode_number(0))
-    payload = _encode_channel_id(_CONTROL_CHANNEL_ID) + block
-    return create_binary_frame(payload, mask=outer_frame_mask)
+    return block
 
 
 def _parse_request_text(request_text):
@@ -318,44 +313,34 @@
 
     def _read_number(self):
         if self._read_position + 1 > len(self._data):
-            raise PhysicalConnectionError(
-                _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+            raise ValueError(
                 'Cannot read the first byte of number field')
 
         number = ord(self._data[self._read_position])
         if number & 0x80 == 0x80:
-            raise PhysicalConnectionError(
-                _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+            raise ValueError(
                 'The most significant bit of the first byte of number should '
                 'be unset')
         self._read_position += 1
         pos = self._read_position
         if number == 127:
             if pos + 8 > len(self._data):
-                raise PhysicalConnectionError(
-                    _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
-                    'Invalid number field')
+                raise ValueError('Invalid number field')
             self._read_position += 8
             number = struct.unpack('!Q', self._data[pos:pos+8])[0]
             if number > 0x7FFFFFFFFFFFFFFF:
-                raise PhysicalConnectionError(
-                    _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
-                    'Encoded number >= 2^63')
+                raise ValueError('Encoded number(%d) >= 2^63' % number)
             if number <= 0xFFFF:
-                raise PhysicalConnectionError(
-                    _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+                raise ValueError(
                     '%d should not be encoded by 9 bytes encoding' % number)
             return number
         if number == 126:
             if pos + 2 > len(self._data):
-                raise PhysicalConnectionError(
-                    _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
-                    'Invalid number field')
+                raise ValueError('Invalid number field')
             self._read_position += 2
             number = struct.unpack('!H', self._data[pos:pos+2])[0]
             if number <= 125:
-                raise PhysicalConnectionError(
-                    _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+                raise ValueError(
                     '%d should not be encoded by 3 bytes encoding' % number)
         return number
 
@@ -366,7 +351,11 @@
             - the contents.
         """
 
-        size = self._read_number()
+        try:
+            size = self._read_number()
+        except ValueError, e:
+            raise PhysicalConnectionError(_DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+                                          str(e))
         pos = self._read_position
         if pos + size > len(self._data):
             raise PhysicalConnectionError(
@@ -419,9 +408,11 @@
 
         try:
             control_block.channel_id = self.read_channel_id()
+            control_block.send_quota = self._read_number()
         except ValueError, e:
-            raise PhysicalConnectionError(_DROP_CODE_INVALID_MUX_CONTROL_BLOCK)
-        control_block.send_quota = self._read_number()
+            raise PhysicalConnectionError(_DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+                                          str(e))
+
         return control_block
 
     def _read_drop_channel(self, first_byte, control_block):
@@ -455,8 +446,12 @@
                 _DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
                 'Reserved bits must be unset')
         control_block.fallback = first_byte & 1
-        control_block.slots = self._read_number()
-        control_block.send_quota = self._read_number()
+        try:
+            control_block.slots = self._read_number()
+            control_block.send_quota = self._read_number()
+        except ValueError, e:
+            raise PhysicalConnectionError(_DROP_CODE_INVALID_MUX_CONTROL_BLOCK,
+                                          str(e))
         return control_block
 
     def read_control_blocks(self):
@@ -549,8 +544,12 @@
         self._mux_handler = mux_handler
         self._channel_id = channel_id
         self._incoming_data = ''
+
+        # - Protects _waiting_write_completion
+        # - Signals the thread waiting for completion of write by mux handler
         self._write_condition = threading.Condition()
         self._waiting_write_completion = False
+
         self._read_condition = threading.Condition()
         self._read_state = self.STATE_ACTIVE
 
@@ -594,6 +593,7 @@
             self._waiting_write_completion = True
             self._mux_handler.send_data(self._channel_id, data)
             self._write_condition.wait()
+            # TODO(tyoshino): Raise an exception if woke up by on_writer_done.
         finally:
             self._write_condition.release()
 
@@ -607,20 +607,31 @@
 
         self._mux_handler.send_control_data(data)
 
-    def notify_write_done(self):
+    def on_write_data_done(self):
         """Called when sending data is completed."""
 
         try:
             self._write_condition.acquire()
             if not self._waiting_write_completion:
                 raise MuxUnexpectedException(
-                    'Invalid call of notify_write_done for logical connection'
-                    ' %d' % self._channel_id)
+                    'Invalid call of on_write_data_done for logical '
+                    'connection %d' % self._channel_id)
             self._waiting_write_completion = False
             self._write_condition.notify()
         finally:
             self._write_condition.release()
 
+    def on_writer_done(self):
+        """Called by the mux handler when the writer thread has finished."""
+
+        try:
+            self._write_condition.acquire()
+            self._waiting_write_completion = False
+            self._write_condition.notify()
+        finally:
+            self._write_condition.release()
+
+
     def append_frame_data(self, frame_data):
         """Appends incoming frame data. Called when mux_handler dispatches
         frame data to the corresponding application.
@@ -686,37 +697,162 @@
         self._read_condition.release()
 
 
+class _InnerMessage(object):
+    """Holds the result of _InnerMessageBuilder.build().
+    """
+
+    def __init__(self, opcode, payload):
+        self.opcode = opcode
+        self.payload = payload
+
+
+class _InnerMessageBuilder(object):
+    """A class that holds the context of inner message fragmentation and
+    builds a message from fragmented inner frame(s).
+    """
+
+    def __init__(self):
+        self._control_opcode = None
+        self._pending_control_fragments = []
+        self._message_opcode = None
+        self._pending_message_fragments = []
+        self._frame_handler = self._handle_first
+
+    def _handle_first(self, frame):
+        if frame.opcode == common.OPCODE_CONTINUATION:
+            raise InvalidFrameException('Sending invalid continuation opcode')
+
+        if common.is_control_opcode(frame.opcode):
+            return self._process_first_fragmented_control(frame)
+        else:
+            return self._process_first_fragmented_message(frame)
+
+    def _process_first_fragmented_control(self, frame):
+        self._control_opcode = frame.opcode
+        self._pending_control_fragments.append(frame.payload)
+        if not frame.fin:
+            self._frame_handler = self._handle_fragmented_control
+            return None
+        return self._reassemble_fragmented_control()
+
+    def _process_first_fragmented_message(self, frame):
+        self._message_opcode = frame.opcode
+        self._pending_message_fragments.append(frame.payload)
+        if not frame.fin:
+            self._frame_handler = self._handle_fragmented_message
+            return None
+        return self._reassemble_fragmented_message()
+
+    def _handle_fragmented_control(self, frame):
+        if frame.opcode != common.OPCODE_CONTINUATION:
+            raise InvalidFrameException(
+                'Sending invalid opcode %d while sending fragmented control '
+                'message' % frame.opcode)
+        self._pending_control_fragments.append(frame.payload)
+        if not frame.fin:
+            return None
+        return self._reassemble_fragmented_control()
+
+    def _reassemble_fragmented_control(self):
+        opcode = self._control_opcode
+        payload = ''.join(self._pending_control_fragments)
+        self._control_opcode = None
+        self._pending_control_fragments = []
+        if self._message_opcode is not None:
+            self._frame_handler = self._handle_fragmented_message
+        else:
+            self._frame_handler = self._handle_first
+        return _InnerMessage(opcode, payload)
+
+    def _handle_fragmented_message(self, frame):
+        # Sender can interleave a control message while sending fragmented
+        # messages.
+        if common.is_control_opcode(frame.opcode):
+            if self._control_opcode is not None:
+                raise MuxUnexpectedException(
+                    'Should not reach here(Bug in builder)')
+            return self._process_first_fragmented_control(frame)
+
+        if frame.opcode != common.OPCODE_CONTINUATION:
+            raise InvalidFrameException(
+                'Sending invalid opcode %d while sending fragmented message' %
+                frame.opcode)
+        self._pending_message_fragments.append(frame.payload)
+        if not frame.fin:
+            return None
+        return self._reassemble_fragmented_message()
+
+    def _reassemble_fragmented_message(self):
+        opcode = self._message_opcode
+        payload = ''.join(self._pending_message_fragments)
+        self._message_opcode = None
+        self._pending_message_fragments = []
+        self._frame_handler = self._handle_first
+        return _InnerMessage(opcode, payload)
+
+    def build(self, frame):
+        """Build an inner message. Returns an _InnerMessage instance when
+        the given frame is the last fragmented frame. Returns None otherwise.
+
+        Args:
+            frame: an inner frame.
+        Raises:
+            InvalidFrameException: when received invalid opcode. (e.g.
+                receiving non continuation data opcode but the fin flag of
+                the previous inner frame was not set.)
+        """
+
+        return self._frame_handler(frame)
+
+
 class _LogicalStream(Stream):
     """Mimics the Stream class. This class interprets multiplexed WebSocket
     frames.
     """
 
-    def __init__(self, request, send_quota, receive_quota):
+    def __init__(self, request, stream_options, send_quota, receive_quota):
         """Constructs an instance.
 
         Args:
             request: _LogicalRequest instance.
+            stream_options: StreamOptions instance.
             send_quota: Initial send quota.
             receive_quota: Initial receive quota.
         """
 
-        # TODO(bashi): Support frame filters.
-        stream_options = StreamOptions()
         # Physical stream is responsible for masking.
         stream_options.unmask_receive = False
-        # Control frames can be fragmented on logical channel.
-        stream_options.allow_fragmented_control_frame = True
         Stream.__init__(self, request, stream_options)
+
+        self._send_closed = False
         self._send_quota = send_quota
-        self._send_quota_condition = threading.Condition()
+        # - Protects _send_closed and _send_quota
+        # - Signals the thread waiting for send quota replenished
+        self._send_condition = threading.Condition()
+
+        # The opcode of the first frame in messages.
+        self._message_opcode = common.OPCODE_TEXT
+        # True when the last message was fragmented.
+        self._last_message_was_fragmented = False
+
         self._receive_quota = receive_quota
         self._write_inner_frame_semaphore = threading.Semaphore()
 
+        self._inner_message_builder = _InnerMessageBuilder()
+
     def _create_inner_frame(self, opcode, payload, end=True):
-        # TODO(bashi): Support extensions that use reserved bits.
-        first_byte = (end << 7) | opcode
-        return (_encode_channel_id(self._request.channel_id) +
-                chr(first_byte) + payload)
+        frame = Frame(fin=end, opcode=opcode, payload=payload)
+        for frame_filter in self._options.outgoing_frame_filters:
+            frame_filter.filter(frame)
+
+        if len(payload) != len(frame.payload):
+            raise MuxUnexpectedException(
+                'Mux extension must not be used after extensions which change '
+                ' frame boundary')
+
+        first_byte = ((frame.fin << 7) | (frame.rsv1 << 6) |
+                      (frame.rsv2 << 5) | (frame.rsv3 << 4) | frame.opcode)
+        return chr(first_byte) + frame.payload
 
     def _write_inner_frame(self, opcode, payload, end=True):
         payload_length = len(payload)
@@ -730,14 +866,36 @@
             # multiplexing control blocks can be inserted between fragmented
             # inner frames on the physical channel.
             self._write_inner_frame_semaphore.acquire()
+
+            # Consume an octet quota when this is the first fragmented frame.
+            if opcode != common.OPCODE_CONTINUATION:
+                try:
+                    self._send_condition.acquire()
+                    while (not self._send_closed) and self._send_quota == 0:
+                        self._send_condition.wait()
+
+                    if self._send_closed:
+                        raise BadOperationException(
+                            'Logical connection %d is closed' %
+                            self._request.channel_id)
+
+                    self._send_quota -= 1
+                finally:
+                    self._send_condition.release()
+
             while write_position < payload_length:
                 try:
-                    self._send_quota_condition.acquire()
-                    while self._send_quota == 0:
+                    self._send_condition.acquire()
+                    while (not self._send_closed) and self._send_quota == 0:
                         self._logger.debug(
                             'No quota. Waiting FlowControl message for %d.' %
                             self._request.channel_id)
-                        self._send_quota_condition.wait()
+                        self._send_condition.wait()
+
+                    if self._send_closed:
+                        raise BadOperationException(
+                            'Logical connection %d is closed' %
+                            self.request._channel_id)
 
                     remaining = payload_length - write_position
                     write_length = min(self._send_quota, remaining)
@@ -749,18 +907,16 @@
                         opcode,
                         payload[write_position:write_position+write_length],
                         inner_frame_end)
-                    frame_data = self._writer.build(
-                        inner_frame, end=True, binary=True)
                     self._send_quota -= write_length
                     self._logger.debug('Consumed quota=%d, remaining=%d' %
                                        (write_length, self._send_quota))
                 finally:
-                    self._send_quota_condition.release()
+                    self._send_condition.release()
 
                 # Writing data will block the worker so we need to release
-                # _send_quota_condition before writing.
-                self._logger.debug('Sending inner frame: %r' % frame_data)
-                self._request.connection.write(frame_data)
+                # _send_condition before writing.
+                self._logger.debug('Sending inner frame: %r' % inner_frame)
+                self._request.connection.write(inner_frame)
                 write_position += write_length
 
                 opcode = common.OPCODE_CONTINUATION
@@ -773,12 +929,18 @@
     def replenish_send_quota(self, send_quota):
         """Replenish send quota."""
 
-        self._send_quota_condition.acquire()
-        self._send_quota += send_quota
-        self._logger.debug('Replenished send quota for channel id %d: %d' %
-                           (self._request.channel_id, self._send_quota))
-        self._send_quota_condition.notify()
-        self._send_quota_condition.release()
+        try:
+            self._send_condition.acquire()
+            if self._send_quota + send_quota > 0x7FFFFFFFFFFFFFFF:
+                self._send_quota = 0
+                raise LogicalChannelError(
+                    self._request.channel_id, _DROP_CODE_SEND_QUOTA_OVERFLOW)
+            self._send_quota += send_quota
+            self._logger.debug('Replenished send quota for channel id %d: %d' %
+                               (self._request.channel_id, self._send_quota))
+        finally:
+            self._send_condition.notify()
+            self._send_condition.release()
 
     def consume_receive_quota(self, amount):
         """Consumes receive quota. Returns False on failure."""
@@ -808,7 +970,19 @@
             opcode = common.OPCODE_TEXT
             message = message.encode('utf-8')
 
+        for message_filter in self._options.outgoing_message_filters:
+            message = message_filter.filter(message, end, binary)
+
+        if self._last_message_was_fragmented:
+            if opcode != self._message_opcode:
+                raise BadOperationException('Message types are different in '
+                                            'frames for the same message')
+            opcode = common.OPCODE_CONTINUATION
+        else:
+            self._message_opcode = opcode
+
         self._write_inner_frame(opcode, message, end)
+        self._last_message_was_fragmented = not end
 
     def _receive_frame(self):
         """Overrides Stream._receive_frame.
@@ -821,6 +995,9 @@
 
         opcode, payload, fin, rsv1, rsv2, rsv3 = Stream._receive_frame(self)
         amount = len(payload)
+        # Replenish extra one octet when receiving the first fragmented frame.
+        if opcode != common.OPCODE_CONTINUATION:
+            amount += 1
         self._receive_quota += amount
         frame_data = _create_flow_control(self._request.channel_id,
                                           amount)
@@ -829,6 +1006,21 @@
         self._request.connection.write_control_data(frame_data)
         return opcode, payload, fin, rsv1, rsv2, rsv3
 
+    def _get_message_from_frame(self, frame):
+        """Overrides Stream._get_message_from_frame.
+        """
+
+        try:
+            inner_message = self._inner_message_builder.build(frame)
+        except InvalidFrameException:
+            raise LogicalChannelError(
+                self._request.channel_id, _DROP_CODE_BAD_FRAGMENTATION)
+
+        if inner_message is None:
+            return None
+        self._original_opcode = inner_message.opcode
+        return inner_message.payload
+
     def receive_message(self):
         """Overrides Stream.receive_message."""
 
@@ -875,12 +1067,13 @@
                            self._request.channel_id)
         self._request.server_terminated = True
 
-    def _drain_received_data(self):
-        """Overrides Stream._drain_received_data. Nothing need to be done for
-        logical channel.
-        """
+    def stop_sending(self):
+        """Stops accepting new send operation (_write_inner_frame)."""
 
-        pass
+        self._send_condition.acquire()
+        self._send_closed = True
+        self._send_condition.notify()
+        self._send_condition.release()
 
 
 class _OutgoingData(object):
@@ -911,8 +1104,17 @@
         self._logger = util.get_class_logger(self)
         self._mux_handler = mux_handler
         self.setDaemon(True)
+
+        # When set, make this thread stop accepting new data, flush pending
+        # data and exit.
         self._stop_requested = False
+        # The close code of the physical connection.
+        self._close_code = common.STATUS_NORMAL_CLOSURE
+        # Deque for passing write data. It's protected by _deque_condition
+        # until _stop_requested is set.
         self._deque = collections.deque()
+        # - Protects _deque, _stop_requested and _close_code
+        # - Signals threads waiting for them to be available
         self._deque_condition = threading.Condition()
 
     def put_outgoing_data(self, data):
@@ -937,8 +1139,11 @@
             self._deque_condition.release()
 
     def _write_data(self, outgoing_data):
+        message = (_encode_channel_id(outgoing_data.channel_id) +
+                   outgoing_data.data)
         try:
-            self._mux_handler.physical_connection.write(outgoing_data.data)
+            self._mux_handler.physical_stream.send_message(
+                message=message, end=True, binary=True)
         except Exception, e:
             util.prepend_message_to_exception(
                 'Failed to send message to %r: ' %
@@ -948,33 +1153,51 @@
         # TODO(bashi): It would be better to block the thread that sends
         # control data as well.
         if outgoing_data.channel_id != _CONTROL_CHANNEL_ID:
-            self._mux_handler.notify_write_done(outgoing_data.channel_id)
+            self._mux_handler.notify_write_data_done(outgoing_data.channel_id)
 
     def run(self):
-        self._deque_condition.acquire()
-        while not self._stop_requested:
-            if len(self._deque) == 0:
-                self._deque_condition.wait()
-                continue
-
-            outgoing_data = self._deque.popleft()
-            self._deque_condition.release()
-            self._write_data(outgoing_data)
-            self._deque_condition.acquire()
-
-        # Flush deque
         try:
-            while len(self._deque) > 0:
-                outgoing_data = self._deque.popleft()
-                self._write_data(outgoing_data)
-        finally:
-            self._deque_condition.release()
+            self._deque_condition.acquire()
+            while not self._stop_requested:
+                if len(self._deque) == 0:
+                    self._deque_condition.wait()
+                    continue
 
-    def stop(self):
+                outgoing_data = self._deque.popleft()
+
+                self._deque_condition.release()
+                self._write_data(outgoing_data)
+                self._deque_condition.acquire()
+
+            # Flush deque.
+            #
+            # At this point, self._deque_condition is always acquired.
+            try:
+                while len(self._deque) > 0:
+                    outgoing_data = self._deque.popleft()
+                    self._write_data(outgoing_data)
+            finally:
+                self._deque_condition.release()
+
+            # Close physical connection.
+            try:
+                # Don't wait the response here. The response will be read
+                # by the reader thread.
+                self._mux_handler.physical_stream.close_connection(
+                    self._close_code, wait_response=False)
+            except Exception, e:
+                util.prepend_message_to_exception(
+                    'Failed to close the physical connection: %r' % e)
+                raise
+        finally:
+            self._mux_handler.notify_writer_done()
+
+    def stop(self, close_code=common.STATUS_NORMAL_CLOSURE):
         """Stops the writer thread."""
 
         self._deque_condition.acquire()
         self._stop_requested = True
+        self._close_code = close_code
         self._deque_condition.notify()
         self._deque_condition.release()
 
@@ -1055,6 +1278,9 @@
         try:
             # Non-critical exceptions will be handled by dispatcher.
             self._mux_handler.dispatcher.transfer_data(self._request)
+        except LogicalChannelError, e:
+            self._mux_handler.fail_logical_channel(
+                e.channel_id, e.drop_code, e.message)
         finally:
             self._mux_handler.notify_worker_done(self._request.channel_id)
 
@@ -1083,8 +1309,6 @@
         #     these headers are included already.
         request.headers_in[common.UPGRADE_HEADER] = (
             common.WEBSOCKET_UPGRADE_TYPE)
-        request.headers_in[common.CONNECTION_HEADER] = (
-            common.UPGRADE_CONNECTION_TYPE)
         request.headers_in[common.SEC_WEBSOCKET_VERSION_HEADER] = (
             str(common.VERSION_HYBI_LATEST))
         request.headers_in[common.SEC_WEBSOCKET_KEY_HEADER] = (
@@ -1095,8 +1319,9 @@
 
         self._logger.debug('Creating logical stream for %d' %
                            self._request.channel_id)
-        return _LogicalStream(self._request, self._send_quota,
-                              self._receive_quota)
+        return _LogicalStream(
+            self._request, stream_options, self._send_quota,
+            self._receive_quota)
 
     def _create_handshake_response(self, accept):
         """Override hybi._create_handshake_response."""
@@ -1105,7 +1330,9 @@
 
         response.append('HTTP/1.1 101 Switching Protocols\r\n')
 
-        # Upgrade, Connection and Sec-WebSocket-Accept should be excluded.
+        # Upgrade and Sec-WebSocket-Accept should be excluded.
+        response.append('%s: %s\r\n' % (
+            common.CONNECTION_HEADER, common.UPGRADE_CONNECTION_TYPE))
         if self._request.ws_protocol is not None:
             response.append('%s: %s\r\n' % (
                 common.SEC_WEBSOCKET_PROTOCOL_HEADER,
@@ -1169,8 +1396,6 @@
                     del headers[key]
                 else:
                     headers[key] = value
-        # TODO(bashi): Support extensions
-        headers['Sec-WebSocket-Extensions'] = ''
         return headers
 
 
@@ -1232,8 +1457,12 @@
 
         # Create "Implicitly Opened Connection".
         logical_connection = _LogicalConnection(self, _DEFAULT_CHANNEL_ID)
-        self._handshake_base = _HandshakeDeltaBase(
-            self.original_request.headers_in)
+        headers = copy.copy(self.original_request.headers_in)
+        # Add extensions for logical channel.
+        headers[common.SEC_WEBSOCKET_EXTENSIONS_HEADER] = (
+            common.format_extensions(
+                self.original_request.mux_processor.extensions()))
+        self._handshake_base = _HandshakeDeltaBase(headers)
         logical_request = _LogicalRequest(
             _DEFAULT_CHANNEL_ID,
             self.original_request.method,
@@ -1245,8 +1474,9 @@
         # but we will send FlowControl later so set the initial quota to
         # _INITIAL_QUOTA_FOR_CLIENT.
         self._channel_slots.append(_INITIAL_QUOTA_FOR_CLIENT)
+        send_quota = self.original_request.mux_processor.quota()
         if not self._do_handshake_for_logical_request(
-            logical_request, send_quota=self.original_request.mux_quota):
+            logical_request, send_quota=send_quota):
             raise MuxUnexpectedException(
                 'Failed handshake on the default channel id')
         self._add_logical_channel(logical_request)
@@ -1287,7 +1517,6 @@
                 if not self._worker_done_notify_received:
                     self._logger.debug('Waiting worker(s) timed out')
                     return False
-
         finally:
             self._logical_channels_condition.release()
 
@@ -1297,7 +1526,7 @@
 
         return True
 
-    def notify_write_done(self, channel_id):
+    def notify_write_data_done(self, channel_id):
         """Called by the writer thread when a write operation has done.
 
         Args:
@@ -1308,7 +1537,7 @@
             self._logical_channels_condition.acquire()
             if channel_id in self._logical_channels:
                 channel_data = self._logical_channels[channel_id]
-                channel_data.request.connection.notify_write_done()
+                channel_data.request.connection.on_write_data_done()
             else:
                 self._logger.debug('Seems that logical channel for %d has gone'
                                    % channel_id)
@@ -1469,9 +1698,11 @@
                 return
             channel_data = self._logical_channels[block.channel_id]
             channel_data.drop_code = _DROP_CODE_ACKNOWLEDGED
+
             # Close the logical channel
             channel_data.request.connection.set_read_state(
                 _LogicalConnection.STATE_TERMINATED)
+            channel_data.request.ws_stream.stop_sending()
         finally:
             self._logical_channels_condition.release()
 
@@ -1506,8 +1737,11 @@
                 return
             channel_data = self._logical_channels[channel_id]
             fin, rsv1, rsv2, rsv3, opcode, payload = parser.read_inner_frame()
+            consuming_byte = len(payload)
+            if opcode != common.OPCODE_CONTINUATION:
+                consuming_byte += 1
             if not channel_data.request.ws_stream.consume_receive_quota(
-                len(payload)):
+                consuming_byte):
                 # The client violates quota. Close logical channel.
                 raise LogicalChannelError(
                     channel_id, _DROP_CODE_SEND_QUOTA_VIOLATION)
@@ -1569,15 +1803,32 @@
         finished.
         """
 
-        # Terminate all logical connections
-        self._logger.debug('termiating all logical connections...')
+        self._logger.debug(
+            'Termiating all logical connections waiting for incoming data '
+            '...')
         self._logical_channels_condition.acquire()
         for channel_data in self._logical_channels.values():
             try:
                 channel_data.request.connection.set_read_state(
                     _LogicalConnection.STATE_TERMINATED)
             except Exception:
-                pass
+                self._logger.debug(traceback.format_exc())
+        self._logical_channels_condition.release()
+
+    def notify_writer_done(self):
+        """This method is called by the writer thread when the writer has
+        finished.
+        """
+
+        self._logger.debug(
+            'Termiating all logical connections waiting for write '
+            'completion ...')
+        self._logical_channels_condition.acquire()
+        for channel_data in self._logical_channels.values():
+            try:
+                channel_data.request.connection.on_writer_done()
+            except Exception:
+                self._logger.debug(traceback.format_exc())
         self._logical_channels_condition.release()
 
     def fail_physical_connection(self, code, message):
@@ -1590,8 +1841,7 @@
 
         self._logger.debug('Failing the physical connection...')
         self._send_drop_channel(_CONTROL_CHANNEL_ID, code, message)
-        self.physical_stream.close_connection(
-            common.STATUS_INTERNAL_ENDPOINT_ERROR)
+        self._writer.stop(common.STATUS_INTERNAL_ENDPOINT_ERROR)
 
     def fail_logical_channel(self, channel_id, code, message):
         """Fail a logical channel.
@@ -1611,8 +1861,10 @@
                 # called later and it will send DropChannel.
                 channel_data.drop_code = code
                 channel_data.drop_message = message
+
                 channel_data.request.connection.set_read_state(
                     _LogicalConnection.STATE_TERMINATED)
+                channel_data.request.ws_stream.stop_sending()
             else:
                 self._send_drop_channel(channel_id, code, message)
         finally:
@@ -1620,7 +1872,8 @@
 
 
 def use_mux(request):
-    return hasattr(request, 'mux') and request.mux
+    return hasattr(request, 'mux_processor') and (
+        request.mux_processor.is_active())
 
 
 def start(request, dispatcher):
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
index 07a33d9..2bf3b0c 100755
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py
@@ -76,6 +76,9 @@
 
 To support TLS, run standalone.py with -t, -k, and -c options.
 
+Note that when ssl module is used and the key/cert location is incorrect,
+TLS connection silently fails while pyOpenSSL fails on startup.
+
 
 SUPPORTING CLIENT AUTHENTICATION
 
@@ -140,18 +143,6 @@
 import threading
 import time
 
-_HAS_SSL = False
-_HAS_OPEN_SSL = False
-try:
-    import ssl
-    _HAS_SSL = True
-except ImportError:
-    try:
-        import OpenSSL.SSL
-        _HAS_OPEN_SSL = True
-    except ImportError:
-        pass
-
 from mod_pywebsocket import common
 from mod_pywebsocket import dispatch
 from mod_pywebsocket import handshake
@@ -168,6 +159,10 @@
 # 1024 is practically large enough to contain WebSocket handshake lines.
 _MAX_MEMORIZED_LINES = 1024
 
+# Constants for the --tls_module flag.
+_TLS_BY_STANDARD_MODULE = 'ssl'
+_TLS_BY_PYOPENSSL = 'pyopenssl'
+
 
 class _StandaloneConnection(object):
     """Mimic mod_python mp_conn."""
@@ -231,11 +226,23 @@
         self.headers_in = request_handler.headers
 
     def get_uri(self):
-        """Getter to mimic request.uri."""
+        """Getter to mimic request.uri.
+
+        This method returns the raw data at the Request-URI part of the
+        Request-Line, while the uri method on the request object of mod_python
+        returns the path portion after parsing the raw data. This behavior is
+        kept for compatibility.
+        """
 
         return self._request_handler.path
     uri = property(get_uri)
 
+    def get_unparsed_uri(self):
+        """Getter to mimic request.unparsed_uri."""
+
+        return self._request_handler.path
+    unparsed_uri = property(get_unparsed_uri)
+
     def get_method(self):
         """Getter to mimic request.method."""
 
@@ -253,39 +260,68 @@
 
         return self._use_tls
 
-    def _drain_received_data(self):
-        """Don't use this method from WebSocket handler. Drains unread data
-        in the receive buffer.
-        """
 
-        raw_socket = self._request_handler.connection
-        drained_data = util.drain_received_data(raw_socket)
+def _import_ssl():
+    global ssl
+    try:
+        import ssl
+        return True
+    except ImportError:
+        return False
 
-        if drained_data:
-            self._logger.debug(
-                'Drained data following close frame: %r', drained_data)
+
+def _import_pyopenssl():
+    global OpenSSL
+    try:
+        import OpenSSL.SSL
+        return True
+    except ImportError:
+        return False
 
 
 class _StandaloneSSLConnection(object):
-    """A wrapper class for OpenSSL.SSL.Connection to provide makefile method
-    which is not supported by the class.
+    """A wrapper class for OpenSSL.SSL.Connection to
+    - provide makefile method which is not supported by the class
+    - tweak shutdown method since OpenSSL.SSL.Connection.shutdown doesn't
+      accept the "how" argument.
+    - convert SysCallError exceptions that its recv method may raise into a
+      return value of '', meaning EOF. We cannot overwrite the recv method on
+      self._connection since it's immutable.
     """
 
+    _OVERRIDDEN_ATTRIBUTES = ['_connection', 'makefile', 'shutdown', 'recv']
+
     def __init__(self, connection):
         self._connection = connection
 
     def __getattribute__(self, name):
-        if name in ('_connection', 'makefile'):
+        if name in _StandaloneSSLConnection._OVERRIDDEN_ATTRIBUTES:
             return object.__getattribute__(self, name)
         return self._connection.__getattribute__(name)
 
     def __setattr__(self, name, value):
-        if name in ('_connection', 'makefile'):
+        if name in _StandaloneSSLConnection._OVERRIDDEN_ATTRIBUTES:
             return object.__setattr__(self, name, value)
         return self._connection.__setattr__(name, value)
 
     def makefile(self, mode='r', bufsize=-1):
-        return socket._fileobject(self._connection, mode, bufsize)
+        return socket._fileobject(self, mode, bufsize)
+
+    def shutdown(self, unused_how):
+        self._connection.shutdown()
+
+    def recv(self, bufsize, flags=0):
+        if flags != 0:
+            raise ValueError('Non-zero flags not allowed')
+
+        try:
+            return self._connection.recv(bufsize)
+        except OpenSSL.SSL.SysCallError, (err, message):
+            if err == -1:
+                # Suppress "unexpected EOF" exception. See the OpenSSL document
+                # for SSL_get_error.
+                return ''
+            raise
 
 
 def _alias_handlers(dispatcher, websock_handlers_map_file):
@@ -340,7 +376,7 @@
         warnings = options.dispatcher.source_warnings()
         if warnings:
             for warning in warnings:
-                logging.warning('mod_pywebsocket: %s' % warning)
+                logging.warning('Warning in source loading: %s' % warning)
 
         self._logger = util.get_class_logger(self)
 
@@ -387,25 +423,25 @@
             except Exception, e:
                 self._logger.info('Skip by failure: %r', e)
                 continue
-            if self.websocket_server_options.use_tls:
-                if _HAS_SSL:
-                    if self.websocket_server_options.tls_client_auth:
-                        client_cert_ = ssl.CERT_REQUIRED
+            server_options = self.websocket_server_options
+            if server_options.use_tls:
+                # For the case of _HAS_OPEN_SSL, we do wrapper setup after
+                # accept.
+                if server_options.tls_module == _TLS_BY_STANDARD_MODULE:
+                    if server_options.tls_client_auth:
+                        if server_options.tls_client_cert_optional:
+                            client_cert_ = ssl.CERT_OPTIONAL
+                        else:
+                            client_cert_ = ssl.CERT_REQUIRED
                     else:
                         client_cert_ = ssl.CERT_NONE
                     socket_ = ssl.wrap_socket(socket_,
-                        keyfile=self.websocket_server_options.private_key,
-                        certfile=self.websocket_server_options.certificate,
+                        keyfile=server_options.private_key,
+                        certfile=server_options.certificate,
                         ssl_version=ssl.PROTOCOL_SSLv23,
-                        ca_certs=self.websocket_server_options.tls_client_ca,
-                        cert_reqs=client_cert_)
-                if _HAS_OPEN_SSL:
-                    ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
-                    ctx.use_privatekey_file(
-                        self.websocket_server_options.private_key)
-                    ctx.use_certificate_file(
-                        self.websocket_server_options.certificate)
-                    socket_ = OpenSSL.SSL.Connection(ctx, socket_)
+                        ca_certs=server_options.tls_client_ca,
+                        cert_reqs=client_cert_,
+                        do_handshake_on_connect=False)
             self._sockets.append((socket_, addrinfo))
 
     def server_bind(self):
@@ -479,7 +515,7 @@
         self._logger.critical('Not supported: fileno')
         return self._sockets[0][0].fileno()
 
-    def handle_error(self, rquest, client_address):
+    def handle_error(self, request, client_address):
         """Override SocketServer.handle_error."""
 
         self._logger.error(
@@ -496,8 +532,63 @@
         """
 
         accepted_socket, client_address = self.socket.accept()
-        if self.websocket_server_options.use_tls and _HAS_OPEN_SSL:
-            accepted_socket = _StandaloneSSLConnection(accepted_socket)
+
+        server_options = self.websocket_server_options
+        if server_options.use_tls:
+            if server_options.tls_module == _TLS_BY_STANDARD_MODULE:
+                try:
+                    accepted_socket.do_handshake()
+                except ssl.SSLError, e:
+                    self._logger.debug('%r', e)
+                    raise
+
+                # Print cipher in use. Handshake is done on accept.
+                self._logger.debug('Cipher: %s', accepted_socket.cipher())
+                self._logger.debug('Client cert: %r',
+                                   accepted_socket.getpeercert())
+            elif server_options.tls_module == _TLS_BY_PYOPENSSL:
+                # We cannot print the cipher in use. pyOpenSSL doesn't provide
+                # any method to fetch that.
+
+                ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
+                ctx.use_privatekey_file(server_options.private_key)
+                ctx.use_certificate_file(server_options.certificate)
+
+                def default_callback(conn, cert, errnum, errdepth, ok):
+                    return ok == 1
+
+                # See the OpenSSL document for SSL_CTX_set_verify.
+                if server_options.tls_client_auth:
+                    verify_mode = OpenSSL.SSL.VERIFY_PEER
+                    if not server_options.tls_client_cert_optional:
+                        verify_mode |= OpenSSL.SSL.VERIFY_FAIL_IF_NO_PEER_CERT
+                    ctx.set_verify(verify_mode, default_callback)
+                    ctx.load_verify_locations(server_options.tls_client_ca,
+                                              None)
+                else:
+                    ctx.set_verify(OpenSSL.SSL.VERIFY_NONE, default_callback)
+
+                accepted_socket = OpenSSL.SSL.Connection(ctx, accepted_socket)
+                accepted_socket.set_accept_state()
+
+                # Convert SSL related error into socket.error so that
+                # SocketServer ignores them and keeps running.
+                #
+                # TODO(tyoshino): Convert all kinds of errors.
+                try:
+                    accepted_socket.do_handshake()
+                except OpenSSL.SSL.Error, e:
+                    # Set errno part to 1 (SSL_ERROR_SSL) like the ssl module
+                    # does.
+                    self._logger.debug('%r', e)
+                    raise socket.error(1, '%r' % e)
+                cert = accepted_socket.get_peer_certificate()
+                self._logger.debug('Client cert subject: %r',
+                                   cert.get_subject().get_components())
+                accepted_socket = _StandaloneSSLConnection(accepted_socket)
+            else:
+                raise ValueError('No TLS support module is available')
+
         return accepted_socket, client_address
 
     def serve_forever(self, poll_interval=0.5):
@@ -636,7 +727,7 @@
                 self._logger.info('Fallback to CGIHTTPRequestHandler')
                 return True
         except dispatch.DispatchException, e:
-            self._logger.info('%s', e)
+            self._logger.info('Dispatch failed for error: %s', e)
             self.send_error(e.status)
             return False
 
@@ -652,7 +743,7 @@
                     allowDraft75=self._options.allow_draft75,
                     strict=self._options.strict)
             except handshake.VersionException, e:
-                self._logger.info('%s', e)
+                self._logger.info('Handshake failed for version error: %s', e)
                 self.send_response(common.HTTP_STATUS_BAD_REQUEST)
                 self.send_header(common.SEC_WEBSOCKET_VERSION_HEADER,
                                  e.supported_versions)
@@ -660,14 +751,14 @@
                 return False
             except handshake.HandshakeException, e:
                 # Handshake for ws(s) failed.
-                self._logger.info('%s', e)
+                self._logger.info('Handshake failed for error: %s', e)
                 self.send_error(e.status)
                 return False
 
             request._dispatcher = self._options.dispatcher
             self._options.dispatcher.transfer_data(request)
         except handshake.AbortedByUserException, e:
-            self._logger.info('%s', e)
+            self._logger.info('Aborted: %s', e)
         return False
 
     def log_request(self, code='-', size='-'):
@@ -799,6 +890,12 @@
                             'as CGI programs. Must be executable.'))
     parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
                       default=False, help='use TLS (wss://)')
+    parser.add_option('--tls-module', '--tls_module', dest='tls_module',
+                      type='choice',
+                      choices = [_TLS_BY_STANDARD_MODULE, _TLS_BY_PYOPENSSL],
+                      help='Use ssl module if "%s" is specified. '
+                      'Use pyOpenSSL module if "%s" is specified' %
+                      (_TLS_BY_STANDARD_MODULE, _TLS_BY_PYOPENSSL))
     parser.add_option('-k', '--private-key', '--private_key',
                       dest='private_key',
                       default='', help='TLS private key file.')
@@ -806,7 +903,12 @@
                       default='', help='TLS certificate file.')
     parser.add_option('--tls-client-auth', dest='tls_client_auth',
                       action='store_true', default=False,
-                      help='Requires TLS client auth on every connection.')
+                      help='Requests TLS client auth on every connection.')
+    parser.add_option('--tls-client-cert-optional',
+                      dest='tls_client_cert_optional',
+                      action='store_true', default=False,
+                      help=('Makes client certificate optional even though '
+                            'TLS client auth is enabled.'))
     parser.add_option('--tls-client-ca', dest='tls_client_ca', default='',
                       help=('Specifies a pem file which contains a set of '
                             'concatenated CA certificates which are used to '
@@ -933,6 +1035,12 @@
 
     _configure_logging(options)
 
+    if options.allow_draft75:
+        logging.warning('--allow_draft75 option is obsolete.')
+
+    if options.strict:
+        logging.warning('--strict option is obsolete.')
+
     # TODO(tyoshino): Clean up initialization of CGI related values. Move some
     # of code here to WebSocketRequestHandler class if it's better.
     options.cgi_directories = []
@@ -955,20 +1063,53 @@
             options.is_executable_method = __check_script
 
     if options.use_tls:
-        if not (_HAS_SSL or _HAS_OPEN_SSL):
-            logging.critical('TLS support requires ssl or pyOpenSSL module.')
+        if options.tls_module is None:
+            if _import_ssl():
+                options.tls_module = _TLS_BY_STANDARD_MODULE
+                logging.debug('Using ssl module')
+            elif _import_pyopenssl():
+                options.tls_module = _TLS_BY_PYOPENSSL
+                logging.debug('Using pyOpenSSL module')
+            else:
+                logging.critical(
+                        'TLS support requires ssl or pyOpenSSL module.')
+                sys.exit(1)
+        elif options.tls_module == _TLS_BY_STANDARD_MODULE:
+            if not _import_ssl():
+                logging.critical('ssl module is not available')
+                sys.exit(1)
+        elif options.tls_module == _TLS_BY_PYOPENSSL:
+            if not _import_pyopenssl():
+                logging.critical('pyOpenSSL module is not available')
+                sys.exit(1)
+        else:
+            logging.critical('Invalid --tls-module option: %r',
+                             options.tls_module)
             sys.exit(1)
+
         if not options.private_key or not options.certificate:
             logging.critical(
                     'To use TLS, specify private_key and certificate.')
             sys.exit(1)
 
-    if options.tls_client_auth:
-        if not options.use_tls:
+        if (options.tls_client_cert_optional and
+            not options.tls_client_auth):
+            logging.critical('Client authentication must be enabled to '
+                             'specify tls_client_cert_optional')
+            sys.exit(1)
+    else:
+        if options.tls_module is not None:
+            logging.critical('Use --tls-module option only together with '
+                             '--use-tls option.')
+            sys.exit(1)
+
+        if options.tls_client_auth:
             logging.critical('TLS must be enabled for client authentication.')
             sys.exit(1)
-        if not _HAS_SSL:
-            logging.critical('Client authentication requires ssl module.')
+
+        if options.tls_client_cert_optional:
+            logging.critical('TLS must be enabled for client authentication.')
+            sys.exit(1)
 
     if not options.scan_dir:
         options.scan_dir = options.websock_handlers
diff --git a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
index 7bb0b5d..adaca3a 100644
--- a/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
+++ b/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
@@ -56,6 +56,11 @@
 import traceback
 import zlib
 
+try:
+    from mod_pywebsocket import fast_masking
+except ImportError:
+    pass
+
 
 def get_stack_trace():
     """Get the current stack trace as string.
@@ -169,45 +174,39 @@
     ended and resumes from that point on the next mask method call.
     """
 
-    def __init__(self, mask):
-        self._mask = map(ord, mask)
-        self._mask_size = len(self._mask)
-        self._count = 0
+    def __init__(self, masking_key):
+        self._masking_key = masking_key
+        self._masking_key_index = 0
 
-    def mask(self, s):
+    def _mask_using_swig(self, s):
+        masked_data = fast_masking.mask(
+                s, self._masking_key, self._masking_key_index)
+        self._masking_key_index = (
+                (self._masking_key_index + len(s)) % len(self._masking_key))
+        return masked_data
+
+    def _mask_using_array(self, s):
         result = array.array('B')
         result.fromstring(s)
+
         # Use temporary local variables to eliminate the cost to access
         # attributes
-        count = self._count
-        mask = self._mask
-        mask_size = self._mask_size
+        masking_key = map(ord, self._masking_key)
+        masking_key_size = len(masking_key)
+        masking_key_index = self._masking_key_index
+
         for i in xrange(len(result)):
-            result[i] ^= mask[count]
-            count = (count + 1) % mask_size
-        self._count = count
+            result[i] ^= masking_key[masking_key_index]
+            masking_key_index = (masking_key_index + 1) % masking_key_size
+
+        self._masking_key_index = masking_key_index
 
         return result.tostring()
 
-
-class DeflateRequest(object):
-    """A wrapper class for request object to intercept send and recv to perform
-    deflate compression and decompression transparently.
-    """
-
-    def __init__(self, request):
-        self._request = request
-        self.connection = DeflateConnection(request.connection)
-
-    def __getattribute__(self, name):
-        if name in ('_request', 'connection'):
-            return object.__getattribute__(self, name)
-        return self._request.__getattribute__(name)
-
-    def __setattr__(self, name, value):
-        if name in ('_request', 'connection'):
-            return object.__setattr__(self, name, value)
-        return self._request.__setattr__(name, value)
+    if 'fast_masking' in globals():
+        mask = _mask_using_swig
+    else:
+        mask = _mask_using_array
 
 
 # By making wbits option negative, we can suppress CMF/FLG (2 octet) and
@@ -252,6 +251,7 @@
         self._logger.debug('Compress result %r', compressed_bytes)
         return compressed_bytes
 
+
 class _Inflater(object):
 
     def __init__(self):
@@ -346,6 +346,7 @@
             return self._deflater.compress_and_flush(bytes)[:-4]
         return self._deflater.compress(bytes)
 
+
 class _RFC1979Inflater(object):
     """A decompressor class for byte sequence compressed and flushed following
     the algorithm described in the RFC1979 section 2.1.
@@ -405,111 +406,4 @@
         return len(bytes)
 
 
-class DeflateConnection(object):
-    """A wrapper class for request object to intercept write and read to
-    perform deflate compression and decompression transparently.
-    """
-
-    def __init__(self, connection):
-        self._connection = connection
-
-        self._logger = get_class_logger(self)
-
-        self._deflater = _Deflater(zlib.MAX_WBITS)
-        self._inflater = _Inflater()
-
-    def get_remote_addr(self):
-        return self._connection.remote_addr
-    remote_addr = property(get_remote_addr)
-
-    def put_bytes(self, bytes):
-        self.write(bytes)
-
-    def read(self, size=-1):
-        """Reads at most size bytes. Blocks until there's at least one byte
-        available.
-        """
-
-        # TODO(tyoshino): Allow call with size=0.
-        if not (size == -1 or size > 0):
-            raise Exception('size must be -1 or positive')
-
-        data = ''
-        while True:
-            if size == -1:
-                data += self._inflater.decompress(-1)
-            else:
-                data += self._inflater.decompress(size - len(data))
-
-            if size >= 0 and len(data) != 0:
-                break
-
-            # TODO(tyoshino): Make this read efficient by some workaround.
-            #
-            # In 3.0.3 and prior of mod_python, read blocks until length bytes
-            # was read. We don't know the exact size to read while using
-            # deflate, so read byte-by-byte.
-            #
-            # _StandaloneRequest.read that ultimately performs
-            # socket._fileobject.read also blocks until length bytes was read
-            read_data = self._connection.read(1)
-            if not read_data:
-                break
-            self._inflater.append(read_data)
-        return data
-
-    def write(self, bytes):
-        self._connection.write(self._deflater.compress_and_flush(bytes))
-
-
-def _is_ewouldblock_errno(error_number):
-    """Returns True iff error_number indicates that receive operation would
-    block. To make this portable, we check availability of errno and then
-    compare them.
-    """
-
-    for error_name in ['WSAEWOULDBLOCK', 'EWOULDBLOCK', 'EAGAIN']:
-        if (error_name in dir(errno) and
-            error_number == getattr(errno, error_name)):
-            return True
-    return False
-
-
-def drain_received_data(raw_socket):
-    # Set the socket non-blocking.
-    original_timeout = raw_socket.gettimeout()
-    raw_socket.settimeout(0.0)
-
-    drained_data = []
-
-    # Drain until the socket is closed or no data is immediately
-    # available for read.
-    while True:
-        try:
-            data = raw_socket.recv(1)
-            if not data:
-                break
-            drained_data.append(data)
-        except socket.error, e:
-            # e can be either a pair (errno, string) or just a string (or
-            # something else) telling what went wrong. We suppress only
-            # the errors that indicates that the socket blocks. Those
-            # exceptions can be parsed as a pair (errno, string).
-            try:
-                error_number, message = e
-            except:
-                # Failed to parse socket.error.
-                raise e
-
-            if _is_ewouldblock_errno(error_number):
-                break
-            else:
-                raise e
-
-    # Rollback timeout value.
-    raw_socket.settimeout(original_timeout)
-
-    return ''.join(drained_data)
-
-
 # vi:sts=4 sw=4 et
diff --git a/Tools/Scripts/webkitpy/tool/bot/irc_command.py b/Tools/Scripts/webkitpy/tool/bot/irc_command.py
deleted file mode 100644
index c168376..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/irc_command.py
+++ /dev/null
@@ -1,356 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import itertools
-import random
-import re
-
-from webkitpy.common.config import irc as config_irc
-from webkitpy.common.config import urls
-from webkitpy.common.config.committers import CommitterList
-from webkitpy.common.net.web import Web
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.tool.bot.queueengine import TerminateQueue
-from webkitpy.tool.grammar import join_with_separators
-
-
-def _post_error_and_check_for_bug_url(tool, nicks_string, exception):
-    tool.irc().post("%s" % exception)
-    bug_id = urls.parse_bug_id(exception.output)
-    if bug_id:
-        bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
-        tool.irc().post("%s: Ugg...  Might have created %s" % (nicks_string, bug_url))
-
-
-# FIXME: Merge with Command?
-class IRCCommand(object):
-    usage_string = None
-    help_string = None
-
-    def execute(self, nick, args, tool, sheriff):
-        raise NotImplementedError("subclasses must implement")
-
-    @classmethod
-    def usage(cls, nick):
-        return "%s: Usage: %s" % (nick, cls.usage_string)
-
-    @classmethod
-    def help(cls, nick):
-        return "%s: %s" % (nick, cls.help_string)
-
-
-class CreateBug(IRCCommand):
-    usage_string = "create-bug BUG_TITLE"
-    help_string = "Creates a Bugzilla bug with the given title."
-
-    def execute(self, nick, args, tool, sheriff):
-        if not args:
-            return self.usage(nick)
-
-        bug_title = " ".join(args)
-        bug_description = "%s\nRequested by %s on %s." % (bug_title, nick, config_irc.channel)
-
-        # There happens to be a committers list hung off of Bugzilla, so
-        # re-using that one makes things easiest for now.
-        requester = tool.bugs.committers.contributor_by_irc_nickname(nick)
-        requester_email = requester.bugzilla_email() if requester else None
-
-        try:
-            bug_id = tool.bugs.create_bug(bug_title, bug_description, cc=requester_email, assignee=requester_email)
-            bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
-            return "%s: Created bug: %s" % (nick, bug_url)
-        except Exception, e:
-            return "%s: Failed to create bug:\n%s" % (nick, e)
-
-
-class Help(IRCCommand):
-    usage_string = "help [COMMAND]"
-    help_string = "Provides help on individual sheriffbot commands."
-
-    def execute(self, nick, args, tool, sheriff):
-        if args:
-            for command_name in args:
-                if command_name in commands:
-                    self._post_command_help(nick, tool, commands[command_name])
-        else:
-            tool.irc().post("%s: Available commands: %s" % (nick, ", ".join(sorted(visible_commands.keys()))))
-            tool.irc().post('%s: Type "sheriffbot: help COMMAND" for help on individual commands.' % nick)
-
-    def _post_command_help(self, nick, tool, command):
-        tool.irc().post(command.usage(nick))
-        tool.irc().post(command.help(nick))
-        aliases = " ".join(sorted(filter(lambda alias: commands[alias] == command and alias not in visible_commands, commands)))
-        if aliases:
-            tool.irc().post("%s: Aliases: %s" % (nick, aliases))
-
-
-class Hi(IRCCommand):
-    usage_string = "hi"
-    help_string = "Retrieves a random quip from Bugzilla."
-
-    def execute(self, nick, args, tool, sheriff):
-        quips = tool.bugs.quips()
-        quips.append('"Only you can prevent forest fires." -- Smokey the Bear')
-        return random.choice(quips)
-
-
-class Restart(IRCCommand):
-    usage_string = "restart"
-    help_string = "Restarts sherrifbot.  Will update its WebKit checkout, and re-join the channel momentarily."
-
-    def execute(self, nick, args, tool, sheriff):
-        tool.irc().post("Restarting...")
-        raise TerminateQueue()
-
-
-class RollChromiumDEPS(IRCCommand):
-    usage_string = "roll-chromium-deps REVISION"
-    help_string = "Rolls WebKit's Chromium DEPS to the given revision. Give LKGR as the revision number to use the last known good revision. This lands an unreviewed patch and provides the bug URL."
-
-    def _parse_args(self, args):
-        if not args:
-            return None
-        revision = args[0].lstrip("r")
-        if revision == "LKGR" or revision.isdigit():
-            return revision
-        return None
-
-    def _expand_irc_nickname(self, nick):
-        contributor = CommitterList().contributor_by_irc_nickname(nick)
-        if contributor:
-            return str(contributor)
-        return nick
-
-    def execute(self, nick, args, tool, sheriff):
-        revision = self._parse_args(args)
-        if not revision:
-            return self.usage(nick)
-
-        roll_target = "r%s" % revision if revision.isdigit() else "last-known good revision"
-        tool.irc().post("%s: Rolling Chromium DEPS to %s" % (nick, roll_target))
-        changelog_message = "Unreviewed.  Rolled Chromium DEPS to %s.  Requested by %s via sheriffbot.\n\n" % (roll_target, self._expand_irc_nickname(nick))
-
-        try:
-            bug_id = sheriff.post_chromium_deps_roll(revision, roll_target, changelog_message)
-            bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
-            return "%s: Created DEPS roll: %s" % (nick, bug_url)
-        except ScriptError, e:
-            tool.irc().post("%s: Failed to create DEPS roll:" % nick)
-            pre_bug_error_messages = [
-                r"Current Chromium DEPS revision \d+ is newer than \d+\.",
-                r"Unable to update Chromium DEPS\.",
-                r"Unable to parse LKGR from: .*",
-                r"Unable to reach LKGR source: .*",
-                r"Invalid revision number\.",
-            ]
-            for message in pre_bug_error_messages:
-                match = re.search(message, e.output)
-                if match:
-                    return "%s: %s" % (nick, match.group(0))
-            _post_error_and_check_for_bug_url(tool, nick, e)
-
-
-class Rollout(IRCCommand):
-    usage_string = "rollout SVN_REVISION [SVN_REVISIONS] REASON"
-    help_string = "Opens a rollout bug, CCing author + reviewer, and attaching the reverse-diff of the given revisions marked as commit-queue=?."
-
-    def _extract_revisions(self, arg):
-        revision_list = []
-        possible_revisions = arg.split(",")
-        for revision in possible_revisions:
-            revision = revision.strip()
-            if not revision:
-                continue
-            revision = revision.lstrip("r")
-            # If one part of the arg isn't in the correct format,
-            # then none of the arg should be considered a revision.
-            if not revision.isdigit():
-                return None
-            revision_list.append(int(revision))
-        return revision_list
-
-    def _parse_args(self, args):
-        if not args:
-            return (None, None)
-
-        svn_revision_list = []
-        remaining_args = args[:]
-        # First process all revisions.
-        while remaining_args:
-            new_revisions = self._extract_revisions(remaining_args[0])
-            if not new_revisions:
-                break
-            svn_revision_list += new_revisions
-            remaining_args = remaining_args[1:]
-
-        # Was there a revision number?
-        if not len(svn_revision_list):
-            return (None, None)
-
-        # Everything left is the reason.
-        rollout_reason = " ".join(remaining_args)
-        return svn_revision_list, rollout_reason
-
-    def _responsible_nicknames_from_revisions(self, tool, sheriff, svn_revision_list):
-        commit_infos = map(tool.checkout().commit_info_for_revision, svn_revision_list)
-        nickname_lists = map(sheriff.responsible_nicknames_from_commit_info, commit_infos)
-        return sorted(set(itertools.chain(*nickname_lists)))
-
-    def _nicks_string(self, tool, sheriff, requester_nick, svn_revision_list):
-        # FIXME: _parse_args guarentees that our svn_revision_list is all numbers.
-        # However, it's possible our checkout will not include one of the revisions,
-        # so we may need to catch exceptions from commit_info_for_revision here.
-        target_nicks = [requester_nick] + self._responsible_nicknames_from_revisions(tool, sheriff, svn_revision_list)
-        return ", ".join(target_nicks)
-
-    def _update_working_copy(self, tool):
-        tool.scm().discard_local_changes()
-        tool.executive.run_and_throw_if_fail(tool.deprecated_port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root)
-
-    def execute(self, nick, args, tool, sheriff):
-        svn_revision_list, rollout_reason = self._parse_args(args)
-
-        if (not svn_revision_list or not rollout_reason):
-            return self.usage(nick)
-
-        revision_urls_string = join_with_separators([urls.view_revision_url(revision) for revision in svn_revision_list])
-        tool.irc().post("%s: Preparing rollout for %s ..." % (nick, revision_urls_string))
-
-        self._update_working_copy(tool)
-
-        # FIXME: IRCCommand should bind to a tool and have a self._tool like Command objects do.
-        # Likewise we should probably have a self._sheriff.
-        nicks_string = self._nicks_string(tool, sheriff, nick, svn_revision_list)
-
-        try:
-            complete_reason = "%s (Requested by %s on %s)." % (
-                rollout_reason, nick, config_irc.channel)
-            bug_id = sheriff.post_rollout_patch(svn_revision_list, complete_reason)
-            bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
-            tool.irc().post("%s: Created rollout: %s" % (nicks_string, bug_url))
-        except ScriptError, e:
-            tool.irc().post("%s: Failed to create rollout patch:" % nicks_string)
-            _post_error_and_check_for_bug_url(tool, nicks_string, e)
-
-
-class Sheriffs(IRCCommand):
-    usage_string = "sheriffs"
-    help_string = "Retrieves who the current Chromium WebKit sheriffs are from: %s" % urls.chromium_webkit_sheriff_url
-
-    def _retrieve_webkit_sheriffs(self, tool, url):
-        try:
-            sheriff_js = tool.web.get_binary(url, True)
-        except:
-            return None
-        if sheriff_js == None:
-            return None
-
-        match = re.search(r"document.write\('(.*)'\)", sheriff_js)
-
-        try:
-            return match.group(1)
-        except:
-            return None
-
-    def execute(self, nick, args, tool, sheriff):
-        if not args:
-            url = urls.chromium_webkit_sheriff_url
-        else:
-            url = args[0]
-
-        sheriffs = self._retrieve_webkit_sheriffs(tool, url)
-        if sheriffs == None:
-            return "%s: Failed to parse URL: %s" % (nick, url)
-
-        sheriff_name = "Chromium Webkit sheriff"
-        sheriff_count = len(sheriffs.split())
-        if sheriff_count == 0:
-            return "%s: There are no %ss currently assigned." % (nick, sheriff_name)
-        if sheriff_count == 1:
-            return "%s: The current %s is: %s" % (nick, sheriff_name, sheriffs)
-        return "%s: The current %ss are: %s" % (nick, sheriff_name, sheriffs)
-
-
-class Whois(IRCCommand):
-    usage_string = "whois SEARCH_STRING"
-    help_string = "Searches known contributors and returns any matches with irc, email and full name. Wild card * permitted."
-
-    def _nick_or_full_record(self, contributor):
-        if contributor.irc_nicknames:
-            return ', '.join(contributor.irc_nicknames)
-        return unicode(contributor)
-
-    def execute(self, nick, args, tool, sheriff):
-        if not args:
-            return self.usage(nick)
-        search_string = " ".join(args)
-        # FIXME: We should get the ContributorList off the tool somewhere.
-        contributors = CommitterList().contributors_by_search_string(search_string)
-        if not contributors:
-            return "%s: Sorry, I don't know any contributors matching '%s'." % (nick, search_string)
-        if len(contributors) > 5:
-            return "%s: More than 5 contributors match '%s', could you be more specific?" % (nick, search_string)
-        if len(contributors) == 1:
-            contributor = contributors[0]
-            if not contributor.irc_nicknames:
-                return "%s: %s hasn't told me their nick. Boo hoo :-(" % (nick, contributor)
-            if contributor.emails and search_string.lower() not in map(lambda email: email.lower(), contributor.emails):
-                formattedEmails = ', '.join(contributor.emails)
-                return "%s: %s is %s (%s). Why do you ask?" % (nick, search_string, self._nick_or_full_record(contributor), formattedEmails)
-            else:
-                return "%s: %s is %s. Why do you ask?" % (nick, search_string, self._nick_or_full_record(contributor))
-        contributor_nicks = map(self._nick_or_full_record, contributors)
-        contributors_string = join_with_separators(contributor_nicks, only_two_separator=" or ", last_separator=', or ')
-        return "%s: I'm not sure who you mean?  %s could be '%s'." % (nick, contributors_string, search_string)
-
-
-# FIXME: Lame.  We should have an auto-registering CommandCenter.
-visible_commands = {
-    "create-bug": CreateBug,
-    "help": Help,
-    "hi": Hi,
-    "restart": Restart,
-    "roll-chromium-deps": RollChromiumDEPS,
-    "rollout": Rollout,
-    "sheriffs": Sheriffs,
-    "whois": Whois,
-}
-
-# Add revert as an "easter egg" command. Why?
-# revert is the same as rollout and it would be confusing to list both when
-# they do the same thing. However, this command is a very natural thing for
-# people to use and it seems silly to have them hunt around for "rollout" instead.
-commands = visible_commands.copy()
-commands["revert"] = Rollout
-commands["gardeners"] = Sheriffs
-# Enough people misspell "sheriffs" that they've requested aliases for the command.
-commands["sherriffs"] = Sheriffs
-commands["sherifs"] = Sheriffs
-commands["sherrifs"] = Sheriffs
-# "hello" Alias for "hi" command for the purposes of testing aliases
-commands["hello"] = Hi
diff --git a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py b/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
deleted file mode 100644
index 0517744..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import unittest2 as unittest
-
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.tool.bot.irc_command import *
-from webkitpy.tool.mocktool import MockTool
-from webkitpy.common.net.web_mock import MockWeb
-from webkitpy.common.system.executive_mock import MockExecutive
-
-
-class IRCCommandTest(unittest.TestCase):
-    def test_whois(self):
-        whois = Whois()
-        self.assertEqual("tom: Usage: whois SEARCH_STRING",
-                          whois.execute("tom", [], None, None))
-        self.assertEqual("tom: Adam Barth is abarth (abarth@webkit.org). Why do you ask?",
-                          whois.execute("tom", ["Adam", "Barth"], None, None))
-        self.assertEqual("tom: Sorry, I don't know any contributors matching 'unknown@example.com'.",
-                          whois.execute("tom", ["unknown@example.com"], None, None))
-        self.assertEqual("tom: tonyg@chromium.org is tonyg-cr. Why do you ask?",
-                          whois.execute("tom", ["tonyg@chromium.org"], None, None))
-        self.assertEqual("tom: TonyG@Chromium.org is tonyg-cr. Why do you ask?",
-                          whois.execute("tom", ["TonyG@Chromium.org"], None, None))
-        self.assertEqual("tom: rniwa is rniwa (rniwa@webkit.org). Why do you ask?",
-                          whois.execute("tom", ["rniwa"], None, None))
-        self.assertEqual("tom: lopez is xan (xan.lopez@gmail.com, xan@gnome.org, xan@webkit.org, xlopez@igalia.com). Why do you ask?",
-                          whois.execute("tom", ["lopez"], None, None))
-        self.assertEqual('tom: "Vicki Murley" <vicki@apple.com> hasn\'t told me their nick. Boo hoo :-(',
-                          whois.execute("tom", ["vicki@apple.com"], None, None))
-        self.assertEqual('tom: I\'m not sure who you mean?  gavinp or gbarra could be \'Gavin\'.',
-                          whois.execute("tom", ["Gavin"], None, None))
-        self.assertEqual('tom: More than 5 contributors match \'david\', could you be more specific?',
-                          whois.execute("tom", ["david"], None, None))
-
-    @staticmethod
-    def _sheriff_test_data_url(suffix):
-        return "file://" + os.path.join(os.path.dirname(os.path.abspath(__file__)), "testdata", "webkit_sheriff_%s.js" % suffix)
-
-    def test_sheriffs(self):
-        sheriffs = Sheriffs()
-        tool = MockTool(web=MockWeb({
-          "test_0": "document.write('');",
-          "test_1": "document.write('test_user');",
-          "test_2": "document.write('test_user_1, test_user_2');",
-          "test_malformed": "malformed",
-        }))
-        self.assertEqual("tom: There are no Chromium Webkit sheriffs currently assigned.",
-                         sheriffs.execute("tom", ["test_0"], tool, None))
-        self.assertEqual("tom: The current Chromium Webkit sheriff is: test_user",
-                         sheriffs.execute("tom", ["test_1"], tool, None))
-        self.assertEqual("tom: The current Chromium Webkit sheriffs are: test_user_1, test_user_2",
-                         sheriffs.execute("tom", ["test_2"], tool, None))
-        self.assertEqual("tom: Failed to parse URL: test_malformed",
-                         sheriffs.execute("tom", ["test_malformed"], tool, None))
-        self.assertEqual("tom: Failed to parse URL: invalid",
-                         sheriffs.execute("tom", ["invalid"], tool, None))
-
-    def test_create_bug(self):
-        create_bug = CreateBug()
-        self.assertEqual("tom: Usage: create-bug BUG_TITLE",
-                          create_bug.execute("tom", [], None, None))
-
-        example_args = ["sherrif-bot", "should", "have", "a", "create-bug", "command"]
-        tool = MockTool()
-
-        # MockBugzilla has a create_bug, but it logs to stderr, this avoids any logging.
-        tool.bugs.create_bug = lambda a, b, cc=None, assignee=None: 50004
-        self.assertEqual("tom: Created bug: http://example.com/50004",
-                          create_bug.execute("tom", example_args, tool, None))
-
-        def mock_create_bug(title, description, cc=None, assignee=None):
-            raise Exception("Exception from bugzilla!")
-        tool.bugs.create_bug = mock_create_bug
-        self.assertEqual("tom: Failed to create bug:\nException from bugzilla!",
-                          create_bug.execute("tom", example_args, tool, None))
-
-    def test_roll_chromium_deps(self):
-        roll = RollChromiumDEPS()
-        self.assertIsNone(roll._parse_args([]))
-        self.assertIsNone(roll._parse_args(["invalid"]))
-        self.assertEqual("1234", roll._parse_args(["1234"]))
-        self.assertEqual("1234", roll._parse_args(["r1234"]))
-        self.assertEqual("LKGR", roll._parse_args(["LKGR"]))
-        self.assertEqual('"Alan Cutter" <alancutter@chromium.org>', roll._expand_irc_nickname("alancutter"))
-        self.assertEqual("unknown_irc_nickname", roll._expand_irc_nickname("unknown_irc_nickname"))
-
-    def test_rollout_updates_working_copy(self):
-        rollout = Rollout()
-        tool = MockTool()
-        tool.executive = MockExecutive(should_log=True)
-        expected_logs = "MOCK run_and_throw_if_fail: ['mock-update-webkit'], cwd=/mock-checkout\n"
-        OutputCapture().assert_outputs(self, rollout._update_working_copy, [tool], expected_logs=expected_logs)
-
-    def test_rollout(self):
-        rollout = Rollout()
-        self.assertEqual(([1234], "testing foo"),
-                          rollout._parse_args(["1234", "testing", "foo"]))
-
-        self.assertEqual(([554], "testing foo"),
-                          rollout._parse_args(["r554", "testing", "foo"]))
-
-        self.assertEqual(([556, 792], "testing foo"),
-                          rollout._parse_args(["r556", "792", "testing", "foo"]))
-
-        self.assertEqual(([128, 256], "testing foo"),
-                          rollout._parse_args(["r128,r256", "testing", "foo"]))
-
-        self.assertEqual(([512, 1024, 2048], "testing foo"),
-                          rollout._parse_args(["512,", "1024,2048", "testing", "foo"]))
-
-        # Test invalid argument parsing:
-        self.assertEqual((None, None), rollout._parse_args([]))
-        self.assertEqual((None, None), rollout._parse_args(["--bar", "1234"]))
-
-        # Invalid arguments result in the USAGE message.
-        self.assertEqual("tom: Usage: rollout SVN_REVISION [SVN_REVISIONS] REASON",
-                          rollout.execute("tom", [], None, None))
-
-        # FIXME: We need a better way to test IRCCommands which call tool.irc().post()
diff --git a/Tools/Scripts/webkitpy/tool/bot/ircbot.py b/Tools/Scripts/webkitpy/tool/bot/ircbot.py
deleted file mode 100644
index 0c45b97..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/ircbot.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.tool.bot.queueengine import TerminateQueue
-from webkitpy.tool.bot.irc_command import IRCCommand
-from webkitpy.common.net.irc.ircbot import IRCBotDelegate
-from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
-
-
-class _IRCThreadTearoff(IRCBotDelegate):
-    def __init__(self, name, password, message_queue, wakeup_event):
-        self._name = name
-        self._password = password
-        self._message_queue = message_queue
-        self._wakeup_event = wakeup_event
-
-    # IRCBotDelegate methods
-
-    def irc_message_received(self, nick, message):
-        self._message_queue.post([nick, message])
-        self._wakeup_event.set()
-
-    def irc_nickname(self):
-        return self._name
-
-    def irc_password(self):
-        return self._password
-
-
-class Eliza(IRCCommand):
-    therapist = None
-
-    def __init__(self):
-        if not self.therapist:
-            import webkitpy.thirdparty.autoinstalled.eliza as eliza
-            Eliza.therapist = eliza.eliza()
-
-    def execute(self, nick, args, tool, sheriff):
-        return "%s: %s" % (nick, self.therapist.respond(" ".join(args)))
-
-
-class IRCBot(object):
-    def __init__(self, name, tool, agent, commands):
-        self._name = name
-        self._tool = tool
-        self._agent = agent
-        self._message_queue = ThreadedMessageQueue()
-        self._commands = commands
-
-    def irc_delegate(self):
-        return _IRCThreadTearoff(self._name, self._tool.irc_password,
-            self._message_queue, self._tool.wakeup_event)
-
-    def _parse_command_and_args(self, request):
-        tokenized_request = request.strip().split(" ")
-        command = self._commands.get(tokenized_request[0])
-        args = tokenized_request[1:]
-        if not command:
-            # Give the peoples someone to talk with.
-            command = Eliza
-            args = tokenized_request
-        return (command, args)
-
-    def process_message(self, requester_nick, request):
-        command, args = self._parse_command_and_args(request)
-        try:
-            response = command().execute(requester_nick, args, self._tool, self._agent)
-            if response:
-                self._tool.irc().post(response)
-        except TerminateQueue:
-            raise
-        # This will catch everything else. SystemExit and KeyboardInterrupt are not subclasses of Exception, so we won't catch those.
-        except Exception, e:
-            self._tool.irc().post("Exception executing command: %s" % e)
-
-    def process_pending_messages(self):
-        (messages, is_running) = self._message_queue.take_all()
-        for message in messages:
-            (nick, request) = message
-            self.process_message(nick, request)
diff --git a/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py b/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
deleted file mode 100644
index c83569b..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-import random
-
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.tool.bot import irc_command
-from webkitpy.tool.bot.queueengine import TerminateQueue
-from webkitpy.tool.bot.sheriff import Sheriff
-from webkitpy.tool.bot.ircbot import IRCBot
-from webkitpy.tool.bot.ircbot import Eliza
-from webkitpy.tool.bot.sheriff_unittest import MockSheriffBot
-from webkitpy.tool.mocktool import MockTool
-
-
-def run(message):
-    tool = MockTool()
-    tool.ensure_irc_connected(None)
-    bot = IRCBot("sheriffbot", tool, Sheriff(tool, MockSheriffBot()), irc_command.commands)
-    bot._message_queue.post(["mock_nick", message])
-    bot.process_pending_messages()
-
-
-class IRCBotTest(unittest.TestCase):
-    def test_eliza(self):
-        eliza = Eliza()
-        eliza.execute("tom", "hi", None, None)
-        eliza.execute("tom", "bye", None, None)
-
-    def test_parse_command_and_args(self):
-        tool = MockTool()
-        bot = IRCBot("sheriffbot", tool, Sheriff(tool, MockSheriffBot()), irc_command.commands)
-        self.assertEqual(bot._parse_command_and_args(""), (Eliza, [""]))
-        self.assertEqual(bot._parse_command_and_args("   "), (Eliza, [""]))
-        self.assertEqual(bot._parse_command_and_args(" hi "), (irc_command.Hi, []))
-        self.assertEqual(bot._parse_command_and_args(" hi there "), (irc_command.Hi, ["there"]))
-
-    def test_exception_during_command(self):
-        tool = MockTool()
-        tool.ensure_irc_connected(None)
-        bot = IRCBot("sheriffbot", tool, Sheriff(tool, MockSheriffBot()), irc_command.commands)
-
-        class CommandWithException(object):
-            def execute(self, nick, args, tool, sheriff):
-                raise Exception("mock_exception")
-
-        bot._parse_command_and_args = lambda request: (CommandWithException, [])
-        expected_logs = 'MOCK: irc.post: Exception executing command: mock_exception\n'
-        OutputCapture().assert_outputs(self, bot.process_message, args=["mock_nick", "ignored message"], expected_logs=expected_logs)
-
-        class CommandWithException(object):
-            def execute(self, nick, args, tool, sheriff):
-                raise KeyboardInterrupt()
-
-        bot._parse_command_and_args = lambda request: (CommandWithException, [])
-        # KeyboardInterrupt and SystemExit are not subclasses of Exception and thus correctly will not be caught.
-        OutputCapture().assert_outputs(self, bot.process_message, args=["mock_nick", "ignored message"], expected_exception=KeyboardInterrupt)
-
-    def test_hi(self):
-        random.seed(23324)
-        expected_logs = 'MOCK: irc.post: "Only you can prevent forest fires." -- Smokey the Bear\n'
-        OutputCapture().assert_outputs(self, run, args=["hi"], expected_logs=expected_logs)
-
-    def test_help(self):
-        expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, sheriffs, whois\nMOCK: irc.post: mock_nick: Type "sheriffbot: help COMMAND" for help on individual commands.\n'
-        OutputCapture().assert_outputs(self, run, args=["help"], expected_logs=expected_logs)
-        expected_logs = 'MOCK: irc.post: mock_nick: Usage: hi\nMOCK: irc.post: mock_nick: Retrieves a random quip from Bugzilla.\nMOCK: irc.post: mock_nick: Aliases: hello\n'
-        OutputCapture().assert_outputs(self, run, args=["help hi"], expected_logs=expected_logs)
-        OutputCapture().assert_outputs(self, run, args=["help hello"], expected_logs=expected_logs)
-
-    def test_restart(self):
-        expected_logs = "MOCK: irc.post: Restarting...\n"
-        OutputCapture().assert_outputs(self, run, args=["restart"], expected_logs=expected_logs, expected_exception=TerminateQueue)
-
-    def test_rollout(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654 ...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout 21654 This patch broke the world"], expected_logs=expected_logs)
-
-    def test_revert(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654 ...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["revert 21654 This patch broke the world"], expected_logs=expected_logs)
-
-    def test_roll_chromium_deps(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Rolling Chromium DEPS to r21654\nMOCK: irc.post: mock_nick: Created DEPS roll: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["roll-chromium-deps 21654"], expected_logs=expected_logs)
-
-    def test_roll_chromium_deps_to_lkgr(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Rolling Chromium DEPS to last-known good revision\nMOCK: irc.post: mock_nick: Created DEPS roll: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["roll-chromium-deps LKGR"], expected_logs=expected_logs)
-
-    def test_multi_rollout(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654, http://trac.webkit.org/changeset/21655, and http://trac.webkit.org/changeset/21656 ...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout 21654 21655 21656 This 21654 patch broke the world"], expected_logs=expected_logs)
-
-    def test_rollout_with_r_in_svn_revision(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654 ...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout r21654 This patch broke the world"], expected_logs=expected_logs)
-
-    def test_multi_rollout_with_r_in_svn_revision(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654, http://trac.webkit.org/changeset/21655, and http://trac.webkit.org/changeset/21656 ...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout r21654 21655 r21656 This r21654 patch broke the world"], expected_logs=expected_logs)
-
-    def test_rollout_bananas(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Usage: rollout SVN_REVISION [SVN_REVISIONS] REASON\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout bananas"], expected_logs=expected_logs)
-
-    def test_rollout_invalidate_revision(self):
-        # When folks pass junk arguments, we should just spit the usage back at them.
-        expected_logs = "MOCK: irc.post: mock_nick: Usage: rollout SVN_REVISION [SVN_REVISIONS] REASON\n"
-        OutputCapture().assert_outputs(self, run,
-                                       args=["rollout --component=Tools 21654"],
-                                       expected_logs=expected_logs)
-
-    def test_rollout_invalidate_reason(self):
-        # FIXME: I'm slightly confused as to why this doesn't return the USAGE message.
-        expected_logs = """MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654 ...
-MOCK: irc.post: mock_nick, abarth, darin, eseidel: Failed to create rollout patch:
-MOCK: irc.post: The rollout reason may not begin with - (\"-bad (Requested by mock_nick on #webkit).\").
-"""
-        OutputCapture().assert_outputs(self, run,
-                                       args=["rollout 21654 -bad"],
-                                       expected_logs=expected_logs)
-
-    def test_multi_rollout_invalidate_reason(self):
-        expected_logs = """MOCK: irc.post: mock_nick: Preparing rollout for http://trac.webkit.org/changeset/21654, http://trac.webkit.org/changeset/21655, and http://trac.webkit.org/changeset/21656 ...
-MOCK: irc.post: mock_nick, abarth, darin, eseidel: Failed to create rollout patch:
-MOCK: irc.post: The rollout reason may not begin with - (\"-bad (Requested by mock_nick on #webkit).\").
-"""
-        OutputCapture().assert_outputs(self, run,
-                                       args=["rollout "
-                                             "21654 21655 r21656 -bad"],
-                                       expected_logs=expected_logs)
-
-    def test_rollout_no_reason(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Usage: rollout SVN_REVISION [SVN_REVISIONS] REASON\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout 21654"], expected_logs=expected_logs)
-
-    def test_multi_rollout_no_reason(self):
-        expected_logs = "MOCK: irc.post: mock_nick: Usage: rollout SVN_REVISION [SVN_REVISIONS] REASON\n"
-        OutputCapture().assert_outputs(self, run, args=["rollout 21654 21655 r21656"], expected_logs=expected_logs)
diff --git a/Tools/Scripts/webkitpy/tool/bot/sheriff.py b/Tools/Scripts/webkitpy/tool/bot/sheriff.py
deleted file mode 100644
index 38e4bf2..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/sheriff.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright (c) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.common.config import urls
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.tool.grammar import join_with_separators
-
-
-class Sheriff(object):
-    def __init__(self, tool, sheriffbot):
-        self._tool = tool
-        self._sheriffbot = sheriffbot
-
-    def responsible_nicknames_from_commit_info(self, commit_info):
-        nestedList = [party.irc_nicknames for party in commit_info.responsible_parties() if party.irc_nicknames]
-        return reduce(lambda list, childList: list + childList, nestedList)
-
-    def post_irc_warning(self, commit_info, builders):
-        irc_nicknames = sorted(self.responsible_nicknames_from_commit_info(commit_info))
-        irc_prefix = ": " if irc_nicknames else ""
-        irc_message = "%s%s%s might have broken %s" % (
-            ", ".join(irc_nicknames),
-            irc_prefix,
-            urls.view_revision_url(commit_info.revision()),
-            join_with_separators([builder.name() for builder in builders]))
-
-        self._tool.irc().post(irc_message)
-
-    def post_irc_summary(self, failure_map):
-        failing_tests = failure_map.failing_tests()
-        if not failing_tests:
-            return
-        test_list_limit = 5
-        irc_message = "New failures: %s" % ", ".join(sorted(failing_tests)[:test_list_limit])
-        failure_count = len(failing_tests)
-        if failure_count > test_list_limit:
-            irc_message += " (and %s more...)" % (failure_count - test_list_limit)
-        self._tool.irc().post(irc_message)
-
-    def post_rollout_patch(self, svn_revision_list, rollout_reason):
-        # Ensure that svn revisions are numbers (and not options to
-        # create-rollout).
-        try:
-            svn_revisions = " ".join([str(int(revision)) for revision in svn_revision_list])
-        except:
-            raise ScriptError(message="Invalid svn revision number \"%s\"."
-                              % " ".join(svn_revision_list))
-
-        if rollout_reason.startswith("-"):
-            raise ScriptError(message="The rollout reason may not begin "
-                              "with - (\"%s\")." % rollout_reason)
-
-        output = self._sheriffbot.run_webkit_patch([
-            "create-rollout",
-            "--force-clean",
-            # In principle, we should pass --non-interactive here, but it
-            # turns out that create-rollout doesn't need it yet.  We can't
-            # pass it prophylactically because we reject unrecognized command
-            # line switches.
-            "--parent-command=sheriff-bot",
-            svn_revisions,
-            rollout_reason,
-        ])
-        return urls.parse_bug_id(output)
-
-    def post_chromium_deps_roll(self, revision, revision_name, changelog_message):
-        args = [
-            "post-chromium-deps-roll",
-            "--force-clean",
-            "--non-interactive",
-            "--parent-command=sheriff-bot",
-        ]
-        # revision can be None, but revision_name is always something meaningful.
-        args += [revision, revision_name, changelog_message]
-        output = self._sheriffbot.run_webkit_patch(args)
-        return urls.parse_bug_id(output)
-
-    def post_blame_comment_on_bug(self, commit_info, builders, tests):
-        if not commit_info.bug_id():
-            return
-        comment = "%s might have broken %s" % (
-            urls.view_revision_url(commit_info.revision()),
-            join_with_separators([builder.name() for builder in builders]))
-        if tests:
-            comment += "\nThe following tests are not passing:\n"
-            comment += "\n".join(tests)
-        self._tool.bugs.post_comment_to_bug(commit_info.bug_id(),
-                                            comment,
-                                            cc=self._sheriffbot.watchers)
diff --git a/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py b/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
deleted file mode 100644
index cf989c9..0000000
--- a/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.common.net.buildbot import Builder
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.thirdparty.mock import Mock
-from webkitpy.tool.bot.sheriff import Sheriff
-from webkitpy.tool.mocktool import MockTool
-
-
-class MockSheriffBot(object):
-    name = "mock-sheriff-bot"
-    watchers = [
-        "watcher@example.com",
-    ]
-
-    def run_webkit_patch(self, args):
-        return "Created bug https://bugs.webkit.org/show_bug.cgi?id=36936\n"
-
-
-class SheriffTest(unittest.TestCase):
-    def test_post_blame_comment_on_bug(self):
-        def run():
-            sheriff = Sheriff(MockTool(), MockSheriffBot())
-            builders = [
-                Builder("Foo", None),
-                Builder("Bar", None),
-            ]
-            commit_info = Mock()
-            commit_info.bug_id = lambda: None
-            commit_info.revision = lambda: 4321
-            # Should do nothing with no bug_id
-            sheriff.post_blame_comment_on_bug(commit_info, builders, [])
-            sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1", "mock-test-2"])
-            # Should try to post a comment to the bug, but MockTool.bugs does nothing.
-            commit_info.bug_id = lambda: 1234
-            sheriff.post_blame_comment_on_bug(commit_info, builders, [])
-            sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1"])
-            sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1", "mock-test-2"])
-
-        expected_logs = u"""MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
---- Begin comment ---
-http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
---- End comment ---
-
-MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
---- Begin comment ---
-http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
-The following tests are not passing:
-mock-test-1
---- End comment ---
-
-MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
---- Begin comment ---
-http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
-The following tests are not passing:
-mock-test-1
-mock-test-2
---- End comment ---
-
-"""
-        OutputCapture().assert_outputs(self, run, expected_logs=expected_logs)
diff --git a/Tools/Scripts/webkitpy/tool/commands/__init__.py b/Tools/Scripts/webkitpy/tool/commands/__init__.py
index f4af47e..24646fc 100644
--- a/Tools/Scripts/webkitpy/tool/commands/__init__.py
+++ b/Tools/Scripts/webkitpy/tool/commands/__init__.py
@@ -10,15 +10,12 @@
 from webkitpy.tool.commands.earlywarningsystem import *
 from webkitpy.tool.commands.findusers import FindUsers
 from webkitpy.tool.commands.gardenomatic import GardenOMatic
-from webkitpy.tool.commands.newcommitbot import NewCommitBot
 from webkitpy.tool.commands.openbugs import OpenBugs
-from webkitpy.tool.commands.perfalizer import Perfalizer
 from webkitpy.tool.commands.prettydiff import PrettyDiff
 from webkitpy.tool.commands.queries import *
 from webkitpy.tool.commands.queues import *
 from webkitpy.tool.commands.rebaseline import Rebaseline
 from webkitpy.tool.commands.rebaselineserver import RebaselineServer
 from webkitpy.tool.commands.roll import *
-from webkitpy.tool.commands.sheriffbot import *
 from webkitpy.tool.commands.upload import *
 from webkitpy.tool.commands.suggestnominations import *
diff --git a/Tools/Scripts/webkitpy/tool/commands/download_unittest.py b/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
index bc7fc4f..dbbdf2d 100644
--- a/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
@@ -73,6 +73,8 @@
 
 
 class DownloadCommandsTest(CommandsTest):
+    maxDiff = None
+
     def _default_options(self):
         options = MockOptions()
         options.build = True
@@ -158,7 +160,7 @@
     def test_land_cowboy(self):
         expected_logs = """MOCK run_and_throw_if_fail: ['mock-prepare-ChangeLog', '--email=MOCK email', '--merge-base=None', 'MockFile1'], cwd=/mock-checkout
 MOCK run_and_throw_if_fail: ['mock-check-webkit-style', '--git-commit', 'MOCK git commit', '--diff-files', 'MockFile1', '--filter', '-changelog'], cwd=/mock-checkout
-MOCK run_command: ['ruby', '-I', '/mock-checkout/Websites/bugs.webkit.org/PrettyPatch', '/mock-checkout/Websites/bugs.webkit.org/PrettyPatch/prettify.rb'], cwd=None, input=Patch1
+MOCK run_command: ['ruby', '-I', '/mock-checkout/Tools/Scripts/webkitruby/PrettyPatch', '/mock-checkout/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb'], cwd=None, input=Patch1
 MOCK: user.open_url: file://...
 Was that diff correct?
 Building WebKit
diff --git a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
index bd24274..90501fc 100644
--- a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
+++ b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -212,7 +212,6 @@
 class MacEWS(AbstractEarlyWarningSystem):
     name = "mac-ews"
     port_name = "mac"
-    _default_run_tests = True
     watchers = AbstractEarlyWarningSystem.watchers + [
         "rniwa@webkit.org",
     ]
@@ -221,7 +220,6 @@
 class MacWK2EWS(AbstractEarlyWarningSystem):
     name = "mac-wk2-ews"
     port_name = "mac-wk2"
-    _default_run_tests = True
     watchers = AbstractEarlyWarningSystem.watchers + [
         "rniwa@webkit.org",
     ]
diff --git a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
index 5f0b806..3ab1cd4 100644
--- a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -38,7 +38,7 @@
     def test_failing_tests_message(self):
         # Needed to define port_name, used in AbstractEarlyWarningSystem.__init__
         class TestEWS(AbstractEarlyWarningSystem):
-            port_name = "win"  # Needs to be a port which port/factory understands.
+            port_name = "chromium"  # Needs to be a port which port/factory understands.
 
         ews = TestEWS()
         ews.bind_to_tool(MockTool())
diff --git a/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py b/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py
deleted file mode 100644
index 16434cf..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# Copyright (c) 2012 Google Inc. All rights reserved.
-# Copyright (c) 2013 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-import re
-
-from webkitpy.common.config.committers import CommitterList
-from webkitpy.tool.bot.irc_command import IRCCommand
-from webkitpy.tool.bot.irc_command import Help
-from webkitpy.tool.bot.irc_command import Hi
-from webkitpy.tool.bot.irc_command import Restart
-from webkitpy.tool.bot.ircbot import IRCBot
-from webkitpy.tool.commands.queues import AbstractQueue
-from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
-
-_log = logging.getLogger(__name__)
-
-
-class PingPong(IRCCommand):
-    def execute(self, nick, args, tool, sheriff):
-        return nick + ": pong"
-
-
-class NewCommitBot(AbstractQueue, StepSequenceErrorHandler):
-    name = "new-commit-bot"
-    watchers = AbstractQueue.watchers + ["rniwa@webkit.org"]
-
-    _commands = {
-        "ping": PingPong,
-        "restart": Restart,
-    }
-
-    # AbstractQueue methods
-
-    def begin_work_queue(self):
-        AbstractQueue.begin_work_queue(self)
-        self._last_svn_revision = int(self._tool.scm().head_svn_revision())
-        self._irc_bot = IRCBot('WKR', self._tool, None, self._commands)
-        self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
-
-    def work_item_log_path(self, failure_map):
-        return None
-
-    def next_work_item(self):
-        self._irc_bot.process_pending_messages()
-
-        _log.info('Last SVN revision: %d' % self._last_svn_revision)
-
-        _log.info('Updating checkout')
-        self._update_checkout()
-
-        _log.info('Obtaining new SVN revisions')
-        revisions = self._new_svn_revisions()
-
-        _log.info('Obtaining commit logs for %d revisions' % len(revisions))
-        for revision in revisions:
-            commit_log = self._tool.scm().svn_commit_log(revision)
-            self._tool.irc().post(self._summarize_commit_log(commit_log).encode('ascii', 'ignore'))
-
-        return
-
-    def process_work_item(self, failure_map):
-        return True
-
-    def _update_checkout(self):
-        tool = self._tool
-        tool.executive.run_and_throw_if_fail(tool.deprecated_port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root)
-
-    def _new_svn_revisions(self):
-        scm = self._tool.scm()
-        current_head = int(scm.head_svn_revision())
-        first_new_revision = self._last_svn_revision + 1
-        self._last_svn_revision = current_head
-        return range(max(first_new_revision, current_head - 20), current_head + 1)
-
-    _patch_by_regex = re.compile(r'^Patch\s+by\s+(?P<author>.+?)\s+on(\s+\d{4}-\d{2}-\d{2})?\n?', re.MULTILINE | re.IGNORECASE)
-    _rollout_regex = re.compile(r'(rolling out|reverting) (?P<revisions>r?\d+((,\s*|,?\s*and\s+)?r?\d+)*)\.?\s*', re.MULTILINE | re.IGNORECASE)
-    _requested_by_regex = re.compile(r'^\"?(?P<reason>.+?)\"? \(Requested\s+by\s+(?P<author>.+?)\s+on\s+#webkit\)\.', re.MULTILINE | re.IGNORECASE)
-    _bugzilla_url_regex = re.compile(r'http(s?)://bugs\.webkit\.org/show_bug\.cgi\?id=(?P<id>\d+)', re.MULTILINE)
-    _trac_url_regex = re.compile(r'http(s?)://trac.webkit.org/changeset/(?P<revision>\d+)', re.MULTILINE)
-
-    @classmethod
-    def _summarize_commit_log(self, commit_log, committer_list=CommitterList()):
-        patch_by = self._patch_by_regex.search(commit_log)
-        commit_log = self._patch_by_regex.sub('', commit_log, count=1)
-
-        rollout = self._rollout_regex.search(commit_log)
-        commit_log = self._rollout_regex.sub('', commit_log, count=1)
-
-        requested_by = self._requested_by_regex.search(commit_log)
-
-        commit_log = self._bugzilla_url_regex.sub(r'https://webkit.org/b/\g<id>', commit_log)
-        commit_log = self._trac_url_regex.sub(r'https://trac.webkit.org/r\g<revision>', commit_log)
-
-        for contributor in committer_list.contributors():
-            if not contributor.irc_nicknames:
-                continue
-            name_with_nick = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
-            if contributor.full_name in commit_log:
-                commit_log = commit_log.replace(contributor.full_name, name_with_nick)
-                for email in contributor.emails:
-                    commit_log = commit_log.replace(' <' + email + '>', '')
-            else:
-                for email in contributor.emails:
-                    commit_log = commit_log.replace(email, name_with_nick)
-
-        lines = commit_log.split('\n')[1:-2]  # Ignore lines with ----------.
-
-        firstline = re.match(r'^(?P<revision>r\d+) \| (?P<email>[^\|]+) \| (?P<timestamp>[^|]+) \| [^\n]+', lines[0])
-        assert firstline
-        author = firstline.group('email')
-        if patch_by:
-            author = patch_by.group('author')
-
-        linkified_revision = 'https://trac.webkit.org/%s' % firstline.group('revision')
-        lines[0] = '%s by %s' % (linkified_revision, author)
-
-        if rollout:
-            if requested_by:
-                author = requested_by.group('author')
-                contributor = committer_list.contributor_by_irc_nickname(author)
-                if contributor:
-                    author = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
-                return '%s rolled out %s in %s : %s' % (author, rollout.group('revisions'),
-                    linkified_revision, requested_by.group('reason'))
-            lines[0] = '%s rolled out %s in %s' % (author, rollout.group('revisions'), linkified_revision)
-
-        return ' '.join(filter(lambda line: len(line), lines)[0:4])
-
-    def handle_unexpected_error(self, failure_map, message):
-        _log.error(message)
-
-    # StepSequenceErrorHandler methods
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        # Ideally we would post some information to IRC about what went wrong
-        # here, but we don't have the IRC password in the child process.
-        pass
diff --git a/Tools/Scripts/webkitpy/tool/commands/newcommitbot_unittest.py b/Tools/Scripts/webkitpy/tool/commands/newcommitbot_unittest.py
deleted file mode 100644
index 05bf456..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/newcommitbot_unittest.py
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright (C) 2013 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.tool.commands.newcommitbot import NewCommitBot
-
-
-class NewCommitBotTest(unittest.TestCase):
-    def test_summarize_commit_log_basic(self):
-        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
-r143106 | jochen@chromium.org | 2013-02-16 10:27:07 -0800 (Sat, 16 Feb 2013) | 10 lines
-
-[chromium] initialize all variables of TestRunner classes
-https://bugs.webkit.org/show_bug.cgi?id=110013
-
-Reviewed by Adam Barth.
-
-* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
-(WebTestRunner::TestInterfaces::TestInterfaces):
-* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
-(WebTestRunner::TestRunner::TestRunner):
-
-------------------------------------------------------------------------"""),
-            "https://trac.webkit.org/r143106 by Jochen Eisinger (jochen__) [chromium] initialize all variables of TestRunner classes"
-            " https://webkit.org/b/110013 Reviewed by Adam Barth (abarth).")
-
-        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
-r140066 | simon.fraser@apple.com | 2013-01-17 16:10:31 -0800 (Thu, 17 Jan 2013) | 10 lines
-
-Allow PaintInfo to carry all PaintBehavior flags
-https://bugs.webkit.org/show_bug.cgi?id=106980
-
-Reviewed by Beth Dakin.
-
-In r139908 I missed one instance of the PaintInfo constructor that should take PaintBehaviorNormal
-instead of "false".
-
-* rendering/RenderScrollbarPart.cpp:
-(WebCore::RenderScrollbarPart::paintIntoRect):
-------------------------------------------------------------------------"""),
-            "https://trac.webkit.org/r140066 by Simon Fraser (smfr)"
-            " Allow PaintInfo to carry all PaintBehavior flags https://webkit.org/b/106980 Reviewed by Beth Dakin (dethbakin).")
-
-    def test_summarize_commit_log_rollout(self):
-        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
-r143104 | commit-queue@webkit.org | 2013-02-16 09:09:01 -0800 (Sat, 16 Feb 2013) | 27 lines
-
-Unreviewed, rolling out r142734.
-http://trac.webkit.org/changeset/142734
-https://bugs.webkit.org/show_bug.cgi?id=110018
-
-"Triggered crashes on lots of websites" (Requested by ggaren
-on #webkit).
-
-Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-16
-
-Source/WebCore:
-
-------------------------------------------------------------------------"""),
-            "Geoffrey Garen (ggaren) rolled out r142734 in https://trac.webkit.org/r143104 : Triggered crashes on lots of websites")
-
-        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
-r139884 | kov@webkit.org | 2013-01-16 08:26:10 -0800 (Wed, 16 Jan 2013) | 23 lines
-
-[GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying
-https://bugs.webkit.org/show_bug.cgi?id=105552
-
-Reverting 139877. It made a couple of API tests fail.
-
-* platform/graphics/gstreamer/GStreamerVersioning.cpp:
-* platform/graphics/gstreamer/GStreamerVersioning.h:
-* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
-(StreamingClient):
-(_WebKitWebSrcPrivate):
-
-------------------------------------------------------------------------"""),
-            "Gustavo Noronha Silva (kov) rolled out 139877 in https://trac.webkit.org/r139884"
-            " [GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying"
-            " https://webkit.org/b/105552 It made a couple of API tests fail.")
-
-        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
-r135487 | commit-queue@webkit.org | 2012-11-22 00:09:25 -0800 (Thu, 22 Nov 2012) | 52 lines
-
-Unreviewed, rolling out r134927 and r134944.
-http://trac.webkit.org/changeset/134927
-http://trac.webkit.org/changeset/134944
-https://bugs.webkit.org/show_bug.cgi?id=103028
-
-Reverting the reverts after merging. (Requested by vsevik on
-#webkit).
-
-Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-22
-
-* English.lproj/localizedStrings.js:
-* WebCore.gypi:
-* WebCore.vcproj/WebCore.vcproj:
-* inspector/compile-front-end.py:
-* inspector/front-end/AdvancedSearchController.js:
-* inspector/front-end/CallStackSidebarPane.js:
-
-------------------------------------------------------------------------"""),
-            "Vsevolod Vlasov (vsevik) rolled out r134927 and r134944 in https://trac.webkit.org/r135487 :"
-            " Reverting the reverts after merging.")
diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
deleted file mode 100644
index ed0e015..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/perfalizer.py
+++ /dev/null
@@ -1,218 +0,0 @@
-# Copyright (c) 2012 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-
-from webkitpy.tool.bot.expectedfailures import ExpectedFailures
-from webkitpy.tool.bot.irc_command import IRCCommand
-from webkitpy.tool.bot.irc_command import Help
-from webkitpy.tool.bot.irc_command import Hi
-from webkitpy.tool.bot.irc_command import Restart
-from webkitpy.tool.bot.ircbot import IRCBot
-from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch
-from webkitpy.tool.bot.sheriff import Sheriff
-from webkitpy.tool.commands.queues import AbstractQueue
-from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
-
-_log = logging.getLogger(__name__)
-
-
-class PerfalizerTask(PatchAnalysisTask):
-    def __init__(self, tool, patch, logger):
-        PatchAnalysisTask.__init__(self, self, patch)
-        self._port = tool.port_factory.get()
-        self._tool = tool
-        self._logger = logger
-
-    def _copy_build_product_without_patch(self):
-        filesystem = self._tool.filesystem
-        configuration = filesystem.basename(self._port._build_path())
-        self._build_directory = filesystem.dirname(self._port._build_path())
-        self._build_directory_without_patch = self._build_directory + 'WithoutPatch'
-
-        try:
-            filesystem.rmtree(self._build_directory_without_patch)
-            filesystem.copytree(filesystem.join(self._build_directory, configuration),
-                filesystem.join(self._build_directory_without_patch, configuration))
-            return True
-        except:
-            return False
-
-    def run(self):
-        if not self._patch.committer() and not self._patch.attacher().can_commit:
-            self._logger('The patch %d is not authorized by a commmitter' % self._patch.id())
-            return False
-
-        self._logger('Preparing to run performance tests for the attachment %d...' % self._patch.id())
-        if not self._clean() or not self._update():
-            return False
-
-        head_revision = self._tool.scm().head_svn_revision()
-
-        self._logger('Building WebKit at r%s without the patch' % head_revision)
-        if not self._build_without_patch():
-            return False
-
-        if not self._port.check_build(needs_http=False):
-            self._logger('Failed to build DumpRenderTree.')
-            return False
-
-        if not self._copy_build_product_without_patch():
-            self._logger('Failed to copy the build product from %s to %s' % (self._build_directory, self._build_directory_without_patch))
-            return False
-
-        self._logger('Building WebKit at r%s with the patch' % head_revision)
-        if not self._apply() or not self._build():
-            return False
-
-        if not self._port.check_build(needs_http=False):
-            self._logger('Failed to build DumpRenderTree.')
-            return False
-
-        filesystem = self._tool.filesystem
-        if filesystem.exists(self._json_path()):
-            filesystem.remove(self._json_path())
-
-        self._logger("Running performance tests...")
-        if self._run_perf_test(self._build_directory_without_patch, 'without %d' % self._patch.id()) < 0:
-            self._logger('Failed to run performance tests without the patch.')
-            return False
-
-        if self._run_perf_test(self._build_directory, 'with %d' % self._patch.id()) < 0:
-            self._logger('Failed to run performance tests with the patch.')
-            return False
-
-        if not filesystem.exists(self._results_page_path()):
-            self._logger('Failed to generate the results page.')
-            return False
-
-        results_page = filesystem.read_text_file(self._results_page_path())
-        self._tool.bugs.add_attachment_to_bug(self._patch.bug_id(), results_page,
-            description="Performance tests results for %d" % self._patch.id(), mimetype='text/html')
-
-        self._logger("Uploaded the results on the bug %d" % self._patch.bug_id())
-        return True
-
-    def parent_command(self):
-        return "perfalizer"
-
-    def run_webkit_patch(self, args):
-        webkit_patch_args = [self._tool.path()]
-        webkit_patch_args.extend(args)
-        return self._tool.executive.run_and_throw_if_fail(webkit_patch_args, cwd=self._tool.scm().checkout_root)
-
-    def _json_path(self):
-        return self._tool.filesystem.join(self._build_directory, 'PerformanceTestResults.json')
-
-    def _results_page_path(self):
-        return self._tool.filesystem.join(self._build_directory, 'PerformanceTestResults.html')
-
-    def _run_perf_test(self, build_path, description):
-        filesystem = self._tool.filesystem
-        script_path = filesystem.join(filesystem.dirname(self._tool.path()), 'run-perf-tests')
-        perf_test_runner_args = [script_path, '--no-build', '--no-show-results', '--build-directory', build_path,
-            '--output-json-path', self._json_path(), '--description', description]
-        return self._tool.executive.run_and_throw_if_fail(perf_test_runner_args, cwd=self._tool.scm().checkout_root)
-
-    def run_command(self, command):
-        self.run_webkit_patch(command)
-
-    def command_passed(self, message, patch):
-        pass
-
-    def command_failed(self, message, script_error, patch):
-        self._logger(message)
-
-    def refetch_patch(self, patch):
-        return self._tool.bugs.fetch_attachment(patch.id())
-
-    def expected_failures(self):
-        return ExpectedFailures()
-
-    def build_style(self):
-        return "release"
-
-
-class PerfTest(IRCCommand):
-    def execute(self, nick, args, tool, sheriff):
-        if not args:
-            tool.irc().post(nick + ": Please specify an attachment/patch id")
-            return
-
-        patch_id = args[0]
-        patch = tool.bugs.fetch_attachment(patch_id)
-        if not patch:
-            tool.irc().post(nick + ": Could not fetch the patch")
-            return
-
-        task = PerfalizerTask(tool, patch, lambda message: tool.irc().post('%s: %s' % (nick, message)))
-        task.run()
-
-
-class Perfalizer(AbstractQueue, StepSequenceErrorHandler):
-    name = "perfalizer"
-    watchers = AbstractQueue.watchers + ["rniwa@webkit.org"]
-
-    _commands = {
-        "help": Help,
-        "hi": Hi,
-        "restart": Restart,
-        "test": PerfTest,
-    }
-
-    # AbstractQueue methods
-
-    def begin_work_queue(self):
-        AbstractQueue.begin_work_queue(self)
-        self._sheriff = Sheriff(self._tool, self)
-        self._irc_bot = IRCBot("perfalizer", self._tool, self._sheriff, self._commands)
-        self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
-
-    def work_item_log_path(self, failure_map):
-        return None
-
-    def _is_old_failure(self, revision):
-        return self._tool.status_server.svn_revision(revision)
-
-    def next_work_item(self):
-        self._irc_bot.process_pending_messages()
-        return
-
-    def process_work_item(self, failure_map):
-        return True
-
-    def handle_unexpected_error(self, failure_map, message):
-        _log.error(message)
-
-    # StepSequenceErrorHandler methods
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        # Ideally we would post some information to IRC about what went wrong
-        # here, but we don't have the IRC password in the child process.
-        pass
diff --git a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py b/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py
deleted file mode 100644
index 14211e4..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/perfalizer_unittest.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright (C) 2012 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest2 as unittest
-
-from webkitpy.common.net.buildbot import Builder
-from webkitpy.common.system.executive import ScriptError
-from webkitpy.common.system.outputcapture import OutputCapture
-from webkitpy.layout_tests.port.test import TestPort
-from webkitpy.tool.commands.perfalizer import PerfalizerTask
-from webkitpy.tool.mocktool import MockTool
-
-
-class PerfalizerTaskTest(unittest.TestCase):
-    def _create_and_run_perfalizer(self, commands_to_fail=[]):
-        tool = MockTool()
-        patch = tool.bugs.fetch_attachment(10000)
-
-        logs = []
-
-        def logger(message):
-            logs.append(message)
-
-        def run_webkit_patch(args):
-            if args[0] in commands_to_fail:
-                raise ScriptError
-
-        def run_perf_test(build_path, description):
-            self.assertTrue(description == 'without 10000' or description == 'with 10000')
-            if 'run-perf-tests' in commands_to_fail:
-                return -1
-            if 'results-page' not in commands_to_fail:
-                tool.filesystem.write_text_file(tool.filesystem.join(build_path, 'PerformanceTestResults.html'), 'results page')
-            return 0
-
-        perfalizer = PerfalizerTask(tool, patch, logger)
-        perfalizer._port = TestPort(tool)
-        perfalizer.run_webkit_patch = run_webkit_patch
-        perfalizer._run_perf_test = run_perf_test
-
-        capture = OutputCapture()
-        capture.capture_output()
-
-        if commands_to_fail:
-            self.assertFalse(perfalizer.run())
-        else:
-            self.assertTrue(perfalizer.run())
-
-        capture.restore_output()
-
-        return logs
-
-    def test_run(self):
-        self.assertEqual(self._create_and_run_perfalizer(), [
-            'Preparing to run performance tests for the attachment 10000...',
-            'Building WebKit at r1234 without the patch',
-            'Building WebKit at r1234 with the patch',
-            'Running performance tests...',
-            'Uploaded the results on the bug 50000'])
-
-    def test_run_with_clean_fails(self):
-        self.assertEqual(self._create_and_run_perfalizer(['clean']), [
-            'Preparing to run performance tests for the attachment 10000...',
-            'Unable to clean working directory'])
-
-    def test_run_with_update_fails(self):
-        logs = self._create_and_run_perfalizer(['update'])
-        self.assertEqual(len(logs), 2)
-        self.assertEqual(logs[-1], 'Unable to update working directory')
-
-    def test_run_with_build_fails(self):
-        logs = self._create_and_run_perfalizer(['build'])
-        self.assertEqual(len(logs), 3)
-
-    def test_run_with_build_fails(self):
-        logs = self._create_and_run_perfalizer(['apply-attachment'])
-        self.assertEqual(len(logs), 4)
-
-    def test_run_with_perf_test_fails(self):
-        logs = self._create_and_run_perfalizer(['run-perf-tests'])
-        self.assertEqual(len(logs), 5)
-        self.assertEqual(logs[-1], 'Failed to run performance tests without the patch.')
-
-    def test_run_without_results_page(self):
-        logs = self._create_and_run_perfalizer(['results-page'])
-        self.assertEqual(len(logs), 5)
-        self.assertEqual(logs[-1], 'Failed to generate the results page.')
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues.py b/Tools/Scripts/webkitpy/tool/commands/queues.py
index 8a47e4c..b9a78a8 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues.py
@@ -260,15 +260,10 @@
         AbstractPatchQueue.__init__(self, options)
 
     # FIXME: This is a hack to map between the old port names and the new port names.
-    def _new_port_name_from_old(self, port_name):
+    def _new_port_name_from_old(self, port_name, platform):
         # The new port system has no concept of xvfb yet.
         if port_name == 'chromium-xvfb':
             return 'chromium'
-        # ApplePort.determine_full_port_name asserts if the name doesn't include version.
-        if port_name == 'mac':
-            return 'mac-future'
-        if port_name == 'win':
-            return 'win-future'
         return port_name
 
     def begin_work_queue(self):
@@ -279,11 +274,11 @@
         self._deprecated_port = DeprecatedPort.port(self.port_name)
         # FIXME: This violates abstraction
         self._tool._deprecated_port = self._deprecated_port
-        self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name))
+        self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform))
 
     def _upload_results_archive_for_patch(self, patch, results_archive_zip):
         if not self._port:
-            self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name))
+            self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform))
 
         bot_id = self._tool.status_server.bot_id or "bot"
         description = "Archive of layout-test-results from %s for %s" % (bot_id, self._port.name())
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 53a46ed..929f83e 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -176,10 +176,10 @@
         queue._options = Mock()
         queue._options.port = None
         patch = queue._tool.bugs.fetch_attachment(10001)
-        expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=Archive of layout-test-results from bot for mac-snowleopard filename=layout-test-results.zip mimetype=None
+        expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=Archive of layout-test-results from bot for chromium-mac-snowleopard filename=layout-test-results.zip mimetype=None
 -- Begin comment --
 The attached test failures were seen while running run-webkit-tests on the mock-queue.
-Port: mac-snowleopard  Platform: MockPlatform 1.0
+Port: chromium-mac-snowleopard  Platform: MockPlatform 1.0
 -- End comment --
 """
         OutputCapture().assert_outputs(self, queue._upload_results_archive_for_patch, [patch, Mock()], expected_logs=expected_logs)
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index b6e408d..c6c4d2a 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -32,6 +32,7 @@
 import sys
 
 from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer
+from webkitpy.common.memoized import memoized
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWriter
 from webkitpy.layout_tests.models import test_failures
@@ -85,7 +86,7 @@
                 help="Platform to move existing baselines to before rebaselining. This is for bringing up new ports."),
             optparse.make_option("--test", help="Test to rebaseline"),
             ])
-        self._scm_changes = {'add': []}
+        self._scm_changes = {'add': [], 'remove-lines': []}
 
     def _results_url(self, builder_name):
         return self._tool.buildbot_for_builder_name(builder_name).builder_with_name(builder_name).latest_layout_test_results_url()
@@ -97,6 +98,24 @@
             return self._tool.filesystem.join(port.layout_tests_dir(), 'platform', override_dir)
         return port.baseline_version_dir()
 
+    @memoized
+    def _immediate_predecessors_in_fallback(self, path_to_rebaseline):
+        port_names = self._tool.port_factory.all_port_names()
+        immediate_predecessors_in_fallback = []
+        for port_name in port_names:
+            port = self._tool.port_factory.get(port_name)
+            if not port.buildbot_archives_baselines():
+                continue
+            baseline_search_path = port.baseline_search_path()
+            try:
+                index = baseline_search_path.index(path_to_rebaseline)
+                if index:
+                    immediate_predecessors_in_fallback.append(self._tool.filesystem.basename(baseline_search_path[index - 1]))
+            except ValueError:
+                # index throw's a ValueError if the item isn't in the list.
+                pass
+        return immediate_predecessors_in_fallback
+
     def _copy_existing_baseline(self, move_overwritten_baselines_to, test_name, suffix):
         old_baselines = []
         new_baselines = []
@@ -128,9 +147,13 @@
             if not self._tool.scm().exists(new_baseline):
                 self._add_to_scm(new_baseline)
 
-    def _save_baseline(self, data, target_baseline):
+    def _save_baseline(self, data, target_baseline, baseline_directory, test_name, suffix):
         if not data:
+            _log.debug("No baseline data to save.")
             return
+
+        self._copy_existing_baseline(self._immediate_predecessors_in_fallback(baseline_directory), test_name, suffix)
+
         filesystem = self._tool.filesystem
         filesystem.maybe_make_directory(filesystem.dirname(target_baseline))
         filesystem.write_binary_file(target_baseline, data)
@@ -140,27 +163,6 @@
     def _add_to_scm(self, path):
         self._scm_changes['add'].append(path)
 
-    def _update_expectations_file(self, builder_name, test_name):
-        port = self._tool.port_factory.get_from_builder_name(builder_name)
-
-        # Since rebaseline-test-internal can be called multiple times in parallel,
-        # we need to ensure that we're not trying to update the expectations file
-        # concurrently as well.
-        # FIXME: We should rework the code to not need this; maybe just download
-        # the files in parallel and rebaseline local files serially?
-        try:
-            path = port.path_to_test_expectations_file()
-            lock = self._tool.make_file_lock(path + '.lock')
-            lock.acquire_lock()
-            expectations = TestExpectations(port, include_generic=False, include_overrides=False)
-            for test_configuration in port.all_test_configurations():
-                if test_configuration.version == port.test_configuration().version:
-                    expectationsString = expectations.remove_configuration_from_test(test_name, test_configuration)
-
-            self._tool.filesystem.write_text_file(path, expectationsString)
-        finally:
-            lock.release_lock()
-
     def _test_root(self, test_name):
         return self._tool.filesystem.splitext(test_name)[0]
 
@@ -176,13 +178,19 @@
         source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_result(test_name, suffix))
         target_baseline = self._tool.filesystem.join(baseline_directory, self._file_name_for_expected_result(test_name, suffix))
 
+        # FIXME: This concept is outdated now that we always move baselines in _save_baseline.
         if move_overwritten_baselines_to:
             self._copy_existing_baseline(move_overwritten_baselines_to, test_name, suffix)
 
         _log.debug("Retrieving %s." % source_baseline)
-        self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline)
+        self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline, baseline_directory, test_name, suffix)
 
     def _rebaseline_test_and_update_expectations(self, options):
+        port = self._tool.port_factory.get_from_builder_name(options.builder)
+        if (port.reference_files(options.test)):
+            _log.warning("Cannot rebaseline reftest: %s", options.test)
+            return
+
         if options.results_directory:
             results_url = 'file://' + options.results_directory
         else:
@@ -190,7 +198,7 @@
         self._baseline_suffix_list = options.suffixes.split(',')
         for suffix in self._baseline_suffix_list:
             self._rebaseline_test(options.builder, options.test, options.move_overwritten_baselines_to, suffix, results_url)
-        self._update_expectations_file(options.builder, options.test)
+        self._scm_changes['remove-lines'].append({'builder': options.builder, 'test': options.test})
 
     def execute(self, options, args, tool):
         self._rebaseline_test_and_update_expectations(options)
@@ -320,12 +328,22 @@
 
     def _files_to_add(self, command_results):
         files_to_add = set()
+        lines_to_remove = {}
         for output in [result[1].split('\n') for result in command_results]:
             file_added = False
             for line in output:
                 try:
                     if line:
-                        files_to_add.update(json.loads(line)['add'])
+                        parsed_line = json.loads(line)
+                        if 'add' in parsed_line:
+                            files_to_add.update(parsed_line['add'])
+                        if 'remove-lines' in parsed_line:
+                            for line_to_remove in parsed_line['remove-lines']:
+                                test = line_to_remove['test']
+                                builder = line_to_remove['builder']
+                                if test not in lines_to_remove:
+                                    lines_to_remove[test] = []
+                                lines_to_remove[test].append(builder)
                         file_added = True
                 except ValueError:
                     _log.debug('"%s" is not a JSON object, ignoring' % line)
@@ -333,8 +351,7 @@
             if not file_added:
                 _log.debug('Could not add file based off output "%s"' % output)
 
-
-        return list(files_to_add)
+        return list(files_to_add), lines_to_remove
 
     def _optimize_baselines(self, test_list, verbose=False):
         # We don't run this in parallel because modifying the SCM in parallel is unreliable.
@@ -345,6 +362,17 @@
             # FIXME: We should propagate the platform options as well.
             self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(all_suffixes), test], verbose)
 
+    def _update_expectations_files(self, lines_to_remove):
+        for test in lines_to_remove:
+            for builder in lines_to_remove[test]:
+                port = self._tool.port_factory.get_from_builder_name(builder)
+                path = port.path_to_generic_test_expectations_file()
+                expectations = TestExpectations(port, include_overrides=False)
+                for test_configuration in port.all_test_configurations():
+                    if test_configuration.version == port.test_configuration().version:
+                        expectationsString = expectations.remove_configuration_from_test(test, test_configuration)
+                self._tool.filesystem.write_text_file(path, expectationsString)
+
     def _rebaseline(self, options, test_list):
         for test, builders_to_check in sorted(test_list.items()):
             _log.info("Rebaselining %s" % test)
@@ -353,15 +381,15 @@
 
         commands = self._rebaseline_commands(test_list, options)
         command_results = self._tool.executive.run_in_parallel(commands)
-
         log_output = '\n'.join(result[2] for result in command_results).replace('\n\n', '\n')
         for line in log_output.split('\n'):
             if line:
                 print >> sys.stderr, line  # FIXME: Figure out how to log properly.
 
-        files_to_add = self._files_to_add(command_results)
+        files_to_add, lines_to_remove = self._files_to_add(command_results)
         if files_to_add:
             self._tool.scm().add_list(list(files_to_add))
+        self._update_expectations_files(lines_to_remove)
 
         if options.optimize:
             self._optimize_baselines(test_list, options.verbose)
@@ -393,14 +421,6 @@
             ] + self.platform_options)
         self._test_list = None
 
-    def _update_expectations_files(self, port_name):
-        port = self._tool.port_factory.get(port_name)
-
-        expectations = TestExpectations(port)
-        for path in port.expectations_dict():
-            if self._tool.filesystem.exists(path):
-                self._tool.filesystem.write_text_file(path, expectations.remove_rebaselined_tests(expectations.get_rebaselining_failures(), path))
-
     def _tests_to_rebaseline(self, port):
         tests_to_rebaseline = {}
         expectations = TestExpectations(port, include_overrides=True)
@@ -435,9 +455,6 @@
 
         self._rebaseline(options, self._test_list)
 
-        for port_name in port_names:
-            self._update_expectations_files(port_name)
-
 
 class Rebaseline(AbstractParallelRebaselineCommand):
     name = "rebaseline"
@@ -455,17 +472,9 @@
 
     def _builders_to_pull_from(self):
         chromium_buildbot_builder_names = []
-        webkit_buildbot_builder_names = []
         for name in builders.all_builder_names():
-            if self._tool.port_factory.get_from_builder_name(name).is_chromium():
-                chromium_buildbot_builder_names.append(name)
-            else:
-                webkit_buildbot_builder_names.append(name)
-
-        titles = ["build.webkit.org bots", "build.chromium.org bots"]
-        lists = [webkit_buildbot_builder_names, chromium_buildbot_builder_names]
-
-        chosen_names = self._tool.user.prompt_with_multiple_lists("Which builder to pull results from:", titles, lists, can_choose_multiple=True)
+            chromium_buildbot_builder_names.append(name)
+        chosen_names = self._tool.user.prompt_with_list("Which builder to pull results from:", chromium_buildbot_builder_names, can_choose_multiple=True)
         return [self._builder_with_name(name) for name in chosen_names]
 
     def _builder_with_name(self, name):
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index b93e1a5..c982731 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -48,7 +48,7 @@
         self.command = self.command_constructor()  # lint warns that command_constructor might not be set, but this is intentional; pylint: disable=E1102
         self.command.bind_to_tool(self.tool)
         self.lion_port = self.tool.port_factory.get_from_builder_name("WebKit Mac10.7")
-        self.lion_expectations_path = self.lion_port.path_to_test_expectations_file()
+        self.lion_expectations_path = self.lion_port.path_to_generic_test_expectations_file()
 
         # FIXME: we should override builders._exact_matches here to point to a set
         # of test ports and restore the value in tearDown(), and that way the
@@ -83,14 +83,6 @@
 
     def test_baseline_directory(self):
         command = self.command
-        self.assertMultiLineEqual(command._baseline_directory("Apple Win XP Debug (Tests)"), "/mock-checkout/LayoutTests/platform/win-xp")
-        self.assertMultiLineEqual(command._baseline_directory("Apple Win 7 Release (Tests)"), "/mock-checkout/LayoutTests/platform/win")
-        self.assertMultiLineEqual(command._baseline_directory("Apple Lion Release WK1 (Tests)"), "/mock-checkout/LayoutTests/platform/mac-lion")
-        self.assertMultiLineEqual(command._baseline_directory("Apple Lion Release WK2 (Tests)"), "/mock-checkout/LayoutTests/platform/mac-wk2")
-        self.assertMultiLineEqual(command._baseline_directory("GTK Linux 64-bit Debug"), "/mock-checkout/LayoutTests/platform/gtk-wk1")
-        self.assertMultiLineEqual(command._baseline_directory("GTK Linux 64-bit Release WK2 (Tests)"), "/mock-checkout/LayoutTests/platform/gtk-wk2")
-        self.assertMultiLineEqual(command._baseline_directory("EFL Linux 64-bit Release WK2"), "/mock-checkout/LayoutTests/platform/efl-wk2")
-        self.assertMultiLineEqual(command._baseline_directory("Qt Linux Release"), "/mock-checkout/LayoutTests/platform/qt")
         self.assertMultiLineEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac-lion")
         self.assertMultiLineEqual(command._baseline_directory("WebKit Mac10.6"), "/mock-checkout/LayoutTests/platform/chromium-mac-snowleopard")
 
@@ -115,36 +107,6 @@
 Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ]
 """)
 
-    def test_rebaseline_updates_expectations_file(self):
-        self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
-        self._write("userscripts/another-test.html", "Dummy test contents")
-
-        self.options.suffixes = 'png,wav,txt'
-        self.command._rebaseline_test_and_update_expectations(self.options)
-
-        self.assertItemsEqual(self.tool.web.urls_fetched,
-            [self.WEB_PREFIX + '/userscripts/another-test-actual.png',
-             self.WEB_PREFIX + '/userscripts/another-test-actual.wav',
-             self.WEB_PREFIX + '/userscripts/another-test-actual.txt'])
-        new_expectations = self._read(self.lion_expectations_path)
-        self.assertMultiLineEqual(new_expectations, "Bug(x) [ MountainLion SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
-
-    def test_rebaseline_does_not_include_overrides(self):
-        self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
-        self._write(self.lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "Bug(y) [ Mac ] other-test.html [ Failure ]\n")
-        self._write("userscripts/another-test.html", "Dummy test contents")
-
-        self.options.suffixes = 'png,wav,txt'
-        self.command._rebaseline_test_and_update_expectations(self.options)
-
-        self.assertItemsEqual(self.tool.web.urls_fetched,
-            [self.WEB_PREFIX + '/userscripts/another-test-actual.png',
-             self.WEB_PREFIX + '/userscripts/another-test-actual.wav',
-             self.WEB_PREFIX + '/userscripts/another-test-actual.txt'])
-
-        new_expectations = self._read(self.lion_expectations_path)
-        self.assertMultiLineEqual(new_expectations, "Bug(x) [ MountainLion SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
-
     def test_rebaseline_test(self):
         self.command._rebaseline_test("WebKit Linux", "userscripts/another-test.html", None, "txt", self.WEB_PREFIX)
         self.assertItemsEqual(self.tool.web.urls_fetched, [self.WEB_PREFIX + '/userscripts/another-test-actual.txt'])
@@ -155,6 +117,11 @@
         self.command._rebaseline_test_and_update_expectations(self.options)
         self.assertItemsEqual(self.tool.web.urls_fetched, ['file:///tmp/userscripts/another-test-actual.txt'])
 
+    def test_rebaseline_reftest(self):
+        self._write("userscripts/another-test-expected.html", "generic result")
+        OutputCapture().assert_outputs(self, self.command._rebaseline_test_and_update_expectations, args=[self.options],
+            expected_logs="Cannot rebaseline reftest: userscripts/another-test.html\n")
+
     def test_rebaseline_test_and_print_scm_changes(self):
         self.command._print_scm_changes = True
         self.command._scm_changes = {'add': [], 'delete': []}
@@ -196,7 +163,7 @@
         self.assertMultiLineEqual(self._read("platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt"), "original snowleopard result")
         self.assertMultiLineEqual(self._read("platform/chromium-mac-lion/userscripts/another-test-expected.txt"), self.MOCK_WEB_RESULT)
 
-    def test_rebaseline_test_internal_with_move_overwritten_baselines_to(self):
+    def test_rebaseline_test_internal_with_copying_overwritten_baseline_first(self):
         self.tool.executive = MockExecutive2()
 
         # FIXME: it's confusing that this is the test- port, and not the regular lion port. Really all of the tests should be using the test ports.
@@ -212,7 +179,7 @@
             }
 
             options = MockOptions(optimize=True, builder="MOCK SnowLeopard", suffixes="txt",
-                move_overwritten_baselines_to=["test-mac-leopard"], verbose=True, test="failures/expected/image.html",
+                move_overwritten_baselines_to=None, verbose=True, test="failures/expected/image.html",
                 results_directory=None)
 
             oc.capture_output()
@@ -222,7 +189,102 @@
             builders._exact_matches = old_exact_matches
 
         self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-mac-leopard/failures/expected/image-expected.txt')), 'original snowleopard result')
-        self.assertMultiLineEqual(out, '{"add": []}\n')
+        self.assertMultiLineEqual(out, '{"add": [], "remove-lines": [{"test": "failures/expected/image.html", "builder": "MOCK SnowLeopard"}]}\n')
+
+    def test_rebaseline_test_internal_with_copying_overwritten_baseline_first_to_multiple_locations(self):
+        self.tool.executive = MockExecutive2()
+
+        # FIXME: it's confusing that this is the test- port, and not the regular win port. Really all of the tests should be using the test ports.
+        port = self.tool.port_factory.get('test-win-win7')
+        self._write(port._filesystem.join(port.layout_tests_dir(), 'platform/test-win-win7/failures/expected/image-expected.txt'), 'original win7 result')
+
+        old_exact_matches = builders._exact_matches
+        oc = OutputCapture()
+        try:
+            builders._exact_matches = {
+                "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])},
+                "MOCK Linux": {"port_name": "test-linux-x86_64", "specifiers": set(["mock-specifier"])},
+                "MOCK Vista": {"port_name": "test-win-vista", "specifiers": set(["mock-specifier"])},
+                "MOCK Win7": {"port_name": "test-win-win7", "specifiers": set(["mock-specifier"])},
+            }
+
+            options = MockOptions(optimize=True, builder="MOCK Win7", suffixes="txt",
+                move_overwritten_baselines_to=None, verbose=True, test="failures/expected/image.html",
+                results_directory=None)
+
+            oc.capture_output()
+            self.command.execute(options, [], self.tool)
+        finally:
+            out, _, _ = oc.restore_output()
+            builders._exact_matches = old_exact_matches
+
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-linux-x86_64/failures/expected/image-expected.txt')), 'original win7 result')
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-win-vista/failures/expected/image-expected.txt')), 'original win7 result')
+        self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/chromium-mac-leopard/userscripts/another-test-expected.txt')))
+        self.assertMultiLineEqual(out, '{"add": [], "remove-lines": [{"test": "failures/expected/image.html", "builder": "MOCK Win7"}]}\n')
+
+    def test_rebaseline_test_internal_with_no_overwrite_existing_baseline(self):
+        self.tool.executive = MockExecutive2()
+
+        # FIXME: it's confusing that this is the test- port, and not the regular win port. Really all of the tests should be using the test ports.
+        port = self.tool.port_factory.get('test-win-win7')
+        self._write(port._filesystem.join(port.layout_tests_dir(), 'platform/test-win-win7/failures/expected/image-expected.txt'), 'original win7 result')
+        self._write(port._filesystem.join(port.layout_tests_dir(), 'platform/test-win-vista/failures/expected/image-expected.txt'), 'original vista result')
+
+        old_exact_matches = builders._exact_matches
+        oc = OutputCapture()
+        try:
+            builders._exact_matches = {
+                "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])},
+                "MOCK Linux": {"port_name": "test-linux-x86_64", "specifiers": set(["mock-specifier"])},
+                "MOCK Vista": {"port_name": "test-win-vista", "specifiers": set(["mock-specifier"])},
+                "MOCK Win7": {"port_name": "test-win-win7", "specifiers": set(["mock-specifier"])},
+            }
+
+            options = MockOptions(optimize=True, builder="MOCK Win7", suffixes="txt",
+                move_overwritten_baselines_to=None, verbose=True, test="failures/expected/image.html",
+                results_directory=None)
+
+            oc.capture_output()
+            self.command.execute(options, [], self.tool)
+        finally:
+            out, _, _ = oc.restore_output()
+            builders._exact_matches = old_exact_matches
+
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-linux-x86_64/failures/expected/image-expected.txt')), 'original win7 result')
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-win-vista/failures/expected/image-expected.txt')), 'original vista result')
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-win-win7/failures/expected/image-expected.txt')), 'MOCK Web result, convert 404 to None=True')
+        self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/chromium-mac-leopard/userscripts/another-test-expected.txt')))
+        self.assertMultiLineEqual(out, '{"add": [], "remove-lines": [{"test": "failures/expected/image.html", "builder": "MOCK Win7"}]}\n')
+
+    def test_rebaseline_test_internal_with_port_that_lacks_buildbot(self):
+        self.tool.executive = MockExecutive2()
+
+        # FIXME: it's confusing that this is the test- port, and not the regular win port. Really all of the tests should be using the test ports.
+        port = self.tool.port_factory.get('test-win-vista')
+        self._write(port._filesystem.join(port.layout_tests_dir(), 'platform/test-win-vista/failures/expected/image-expected.txt'), 'original vista result')
+
+        old_exact_matches = builders._exact_matches
+        oc = OutputCapture()
+        try:
+            builders._exact_matches = {
+                "MOCK XP": {"port_name": "test-win-xp"},
+                "MOCK Vista": {"port_name": "test-win-vista"},
+            }
+
+            options = MockOptions(optimize=True, builder="MOCK Vista", suffixes="txt",
+                move_overwritten_baselines_to=None, verbose=True, test="failures/expected/image.html",
+                results_directory=None)
+
+            oc.capture_output()
+            self.command.execute(options, [], self.tool)
+        finally:
+            out, _, _ = oc.restore_output()
+            builders._exact_matches = old_exact_matches
+
+        self.assertMultiLineEqual(self._read(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-win-vista/failures/expected/image-expected.txt')), 'MOCK Web result, convert 404 to None=True')
+        self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(port.layout_tests_dir(), 'platform/test-win-xp/failures/expected/image-expected.txt')))
+        self.assertMultiLineEqual(out, '{"add": [], "remove-lines": [{"test": "failures/expected/image.html", "builder": "MOCK Vista"}]}\n')
 
 
 class TestRebaselineJson(_BaseTestCase):
@@ -285,6 +347,46 @@
         self.assertEqual(self.tool.executive.calls,
             [[['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html', '--results-directory', '/tmp', '--verbose']]])
 
+class TestRebaselineJsonUpdatesExpectationsFiles(_BaseTestCase):
+    command_constructor = RebaselineJson
+
+    def setUp(self):
+        super(TestRebaselineJsonUpdatesExpectationsFiles, self).setUp()
+        self.tool.executive = MockExecutive2()
+
+        def mock_run_command(args,
+                             cwd=None,
+                             input=None,
+                             error_handler=None,
+                             return_exit_code=False,
+                             return_stderr=True,
+                             decode_output=False,
+                             env=None):
+            return '{"add": [], "remove-lines": [{"test": "userscripts/another-test.html", "builder": "WebKit Mac10.7"}]}\n'
+        self.tool.executive.run_command = mock_run_command
+
+    def test_rebaseline_updates_expectations_file(self):
+        options = MockOptions(optimize=False, verbose=True, move_overwritten_baselines=False, results_directory=None)
+
+        self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
+        self._write("userscripts/another-test.html", "Dummy test contents")
+
+        self.command._rebaseline(options,  {"userscripts/another-test.html": {"WebKit Mac10.7": ["txt", "png"]}})
+
+        new_expectations = self._read(self.lion_expectations_path)
+        self.assertMultiLineEqual(new_expectations, "Bug(x) [ MountainLion SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
+
+    def test_rebaseline_updates_expectations_file_all_platforms(self):
+        options = MockOptions(optimize=False, verbose=True, move_overwritten_baselines=False, results_directory=None)
+
+        self._write(self.lion_expectations_path, "Bug(x) userscripts/another-test.html [ ImageOnlyFailure ]\n")
+        self._write("userscripts/another-test.html", "Dummy test contents")
+
+        self.command._rebaseline(options,  {"userscripts/another-test.html": {"WebKit Mac10.7": ["txt", "png"]}})
+
+        new_expectations = self._read(self.lion_expectations_path)
+        self.assertMultiLineEqual(new_expectations, "Bug(x) [ Linux MountainLion SnowLeopard Win ] userscripts/another-test.html [ ImageOnlyFailure ]\n")
+
 
 class TestRebaseline(_BaseTestCase):
     # This command shares most of its logic with RebaselineJson, so these tests just test what is different.
@@ -337,7 +439,7 @@
         # FIXME: change this to use the test- ports.
         calls = filter(lambda x: x != ['qmake', '-v'], self.tool.executive.calls)
         self.assertEqual(len(calls), 1)
-        self.assertEqual(len(calls[0]), 36)
+        self.assertEqual(len(calls[0]), 14)
 
     def test_rebaseline_expectations_noop(self):
         self._zero_out_test_expectations()
diff --git a/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py b/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py
deleted file mode 100644
index 0f91be3..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import logging
-
-from webkitpy.tool.bot.sheriff import Sheriff
-from webkitpy.tool.bot.irc_command import commands as irc_commands
-from webkitpy.tool.bot.ircbot import IRCBot
-from webkitpy.tool.commands.queues import AbstractQueue
-from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
-
-_log = logging.getLogger(__name__)
-
-
-class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
-    name = "sheriff-bot"
-    watchers = AbstractQueue.watchers + [
-        "abarth@webkit.org",
-        "eric@webkit.org",
-    ]
-
-    # AbstractQueue methods
-
-    def begin_work_queue(self):
-        AbstractQueue.begin_work_queue(self)
-        self._sheriff = Sheriff(self._tool, self)
-        self._irc_bot = IRCBot("sheriffbot", self._tool, self._sheriff, irc_commands)
-        self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
-
-    def work_item_log_path(self, failure_map):
-        return None
-
-    def _is_old_failure(self, revision):
-        return self._tool.status_server.svn_revision(revision)
-
-    def next_work_item(self):
-        self._irc_bot.process_pending_messages()
-        return
-
-    def process_work_item(self, failure_map):
-        return True
-
-    def handle_unexpected_error(self, failure_map, message):
-        _log.error(message)
-
-    # StepSequenceErrorHandler methods
-
-    @classmethod
-    def handle_script_error(cls, tool, state, script_error):
-        # Ideally we would post some information to IRC about what went wrong
-        # here, but we don't have the IRC password in the child process.
-        pass
diff --git a/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py b/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
deleted file mode 100644
index bed8c74..0000000
--- a/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.tool.commands.queuestest import QueuesTest, MockQueueEngine
-from webkitpy.tool.commands import SheriffBot
-from webkitpy.tool.mocktool import MockTool, MockOptions
-from webkitpy.tool.bot.irc_command import Rollout, Sheriffs
-
-
-class SheriffBotTest(QueuesTest):
-    def test_command_aliases(self):
-        tool = MockTool()
-        options = MockOptions()
-        options.ensure_value("confirm", False)
-        options.ensure_value("seconds_to_sleep", 120)
-        sheriffbot = SheriffBot()
-        sheriffbot.execute(options, [], tool, MockQueueEngine)
-        sheriffbot.begin_work_queue()
-        irc_bot = sheriffbot._irc_bot
-        # Test Rollout command aliases
-        revert_command, args = irc_bot._parse_command_and_args("revert")
-        self.assertEqual(revert_command, Rollout)
-        # Test Sheriffs command aliases
-        gardeners_command, args = irc_bot._parse_command_and_args("gardeners")
-        self.assertEqual(gardeners_command, Sheriffs)
-        sherifs_command, args = irc_bot._parse_command_and_args("sherifs")
-        self.assertEqual(sherifs_command, Sheriffs)
-        sherrifs_command, args = irc_bot._parse_command_and_args("sherrifs")
-        self.assertEqual(sherrifs_command, Sheriffs)
-        sherriffs_command, args = irc_bot._parse_command_and_args("sherriffs")
-        self.assertEqual(sherriffs_command, Sheriffs)
diff --git a/Tools/Scripts/webkitpy/tool/main.py b/Tools/Scripts/webkitpy/tool/main.py
index 3fa6e6b..c1f5289 100644
--- a/Tools/Scripts/webkitpy/tool/main.py
+++ b/Tools/Scripts/webkitpy/tool/main.py
@@ -35,7 +35,6 @@
 
 from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.host import Host
-from webkitpy.common.net.irc import ircproxy
 from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.tool.multicommandtool import MultiCommandTool
 from webkitpy.tool import commands
@@ -47,7 +46,6 @@
         make_option("-d", "--directory", action="append", dest="patch_directories", default=[], help="Directory to look at for changed files"),
         make_option("--status-host", action="store", dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
         make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
-        make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."),
         make_option("--seconds-to-sleep", action="store", default=120, type="int", help="Number of seconds to sleep in the task queue."),
         make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...)."),
     ]
@@ -59,7 +57,6 @@
         self.status_server = StatusServer()
 
         self.wakeup_event = threading.Event()
-        self._irc = None
         self._deprecated_port = None
 
     def deprecated_port(self):
@@ -68,20 +65,6 @@
     def path(self):
         return self._path
 
-    def ensure_irc_connected(self, irc_delegate):
-        if not self._irc:
-            self._irc = ircproxy.IRCProxy(irc_delegate)
-
-    def irc(self):
-        # We don't automatically construct IRCProxy here because constructing
-        # IRCProxy actually connects to IRC.  We want clients to explicitly
-        # connect to IRC.
-        return self._irc
-
-    def command_completed(self):
-        if self._irc:
-            self._irc.disconnect()
-
     def should_show_in_main_help(self, command):
         if not command.show_in_main_help:
             return False
@@ -96,8 +79,6 @@
             self.status_server.set_host(options.status_host)
         if options.bot_id:
             self.status_server.set_bot_id(options.bot_id)
-        if options.irc_password:
-            self.irc_password = options.irc_password
         # If options.port is None, we'll get the default port for this platform.
         self._deprecated_port = DeprecatedPort.port(options.port)
 
diff --git a/Tools/Scripts/webkitpy/tool/mocktool.py b/Tools/Scripts/webkitpy/tool/mocktool.py
index 8afaea9..71b8513 100644
--- a/Tools/Scripts/webkitpy/tool/mocktool.py
+++ b/Tools/Scripts/webkitpy/tool/mocktool.py
@@ -31,7 +31,6 @@
 from webkitpy.common.host_mock import MockHost
 from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot
 from webkitpy.common.net.statusserver_mock import MockStatusServer
-from webkitpy.common.net.irc.irc_mock import MockIRC
 
 # FIXME: Old-style "Ports" need to die and be replaced by modern layout_tests.port which needs to move to common.
 from webkitpy.common.config.ports_mock import MockPort
@@ -67,8 +66,6 @@
         self._deprecated_port = MockPort()
         self.status_server = MockStatusServer()
 
-        self._irc = None
-        self.irc_password = "MOCK irc password"
         self.wakeup_event = threading.Event()
 
     def deprecated_port(self):
@@ -77,12 +74,5 @@
     def path(self):
         return "echo"
 
-    def ensure_irc_connected(self, delegate):
-        if not self._irc:
-            self._irc = MockIRC()
-
-    def irc(self):
-        return self._irc
-
     def buildbot_for_builder_name(self, name):
         return MockBuildBot()
diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
index 6d29f44..0a5713c 100644
--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
@@ -27,6 +27,7 @@
 import logging
 import json
 import os
+import re
 import sys
 import urllib
 
@@ -52,6 +53,12 @@
 
 
 class GardeningHTTPRequestHandler(ReflectionHandler):
+    REVISION_LIMIT = 100
+    BLINK_SVN_URL = 'http://src.chromium.org/blink/trunk'
+    CHROMIUM_SVN_DEPS_URL = 'http://src.chromium.org/chrome/trunk/src/DEPS'
+    # "webkit_revision": "149598",
+    BLINK_REVISION_REGEXP = re.compile(r'^  "webkit_revision": "(?P<revision>\d+)",$', re.MULTILINE);
+
     STATIC_FILE_NAMES = frozenset()
 
     STATIC_FILE_EXTENSIONS = ('.js', '.css', '.html', '.gif', '.png', '.ico')
@@ -62,10 +69,7 @@
         '..',
         '..',
         '..',
-        'BuildSlaveSupport',
-        'build.webkit.org-config',
-        'public_html',
-        'TestFailures')
+        'GardeningServer')
 
     allow_cross_origin_requests = True
     debug_output = ''
@@ -80,6 +84,21 @@
         output, error = process.communicate()
         return (process.returncode, output, error)
 
+    def svnlog(self):
+        self._serve_xml(self.server.tool.executive.run_command(['svn', 'log', '--xml', '--limit', self.REVISION_LIMIT, self.BLINK_SVN_URL]))
+
+    def lastroll(self):
+        deps_contents = self.server.tool.executive.run_command(['svn', 'cat', self.CHROMIUM_SVN_DEPS_URL])
+        match = re.search(self.BLINK_REVISION_REGEXP, deps_contents)
+        if not match:
+            _log.error("Unable to produce last Blink roll revision")
+            self._serve_text("0")
+            return
+
+        revision_line = match.group()
+        revision = match.group("revision")
+        self._serve_text(revision)
+
     def rebaselineall(self):
         command = ['rebaseline-json']
         if self.server.options.move_overwritten_baselines:
diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
index 45bd4ee..e849bc7 100644
--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py
@@ -48,15 +48,15 @@
         return host.port_factory.get("test-win-xp")
 
     @classmethod
-    def path_to_test_expectations_file(cls):
-        return cls.create().path_to_test_expectations_file()
+    def path_to_generic_test_expectations_file(cls):
+        return cls.create().path_to_generic_test_expectations_file()
 
 
 class MockServer(object):
     def __init__(self):
         self.tool = MockTool()
         self.tool.executive = MockExecutive(should_log=True)
-        self.tool.filesystem.files[TestPortFactory.path_to_test_expectations_file()] = ""
+        self.tool.filesystem.files[TestPortFactory.path_to_generic_test_expectations_file()] = ""
 
 
 # The real GardeningHTTPRequestHandler has a constructor that's too hard to
@@ -82,6 +82,10 @@
         print json.dumps(json_object)
         print "== End JSON Response =="
 
+    def _serve_xml(self, xml):
+        print "== Begin XML Response =="
+        print xml
+        print "== End XML Response =="
 
 class GardeningServerTest(unittest.TestCase):
     def _post_to_path(self, path, body=None, expected_stderr=None, expected_stdout=None, server=None):
@@ -90,6 +94,26 @@
         handler.body = body
         OutputCapture().assert_outputs(self, handler.do_POST, expected_stderr=expected_stderr, expected_stdout=expected_stdout)
 
+    def test_svnlog(self):
+        expected_stderr = ''
+        expected_stdout = '== Begin XML Response ==\nMOCK output of child process\n== End XML Response ==\n'
+        self._post_to_path('/svnlog', expected_stderr=expected_stderr, expected_stdout=expected_stdout)
+
+    def test_lastroll(self):
+        expected_stderr = 'MOCK run_command: [\'svn\', \'cat\', \'http://src.chromium.org/chrome/trunk/src/DEPS\'], cwd=None, input=None\n'
+        expected_stdout = '== Begin Response ==\n1\n== End Response ==\n'
+        server = MockServer()
+
+        self.output = ['  "webkit_revision": "3",', 'lol']
+
+        def run_command(args, cwd=None, input=None, **kwargs):
+            print >> sys.stderr, "MOCK run_command: %s, cwd=%s, input=%s" % (args, cwd, input)
+            return self.output.pop(0)
+
+        server.tool.executive.run_command = run_command
+        self._post_to_path('/lastroll', expected_stderr=expected_stderr, expected_stdout='== Begin Response ==\n3\n== End Response ==\n', server=server)
+        self._post_to_path('/lastroll', expected_stderr=expected_stderr, expected_stdout='== Begin Response ==\n0\n== End Response ==\n', server=server)
+
     def disabled_test_rollout(self):
         expected_stderr = "MOCK run_command: ['echo', 'rollout', '--force-clean', '--non-interactive', '2314', 'MOCK rollout reason'], cwd=/mock-checkout\n"
         expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
diff --git a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py
index 954fb56..549b271 100644
--- a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py
+++ b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py
@@ -142,3 +142,11 @@
 
             if not headers_only:
                 shutil.copyfileobj(static_file, self.wfile)
+
+    def _serve_xml(self, xml):
+        self.send_response(200)
+        self._send_access_control_header()
+        self.send_header("Content-type", "text/xml")
+        self.end_headers()
+        xml = xml.encode('utf-8')
+        self.wfile.write(xml)
diff --git a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler_unittest.py b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler_unittest.py
index e1d5623..3ea9a28 100644
--- a/Tools/Scripts/webkitpy/tool/servers/reflectionhandler_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/servers/reflectionhandler_unittest.py
@@ -52,6 +52,26 @@
         self.functions_run.add("some_html")
 
 
+class WriteConvertingLogger(object):
+    def __init__(self):
+        self.data = ''
+
+    def write(self, data):
+        # If data is still in ASCII, this will throw an exception.
+        self.data = str(data)
+
+
+class TestReflectionHandlerServeXML(ReflectionHandler):
+    def __init__(self):
+        self.requestline = False
+        self.client_address = '127.0.0.1'
+        self.request_version = '1'
+        self.wfile = WriteConvertingLogger()
+
+    def serve_xml(self, data):
+        self._serve_xml(data)
+
+
 class ReflectionHandlerTest(unittest.TestCase):
     def assert_handler_response(self, requests, expected_static_files, expected_errors, expected_functions):
         handler = TestReflectionHandler()
@@ -68,3 +88,9 @@
         self.assert_handler_response(["/test.js", "/test.exe", "/testhtml"], set(["test.js"]), set([404]), set())
         self.assert_handler_response(["/test.html", "/function.one"], set(["test.html"]), set(), set(['function_one']))
         self.assert_handler_response(["/some.html"], set(["some.html"]), set(), set())
+
+    def test_svn_log_non_ascii(self):
+        xmlChangelog = u'<?xml version="1.0"?>\n<log>\n<logentry revision="1">\n<msg>Patch from John Do\xe9.</msg>\n</logentry>\n</log>'
+        handler = TestReflectionHandlerServeXML()
+        handler.serve_xml(xmlChangelog)
+        self.assertEqual(handler.wfile.data, xmlChangelog.encode('utf-8'))
diff --git a/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb b/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb
new file mode 100644
index 0000000..7398888
--- /dev/null
+++ b/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb
@@ -0,0 +1,1005 @@
+require 'cgi'
+require 'diff'
+require 'open3'
+require 'open-uri'
+require 'pp'
+require 'set'
+require 'tempfile'
+
+module PrettyPatch
+
+public
+
+    GIT_PATH = "git"
+
+    def self.prettify(string)
+        $last_prettify_file_count = -1
+        $last_prettify_part_count = { "remove" => 0, "add" => 0, "shared" => 0, "binary" => 0, "extract-error" => 0 }
+        string = normalize_line_ending(string)
+        str = "#{HEADER}<body>\n"
+
+        # Just look at the first line to see if it is an SVN revision number as added
+        # by webkit-patch for git checkouts.
+        $svn_revision = 0
+        string.each_line do |line|
+            match = /^Subversion\ Revision: (\d*)$/.match(line)
+            unless match.nil?
+                str << "<span class='revision'>#{match[1]}</span>\n"
+                $svn_revision = match[1].to_i;
+            end
+            break
+        end
+
+        fileDiffs = FileDiff.parse(string)
+
+        $last_prettify_file_count = fileDiffs.length
+        str << fileDiffs.collect{ |diff| diff.to_html }.join
+        str << "</body></html>"
+    end
+
+    def self.filename_from_diff_header(line)
+        DIFF_HEADER_FORMATS.each do |format|
+            match = format.match(line)
+            return match[1] unless match.nil?
+        end
+        nil
+    end
+
+    def self.diff_header?(line)
+        RELAXED_DIFF_HEADER_FORMATS.any? { |format| line =~ format }
+    end
+
+private
+    DIFF_HEADER_FORMATS = [
+        /^Index: (.*)\r?$/,
+        /^diff --git "?a\/.+"? "?b\/(.+)"?\r?$/,
+        /^\+\+\+ ([^\t]+)(\t.*)?\r?$/
+    ]
+
+    RELAXED_DIFF_HEADER_FORMATS = [
+        /^Index:/,
+        /^diff/
+    ]
+
+    BINARY_FILE_MARKER_FORMAT = /^Cannot display: file marked as a binary type.$/
+
+    IMAGE_FILE_MARKER_FORMAT = /^svn:mime-type = image\/png$/
+
+    GIT_INDEX_MARKER_FORMAT = /^index ([0-9a-f]{40})\.\.([0-9a-f]{40})/
+
+    GIT_BINARY_FILE_MARKER_FORMAT = /^GIT binary patch$/
+
+    GIT_BINARY_PATCH_FORMAT = /^(literal|delta) \d+$/
+
+    GIT_LITERAL_FORMAT = /^literal \d+$/
+
+    GIT_DELTA_FORMAT = /^delta \d+$/
+
+    START_OF_BINARY_DATA_FORMAT = /^[0-9a-zA-Z\+\/=]{20,}/ # Assume 20 chars without a space is base64 binary data.
+
+    START_OF_SECTION_FORMAT = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@\s*(.*)/
+
+    START_OF_EXTENT_STRING = "%c" % 0
+    END_OF_EXTENT_STRING = "%c" % 1
+
+    # We won't search for intra-line diffs in lines longer than this length, to avoid hangs. See <http://webkit.org/b/56109>.
+    MAXIMUM_INTRALINE_DIFF_LINE_LENGTH = 10000
+
+    SMALLEST_EQUAL_OPERATION = 3
+
+    OPENSOURCE_URL = "http://src.chromium.org/viewvc/blink/"
+
+    OPENSOURCE_DIRS = Set.new %w[
+        LayoutTests
+        PerformanceTests
+        Source
+        Tools
+    ]
+
+    IMAGE_CHECKSUM_ERROR = "INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests."
+
+    def self.normalize_line_ending(s)
+        if RUBY_VERSION >= "1.9"
+            # Transliteration table from http://stackoverflow.com/a/6609998
+            transliteration_table = { '\xc2\x82' => ',',        # High code comma
+                                      '\xc2\x84' => ',,',       # High code double comma
+                                      '\xc2\x85' => '...',      # Tripple dot
+                                      '\xc2\x88' => '^',        # High carat
+                                      '\xc2\x91' => '\x27',     # Forward single quote
+                                      '\xc2\x92' => '\x27',     # Reverse single quote
+                                      '\xc2\x93' => '\x22',     # Forward double quote
+                                      '\xc2\x94' => '\x22',     # Reverse double quote
+                                      '\xc2\x95' => ' ',
+                                      '\xc2\x96' => '-',        # High hyphen
+                                      '\xc2\x97' => '--',       # Double hyphen
+                                      '\xc2\x99' => ' ',
+                                      '\xc2\xa0' => ' ',
+                                      '\xc2\xa6' => '|',        # Split vertical bar
+                                      '\xc2\xab' => '<<',       # Double less than
+                                      '\xc2\xbb' => '>>',       # Double greater than
+                                      '\xc2\xbc' => '1/4',      # one quarter
+                                      '\xc2\xbd' => '1/2',      # one half
+                                      '\xc2\xbe' => '3/4',      # three quarters
+                                      '\xca\xbf' => '\x27',     # c-single quote
+                                      '\xcc\xa8' => '',         # modifier - under curve
+                                      '\xcc\xb1' => ''          # modifier - under line
+                                   }
+            encoded_string = s.force_encoding('UTF-8').encode('UTF-16', :invalid => :replace, :replace => '', :fallback => transliteration_table).encode('UTF-8')
+            encoded_string.gsub /\r\n?/, "\n"
+        else
+            s.gsub /\r\n?/, "\n"
+        end
+    end
+
+    def self.find_url_and_path(file_path)
+        # Search file_path from the bottom up, at each level checking whether
+        # we've found a directory we know exists in the source tree.
+
+        dirname, basename = File.split(file_path)
+        dirname.split(/\//).reverse.inject(basename) do |path, directory|
+            path = directory + "/" + path
+
+            return [OPENSOURCE_URL, path] if OPENSOURCE_DIRS.include?(directory)
+
+            path
+        end
+
+        [nil, file_path]
+    end
+
+    def self.linkifyFilename(filename)
+        url, pathBeneathTrunk = find_url_and_path(filename)
+
+        url.nil? ? filename : "<a href='#{url}trunk/#{pathBeneathTrunk}'>#{filename}</a>"
+    end
+
+
+    HEADER =<<EOF
+<html>
+<head>
+<style>
+:link, :visited {
+    text-decoration: none;
+    border-bottom: 1px dotted;
+}
+
+:link {
+    color: #039;
+}
+
+.FileDiff {
+    background-color: #f8f8f8;
+    border: 1px solid #ddd;
+    font-family: monospace;
+    margin: 1em 0;
+    position: relative;
+}
+
+h1 {
+    color: #333;
+    font-family: sans-serif;
+    font-size: 1em;
+    margin-left: 0.5em;
+    display: table-cell;
+    width: 100%;
+    padding: 0.5em;
+}
+
+h1 :link, h1 :visited {
+    color: inherit;
+}
+
+h1 :hover {
+    color: #555;
+    background-color: #eee;
+}
+
+.DiffLinks {
+    float: right;
+}
+
+.FileDiffLinkContainer {
+    opacity: 0;
+    display: table-cell;
+    padding-right: 0.5em;
+    white-space: nowrap;
+}
+
+.DiffSection {
+    background-color: white;
+    border: solid #ddd;
+    border-width: 1px 0px;
+}
+
+.ExpansionLine, .LineContainer {
+    white-space: nowrap;
+}
+
+.sidebyside .DiffBlockPart.add:first-child {
+    float: right;
+}
+
+.LineSide,
+.sidebyside .DiffBlockPart.remove,
+.sidebyside .DiffBlockPart.add {
+    display:inline-block;
+    width: 50%;
+    vertical-align: top;
+}
+
+.sidebyside .resizeHandle {
+    width: 5px;
+    height: 100%;
+    cursor: move;
+    position: absolute;
+    top: 0;
+    left: 50%;
+}
+
+.sidebyside .resizeHandle:hover {
+    background-color: grey;
+    opacity: 0.5;
+}
+
+.sidebyside .DiffBlockPart.remove .to,
+.sidebyside .DiffBlockPart.add .from {
+    display: none;
+}
+
+.lineNumber, .expansionLineNumber {
+    border-bottom: 1px solid #998;
+    border-right: 1px solid #ddd;
+    color: #444;
+    display: inline-block;
+    padding: 1px 5px 0px 0px;
+    text-align: right;
+    vertical-align: bottom;
+    width: 3em;
+}
+
+.lineNumber {
+  background-color: #eed;
+}
+
+.expansionLineNumber {
+  background-color: #eee;
+}
+
+.text {
+    padding-left: 5px;
+    white-space: pre-wrap;
+    word-wrap: break-word;
+}
+
+.image {
+    border: 2px solid black;
+}
+
+.context, .context .lineNumber {
+    color: #849;
+    background-color: #fef;
+}
+
+.Line.add, .FileDiff .add {
+    background-color: #dfd;
+}
+
+.Line.add ins {
+    background-color: #9e9;
+    text-decoration: none;
+}
+
+.Line.remove, .FileDiff .remove {
+    background-color: #fdd;
+}
+
+.Line.remove del {
+    background-color: #e99;
+    text-decoration: none;
+}
+
+/* Support for inline comments */
+
+.author {
+  font-style: italic;
+}
+
+.comment {
+  position: relative;
+}
+
+.comment textarea {
+  height: 6em;
+}
+
+.overallComments textarea {
+  height: 2em;
+  max-width: 100%;
+  min-width: 200px;
+}
+
+.comment textarea, .overallComments textarea {
+  display: block;
+  width: 100%;
+}
+
+.overallComments .open {
+  -webkit-transition: height .2s;
+  height: 4em;
+}
+
+#statusBubbleContainer.wrap {
+  display: block;
+}
+
+#toolbar {
+  display: -webkit-flex;
+  display: -moz-flex;
+  padding: 3px;
+  left: 0;
+  right: 0;
+  border: 1px solid #ddd;
+  background-color: #eee;
+  font-family: sans-serif;
+  position: fixed;
+  bottom: 0;
+}
+
+#toolbar .actions {
+  float: right;
+}
+
+.winter {
+  position: fixed;
+  z-index: 5;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  background-color: black;
+  opacity: 0.8;
+}
+
+.inactive {
+  display: none;
+}
+
+.lightbox {
+  position: fixed;
+  z-index: 6;
+  left: 10%;
+  right: 10%;
+  top: 10%;
+  bottom: 10%;
+  background: white;
+}
+
+.lightbox iframe {
+  width: 100%;
+  height: 100%;
+}
+
+.commentContext .lineNumber {
+  background-color: yellow;
+}
+
+.selected .lineNumber {
+  background-color: #69F;
+  border-bottom-color: #69F;
+  border-right-color: #69F;
+}
+
+.ExpandLinkContainer {
+  opacity: 0;
+  border-top: 1px solid #ddd;
+  border-bottom: 1px solid #ddd;
+}
+
+.ExpandArea {
+  margin: 0;
+}
+
+.ExpandText {
+  margin-left: 0.67em;
+}
+
+.LinkContainer {
+  font-family: sans-serif;
+  font-size: small;
+  font-style: normal;
+  -webkit-transition: opacity 0.5s;
+}
+
+.LinkContainer a {
+  border: 0;
+}
+
+.LinkContainer label:after,
+.LinkContainer a:after {
+  content: " | ";
+  color: black;
+}
+
+.LinkContainer a:last-of-type:after {
+  content: "";
+}
+
+.LinkContainer label {
+  color: #039;
+}
+
+.help {
+ color: gray;
+ font-style: italic;
+}
+
+#message {
+  font-size: small;
+  font-family: sans-serif;
+}
+
+.commentStatus {
+  font-style: italic;
+}
+
+.comment, .previousComment, .frozenComment {
+  background-color: #ffd;
+}
+
+.overallComments {
+  -webkit-flex: 1;
+  -moz-flex: 1;
+  margin-right: 3px;
+}
+
+.previousComment, .frozenComment {
+  border: inset 1px;
+  padding: 5px;
+  white-space: pre-wrap;
+}
+
+.comment button {
+  width: 6em;
+}
+
+div:focus {
+  outline: 1px solid blue;
+  outline-offset: -1px;
+}
+
+.statusBubble {
+  /* The width/height get set to the bubble contents via postMessage on browsers that support it. */
+  width: 450px;
+  height: 20px;
+  margin: 2px 2px 0 0;
+  border: none;
+  vertical-align: middle;
+}
+
+.revision {
+  display: none;
+}
+
+.autosave-state {
+  position: absolute;
+  right: 0;
+  top: -1.3em;
+  padding: 0 3px;
+  outline: 1px solid #DDD;
+  color: #8FDF5F;
+  font-size: small;   
+  background-color: #EEE;
+}
+
+.autosave-state:empty {
+  outline: 0px;
+}
+.autosave-state.saving {
+  color: #E98080;
+}
+
+.clear_float {
+    clear: both;
+}
+</style>
+</head>
+EOF
+
+    def self.revisionOrDescription(string)
+        case string
+        when /\(revision \d+\)/
+            /\(revision (\d+)\)/.match(string)[1]
+        when /\(.*\)/
+            /\((.*)\)/.match(string)[1]
+        end
+    end
+
+    def self.has_image_suffix(filename)
+        filename =~ /\.(png|jpg|gif)$/
+    end
+
+    class FileDiff
+        def initialize(lines)
+            @filename = PrettyPatch.filename_from_diff_header(lines[0].chomp)
+            startOfSections = 1
+            for i in 0...lines.length
+                case lines[i]
+                when /^--- /
+                    @from = PrettyPatch.revisionOrDescription(lines[i])
+                when /^\+\+\+ /
+                    @filename = PrettyPatch.filename_from_diff_header(lines[i].chomp) if @filename.nil?
+                    @to = PrettyPatch.revisionOrDescription(lines[i])
+                    startOfSections = i + 1
+                    break
+                when BINARY_FILE_MARKER_FORMAT
+                    @binary = true
+                    if (IMAGE_FILE_MARKER_FORMAT.match(lines[i + 1]) or PrettyPatch.has_image_suffix(@filename)) then
+                        @image = true
+                        startOfSections = i + 2
+                        for x in startOfSections...lines.length
+                            # Binary diffs often have property changes listed before the actual binary data.  Skip them.
+                            if START_OF_BINARY_DATA_FORMAT.match(lines[x]) then
+                                startOfSections = x
+                                break
+                            end
+                        end
+                    end
+                    break
+                when GIT_INDEX_MARKER_FORMAT
+                    @git_indexes = [$1, $2]
+                when GIT_BINARY_FILE_MARKER_FORMAT
+                    @binary = true
+                    if (GIT_BINARY_PATCH_FORMAT.match(lines[i + 1]) and PrettyPatch.has_image_suffix(@filename)) then
+                        @git_image = true
+                        startOfSections = i + 1
+                    end
+                    break
+                end
+            end
+            lines_with_contents = lines[startOfSections...lines.length]
+            @sections = DiffSection.parse(lines_with_contents) unless @binary
+            if @image and not lines_with_contents.empty?
+                @image_url = "data:image/png;base64," + lines_with_contents.join
+                @image_checksum = FileDiff.read_checksum_from_png(lines_with_contents.join.unpack("m").join)
+            elsif @git_image
+                begin
+                    raise "index line is missing" unless @git_indexes
+
+                    chunks = nil
+                    for i in 0...lines_with_contents.length
+                        if lines_with_contents[i] =~ /^$/
+                            chunks = [lines_with_contents[i + 1 .. -1], lines_with_contents[0 .. i]]
+                            break
+                        end
+                    end
+
+                    raise "no binary chunks" unless chunks
+
+                    from_filepath = FileDiff.extract_contents_of_from_revision(@filename, chunks[0], @git_indexes[0])
+                    to_filepath = FileDiff.extract_contents_of_to_revision(@filename, chunks[1], @git_indexes[1], from_filepath, @git_indexes[0])
+                    filepaths = from_filepath, to_filepath
+
+                    binary_contents = filepaths.collect { |filepath| File.exists?(filepath) ? File.read(filepath) : nil }
+                    @image_urls = binary_contents.collect { |content| (content and not content.empty?) ? "data:image/png;base64," + [content].pack("m") : nil }
+                    @image_checksums = binary_contents.collect { |content| FileDiff.read_checksum_from_png(content) }
+                rescue
+                    $last_prettify_part_count["extract-error"] += 1
+                    @image_error = "Exception raised during decoding git binary patch:<pre>#{CGI.escapeHTML($!.to_s + "\n" + $!.backtrace.join("\n"))}</pre>"
+                ensure
+                    File.unlink(from_filepath) if (from_filepath and File.exists?(from_filepath))
+                    File.unlink(to_filepath) if (to_filepath and File.exists?(to_filepath))
+                end
+            end
+            nil
+        end
+
+        def image_to_html
+            if not @image_url then
+                return "<span class='text'>Image file removed</span>"
+            end
+
+            image_checksum = ""
+            if @image_checksum
+                image_checksum = @image_checksum
+            elsif @filename.include? "-expected.png" and @image_url
+                image_checksum = IMAGE_CHECKSUM_ERROR
+            end
+
+            return "<p>" + image_checksum + "</p><img class='image' src='" + @image_url + "' />"
+        end
+
+        def to_html
+            str = "<div class='FileDiff'>\n"
+            str += "<h1>#{PrettyPatch.linkifyFilename(@filename)}</h1>\n"
+            if @image then
+                str += self.image_to_html
+            elsif @git_image then
+                if @image_error
+                    str += @image_error
+                else
+                    for i in (0...2)
+                        image_url = @image_urls[i]
+                        image_checksum = @image_checksums[i]
+
+                        style = ["remove", "add"][i]
+                        str += "<p class=\"#{style}\">"
+
+                        if image_checksum
+                            str += image_checksum
+                        elsif @filename.include? "-expected.png" and image_url
+                            str += IMAGE_CHECKSUM_ERROR
+                        end
+
+                        str += "<br>"
+
+                        if image_url
+                            str += "<img class='image' src='" + image_url + "' />"
+                        else
+                            str += ["</p>Added", "</p>Removed"][i]
+                        end
+                    end
+                end
+            elsif @binary then
+                $last_prettify_part_count["binary"] += 1
+                str += "<span class='text'>Binary file, nothing to see here</span>"
+            else
+                str += @sections.collect{ |section| section.to_html }.join("<br>\n") unless @sections.nil?
+            end
+
+            if @from then
+                str += "<span class='revision'>" + @from + "</span>"
+            end
+
+            str += "</div>\n"
+        end
+
+        def self.parse(string)
+            haveSeenDiffHeader = false
+            linesForDiffs = []
+            string.each_line do |line|
+                if (PrettyPatch.diff_header?(line))
+                    linesForDiffs << []
+                    haveSeenDiffHeader = true
+                elsif (!haveSeenDiffHeader && line =~ /^--- /)
+                    linesForDiffs << []
+                    haveSeenDiffHeader = false
+                end
+                linesForDiffs.last << line unless linesForDiffs.last.nil?
+            end
+
+            linesForDiffs.collect { |lines| FileDiff.new(lines) }
+        end
+
+        def self.read_checksum_from_png(png_bytes)
+            # Ruby 1.9 added the concept of string encodings, so to avoid treating binary data as UTF-8,
+            # we can force the encoding to binary at this point.
+            if RUBY_VERSION >= "1.9"
+                png_bytes.force_encoding('binary')
+            end
+            match = png_bytes && png_bytes.match(/tEXtchecksum\0([a-fA-F0-9]{32})/)
+            match ? match[1] : nil
+        end
+
+        def self.git_new_file_binary_patch(filename, encoded_chunk, git_index)
+            return <<END
+diff --git a/#{filename} b/#{filename}
+new file mode 100644
+index 0000000000000000000000000000000000000000..#{git_index}
+GIT binary patch
+#{encoded_chunk.join("")}literal 0
+HcmV?d00001
+
+END
+        end
+
+        def self.git_changed_file_binary_patch(to_filename, from_filename, encoded_chunk, to_git_index, from_git_index)
+            return <<END
+diff --git a/#{from_filename} b/#{to_filename}
+copy from #{from_filename}
++++ b/#{to_filename}
+index #{from_git_index}..#{to_git_index}
+GIT binary patch
+#{encoded_chunk.join("")}literal 0
+HcmV?d00001
+
+END
+        end
+
+        def self.get_svn_uri(repository_path)
+            "http://src.chromium.org/blink/trunk/" + (repository_path) + "?p=" + $svn_revision.to_s
+        end
+
+        def self.get_new_temp_filepath_and_name
+            tempfile = Tempfile.new("PrettyPatch")
+            filepath = tempfile.path + '.bin'
+            filename = File.basename(filepath)
+            return filepath, filename
+        end
+
+        def self.download_from_revision_from_svn(repository_path)
+            filepath, filename = get_new_temp_filepath_and_name
+            svn_uri = get_svn_uri(repository_path)
+            open(filepath, 'wb') do |to_file|
+                to_file << open(svn_uri) { |from_file| from_file.read }
+            end
+            return filepath
+        end
+
+        def self.run_git_apply_on_patch(output_filepath, patch)
+            # Apply the git binary patch using git-apply.
+            cmd = GIT_PATH + " apply --directory=" + File.dirname(output_filepath)
+            stdin, stdout, stderr = *Open3.popen3(cmd)
+            begin
+                stdin.puts(patch)
+                stdin.close
+
+                error = stderr.read
+                if error != ""
+                    error = "Error running " + cmd + "\n" + "with patch:\n" + patch[0..500] + "...\n" + error
+                end
+                raise error if error != ""
+            ensure
+                stdin.close unless stdin.closed?
+                stdout.close
+                stderr.close
+            end
+        end
+
+        def self.extract_contents_from_git_binary_literal_chunk(encoded_chunk, git_index)
+            filepath, filename = get_new_temp_filepath_and_name
+            patch = FileDiff.git_new_file_binary_patch(filename, encoded_chunk, git_index)
+            run_git_apply_on_patch(filepath, patch)
+            return filepath
+        end
+
+        def self.extract_contents_from_git_binary_delta_chunk(from_filepath, from_git_index, encoded_chunk, to_git_index)
+            to_filepath, to_filename = get_new_temp_filepath_and_name
+            from_filename = File.basename(from_filepath)
+            patch = FileDiff.git_changed_file_binary_patch(to_filename, from_filename, encoded_chunk, to_git_index, from_git_index)
+            run_git_apply_on_patch(to_filepath, patch)
+            return to_filepath
+        end
+
+        def self.extract_contents_of_from_revision(repository_path, encoded_chunk, git_index)
+            # For literal encoded, simply reconstruct.
+            if GIT_LITERAL_FORMAT.match(encoded_chunk[0])
+                return extract_contents_from_git_binary_literal_chunk(encoded_chunk, git_index)
+            end
+            #  For delta encoded, download from svn.
+            if GIT_DELTA_FORMAT.match(encoded_chunk[0])
+                return download_from_revision_from_svn(repository_path)
+            end
+            raise "Error: unknown git patch encoding"
+        end
+
+        def self.extract_contents_of_to_revision(repository_path, encoded_chunk, git_index, from_filepath, from_git_index)
+            # For literal encoded, simply reconstruct.
+            if GIT_LITERAL_FORMAT.match(encoded_chunk[0])
+                return extract_contents_from_git_binary_literal_chunk(encoded_chunk, git_index)
+            end
+            # For delta encoded, reconstruct using delta and previously constructed 'from' revision.
+            if GIT_DELTA_FORMAT.match(encoded_chunk[0])
+                return extract_contents_from_git_binary_delta_chunk(from_filepath, from_git_index, encoded_chunk, git_index)
+            end
+            raise "Error: unknown git patch encoding"
+        end
+    end
+
+    class DiffBlock
+        attr_accessor :parts
+
+        def initialize(container)
+            @parts = []
+            container << self
+        end
+
+        def to_html
+            str = "<div class='DiffBlock'>\n"
+            str += @parts.collect{ |part| part.to_html }.join
+            str += "<div class='clear_float'></div></div>\n"
+        end
+    end
+
+    class DiffBlockPart
+        attr_reader :className
+        attr :lines
+
+        def initialize(className, container)
+            $last_prettify_part_count[className] += 1
+            @className = className
+            @lines = []
+            container.parts << self
+        end
+
+        def to_html
+            str = "<div class='DiffBlockPart %s'>\n" % @className
+            str += @lines.collect{ |line| line.to_html }.join
+            # Don't put white-space after this so adjacent inline-block DiffBlockParts will not wrap.
+            str += "</div>"
+        end
+    end
+
+    class DiffSection
+        def initialize(lines)
+            lines.length >= 1 or raise "DiffSection.parse only received %d lines" % lines.length
+
+            matches = START_OF_SECTION_FORMAT.match(lines[0])
+
+            if matches
+                from, to = [matches[1].to_i, matches[3].to_i]
+                if matches[2] and matches[4]
+                    from_end = from + matches[2].to_i
+                    to_end = to + matches[4].to_i
+                end
+            end
+
+            @blocks = []
+            diff_block = nil
+            diff_block_part = nil
+
+            for line in lines[1...lines.length]
+                startOfLine = line =~ /^[-\+ ]/ ? 1 : 0
+                text = line[startOfLine...line.length].chomp
+                case line[0]
+                when ?-
+                    if (diff_block_part.nil? or diff_block_part.className != 'remove')
+                        diff_block = DiffBlock.new(@blocks)
+                        diff_block_part = DiffBlockPart.new('remove', diff_block)
+                    end
+
+                    diff_block_part.lines << CodeLine.new(from, nil, text)
+                    from += 1 unless from.nil?
+                when ?+
+                    if (diff_block_part.nil? or diff_block_part.className != 'add')
+                        # Put add lines that immediately follow remove lines into the same DiffBlock.
+                        if (diff_block.nil? or diff_block_part.className != 'remove')
+                            diff_block = DiffBlock.new(@blocks)
+                        end
+
+                        diff_block_part = DiffBlockPart.new('add', diff_block)
+                    end
+
+                    diff_block_part.lines << CodeLine.new(nil, to, text)
+                    to += 1 unless to.nil?
+                else
+                    if (diff_block_part.nil? or diff_block_part.className != 'shared')
+                        diff_block = DiffBlock.new(@blocks)
+                        diff_block_part = DiffBlockPart.new('shared', diff_block)
+                    end
+
+                    diff_block_part.lines << CodeLine.new(from, to, text)
+                    from += 1 unless from.nil?
+                    to += 1 unless to.nil?
+                end
+
+                break if from_end and to_end and from == from_end and to == to_end
+            end
+
+            changes = [ [ [], [] ] ]
+            for block in @blocks
+                for block_part in block.parts
+                    for line in block_part.lines
+                        if (!line.fromLineNumber.nil? and !line.toLineNumber.nil?) then
+                            changes << [ [], [] ]
+                            next
+                        end
+                        changes.last.first << line if line.toLineNumber.nil?
+                        changes.last.last << line if line.fromLineNumber.nil?
+                    end
+                end
+            end
+
+            for change in changes
+                next unless change.first.length == change.last.length
+                for i in (0...change.first.length)
+                    from_text = change.first[i].text
+                    to_text = change.last[i].text
+                    next if from_text.length > MAXIMUM_INTRALINE_DIFF_LINE_LENGTH or to_text.length > MAXIMUM_INTRALINE_DIFF_LINE_LENGTH
+                    raw_operations = HTMLDiff::DiffBuilder.new(from_text, to_text).operations
+                    operations = []
+                    back = 0
+                    raw_operations.each_with_index do |operation, j|
+                        if operation.action == :equal and j < raw_operations.length - 1
+                           length = operation.end_in_new - operation.start_in_new
+                           if length < SMALLEST_EQUAL_OPERATION
+                               back = length
+                               next
+                           end
+                        end
+                        operation.start_in_old -= back
+                        operation.start_in_new -= back
+                        back = 0
+                        operations << operation
+                    end
+                    change.first[i].operations = operations
+                    change.last[i].operations = operations
+                end
+            end
+
+            @blocks.unshift(ContextLine.new(matches[5])) unless matches.nil? || matches[5].empty?
+        end
+
+        def to_html
+            str = "<div class='DiffSection'>\n"
+            str += @blocks.collect{ |block| block.to_html }.join
+            str += "</div>\n"
+        end
+
+        def self.parse(lines)
+            linesForSections = lines.inject([[]]) do |sections, line|
+                sections << [] if line =~ /^@@/
+                sections.last << line
+                sections
+            end
+
+            linesForSections.delete_if { |lines| lines.nil? or lines.empty? }
+            linesForSections.collect { |lines| DiffSection.new(lines) }
+        end
+    end
+
+    class Line
+        attr_reader :fromLineNumber
+        attr_reader :toLineNumber
+        attr_reader :text
+
+        def initialize(from, to, text)
+            @fromLineNumber = from
+            @toLineNumber = to
+            @text = text
+        end
+
+        def text_as_html
+            CGI.escapeHTML(text)
+        end
+
+        def classes
+            lineClasses = ["Line", "LineContainer"]
+            lineClasses << ["add"] unless @toLineNumber.nil? or !@fromLineNumber.nil?
+            lineClasses << ["remove"] unless @fromLineNumber.nil? or !@toLineNumber.nil?
+            lineClasses
+        end
+
+        def to_html
+            markedUpText = self.text_as_html
+            str = "<div class='%s'>\n" % self.classes.join(' ')
+            str += "<span class='from lineNumber'>%s</span><span class='to lineNumber'>%s</span>" %
+                   [@fromLineNumber.nil? ? '&nbsp;' : @fromLineNumber,
+                    @toLineNumber.nil? ? '&nbsp;' : @toLineNumber] unless @fromLineNumber.nil? and @toLineNumber.nil?
+            str += "<span class='text'>%s</span>\n" % markedUpText
+            str += "</div>\n"
+        end
+    end
+
+    class CodeLine < Line
+        attr :operations, true
+
+        def text_as_html
+            html = []
+            tag = @fromLineNumber.nil? ? "ins" : "del"
+            if @operations.nil? or @operations.empty?
+                return CGI.escapeHTML(@text)
+            end
+            @operations.each do |operation|
+                start = @fromLineNumber.nil? ? operation.start_in_new : operation.start_in_old
+                eend = @fromLineNumber.nil? ? operation.end_in_new : operation.end_in_old
+                escaped_text = CGI.escapeHTML(@text[start...eend])
+                if eend - start === 0 or operation.action === :equal
+                    html << escaped_text
+                else
+                    html << "<#{tag}>#{escaped_text}</#{tag}>"
+                end
+            end
+            html.join
+        end
+    end
+
+    class ContextLine < Line
+        def initialize(context)
+            super("@", "@", context)
+        end
+
+        def classes
+            super << "context"
+        end
+    end
+end
diff --git a/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch_test.rb b/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch_test.rb
new file mode 100755
index 0000000..0d5f943
--- /dev/null
+++ b/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch_test.rb
@@ -0,0 +1,99 @@
+#!/usr/bin/ruby
+
+require 'test/unit'
+require 'open-uri'
+require 'PrettyPatch'
+
+# Note: internet connection is needed to run this test suite.
+
+class PrettyPatch_test < Test::Unit::TestCase
+    class Info
+        TITLE = 0
+        FILE = 1
+        ADD = 2
+        REMOVE = 3
+        SHARED = 4
+    end
+
+    PATCHES = {
+        20510 => ["Single change", 1, 1, 0, 2],
+        20528 => ["No 'Index' or 'diff' in patch header", 1, 4, 3, 7],
+        21151 => ["Leading '/' in the path of files", 4, 9, 1, 16],
+        # Binary files use shared blocks, there are three in 30488.
+        30488 => ["Quoted filenames in git diff", 23, 28, 25, 64 + 3],
+        23920 => ["Mac line ending", 3, 3, 0, 5],
+        39615 => ["Git signature", 2, 2, 0, 3],
+        80852 => ["Changes one line plus ChangeLog", 2, 2, 1, 4],
+        83127 => ["Only add stuff", 2, 2, 0, 3],
+        85071 => ["Adds and removes from a file plus git signature", 2, 5, 3, 9],
+        106368 => ["Images with git delta binary patch", 69, 8, 23, 10],
+    }
+
+    def get_patch_uri(id)
+        "https://bugs.webkit.org/attachment.cgi?id=" + id.to_s
+    end
+
+    def get_patch(id)
+        result = nil
+        patch_uri = get_patch_uri(id)
+        begin
+            result = open(patch_uri) { |f| result = f.read }
+        rescue => exception
+            assert(false, "Fail to get patch " + patch_uri)
+        end
+        result
+    end
+
+    def check_one_patch(id, info)
+        patch = get_patch(id)
+        description = get_patch_uri(id)
+        description +=  " (" + info[Info::TITLE] + ")" unless info[Info::TITLE].nil?
+        puts "Testing " + description
+        pretty = nil
+        assert_nothing_raised("Crash while prettifying " + description) {
+            pretty = PrettyPatch.prettify(patch)
+        }
+        assert(pretty, "Empty result while prettifying " + description)
+        assert_equal(info[Info::FILE], $last_prettify_file_count, "Wrong number of files changed in " + description)
+        assert_equal(info[Info::ADD], $last_prettify_part_count["add"], "Wrong number of 'add' parts in " + description)
+        assert_equal(info[Info::REMOVE], $last_prettify_part_count["remove"], "Wrong number of 'remove' parts in " + description)
+        assert_equal(info[Info::SHARED], $last_prettify_part_count["shared"], "Wrong number of 'shared' parts in " + description)
+        assert_equal(0, $last_prettify_part_count["binary"], "Wrong number of 'binary' parts in " + description)
+        assert_equal(0, $last_prettify_part_count["extract-error"], "Wrong number of 'extract-error' parts in " + description)
+        return pretty
+    end
+
+    def test_patches
+        PATCHES.each { |id, info| check_one_patch(id, info) }
+    end
+
+    def test_images_without_checksum
+        pretty = check_one_patch(144064, ["Images without checksums", 10, 5, 4, 8])
+        matches = pretty.match("INVALID: Image lacks a checksum.")
+        # FIXME: This should match, but there's a bug when running the tests where the image data
+        # doesn't get properly written out to the temp files, so there is no image and we don't print
+        # the warning that the image is missing its checksum.
+        assert(!matches, "Should have invalid checksums")
+        # FIXME: This should only have 4 invalid images, but due to the above tempfile issue, there are 0.
+        assert_equal(0, pretty.scan(/INVALID\: Image lacks a checksum\./).size)
+    end
+
+    def test_new_image
+        pretty = check_one_patch(145881, ["New image", 19, 36, 19, 56])
+        matches = pretty.match("INVALID: Image lacks a checksum.")
+        assert(!matches, "Should not have invalid checksums")
+    end
+
+    def test_images_correctly_without_checksum_git
+        pretty = check_one_patch(101620, ["Images correctly without checksums git", 7, 15, 10, 26])
+        matches = pretty.match("INVALID: Image lacks a checksum.")
+        assert(!matches, "Png should lack a checksum without an error.")
+    end
+
+    def test_images_correctly_without_checksum_svn
+        pretty = check_one_patch(31202, ["Images correctly without checksums svn", 4, 4, 1, 4])
+        matches = pretty.match("INVALID: Image lacks a checksum.")
+        assert(!matches, "Png should lack a checksum without an error.")
+    end
+
+end
diff --git a/Tools/Scripts/webkitruby/PrettyPatch/diff.rb b/Tools/Scripts/webkitruby/PrettyPatch/diff.rb
new file mode 100644
index 0000000..e5c154a
--- /dev/null
+++ b/Tools/Scripts/webkitruby/PrettyPatch/diff.rb
@@ -0,0 +1,164 @@
+module HTMLDiff
+
+  Match = Struct.new(:start_in_old, :start_in_new, :size)
+  class Match
+    def end_in_old
+      self.start_in_old + self.size
+    end
+    
+    def end_in_new
+      self.start_in_new + self.size
+    end
+  end
+  
+  Operation = Struct.new(:action, :start_in_old, :end_in_old, :start_in_new, :end_in_new)
+
+  class DiffBuilder
+
+    def initialize(old_version, new_version)
+      @old_version, @new_version = old_version, new_version
+      split_inputs_to_words
+      index_new_words
+    end
+
+    def split_inputs_to_words
+      @old_words = explode(@old_version)
+      @new_words = explode(@new_version)
+    end
+
+    def index_new_words
+      @word_indices = Hash.new { |h, word| h[word] = [] }
+      @new_words.each_with_index { |word, i| @word_indices[word] << i }
+    end
+
+    def operations
+      position_in_old = position_in_new = 0
+      operations = []
+      
+      matches = matching_blocks
+      # an empty match at the end forces the loop below to handle the unmatched tails
+      # I'm sure it can be done more gracefully, but not at 23:52
+      matches << Match.new(@old_words.length, @new_words.length, 0)
+      
+      matches.each_with_index do |match, i|
+        match_starts_at_current_position_in_old = (position_in_old == match.start_in_old)
+        match_starts_at_current_position_in_new = (position_in_new == match.start_in_new)
+        
+        action_upto_match_positions = 
+          case [match_starts_at_current_position_in_old, match_starts_at_current_position_in_new]
+          when [false, false]
+            :replace
+          when [true, false]
+            :insert
+          when [false, true]
+            :delete
+          else
+            # this happens if the first few words are same in both versions
+            :none
+          end
+
+        if action_upto_match_positions != :none
+          operation_upto_match_positions = 
+              Operation.new(action_upto_match_positions, 
+                  position_in_old, match.start_in_old, 
+                  position_in_new, match.start_in_new)
+          operations << operation_upto_match_positions
+        end
+        if match.size != 0
+          match_operation = Operation.new(:equal, 
+              match.start_in_old, match.end_in_old, 
+              match.start_in_new, match.end_in_new)
+          operations << match_operation
+        end
+
+        position_in_old = match.end_in_old
+        position_in_new = match.end_in_new
+      end
+      
+      operations
+    end
+
+    def matching_blocks
+      matching_blocks = []
+      recursively_find_matching_blocks(0, @old_words.size, 0, @new_words.size, matching_blocks)
+      matching_blocks
+    end
+
+    def recursively_find_matching_blocks(start_in_old, end_in_old, start_in_new, end_in_new, matching_blocks)
+      match = find_match(start_in_old, end_in_old, start_in_new, end_in_new)
+      if match
+        if start_in_old < match.start_in_old and start_in_new < match.start_in_new
+          recursively_find_matching_blocks(
+              start_in_old, match.start_in_old, start_in_new, match.start_in_new, matching_blocks) 
+        end
+        matching_blocks << match
+        if match.end_in_old < end_in_old and match.end_in_new < end_in_new
+          recursively_find_matching_blocks(
+              match.end_in_old, end_in_old, match.end_in_new, end_in_new, matching_blocks)
+        end
+      end
+    end
+
+    def find_match(start_in_old, end_in_old, start_in_new, end_in_new)
+
+      best_match_in_old = start_in_old
+      best_match_in_new = start_in_new
+      best_match_size = 0
+      
+      match_length_at = Hash.new { |h, index| h[index] = 0 }
+      
+      start_in_old.upto(end_in_old - 1) do |index_in_old|
+
+        new_match_length_at = Hash.new { |h, index| h[index] = 0 }
+
+        @word_indices[@old_words[index_in_old]].each do |index_in_new|
+          next  if index_in_new < start_in_new
+          break if index_in_new >= end_in_new
+
+          new_match_length = match_length_at[index_in_new - 1] + 1
+          new_match_length_at[index_in_new] = new_match_length
+
+          if new_match_length > best_match_size
+            best_match_in_old = index_in_old - new_match_length + 1
+            best_match_in_new = index_in_new - new_match_length + 1
+            best_match_size = new_match_length
+          end
+        end
+        match_length_at = new_match_length_at
+      end
+
+#      best_match_in_old, best_match_in_new, best_match_size = add_matching_words_left(
+#          best_match_in_old, best_match_in_new, best_match_size, start_in_old, start_in_new)
+#      best_match_in_old, best_match_in_new, match_size = add_matching_words_right(
+#          best_match_in_old, best_match_in_new, best_match_size, end_in_old, end_in_new)
+
+      return (best_match_size != 0 ? Match.new(best_match_in_old, best_match_in_new, best_match_size) : nil)
+    end
+
+    def add_matching_words_left(match_in_old, match_in_new, match_size, start_in_old, start_in_new)
+      while match_in_old > start_in_old and 
+            match_in_new > start_in_new and 
+            @old_words[match_in_old - 1] == @new_words[match_in_new - 1]
+        match_in_old -= 1
+        match_in_new -= 1
+        match_size += 1
+      end
+      [match_in_old, match_in_new, match_size]
+    end
+
+    def add_matching_words_right(match_in_old, match_in_new, match_size, end_in_old, end_in_new)
+      while match_in_old + match_size < end_in_old and 
+            match_in_new + match_size < end_in_new and
+            @old_words[match_in_old + match_size] == @new_words[match_in_new + match_size]
+        match_size += 1
+      end
+      [match_in_old, match_in_new, match_size]
+    end
+
+    def explode(sequence)
+      sequence.is_a?(String) ? sequence.split(//) : sequence
+    end
+
+  end # of class Diff Builder
+  
+end
diff --git a/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb b/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb
new file mode 100755
index 0000000..a9c211f
--- /dev/null
+++ b/Tools/Scripts/webkitruby/PrettyPatch/prettify.rb
@@ -0,0 +1,37 @@
+#!/usr/bin/env ruby
+
+require 'optparse'
+require 'pathname'
+require 'webrick/htmlutils'
+
+$LOAD_PATH << Pathname.new(__FILE__).dirname.realpath.to_s
+
+require 'PrettyPatch'
+
+BACKTRACE_SEPARATOR = "\n\tfrom "
+
+options = { :html_exceptions => false }
+OptionParser.new do |opts|
+    opts.banner = "Usage: #{File.basename($0)} [options] [patch-file]"
+
+    opts.separator ""
+
+    opts.on("--html-exceptions", "Print exceptions to stdout as HTML") { |h| options[:html_exceptions] = h }
+end.parse!
+
+patch_data = nil
+if ARGV.length == 0 || ARGV[0] == '-' then
+    patch_data = $stdin.read
+else
+    File.open(ARGV[0]) { |file| patch_data = file.read }
+end
+
+begin
+    puts PrettyPatch.prettify(patch_data)
+rescue => exception
+    raise unless options[:html_exceptions]
+
+    backtrace = exception.backtrace
+    backtrace[0] += ": " + exception + " (" + exception.class.to_s + ")"
+    print "<pre>\n", WEBrick::HTMLUtils::escape(backtrace.join(BACKTRACE_SEPARATOR)), "\n</pre>\n"
+end