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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py

Issue 2308283002: Allow seeding the random layout test order and write out seed. (Closed)
Patch Set: Add random order seed to results file. Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.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, 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2010, 2012 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 def test_configure_and_cleanup(self): 119 def test_configure_and_cleanup(self):
120 # This test verifies that calling cleanup repeatedly and deleting 120 # This test verifies that calling cleanup repeatedly and deleting
121 # the object is safe. 121 # the object is safe.
122 printer, _ = self.get_printer() 122 printer, _ = self.get_printer()
123 printer.cleanup() 123 printer.cleanup()
124 printer.cleanup() 124 printer.cleanup()
125 printer = None 125 printer = None
126 126
127 def test_print_config(self): 127 def test_print_config(self):
128 printer, err = self.get_printer() 128 printer, err = self.get_printer()
129 # FIXME: it's lame that i have to set these options directly. 129 # FIXME: Make it so these options don't have to be set directly.
130 # pylint: disable=protected-access
130 printer._options.pixel_tests = True 131 printer._options.pixel_tests = True
131 printer._options.new_baseline = True 132 printer._options.new_baseline = True
132 printer._options.time_out_ms = 6000 133 printer._options.time_out_ms = 6000
133 printer._options.slow_time_out_ms = 12000 134 printer._options.slow_time_out_ms = 12000
135 printer._options.order = 'random'
136 printer._options.seed = 1234
134 printer.print_config('/tmp') 137 printer.print_config('/tmp')
135 self.assertIn("Using port 'test-mac-mac10.10'", err.getvalue()) 138 self.assertIn("Using port 'test-mac-mac10.10'", err.getvalue())
136 self.assertIn('Test configuration: <mac10.10, x86, release>', err.getval ue()) 139 self.assertIn('Test configuration: <mac10.10, x86, release>', err.getval ue())
137 self.assertIn('View the test results at file:///tmp', err.getvalue()) 140 self.assertIn('View the test results at file:///tmp', err.getvalue())
138 self.assertIn('View the archived results dashboard at file:///tmp', err. getvalue()) 141 self.assertIn('View the archived results dashboard at file:///tmp', err. getvalue())
139 self.assertIn('Baseline search path: test-mac-mac10.10 -> test-mac-mac10 .11 -> generic', err.getvalue()) 142 self.assertIn('Baseline search path: test-mac-mac10.10 -> test-mac-mac10 .11 -> generic', err.getvalue())
140 self.assertIn('Using Release build', err.getvalue()) 143 self.assertIn('Using Release build', err.getvalue())
141 self.assertIn('Pixel tests enabled', err.getvalue()) 144 self.assertIn('Pixel tests enabled', err.getvalue())
142 self.assertIn('Command line:', err.getvalue()) 145 self.assertIn('Command line:', err.getvalue())
143 self.assertIn('Regular timeout: ', err.getvalue()) 146 self.assertIn('Regular timeout: ', err.getvalue())
147 self.assertIn('Using random order with seed: 1234', err.getvalue())
144 148
145 self.reset(err) 149 self.reset(err)
146 printer._options.quiet = True 150 printer._options.quiet = True
147 printer.print_config('/tmp') 151 printer.print_config('/tmp')
148 self.assertNotIn('Baseline search path: test-mac-mac10.10 -> test-mac-ma c10.11 -> generic', err.getvalue()) 152 self.assertNotIn('Baseline search path: test-mac-mac10.10 -> test-mac-ma c10.11 -> generic', err.getvalue())
149 153
150 def test_print_directory_timings(self): 154 def test_print_directory_timings(self):
151 printer, err = self.get_printer() 155 printer, err = self.get_printer()
152 printer._options.debug_rwt_logging = True 156 printer._options.debug_rwt_logging = True
153 157
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 printer.print_finished_test(result, expected=True, exp_str='', got_str=' ') 254 printer.print_finished_test(result, expected=True, exp_str='', got_str=' ')
251 255
252 printer.print_started_test('passes/text.html') 256 printer.print_started_test('passes/text.html')
253 result = self.get_result('passes/text.html') 257 result = self.get_result('passes/text.html')
254 printer.print_finished_test(result, expected=True, exp_str='', got_str=' ') 258 printer.print_finished_test(result, expected=True, exp_str='', got_str=' ')
255 259
256 # Only the first test's start should be printed. 260 # Only the first test's start should be printed.
257 lines = err.buflist 261 lines = err.buflist
258 self.assertEqual(len(lines), 1) 262 self.assertEqual(len(lines), 1)
259 self.assertTrue(lines[0].endswith('passes/image.html\n')) 263 self.assertTrue(lines[0].endswith('passes/image.html\n'))
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698