diff options
author | Steve Block <steveblock@google.com> | 2011-01-05 12:15:11 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-01-06 14:14:00 +0000 |
commit | d06194330da2bb8da887d2e1adeacb3a5c1504b2 (patch) | |
tree | e0af8413af65a8e30630563441af7bdb8478e513 /WebKitTools/Scripts/webkitpy/tool/commands | |
parent | 419a5cf2f8db6ca014df624865197ffb82caad37 (diff) | |
download | external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.zip external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.gz external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.bz2 |
Merge WebKit at r72805: Initial merge by Git
Note that this is a backwards merge from Chromium release 9.0.600.0
to 9.0.597.0, to align with the Chromium 9 stable release branch.
Change-Id: I5d2bb4e8cee9d39ae8485abf48bdb55ecf8b3790
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool/commands')
5 files changed, 36 insertions, 87 deletions
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) |