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

Side by Side Diff: sky/tools/webkitpy/tool/commands/rebaseline_unittest.py

Issue 802573002: Prepare python code for reftests. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/tools/webkitpy/layout_tests/run_webkit_tests_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 def test_rebaseline_test_with_results_directory(self): 257 def test_rebaseline_test_with_results_directory(self):
258 self._write("userscripts/another-test.html", "test data") 258 self._write("userscripts/another-test.html", "test data")
259 self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/ano ther-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.h tml [ ImageOnlyFailure ]\n") 259 self._write(self.lion_expectations_path, "Bug(x) [ Mac ] userscripts/ano ther-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.h tml [ ImageOnlyFailure ]\n")
260 self.options.results_directory = '/tmp' 260 self.options.results_directory = '/tmp'
261 self.command._rebaseline_test_and_update_expectations(self.options) 261 self.command._rebaseline_test_and_update_expectations(self.options)
262 self.assertItemsEqual(self.tool.web.urls_fetched, ['file:///tmp/userscri pts/another-test-actual.txt']) 262 self.assertItemsEqual(self.tool.web.urls_fetched, ['file:///tmp/userscri pts/another-test-actual.txt'])
263 263
264 def test_rebaseline_reftest(self): 264 def test_rebaseline_reftest(self):
265 self._write("userscripts/another-test.html", "test data") 265 self._write("userscripts/another-test.html", "test data")
266 self._write("userscripts/another-test-expected.html", "generic result") 266 self._write("userscripts/another-test-expected.sky", "generic result")
267 OutputCapture().assert_outputs(self, self.command._rebaseline_test_and_u pdate_expectations, args=[self.options], 267 OutputCapture().assert_outputs(self, self.command._rebaseline_test_and_u pdate_expectations, args=[self.options],
268 expected_logs="Cannot rebaseline reftest: userscripts/another-test.h tml\n") 268 expected_logs="Cannot rebaseline reftest: userscripts/another-test.h tml\n")
269 self.assertDictEqual(self.command._scm_changes, {'add': [], 'remove-line s': [], "delete": []}) 269 self.assertDictEqual(self.command._scm_changes, {'add': [], 'remove-line s': [], "delete": []})
270 270
271 def test_rebaseline_test_and_print_scm_changes(self): 271 def test_rebaseline_test_and_print_scm_changes(self):
272 self.command._print_scm_changes = True 272 self.command._print_scm_changes = True
273 self.command._scm_changes = {'add': [], 'delete': []} 273 self.command._scm_changes = {'add': [], 'delete': []}
274 self.tool._scm.exists = lambda x: False 274 self.tool._scm.exists = lambda x: False
275 275
276 self.command._rebaseline_test("WebKit Linux", "userscripts/another-test. html", "txt", None) 276 self.command._rebaseline_test("WebKit Linux", "userscripts/another-test. html", "txt", None)
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 oc.capture_output() 1258 oc.capture_output()
1259 self.command._do_one_rebaseline() 1259 self.command._do_one_rebaseline()
1260 out, _, _ = oc.restore_output() 1260 out, _, _ = oc.restore_output()
1261 1261
1262 self.assertEqual(out, 'MOCK STDOUT\n') 1262 self.assertEqual(out, 'MOCK STDOUT\n')
1263 self.assertEqual(self.tool.executive.calls, [ 1263 self.assertEqual(self.tool.executive.calls, [
1264 ['git', 'pull'], 1264 ['git', 'pull'],
1265 ['/mock-checkout/third_party/WebKit/tools/webkit-patch', 'auto-rebas eline', '--verbose'], 1265 ['/mock-checkout/third_party/WebKit/tools/webkit-patch', 'auto-rebas eline', '--verbose'],
1266 ]) 1266 ])
1267 self.assertEqual(self._logs, ['MOCK STDOUT']) 1267 self.assertEqual(self._logs, ['MOCK STDOUT'])
OLDNEW
« no previous file with comments | « sky/tools/webkitpy/layout_tests/run_webkit_tests_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698