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

Side by Side Diff: sky/tools/webkitpy/layout_tests/controllers/test_result_writer_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
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 write_test_result(host.filesystem, port, '/tmp', 'foo.html', actual_outp ut, expected_output, failures) 47 write_test_result(host.filesystem, port, '/tmp', 'foo.html', actual_outp ut, expected_output, failures)
48 return host.filesystem.written_files 48 return host.filesystem.written_files
49 49
50 def test_success(self): 50 def test_success(self):
51 # Nothing is written when the test passes. 51 # Nothing is written when the test passes.
52 written_files = self.run_test(failures=[]) 52 written_files = self.run_test(failures=[])
53 self.assertEqual(written_files, {}) 53 self.assertEqual(written_files, {})
54 54
55 def test_reference_exists(self): 55 def test_reference_exists(self):
56 failure = test_failures.FailureReftestMismatch() 56 failure = test_failures.FailureReftestMismatch()
57 failure.reference_filename = '/src/exists-expected.html' 57 failure.reference_filename = '/src/exists-expected.sky'
58 files = {'/src/exists-expected.html': 'yup'} 58 files = {'/src/exists-expected.sky': 'yup'}
59 written_files = self.run_test(failures=[failure], files=files) 59 written_files = self.run_test(failures=[failure], files=files)
60 self.assertEqual(written_files, {'/tmp/exists-expected.html': 'yup'}) 60 self.assertEqual(written_files, {'/tmp/exists-expected.sky': 'yup'})
61 61
62 failure = test_failures.FailureReftestMismatchDidNotOccur() 62 failure = test_failures.FailureReftestMismatchDidNotOccur()
63 failure.reference_filename = '/src/exists-expected-mismatch.html' 63 failure.reference_filename = '/src/exists-expected-mismatch.sky'
64 files = {'/src/exists-expected-mismatch.html': 'yup'} 64 files = {'/src/exists-expected-mismatch.sky': 'yup'}
65 written_files = self.run_test(failures=[failure], files=files) 65 written_files = self.run_test(failures=[failure], files=files)
66 self.assertEqual(written_files, {'/tmp/exists-expected-mismatch.html': ' yup'}) 66 self.assertEqual(written_files, {'/tmp/exists-expected-mismatch.sky': 'y up'})
67 67
68 def test_reference_is_missing(self): 68 def test_reference_is_missing(self):
69 failure = test_failures.FailureReftestMismatch() 69 failure = test_failures.FailureReftestMismatch()
70 failure.reference_filename = 'notfound.html' 70 failure.reference_filename = 'notfound.html'
71 written_files = self.run_test(failures=[failure], files={}) 71 written_files = self.run_test(failures=[failure], files={})
72 self.assertEqual(written_files, {}) 72 self.assertEqual(written_files, {})
73 73
74 failure = test_failures.FailureReftestMismatchDidNotOccur() 74 failure = test_failures.FailureReftestMismatchDidNotOccur()
75 failure.reference_filename = 'notfound.html' 75 failure.reference_filename = 'notfound.html'
76 written_files = self.run_test(failures=[failure], files={}) 76 written_files = self.run_test(failures=[failure], files={})
77 self.assertEqual(written_files, {}) 77 self.assertEqual(written_files, {})
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698