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

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

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 optparse.make_option('-q', '--quiet', action='store_true', default=False , 50 optparse.make_option('-q', '--quiet', action='store_true', default=False ,
51 help='run quietly (errors, warnings, and progress o nly)'), 51 help='run quietly (errors, warnings, and progress o nly)'),
52 optparse.make_option('--timing', action='store_true', default=False, 52 optparse.make_option('--timing', action='store_true', default=False,
53 help='display test times (summary plus per-test w/ --verbose)'), 53 help='display test times (summary plus per-test w/ --verbose)'),
54 optparse.make_option('-v', '--verbose', action='store_true', default=Fal se, 54 optparse.make_option('-v', '--verbose', action='store_true', default=Fal se,
55 help='print a summarized result for every test (one line per test)'), 55 help='print a summarized result for every test (one line per test)'),
56 ] 56 ]
57 57
58 58
59 class Printer(object): 59 class Printer(object):
60
60 """Class handling all non-debug-logging printing done by run-webkit-tests."" " 61 """Class handling all non-debug-logging printing done by run-webkit-tests."" "
61 62
62 def __init__(self, port, options, regular_output, logger=None): 63 def __init__(self, port, options, regular_output, logger=None):
63 self.num_completed = 0 64 self.num_completed = 0
64 self.num_tests = 0 65 self.num_tests = 0
65 self._port = port 66 self._port = port
66 self._options = options 67 self._options = options
67 self._meter = MeteredStream(regular_output, options.debug_rwt_logging, l ogger=logger, 68 self._meter = MeteredStream(regular_output, options.debug_rwt_logging, l ogger=logger,
68 number_of_columns=self._port.host.platform.t erminal_width()) 69 number_of_columns=self._port.host.platform.t erminal_width())
69 self._running_tests = [] 70 self._running_tests = []
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 for test_tuple in individual_test_timings: 188 for test_tuple in individual_test_timings:
188 test_name = test_tuple.test_name 189 test_name = test_tuple.test_name
189 is_timeout_crash_or_slow = False 190 is_timeout_crash_or_slow = False
190 if test_name in run_results.slow_tests: 191 if test_name in run_results.slow_tests:
191 is_timeout_crash_or_slow = True 192 is_timeout_crash_or_slow = True
192 slow_tests.append(test_tuple) 193 slow_tests.append(test_tuple)
193 194
194 if test_name in run_results.failures_by_name: 195 if test_name in run_results.failures_by_name:
195 result = run_results.results_by_name[test_name].type 196 result = run_results.results_by_name[test_name].type
196 if (result == test_expectations.TIMEOUT or 197 if (result == test_expectations.TIMEOUT or
197 result == test_expectations.CRASH): 198 result == test_expectations.CRASH):
198 is_timeout_crash_or_slow = True 199 is_timeout_crash_or_slow = True
199 timeout_or_crash_tests.append(test_tuple) 200 timeout_or_crash_tests.append(test_tuple)
200 201
201 if (not is_timeout_crash_or_slow and num_printed < NUM_SLOW_TESTS_TO _LOG): 202 if (not is_timeout_crash_or_slow and num_printed < NUM_SLOW_TESTS_TO _LOG):
202 num_printed = num_printed + 1 203 num_printed = num_printed + 1
203 unexpected_slow_tests.append(test_tuple) 204 unexpected_slow_tests.append(test_tuple)
204 205
205 self._print_debug("") 206 self._print_debug("")
206 if unexpected_slow_tests: 207 if unexpected_slow_tests:
207 self._print_test_list_timing("%s slowest tests that are not marked a s SLOW and did not timeout/crash:" % 208 self._print_test_list_timing("%s slowest tests that are not marked a s SLOW and did not timeout/crash:" %
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 self._meter.write_throttled_update(msg) 434 self._meter.write_throttled_update(msg)
434 435
435 def write_update(self, msg): 436 def write_update(self, msg):
436 self._meter.write_update(msg) 437 self._meter.write_update(msg)
437 438
438 def writeln(self, msg): 439 def writeln(self, msg):
439 self._meter.writeln(msg) 440 self._meter.writeln(msg)
440 441
441 def flush(self): 442 def flush(self):
442 self._meter.flush() 443 self._meter.flush()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698