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

Side by Side Diff: sky/tools/webkitpy/layout_tests/models/test_run_results_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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 return test_run_results.summarize_results(port, initial_results.expectations , initial_results, retry_results, enabled_pixel_tests_in_retry=False, only_inclu de_failing=only_include_failing) 99 return test_run_results.summarize_results(port, initial_results.expectations , initial_results, retry_results, enabled_pixel_tests_in_retry=False, only_inclu de_failing=only_include_failing)
100 100
101 101
102 class InterpretTestFailuresTest(unittest.TestCase): 102 class InterpretTestFailuresTest(unittest.TestCase):
103 def setUp(self): 103 def setUp(self):
104 host = MockHost() 104 host = MockHost()
105 self.port = host.port_factory.get(port_name='test') 105 self.port = host.port_factory.get(port_name='test')
106 106
107 def test_interpret_test_failures(self): 107 def test_interpret_test_failures(self):
108 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureReftestMismatchDidNotOccur(self.port.abspath_for_test('foo/reftest-expected- mismatch.html'))]) 108 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureReftestMismatchDidNotOccur(self.port.abspath_for_test('foo/reftest-expected- mismatch.sky'))])
109 self.assertEqual(len(test_dict), 0) 109 self.assertEqual(len(test_dict), 0)
110 110
111 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingAudio()]) 111 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingAudio()])
112 self.assertIn('is_missing_audio', test_dict) 112 self.assertIn('is_missing_audio', test_dict)
113 113
114 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingResult()]) 114 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingResult()])
115 self.assertIn('is_missing_text', test_dict) 115 self.assertIn('is_missing_text', test_dict)
116 116
117 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingImage()]) 117 test_dict = test_run_results._interpret_test_failures([test_failures.Fai lureMissingImage()])
118 self.assertIn('is_missing_image', test_dict) 118 self.assertIn('is_missing_image', test_dict)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 def test_timeout_then_unexpected_pass(self): 197 def test_timeout_then_unexpected_pass(self):
198 tests = ['failures/expected/image.html'] 198 tests = ['failures/expected/image.html']
199 expectations = test_expectations.TestExpectations(self.port, tests) 199 expectations = test_expectations.TestExpectations(self.port, tests)
200 initial_results = test_run_results.TestRunResults(expectations, len(test s)) 200 initial_results = test_run_results.TestRunResults(expectations, len(test s))
201 initial_results.add(get_result('failures/expected/image.html', test_expe ctations.TIMEOUT, run_time=1), False, False) 201 initial_results.add(get_result('failures/expected/image.html', test_expe ctations.TIMEOUT, run_time=1), False, False)
202 retry_results = test_run_results.TestRunResults(expectations, len(tests) ) 202 retry_results = test_run_results.TestRunResults(expectations, len(tests) )
203 retry_results.add(get_result('failures/expected/image.html', test_expect ations.PASS, run_time=0.1), False, False) 203 retry_results.add(get_result('failures/expected/image.html', test_expect ations.PASS, run_time=0.1), False, False)
204 summary = test_run_results.summarize_results(self.port, expectations, in itial_results, retry_results, enabled_pixel_tests_in_retry=True, only_include_fa iling=True) 204 summary = test_run_results.summarize_results(self.port, expectations, in itial_results, retry_results, enabled_pixel_tests_in_retry=True, only_include_fa iling=True)
205 self.assertEquals(summary['num_regressions'], 0) 205 self.assertEquals(summary['num_regressions'], 0)
206 self.assertEquals(summary['num_passes'], 1) 206 self.assertEquals(summary['num_passes'], 1)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698