summaryrefslogtreecommitdiff
path: root/Tools/Scripts
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-11 19:54:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-11 19:54:20 +0200
commit88a04ac016f57c2d78e714682445dff2e7db4ade (patch)
treea48ca81ee3b29953121308168db22532d5b57fe2 /Tools/Scripts
parent284837daa07b29d6a63a748544a90b1f5842ac5c (diff)
downloadqtwebkit-88a04ac016f57c2d78e714682445dff2e7db4ade.tar.gz
Imported WebKit commit 42d95198c30c2d1a94a5081181aad0b2be7c316c (http://svn.webkit.org/repository/webkit/trunk@128206)
This includes the rewrite of the configure part of the build system which should fix the QtQuick2 detection and allow for further simplifications in the future
Diffstat (limited to 'Tools/Scripts')
-rwxr-xr-xTools/Scripts/build-webkit8
-rwxr-xr-xTools/Scripts/run-webkit-tests6
-rwxr-xr-xTools/Scripts/webkitdirs.pm227
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/base.py2
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/port/chromium.py7
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py86
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py2
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/factory.py4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py6
-rw-r--r--Tools/Scripts/webkitpy/style/checkers/test_expectations.py11
-rw-r--r--Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py3
11 files changed, 153 insertions, 209 deletions
diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit
index a81922a11..4b161a5ad 100755
--- a/Tools/Scripts/build-webkit
+++ b/Tools/Scripts/build-webkit
@@ -256,7 +256,7 @@ if (isGtk()) {
push @options, "--install-headers=" . $installHeaders if defined($installHeaders);
push @options, "--install-libs=" . $installLibs if defined($installLibs);
push @options, "--makeargs=" . $makeArgs if $makeArgs;
- push @options, "--qmakearg=CONFIG+=no_webkit2" if $noWebKit2;
+ 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";
@@ -265,7 +265,11 @@ if (isGtk()) {
@options = (@ARGV, @options);
foreach (@features) {
- push @options, "DEFINES+=$_->{define}=${$_->{value}}" if $_->{define} && ${$_->{value}} != $_->{default};
+ if ($_->{define} && ${$_->{value}} != $_->{default}) {
+ my $define = lc($_->{define});
+ $define =~ s/^enable_//;
+ push @options, "WEBKIT_CONFIG" . (${$_->{value}} == 1 ? "+" : "-") . "=" . $define;
+ }
}
}
diff --git a/Tools/Scripts/run-webkit-tests b/Tools/Scripts/run-webkit-tests
index aca8d5dc9..4bb8f3944 100755
--- a/Tools/Scripts/run-webkit-tests
+++ b/Tools/Scripts/run-webkit-tests
@@ -112,10 +112,12 @@ if (isQt()) {
push(@ARGV, "--gtk");
} elsif (isEfl()) {
push(@ARGV, "--efl");
+} elsif (isChromiumAndroid()) {
+ push(@ARGV, "--chromium-android");
} elsif (isChromium()) {
- push(@ARGV, "--chromium")
+ push(@ARGV, "--chromium");
} elsif (isWinCairo()) {
- push(@ARGV, "--wincairo")
+ push(@ARGV, "--wincairo");
}
my $harnessPath = File::Spec->catfile(relativeScriptsDir(), $harnessName);
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index 4bbe2d85d..5c0e8d3b8 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -735,8 +735,8 @@ sub builtDylibPathForName
$libraryName .= "d";
}
- my $mkspec = `$qmakebin -query QMAKE_MKSPECS`;
- $mkspec =~ s/[\n|\r]$//g;
+ chomp(my $mkspec = `$qmakebin -query QT_HOST_DATA`);
+ $mkspec .= "/mkspecs";
my $qtMajorVersion = retrieveQMakespecVar("$mkspec/qconfig.pri", "QT_MAJOR_VERSION");
if (not $qtMajorVersion) {
$qtMajorVersion = "";
@@ -834,45 +834,27 @@ sub qtFeatureDefaults
{
die "ERROR: qmake missing but required to build WebKit.\n" if not commandExists($qmakebin);
- my $qmakepath = File::Spec->catfile(sourceDir(), "Tools", "qmake");
- my $qmakecommand;
- if (isWindows()) {
- $qmakecommand = "(set QMAKEPATH=$qmakepath) && $qmakebin";
- } else {
- $qmakecommand = "QMAKEPATH=$qmakepath $qmakebin";
- }
+ my $oldQmakeEval = $ENV{QMAKE_CACHE_EVAL};
+ $ENV{QMAKE_CACHE_EVAL} = "CONFIG+=print_defaults";
my $originalCwd = getcwd();
+ my $qmakepath = File::Spec->catfile(sourceDir(), "Tools", "qmake");
+ chdir $qmakepath or die "Failed to cd into " . $qmakepath . "\n";
+
+ my $file = File::Spec->catfile(sourceDir(), "WebKit.pro");
- my $file = File::Spec->catfile($qmakepath, "configure.pro");
my @buildArgs;
- my $qconfigs;
-
- if (@_) {
- @buildArgs = (@buildArgs, @{$_[0]});
- $qconfigs = $_[1];
- my $dir = File::Spec->catfile(productDir(), "Tools", "qmake");
- File::Path::mkpath($dir);
- chdir $dir or die "Failed to cd into " . $dir . "\n";
- } else {
- # Do a quick check of the features without running the config tests
- push @buildArgs, "CONFIG+=quick_check";
- }
+ @buildArgs = (@buildArgs, @{$_[0]}) if (@_);
- my @defaults = `$qmakecommand @buildArgs -nocache $file 2>&1`;
+ my @defaults = `$qmakebin @buildArgs $file 2>&1`;
my %qtFeatureDefaults;
for (@defaults) {
- if (/ DEFINES: /) {
+ if (/DEFINES: /) {
while (/(\S+?)=(\S+?)/gi) {
$qtFeatureDefaults{$1}=$2;
}
- } elsif (/ CONFIG:(.*)$/) {
- if (@_) {
- $$qconfigs = $1;
- }
} elsif (/Done computing defaults/) {
- print "\n";
last;
} elsif (@_) {
print $_;
@@ -880,6 +862,7 @@ sub qtFeatureDefaults
}
chdir $originalCwd;
+ $ENV{QMAKE_CACHE_EVAL} = $oldQmakeEval;
return %qtFeatureDefaults;
}
@@ -1872,8 +1855,8 @@ sub retrieveQMakespecVar
sub qtMakeCommand($)
{
my ($qmakebin) = @_;
- chomp(my $mkspec = `$qmakebin -query QMAKE_MKSPECS`);
- $mkspec .= "/default";
+ chomp(my $mkspec = `$qmakebin -query QT_HOST_DATA`);
+ $mkspec .= "/mkspecs/default";
my $compiler = retrieveQMakespecVar("$mkspec/qmake.conf", "QMAKE_CC");
#print "default spec: " . $mkspec . "\n";
@@ -2212,6 +2195,7 @@ sub buildQMakeProjects
my $make = qtMakeCommand($qmakebin);
my $makeargs = "";
+ my $command;
my $installHeaders;
my $installLibs;
for my $i (0 .. $#buildParams) {
@@ -2236,14 +2220,23 @@ sub buildQMakeProjects
$makeargs .= " -j" . numberOfCPUs();
}
- my $qmakepath = File::Spec->catfile(sourceDir(), "Tools", "qmake");
- my $qmakecommand;
- if (isWindows()) {
- $qmakecommand = "(set QMAKEPATH=$qmakepath) && $qmakebin";
- } else {
- $qmakecommand = "QMAKEPATH=$qmakepath $qmakebin";
+ $make = "$make $makeargs";
+ $make =~ s/\s+$//;
+
+ my $originalCwd = getcwd();
+ my $dir = File::Spec->canonpath(productDir());
+ File::Path::mkpath($dir);
+ chdir $dir or die "Failed to cd into " . $dir . "\n";
+
+ if ($clean) {
+ $command = "$make distclean";
+ print "\nCalling '$command' in " . $dir . "\n\n";
+ return system $command;
}
+ my $qmakepath = File::Spec->catfile(sourceDir(), "Tools", "qmake");
+ my $qmakecommand = $qmakebin;
+
my $config = configuration();
push @buildArgs, "INSTALL_HEADERS=" . $installHeaders if defined($installHeaders);
push @buildArgs, "INSTALL_LIBS=" . $installLibs if defined($installLibs);
@@ -2252,153 +2245,81 @@ sub buildQMakeProjects
if ($passedConfig =~ m/debug/i) {
push @buildArgs, "CONFIG-=release";
push @buildArgs, "CONFIG+=debug";
- } elsif (!$passedConfig or $passedConfig =~ m/release/i) {
+ } elsif ($passedConfig =~ m/release/i) {
push @buildArgs, "CONFIG+=release";
push @buildArgs, "CONFIG-=debug";
- } else {
+ } elsif ($passedConfig) {
die "Build type $passedConfig is not supported with --qt.\n";
}
push @buildArgs, "CONFIG-=debug_and_release" if ($passedConfig && isDarwin());
- my $originalCwd = getcwd();
- my $dir = File::Spec->canonpath(productDir());
- File::Path::mkpath($dir);
- chdir $dir or die "Failed to cd into " . $dir . "\n";
-
- my %defines = qtFeatureDefaults(\@buildArgs, \$qconfigs);
+ # Using build-webkit to build assumes you want a developer-build
+ push @buildArgs, "CONFIG-=production_build";
my $svnRevision = currentSVNRevision();
+ my $previousSvnRevision = "unknown";
my $buildHint = "";
- my $pathToDefinesCache = File::Spec->catfile($dir, ".webkit.config");
- my $pathToOldDefinesFile = File::Spec->catfile($dir, "defaults.txt");
-
- # FIXME: Get rid of .webkit.config and defaults.txt and move all the logic to .qmake.cache
-
- # Ease transition to new build layout
- if (-e $pathToOldDefinesFile) {
- print "Old build layout detected";
- $buildHint = "clean";
- } elsif (-e $pathToDefinesCache && open(DEFAULTS, $pathToDefinesCache)) {
- my %previousDefines;
- while (<DEFAULTS>) {
- if ($_ =~ m/(\S+)=(\S+)/gi) {
- $previousDefines{$1} = $2;
- }
- }
- close (DEFAULTS);
-
- $previousDefines{"SVN_REVISION"} = "unknown" if not exists $previousDefines{"SVN_REVISION"};
-
- if ($svnRevision ne $previousDefines{"SVN_REVISION"}) {
- print "Last built revision was " . $previousDefines{"SVN_REVISION"} .
- ", now at revision $svnRevision. Full incremental build needed.\n";
-
- $buildHint = "incremental";
- }
-
- # Don't confuse the should-we-clean heuristics below
- delete($previousDefines{"SVN_REVISION"});
-
- my @uniqueDefineNames = keys %{ +{ map { $_, 1 } (keys %defines, keys %previousDefines) } };
- foreach my $define (@uniqueDefineNames) {
- if (! exists $previousDefines{$define}) {
- print "Feature $define added";
- $buildHint = "clean";
- last;
- }
-
- if (! exists $defines{$define}) {
- print "Feature $define removed";
- $buildHint = "clean";
- last;
- }
-
- if ($defines{$define} != $previousDefines{$define}) {
- print "Feature $define changed ($previousDefines{$define} -> $defines{$define})";
- $buildHint = "clean";
- last;
+ my $pathToQmakeCache = File::Spec->catfile($dir, ".qmake.cache");
+ if (-e $pathToQmakeCache && open(QMAKECACHE, $pathToQmakeCache)) {
+ while (<QMAKECACHE>) {
+ if ($_ =~ m/^SVN_REVISION\s=\s(\d+)$/) {
+ $previousSvnRevision = $1;
}
}
- } else {
- # Missing build cache suggests we had a broken build after a clean,
- # so we assume we have to do an incremental build just in case.
- $buildHint = "incremental";
}
- if ($buildHint eq "clean") {
- print ", clean build needed!\n";
- # FIXME: This STDIN/STDOUT check does not work on the bots. Disable until it does.
- # if (! -t STDIN || ( &promptUser("Would you like to clean the build directory?", "yes") eq "yes")) {
- chdir $originalCwd;
- File::Path::rmtree($dir);
- File::Path::mkpath($dir);
- chdir $dir or die "Failed to cd into " . $dir . "\n";
- #}
+ my $result = 0;
- # Still trigger an incremental build
- $buildHint = "incremental";
- }
+ # Run qmake, regadless of having a makefile or not, so that qmake can
+ # detect changes to the configuration.
- if ($buildHint eq "incremental") {
- my $qmakeDefines = "DEFINES +=";
- foreach my $key (sort keys %defines) {
- $qmakeDefines .= " \\\n $key=$defines{$key}";
- }
- open(QMAKE_CACHE, ">.qmake.cache") or die "Cannot create .qmake.cache!\n";
- print QMAKE_CACHE "CONFIG += webkit_configured $qconfigs\n";
- print QMAKE_CACHE $qmakeDefines."\n";
- close(QMAKE_CACHE);
- }
+ push @buildArgs, "-after OVERRIDE_SUBDIRS=\"@{$projects}\"" if @{$projects};
+ unshift @buildArgs, File::Spec->catfile(sourceDir(), "WebKit.pro");
+ $command = "$qmakecommand @buildArgs";
+ print "Calling '$command' in " . $dir . "\n\n";
+ print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
+ print "Installation libraries directory: $installLibs\n" if(defined($installLibs));
- # Save config up-front so we can detect changes to the build config even
- # when the user re-configures after aborting the build.
- open(DEFAULTS, ">$pathToDefinesCache");
- print DEFAULTS "# These defines were set when building WebKit last time\n";
- foreach my $key (sort keys %defines) {
- print DEFAULTS "$key=$defines{$key}\n";
+ my $configChanged = 0;
+ open(QMAKE, "$command 2>&1 |") || die "Could not execute qmake";
+ while (<QMAKE>) {
+ $configChanged = 1 if $_ =~ m/The configuration was changed since the last build/;
+ print $_;
}
- close(DEFAULTS);
- my $result = 0;
-
- my $makefile = File::Spec->catfile($dir, "Makefile");
- if (! -e $makefile) {
- push @buildArgs, "-after OVERRIDE_SUBDIRS=\"@{$projects}\"" if @{$projects};
+ close(QMAKE);
+ $result = $?;
- push @buildArgs, File::Spec->catfile(sourceDir(), "WebKit.pro");
- my $command = "$qmakecommand @buildArgs";
- print "Calling '$command' in " . $dir . "\n\n";
- print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
- print "Installation libraries directory: $installLibs\n" if(defined($installLibs));
+ $command = "$make";
- $result = system "$command";
- if ($result ne 0) {
- die "Failed to setup build environment using $qmakebin!\n";
- }
+ if ($result ne 0) {
+ die "\nFailed to set up build environment using $qmakebin!\n";
}
- my $command = "$make $makeargs";
- $command =~ s/\s+$//;
+ if ($configChanged) {
+ print "Calling '$command wipeclean' in " . $dir . "\n\n";
+ $result = system "$command wipeclean";
+ }
- if ($clean) {
- $command = "$command distclean";
- } elsif ($buildHint eq "incremental") {
- $command = "$command incremental";
+ if ($svnRevision ne $previousSvnRevision) {
+ print "Last built revision was " . $previousSvnRevision .
+ ", now at revision $svnRevision. Full incremental build needed.\n";
+ $command .= " incremental";
}
- print "Calling '$command' in " . $dir . "\n\n";
+ print "\nCalling '$command' in " . $dir . "\n\n";
$result = system $command;
chdir ".." or die;
if ($result eq 0) {
# Now that the build completed successfully we can save the SVN revision
- open(DEFAULTS, ">>$pathToDefinesCache");
- print DEFAULTS "SVN_REVISION=$svnRevision\n";
- close(DEFAULTS);
- } elsif ($buildHint eq "" && exitStatus($result)) {
+ open(QMAKECACHE, ">>$pathToQmakeCache");
+ print QMAKECACHE "SVN_REVISION = $svnRevision\n";
+ close(QMAKECACHE);
+ } elsif (!$command =~ /incremental/ && exitStatus($result)) {
my $exitCode = exitStatus($result);
my $failMessage = <<EOF;
@@ -2411,11 +2332,11 @@ The build failed with exit code $exitCode. This may have been because you
- added a new resource to a qrc file
as dependencies are not automatically re-computed for local developer builds.
-You may try computing dependencies manually by running 'make qmake' in:
+You may try computing dependencies manually by running 'make qmake_all' in:
$dir
-or passing --makeargs="qmake" to build-webkit.
+or passing --makeargs="qmake_all" to build-webkit.
=========================
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 868643711..8997a5fe8 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -156,7 +156,7 @@ class Port(object):
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 50 * 1000
+ return 80 * 1000
return 35 * 1000
def driver_stop_timeout(self):
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index e66b0a204..206219c4c 100755
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -405,10 +405,9 @@ class ChromiumPort(Port):
if (debug_mtime > release_mtime and configuration == 'Release' or
release_mtime > debug_mtime and configuration == 'Debug'):
- _log.warning('You are not running the most '
- 'recent DumpRenderTree binary. You need to '
- 'pass --debug or not to select between '
- 'Debug and Release.')
+ most_recent_binary = 'Release' if configuration == 'Debug' else 'Debug'
+ _log.warning('You are running the %s binary. However the %s binary appears to be more recent. '
+ 'Please pass --%s.', configuration, most_recent_binary, most_recent_binary.lower())
_log.warning('')
# This will fail if we don't have both a debug and release binary.
# That's fine because, in this case, we must already be running the
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
index d2b26870e..600d9a058 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
@@ -31,6 +31,8 @@ import copy
import logging
import os
import re
+import sets
+import subprocess
import threading
import time
@@ -54,7 +56,6 @@ COMMAND_LINE_FILE = DEVICE_SOURCE_ROOT_DIR + 'chrome-native-tests-command-line'
# and Chromium's webkit/support/platform_support_android.cc.
DEVICE_DRT_DIR = DEVICE_SOURCE_ROOT_DIR + 'drt/'
DEVICE_FORWARDER_PATH = DEVICE_DRT_DIR + 'forwarder'
-DEVICE_DRT_STAMP_PATH = DEVICE_DRT_DIR + 'DumpRenderTree.stamp'
DRT_APP_PACKAGE = 'org.chromium.native_test'
DRT_ACTIVITY_FULL_NAME = DRT_APP_PACKAGE + '/.ChromeNativeTestActivity'
@@ -137,6 +138,8 @@ TEST_RESOURCES_TO_PUSH = [
'compositing/resources/video.mp4',
]
+MD5SUM_DEVICE_FILE_NAME = 'md5sum_bin'
+MD5SUM_DEVICE_PATH = '/data/local/tmp/' + MD5SUM_DEVICE_FILE_NAME
class ChromiumAndroidPort(chromium.ChromiumPort):
port_name = 'chromium-android'
@@ -324,10 +327,23 @@ class ChromiumAndroidDriver(driver.Driver):
self._teardown_performance()
super(ChromiumAndroidDriver, self).__del__()
+ def _setup_md5sum_and_push_data_if_needed(self):
+ self._md5sum_path = self._port._build_path_with_configuration(self._port.get_option('configuration'), MD5SUM_DEVICE_FILE_NAME)
+ assert os.path.exists(self._md5sum_path)
+
+ if not self._file_exists_on_device(MD5SUM_DEVICE_PATH):
+ if not self._push_to_device(self._md5sum_path, MD5SUM_DEVICE_PATH):
+ _log.error('Could not push md5sum to device')
+
+ self._push_executable()
+ self._push_fonts()
+ self._push_test_resources()
+
def _setup_test(self):
if self._has_setup:
return
+ self._setup_md5sum_and_push_data_if_needed()
self._has_setup = True
self._run_adb_command(['root'])
self._setup_performance()
@@ -340,10 +356,6 @@ class ChromiumAndroidDriver(driver.Driver):
self._run_adb_command(['shell', 'mkdir', '-p', DEVICE_DRT_DIR])
self._run_adb_command(['shell', 'chmod', '777', DEVICE_DRT_DIR])
- self._push_executable()
- self._push_fonts()
- self._synchronize_datetime()
-
# 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])
@@ -357,29 +369,34 @@ class ChromiumAndroidDriver(driver.Driver):
def _abort(self, message):
raise AssertionError('[%s] %s' % (self._device_serial, message))
+ @staticmethod
+ def _extract_hashes_from_md5sum_output(md5sum_output):
+ assert md5sum_output
+ return [line.split(' ')[0] for line in md5sum_output]
+
+ 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],
+ 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)
+
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()
- forwarder_host_path = self._port._path_to_forwarder()
- host_stamp = int(float(max(os.stat(drt_host_path).st_mtime,
- os.stat(forwarder_host_path).st_mtime)))
- device_stamp = int(float(self._run_adb_command([
- 'shell', 'cat %s 2>/dev/null || echo 0' % DEVICE_DRT_STAMP_PATH])))
- if device_stamp != host_stamp:
- self._log_debug('Pushing executable')
- self._push_to_device(forwarder_host_path, DEVICE_FORWARDER_PATH)
- self._run_adb_command(['uninstall', DRT_APP_PACKAGE])
- install_result = self._run_adb_command(['install', drt_host_path])
- if install_result.find('Success') == -1:
- self._abort('Failed to install %s onto device: %s' % (drt_host_path, install_result))
- self._push_to_device(self._port._build_path('DumpRenderTree.pak'), DEVICE_DRT_DIR + 'DumpRenderTree.pak')
- self._push_to_device(self._port._build_path('DumpRenderTree_resources'), DEVICE_DRT_DIR + 'DumpRenderTree_resources')
- self._push_to_device(self._port._build_path('android_main_fonts.xml'), DEVICE_DRT_DIR + 'android_main_fonts.xml')
- self._push_to_device(self._port._build_path('android_fallback_fonts.xml'), DEVICE_DRT_DIR + 'android_fallback_fonts.xml')
- # Version control of test resources is dependent on executables,
- # because we will always rebuild executables when resources are
- # updated.
- self._push_test_resources()
- self._run_adb_command(['shell', 'echo %d >%s' % (host_stamp, DEVICE_DRT_STAMP_PATH)])
+ install_result = self._run_adb_command(['install', drt_host_path])
+ if install_result.find('Success') == -1:
+ self._abort('Failed to install %s onto device: %s' % (drt_host_path, install_result))
def _push_fonts(self):
if not self._check_version(DEVICE_FONTS_DIR, FONT_FILES_VERSION):
@@ -394,18 +411,7 @@ class ChromiumAndroidDriver(driver.Driver):
def _push_test_resources(self):
self._log_debug('Pushing test resources')
for resource in TEST_RESOURCES_TO_PUSH:
- self._push_to_device(self._port.layout_tests_dir() + '/' + resource, DEVICE_LAYOUT_TESTS_DIR + resource)
-
- def _synchronize_datetime(self):
- # The date/time between host and device may not be synchronized.
- # We need to make them synchronized, otherwise tests might fail.
- try:
- # Get seconds since 1970-01-01 00:00:00 UTC.
- host_datetime = self._port._executive.run_command(['date', '-u', '+%s'])
- except:
- # Reset to 1970-01-01 00:00:00 UTC.
- host_datetime = 0
- self._run_adb_command(['shell', 'date -u %s' % (host_datetime)])
+ self._push_file_if_needed(self._port.layout_tests_dir() + '/' + resource, DEVICE_LAYOUT_TESTS_DIR + resource)
def _check_version(self, dir, version):
assert(dir.endswith('/'))
@@ -664,8 +670,6 @@ class ChromiumAndroidDriver(driver.Driver):
while True:
current_char = self._server_process.read_stdout(deadline, 1)
if current_char == ' ':
- if last_char == '#':
+ if last_char in ('#', '$'):
return
- if last_char == '$':
- raise AssertionError('Adbd is not running as root')
last_char = current_char
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 d200acc5b..f6cc51301 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
@@ -240,7 +240,7 @@ class ChromiumAndroidDriverTest(unittest.TestCase):
self.driver._server_process = driver_unittest.MockServerProcess(lines=['root@android:/ # '])
self.assertEquals(self.driver._read_prompt(time.time() + 1), None)
self.driver._server_process = driver_unittest.MockServerProcess(lines=['$ '])
- self.assertRaises(AssertionError, self.driver._read_prompt, time.time() + 1)
+ self.assertEquals(self.driver._read_prompt(time.time() + 1), None)
def test_command_from_driver_input(self):
driver_input = driver.DriverInput('foo/bar/test.html', 10, 'checksum', True)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
index 9b5cf27b0..7e4750219 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -46,8 +46,10 @@ def port_options(**help_strings):
help='Set the configuration to Release'),
optparse.make_option('--platform', action='store',
help=help_strings.get('platform', 'Platform/Port being tested (e.g., "mac-lion")')),
- optparse.make_option("--chromium", action="store_const", const='chromium', dest='platform',
+ optparse.make_option('--chromium', action='store_const', const='chromium', dest='platform',
help='Alias for --platform=chromium'),
+ optparse.make_option('--chromium-android', action='store_const', const='chromium-android', dest='platform',
+ help='Alias for --platform=chromium-android'),
optparse.make_option('--efl', action='store_const', const='efl', dest="platform",
help='Alias for --platform=efl'),
optparse.make_option('--gtk', action='store_const', const='gtk', dest="platform",
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
index cba5d2b39..bb077c40a 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
@@ -31,6 +31,7 @@ import unittest
from webkitpy.tool.mocktool import MockOptions
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.layout_tests.port import chromium_android
from webkitpy.layout_tests.port import chromium_linux
from webkitpy.layout_tests.port import chromium_mac
from webkitpy.layout_tests.port import chromium_win
@@ -85,6 +86,11 @@ class FactoryTest(unittest.TestCase):
self.assert_port(port_name='chromium', os_name='linux', os_version='lucid',
cls=chromium_linux.ChromiumLinuxPort)
+ def test_chromium_android(self):
+ self.assert_port(port_name='chromium-android', cls=chromium_android.ChromiumAndroidPort)
+ # NOTE: We can't check for port_name=chromium here, as this will append the host's
+ # operating system, whereas host!=target for Android.
+
def test_chromium_win(self):
self.assert_port(port_name='chromium-win-xp', cls=chromium_win.ChromiumWinPort)
self.assert_port(port_name='chromium-win', os_name='win', os_version='xp',
diff --git a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
index 3b81132c3..46403b7db 100644
--- a/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
+++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -49,11 +49,14 @@ class TestExpectationsChecker(object):
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 = optparse.Values({'configuration': 'Release'})
+ options_wk1 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': False})
+ options_wk2 = optparse.Values({'configuration': 'Release', 'webkit_test_runner': True})
for port_name in host.port_factory.all_port_names():
- port = host.port_factory.get(port_name, options=options)
- if port.path_to_test_expectations_file().replace(port.path_from_webkit_base() + host.filesystem.sep, '') == expectations_path:
- return port
+ 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
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 8b53e6dfa..ab70ba202 100644
--- a/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -79,6 +79,9 @@ class TestExpectationsTestCase(unittest.TestCase):
self._expect_port_for_expectations_path('chromium', 'LayoutTests/platform/chromium/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')
def assert_lines_lint(self, lines, should_pass, expected_output=None):
self._error_collector.reset_errors()