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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py

Issue 2399613002: Don't access Port._filesystem directly (use Port.host.filesystem instead). (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import optparse 6 import optparse
7 7
8 from webkitpy.common.net.buildbot import Build 8 from webkitpy.common.net.buildbot import Build
9 from webkitpy.common.net.rietveld import Rietveld 9 from webkitpy.common.net.rietveld import Rietveld
10 from webkitpy.common.net.web_mock import MockWeb 10 from webkitpy.common.net.web_mock import MockWeb
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 # Write to the mock filesystem so that these tests are considered to exi st. 60 # Write to the mock filesystem so that these tests are considered to exi st.
61 port = self.mac_port 61 port = self.mac_port
62 tests = [ 62 tests = [
63 'fast/dom/prototype-taco.html', 63 'fast/dom/prototype-taco.html',
64 'fast/dom/prototype-inheritance.html', 64 'fast/dom/prototype-inheritance.html',
65 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.ht ml', 65 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.ht ml',
66 ] 66 ]
67 for test in tests: 67 for test in tests:
68 # pylint: disable=protected-access 68 # pylint: disable=protected-access
69 self._write(port._filesystem.join(port.layout_tests_dir(), test), 'c ontents') 69 self._write(port.host.filesystem.join(port.layout_tests_dir(), test) , 'contents')
70 70
71 def tearDown(self): 71 def tearDown(self):
72 BaseTestCase.tearDown(self) 72 BaseTestCase.tearDown(self)
73 LoggingTestCase.tearDown(self) 73 LoggingTestCase.tearDown(self)
74 74
75 @staticmethod 75 @staticmethod
76 def command_options(**kwargs): 76 def command_options(**kwargs):
77 options = { 77 options = {
78 'only_changed_tests': False, 78 'only_changed_tests': False,
79 'dry_run': False, 79 'dry_run': False,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 self.assertEqual(self.tool.executive.calls[0], ['git', 'cl', 'try', '-b' , 'MOCK Try Linux']) 158 self.assertEqual(self.tool.executive.calls[0], ['git', 'cl', 'try', '-b' , 'MOCK Try Linux'])
159 159
160 def test_rebaseline_calls(self): 160 def test_rebaseline_calls(self):
161 """Tests the list of commands that are invoked when rebaseline is called .""" 161 """Tests the list of commands that are invoked when rebaseline is called ."""
162 # First write test contents to the mock filesystem so that 162 # First write test contents to the mock filesystem so that
163 # fast/dom/prototype-taco.html is considered a real test to rebaseline. 163 # fast/dom/prototype-taco.html is considered a real test to rebaseline.
164 # TODO(qyearsley): Change this to avoid accessing protected methods. 164 # TODO(qyearsley): Change this to avoid accessing protected methods.
165 # pylint: disable=protected-access 165 # pylint: disable=protected-access
166 port = self.tool.port_factory.get('test-win-win7') 166 port = self.tool.port_factory.get('test-win-win7')
167 self._write( 167 self._write(
168 port._filesystem.join(port.layout_tests_dir(), 'fast/dom/prototype-t aco.html'), 168 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy pe-taco.html'),
169 'test contents') 169 'test contents')
170 170
171 self.command._rebaseline( 171 self.command._rebaseline(
172 self.command_options(issue=11112222), 172 self.command_options(issue=11112222),
173 {"fast/dom/prototype-taco.html": {Build("MOCK Try Win", 5000): ["txt ", "png"]}}) 173 {"fast/dom/prototype-taco.html": {Build("MOCK Try Win", 5000): ["txt ", "png"]}})
174 174
175 self.assertEqual( 175 self.assertEqual(
176 self.tool.executive.calls, 176 self.tool.executive.calls,
177 [ 177 [
178 [['python', 'echo', 'copy-existing-baselines-internal', '--suffi xes', 'txt', 178 [['python', 'echo', 'copy-existing-baselines-internal', '--suffi xes', 'txt',
179 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']], 179 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']],
180 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't xt', 180 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't xt',
181 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']], 181 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']],
182 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '-- suffixes', 'txt', 'fast/dom/prototype-taco.html']] 182 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '-- suffixes', 'txt', 'fast/dom/prototype-taco.html']]
183 ]) 183 ])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698