summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/Scripts/webkitpy')
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/ports.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py11
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/config.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py1
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py40
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css17
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js25
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py34
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py37
14 files changed, 65 insertions, 127 deletions
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index bb2d551..b451721 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -130,7 +130,6 @@ committers_unable_to_review = [
Committer("Jochen Eisinger", "jochen@chromium.org", "jochen__"),
Committer("John Abd-El-Malek", "jam@chromium.org", "jam"),
Committer("John Gregg", ["johnnyg@google.com", "johnnyg@chromium.org"], "johnnyg"),
- Committer("Johnny Ding", ["jnd@chromium.org", "johnnyding.webkit@gmail.com"], "johnnyding"),
Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"),
Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"),
Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]),
diff --git a/WebKitTools/Scripts/webkitpy/common/config/ports.py b/WebKitTools/Scripts/webkitpy/common/config/ports.py
index 5f15e88..d268865 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/ports.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports.py
@@ -221,7 +221,6 @@ class ChromiumPort(WebKitPort):
def build_webkit_command(cls, build_style=None):
command = WebKitPort.build_webkit_command(build_style=build_style)
command.append("--chromium")
- command.append("--update-chromium")
return command
@classmethod
diff --git a/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
index 125981a..3bdf0e6 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
@@ -65,8 +65,8 @@ class WebKitPortTest(unittest.TestCase):
self.assertEquals(ChromiumPort.name(), "Chromium")
self.assertEquals(ChromiumPort.flag(), "--port=chromium")
self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("new-run-webkit-tests"), "--chromium", "--use-drt", "--no-pixel-tests"])
- self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium", "--update-chromium"])
- self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium", "--update-chromium"])
+ self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium"])
+ self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium"])
self.assertEquals(ChromiumPort.update_webkit_command(), [WebKitPort.script_path("update-webkit"), "--chromium"])
def test_chromium_xvfb_port(self):
diff --git a/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
index 2dbc1e8..4e6d3da 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -49,7 +49,16 @@ class MockFileSystem(object):
return False
def join(self, *comps):
- return '/'.join(comps)
+ # os.path.join ignores trailing slashes on components (i.e.
+ # join('foo/', 'bar') and join('foo', 'bar') produce the same result),
+ # we emulate that behavior.
+ trimmed_comps = []
+ for comp in comps:
+ if len(comp) and comp[-1] == '/':
+ trimmed_comps.append(comp[0:-1])
+ else:
+ trimmed_comps.append(comp)
+ return '/'.join(trimmed_comps)
def maybe_make_directory(self, *path):
# FIXME: Implement such that subsequent calls to isdir() work?
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index bc5a9aa..757318d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -492,7 +492,7 @@ class Port(object):
"""Relative unix-style path for a filename under the LayoutTests
directory. Filenames outside the LayoutTests directory should raise
an error."""
- assert filename.startswith(self.layout_tests_dir()), "%s did not start with %s" % (filename, self.layout_tests_dir())
+ #assert(filename.startswith(self.layout_tests_dir()))
return filename[len(self.layout_tests_dir()) + 1:]
def results_directory(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
index 88f1146..9aec637 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
@@ -132,7 +132,7 @@ class Config(object):
# This code will also work if there is no SCM system at all.
if not self._webkit_base_dir:
abspath = os.path.abspath(__file__)
- self._webkit_base_dir = abspath[0:abspath.find('WebKitTools') - 1]
+ self._webkit_base_dir = abspath[0:abspath.find('WebKitTools')]
return self._webkit_base_dir
def _script_path(self, script_name):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
index 8ec28fc..2d23691 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
@@ -186,7 +186,6 @@ class ConfigTest(unittest.TestCase):
c = config.Config(executive.Executive(), filesystem.FileSystem())
base_dir = c.webkit_base_dir()
self.assertTrue(base_dir)
- self.assertNotEqual(base_dir[-1], '/')
orig_cwd = os.getcwd()
os.chdir(os.environ['HOME'])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index f4e92a6..643e204 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -599,25 +599,20 @@ class TestRunner:
message_broker = self._message_broker
self._current_filename_queue = filename_queue
self._current_result_summary = result_summary
-
- if not self._options.dry_run:
- threads = message_broker.start_workers(self)
- else:
- threads = {}
+ threads = message_broker.start_workers(self)
self._printer.print_update("Starting testing ...")
keyboard_interrupted = False
- if not self._options.dry_run:
- try:
- message_broker.run_message_loop()
- except KeyboardInterrupt:
- _log.info("Interrupted, exiting")
- message_broker.cancel_workers()
- keyboard_interrupted = True
- except:
- # Unexpected exception; don't try to clean up workers.
- _log.info("Exception raised, exiting")
- raise
+ try:
+ message_broker.run_message_loop()
+ except KeyboardInterrupt:
+ _log.info("Interrupted, exiting")
+ message_broker.cancel_workers()
+ keyboard_interrupted = True
+ except:
+ # Unexpected exception; don't try to clean up workers.
+ _log.info("Exception raised, exiting")
+ raise
thread_timings, test_timings, individual_test_timings = \
self._collect_timing_info(threads)
@@ -742,18 +737,16 @@ class TestRunner:
self._expectations, result_summary, retry_summary)
self._printer.print_unexpected_results(unexpected_results)
- if (self._options.record_results and not self._options.dry_run and
- not keyboard_interrupted):
+ if self._options.record_results:
# Write the same data to log files and upload generated JSON files
# to appengine server.
self._upload_json_files(unexpected_results, result_summary,
individual_test_timings)
# Write the summary to disk (results.html) and display it if requested.
- if not self._options.dry_run:
- wrote_results = self._write_results_html_file(result_summary)
- if self._options.show_results and wrote_results:
- self._show_results_html_file()
+ wrote_results = self._write_results_html_file(result_summary)
+ if self._options.show_results and wrote_results:
+ self._show_results_html_file()
# Now that we've completed all the processing we can, we re-raise
# a KeyboardInterrupt if necessary so the caller can handle it.
@@ -1527,9 +1520,6 @@ def parse_args(args=None):
optparse.make_option("--no-build", dest="build",
action="store_false", help="Don't check to see if the "
"DumpRenderTree build is up-to-date."),
- optparse.make_option("-n", "--dry-run", action="store_true",
- default=False,
- help="Do everything but actually run the tests or upload results."),
# old-run-webkit-tests has --valgrind instead of wrapper.
optparse.make_option("--wrapper",
help="wrapper command to insert before invocations of "
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index 6bb741a..20a4ac0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -201,13 +201,6 @@ class MainTest(unittest.TestCase):
self.assertTrue('Running 2 DumpRenderTrees in parallel\n'
in regular_output.get())
- def test_dryrun(self):
- batch_tests_run = get_tests_run(['--dry-run'])
- self.assertEqual(batch_tests_run, [])
-
- batch_tests_run = get_tests_run(['-n'])
- self.assertEqual(batch_tests_run, [])
-
def test_exception_raised(self):
self.assertRaises(ValueError, logging_run,
['failures/expected/exception.html'], tests_included=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css
index aff2bf6..62afda6 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css
@@ -217,23 +217,6 @@ a, .link {
color: gray;
}
-#current-baselines {
- font-weight: normal !important;
-}
-
-#current-baselines .platform {
- font-weight: bold;
-}
-
-#current-baselines a {
- color: #ddf;
-}
-
-#current-baselines .was-used-for-test {
- color: #aaf;
- font-weight: bold;
-}
-
#action-buttons {
float: right;
}
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
index 66990d0..25f9146 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
@@ -92,7 +92,7 @@ function main()
var platformOption = document.createElement('option');
platformOption.value = platform;
platformOption.textContent = platform;
-
+
var targetOption = platformOption.cloneNode(true);
targetOption.selected = platform == platforms.defaultPlatform;
$('baseline-target').appendChild(targetOption);
@@ -141,7 +141,7 @@ function displayResults()
selectFailureType();
- document.body.className = '';
+ document.body.classList.remove('loading');
}
/**
@@ -253,17 +253,13 @@ function selectTest()
currentBaselines.textContent = '';
var baselines = results.tests[selectedTest].baselines;
var testName = selectedTest.split('.').slice(0, -1).join('.');
- getSortedKeys(baselines).forEach(function(platform, i) {
- if (i != 0) {
+ for (var platform in baselines) {
+ if (currentBaselines.firstChild) {
currentBaselines.appendChild(document.createTextNode('; '));
}
- var platformName = document.createElement('span');
- platformName.className = 'platform';
- platformName.textContent = platform;
- currentBaselines.appendChild(platformName);
- currentBaselines.appendChild(document.createTextNode(' ('));
- getSortedKeys(baselines[platform]).forEach(function(extension, j) {
- if (j != 0) {
+ currentBaselines.appendChild(document.createTextNode(platform + ' ('));
+ for (var i = 0, extension; extension = baselines[platform][i]; i++) {
+ if (i != 0) {
currentBaselines.appendChild(document.createTextNode(', '));
}
var link = document.createElement('a');
@@ -279,13 +275,10 @@ function selectTest()
link.textContent = extension.substring(1);
}
link.target = '_blank';
- if (baselines[platform][extension]) {
- link.className = 'was-used-for-test';
- }
currentBaselines.appendChild(link);
- });
+ }
currentBaselines.appendChild(document.createTextNode(')'));
- });
+ }
updateState();
loupe.hide();
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js
index 5ad7612..b348462 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js
@@ -91,14 +91,4 @@ function toggle(id)
function getTracUrl(layoutTestPath)
{
return 'http://trac.webkit.org/browser/trunk/LayoutTests/' + layoutTestPath;
-}
-
-function getSortedKeys(obj)
-{
- var keys = [];
- for (var key in obj) {
- keys.push(key);
- }
- keys.sort();
- return keys;
} \ No newline at end of file
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
index 2dcc566..2924a6f 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
@@ -183,7 +183,7 @@ class RebaselineHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
shutil.copyfileobj(static_file, self.wfile)
-def _get_test_baselines(test_file, test_port, layout_tests_directory, platforms, filesystem):
+def _get_test_baselines(test_file, layout_tests_directory, platforms, filesystem):
class AllPlatformsPort(WebKitPort):
def __init__(self):
WebKitPort.__init__(self, filesystem=filesystem)
@@ -196,14 +196,11 @@ def _get_test_baselines(test_file, test_port, layout_tests_directory, platforms,
def platform_from_directory(self, directory):
return self._platforms_by_directory[directory]
- test_path = filesystem.join(layout_tests_directory, test_file)
-
all_platforms_port = AllPlatformsPort()
- all_test_baselines = {}
+ test_baselines = {}
for baseline_extension in ('.txt', '.checksum', '.png'):
- test_baselines = test_port.expected_baselines(
- test_path, baseline_extension)
+ test_path = filesystem.join(layout_tests_directory, test_file)
baselines = all_platforms_port.expected_baselines(
test_path, baseline_extension, all_baselines=True)
for platform_directory, expected_filename in baselines:
@@ -214,12 +211,14 @@ def _get_test_baselines(test_file, test_port, layout_tests_directory, platforms,
else:
platform = all_platforms_port.platform_from_directory(
platform_directory)
- platform_baselines = all_test_baselines.setdefault(platform, {})
- was_used_for_test = (
- platform_directory, expected_filename) in test_baselines
- platform_baselines[baseline_extension] = was_used_for_test
+ if platform not in test_baselines:
+ test_baselines[platform] = []
+ test_baselines[platform].append(baseline_extension)
- return all_test_baselines
+ for platform, extensions in test_baselines.items():
+ test_baselines[platform] = tuple(extensions)
+
+ return test_baselines
class RebaselineServer(AbstractDeclarativeCommand):
name = "rebaseline-server"
@@ -251,17 +250,12 @@ class RebaselineServer(AbstractDeclarativeCommand):
print 'Gathering current baselines...'
for test_file, test_json in results_json['tests'].items():
test_json['state'] = STATE_NEEDS_REBASELINE
- test_path = filesystem.join(layout_tests_directory, test_file)
test_json['baselines'] = _get_test_baselines(
- test_file, port, layout_tests_directory, platforms, filesystem)
-
- server_url = "http://localhost:%d/" % options.httpd_port
- print "Starting server at %s" % server_url
- print ("Use the 'Exit' link in the UI, %squitquitquit "
- "or Ctrl-C to stop") % server_url
+ test_file, layout_tests_directory, platforms, filesystem)
- threading.Timer(
- .1, lambda: self._tool.user.open_url(server_url)).start()
+ print "Starting server at http://localhost:%d/" % options.httpd_port
+ print ("Use the 'Exit' link in the UI, http://localhost:%d/"
+ "quitquitquit or Ctrl-C to stop") % options.httpd_port
httpd = RebaselineHTTPServer(
httpd_port=options.httpd_port,
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
index b37da3d..ea52902 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
@@ -30,7 +30,6 @@ import unittest
from webkitpy.common.system import filesystem_mock
from webkitpy.layout_tests.port import base
-from webkitpy.layout_tests.port.webkit import WebKitPort
from webkitpy.tool.commands import rebaselineserver
@@ -38,7 +37,7 @@ class GetBaselinesTest(unittest.TestCase):
def test_no_baselines(self):
self._assertBaselines(
test_files=(),
- test_name='fast/missing.html',
+ test='fast/missing.html',
expected_baselines={})
def test_text_baselines(self):
@@ -47,11 +46,8 @@ class GetBaselinesTest(unittest.TestCase):
'fast/text-expected.txt',
'platform/mac/fast/text-expected.txt',
),
- test_name='fast/text.html',
- expected_baselines={
- 'mac': {'.txt': True},
- 'base': {'.txt': False},
- })
+ test='fast/text.html',
+ expected_baselines={'mac': ('.txt',), 'base': ('.txt',)})
def test_image_and_text_baselines(self):
self._assertBaselines(
@@ -62,11 +58,11 @@ class GetBaselinesTest(unittest.TestCase):
'platform/win/fast/image-expected.png',
'platform/win/fast/image-expected.checksum',
),
- test_name='fast/image.html',
+ test='fast/image.html',
expected_baselines={
- 'base': {'.txt': True},
- 'mac': {'.checksum': True, '.png': True},
- 'win': {'.checksum': False, '.png': False},
+ 'base': ('.txt',),
+ 'mac': ('.checksum', '.png'),
+ 'win': ('.checksum', '.png'),
})
def test_extra_baselines(self):
@@ -75,25 +71,18 @@ class GetBaselinesTest(unittest.TestCase):
'fast/text-expected.txt',
'platform/nosuchplatform/fast/text-expected.txt',
),
- test_name='fast/text.html',
- expected_baselines={'base': {'.txt': True}})
+ test='fast/text.html',
+ expected_baselines={'base': ('.txt',)})
- def _assertBaselines(self, test_files, test_name, expected_baselines):
+ def _assertBaselines(self, test_files, test, expected_baselines):
layout_tests_directory = base.Port().layout_tests_dir()
mock_filesystem = filesystem_mock.MockFileSystem()
- for file in test_files + (test_name,):
+ for file in test_files + (test,):
file_path = mock_filesystem.join(layout_tests_directory, file)
mock_filesystem.files[file_path] = ''
-
- class TestMacPort(WebKitPort):
- def __init__(self):
- WebKitPort.__init__(self, filesystem=mock_filesystem)
- self._name = 'mac'
-
actual_baselines = rebaselineserver._get_test_baselines(
- test_name,
- TestMacPort(),
+ test,
layout_tests_directory,
('mac', 'win', 'linux'),
mock_filesystem)
- self.assertEqual(expected_baselines, actual_baselines)
+ self.assertEqual(actual_baselines, expected_baselines)