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

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

Issue 2128233003: Split out optimize-baselines command from rebaseline.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 d7e0d90271aca9287f66b63e51143564ab7420ab..d62d560e1c9210416b938c0ac9a1d5a86b64107d 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
@@ -850,78 +850,6 @@ Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ Rebaseline ]
])
-class TestOptimizeBaselines(BaseTestCase):
- command_constructor = OptimizeBaselines
-
- def _write_test_file(self, port, path, contents):
- abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path)
- self.tool.filesystem.write_text_file(abs_path, contents)
-
- def setUp(self):
- super(TestOptimizeBaselines, self).setUp()
-
- def test_modify_scm(self):
- test_port = self.tool.port_factory.get('test')
- self._write_test_file(test_port, 'another/test.html', "Dummy test contents")
- self._write_test_file(test_port, 'platform/test-mac-mac10.10/another/test-expected.txt', "result A")
- self._write_test_file(test_port, 'another/test-expected.txt', "result A")
-
- OutputCapture().assert_outputs(self, self.command.execute, args=[
- MockOptions(suffixes='txt', no_modify_scm=False, platform='test-mac-mac10.10'),
- ['another/test.html'],
- self.tool,
- ], expected_stdout='{"add": [], "remove-lines": [], "delete": []}\n')
-
- self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'platform/test-mac-mac10.10/another/test-expected.txt')))
- self.assertTrue(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'another/test-expected.txt')))
-
- def test_no_modify_scm(self):
- test_port = self.tool.port_factory.get('test')
- self._write_test_file(test_port, 'another/test.html', "Dummy test contents")
- self._write_test_file(test_port, 'platform/test-mac-mac10.10/another/test-expected.txt', "result A")
- self._write_test_file(test_port, 'another/test-expected.txt', "result A")
-
- OutputCapture().assert_outputs(self, self.command.execute, args=[
- MockOptions(suffixes='txt', no_modify_scm=True, platform='test-mac-mac10.10'),
- ['another/test.html'],
- self.tool,
- ], expected_stdout='{"add": [], "remove-lines": [], "delete": ["/test.checkout/LayoutTests/platform/test-mac-mac10.10/another/test-expected.txt"]}\n')
-
- self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'platform/mac/another/test-expected.txt')))
- self.assertTrue(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'another/test-expected.txt')))
-
- def test_optimize_all_suffixes_by_default(self):
- test_port = self.tool.port_factory.get('test')
- self._write_test_file(test_port, 'another/test.html', "Dummy test contents")
- self._write_test_file(test_port, 'platform/test-mac-mac10.10/another/test-expected.txt', "result A")
- self._write_test_file(test_port, 'platform/test-mac-mac10.10/another/test-expected.png', "result A png")
- self._write_test_file(test_port, 'another/test-expected.txt', "result A")
- self._write_test_file(test_port, 'another/test-expected.png', "result A png")
-
- try:
- oc = OutputCapture()
- oc.capture_output()
- self.command.execute(MockOptions(suffixes='txt,wav,png', no_modify_scm=True, platform='test-mac-mac10.10'),
- ['another/test.html'],
- self.tool)
- finally:
- out, _, _ = oc.restore_output()
-
- self.assertEquals(out, '{"add": [], "remove-lines": [], "delete": ["/test.checkout/LayoutTests/platform/test-mac-mac10.10/another/test-expected.txt", "/test.checkout/LayoutTests/platform/test-mac-mac10.10/another/test-expected.png"]}\n')
- self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'platform/mac/another/test-expected.txt')))
- self.assertFalse(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'platform/mac/another/test-expected.png')))
- self.assertTrue(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'another/test-expected.txt')))
- self.assertTrue(self.tool.filesystem.exists(self.tool.filesystem.join(
- test_port.layout_tests_dir(), 'another/test-expected.png')))
-
-
class TestAutoRebaseline(BaseTestCase):
command_constructor = AutoRebaseline

Powered by Google App Engine
This is Rietveld 408576698