Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py

Issue 2790863002: Add support for rebaselining for a port from a non-corresponding builder. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index a7a3560888cc29d833283eb09a4abd7d6a81f41f..c43bcad2b1d5cefc7d2b55e8186c17599d68721f 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -528,7 +528,8 @@ class TestRebaseline(BaseTestCase):
'--suffixes', 'txt,png',
'--port-name', 'test-win-win7',
'--builder', 'MOCK Win7',
- '--results-directory', '/tmp']]
+ '--results-directory', '/tmp',
+ ]],
])
def test_unstaged_baselines(self):
@@ -547,6 +548,40 @@ class TestRebaseline(BaseTestCase):
'/mock-checkout/third_party/WebKit/LayoutTests/x/foo-expected.txt',
])
+ def test_rebaseline_with_different_port_name(self):
+ self._setup_mock_build_data()
+ self._write('userscripts/first-test.html', 'Dummy test contents')
+ test_baseline_set = TestBaselineSet(self.tool)
+ test_baseline_set.add('userscripts/first-test.html', Build('MOCK Win7'), 'test-win-win10')
+ self.command.rebaseline(self.options(), test_baseline_set)
+
+ self.assertEqual(
+ self.tool.executive.calls,
+ [
+ [[
+ 'python', 'echo', 'copy-existing-baselines-internal',
+ '--verbose',
+ '--test', 'userscripts/first-test.html',
+ '--suffixes', 'txt,png',
+ '--port-name', 'test-win-win10',
+
+ ]],
+ [[
+ 'python', 'echo', 'rebaseline-test-internal',
+ '--verbose',
+ '--test', 'userscripts/first-test.html',
+ '--suffixes', 'txt,png',
+ '--port-name', 'test-win-win10',
+ '--builder', 'MOCK Win7',
+ ]],
+ [[
+ 'python', 'echo', 'optimize-baselines',
+ '--verbose',
+ '--suffixes', 'txt,png',
+ 'userscripts/first-test.html',
+ ]]
+ ])
+
class TestRebaselineUpdatesExpectationsFiles(BaseTestCase):
"""Tests for the logic related to updating the test expectations file."""
@@ -1133,10 +1168,10 @@ class TestBaselineSetTest(unittest.TestCase):
self.assertEqual(
list(test_baseline_set),
[
- ('a/x.html', Build(builder_name='MOCK Trusty')),
- ('a/y.html', Build(builder_name='MOCK Trusty')),
- ('a/z.html', Build(builder_name='MOCK Trusty')),
- ('a/z.html', Build(builder_name='MOCK Win10')),
+ ('a/x.html', Build(builder_name='MOCK Trusty'), 'test-linux-trusty'),
+ ('a/y.html', Build(builder_name='MOCK Trusty'), 'test-linux-trusty'),
+ ('a/z.html', Build(builder_name='MOCK Trusty'), 'test-linux-trusty'),
+ ('a/z.html', Build(builder_name='MOCK Win10'), 'test-win-win10'),
])
def test_str_empty(self):
@@ -1150,5 +1185,5 @@ class TestBaselineSetTest(unittest.TestCase):
self.assertEqual(
str(test_baseline_set),
('<TestBaselineSet with:\n'
- ' a/x.html: Build(builder_name=\'MOCK Mac10.12\', build_number=None)\n'
- ' a/x.html: Build(builder_name=\'MOCK Win10\', build_number=None)>'))
+ ' a/x.html: Build(builder_name=\'MOCK Mac10.12\', build_number=None), test-mac-mac10.12\n'
+ ' a/x.html: Build(builder_name=\'MOCK Win10\', build_number=None), test-win-win10>'))

Powered by Google App Engine
This is Rietveld 408576698