| OLD | NEW |
| 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.git_cl import GitCL | 9 from webkitpy.common.net.git_cl import GitCL |
| 10 from webkitpy.common.checkout.git_mock import MockGit | 10 from webkitpy.common.checkout.git_mock import MockGit |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 """Tests the list of commands that are invoked when rebaseline is called
.""" | 269 """Tests the list of commands that are invoked when rebaseline is called
.""" |
| 270 # First write test contents to the mock filesystem so that | 270 # First write test contents to the mock filesystem so that |
| 271 # fast/dom/prototype-taco.html is considered a real test to rebaseline. | 271 # fast/dom/prototype-taco.html is considered a real test to rebaseline. |
| 272 port = self.tool.port_factory.get('test-win-win7') | 272 port = self.tool.port_factory.get('test-win-win7') |
| 273 self._write( | 273 self._write( |
| 274 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy
pe-taco.html'), | 274 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy
pe-taco.html'), |
| 275 'test contents') | 275 'test contents') |
| 276 | 276 |
| 277 self.command.rebaseline( | 277 self.command.rebaseline( |
| 278 self.command_options(), | 278 self.command_options(), |
| 279 {'fast/dom/prototype-taco.html': {Build('MOCK Try Win', 5000): ['txt
', 'png']}}) | 279 {'fast/dom/prototype-taco.html': [Build('MOCK Try Win', 5000)]}) |
| 280 | 280 |
| 281 self.assertEqual( | 281 self.assertEqual( |
| 282 self.tool.executive.calls, | 282 self.tool.executive.calls, |
| 283 [ | 283 [ |
| 284 [['python', 'echo', 'copy-existing-baselines-internal', '--suffi
xes', 'txt', | 284 [['python', 'echo', 'copy-existing-baselines-internal', '--suffi
xes', 'txt', |
| 285 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html']], | 285 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html']], |
| 286 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't
xt', | 286 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't
xt', |
| 287 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html', '--build-number', '5000']], | 287 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html', '--build-number', '5000']], |
| 288 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', '
fast/dom/prototype-taco.html']] | 288 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', '
fast/dom/prototype-taco.html']] |
| 289 ]) | 289 ]) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 320 | 320 |
| 321 def test_bails_when_there_are_unstaged_baselines(self): | 321 def test_bails_when_there_are_unstaged_baselines(self): |
| 322 git = self.tool.git() | 322 git = self.tool.git() |
| 323 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} | 323 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} |
| 324 return_code = self.command.execute(self.command_options(), [], self.tool
) | 324 return_code = self.command.execute(self.command_options(), [], self.tool
) |
| 325 self.assertEqual(return_code, 1) | 325 self.assertEqual(return_code, 1) |
| 326 self.assertLog([ | 326 self.assertLog([ |
| 327 'ERROR: Aborting: there are unstaged baselines:\n', | 327 'ERROR: Aborting: there are unstaged baselines:\n', |
| 328 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', | 328 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', |
| 329 ]) | 329 ]) |
| OLD | NEW |