summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py')
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py34
1 files changed, 14 insertions, 20 deletions
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,