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

Side by Side Diff: chrome/test/functional/perf.py

Issue 10537111: Fix bug in pyauto perf tests where list containing result 0 isn't handled properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Basic pyauto performance tests. 6 """Basic pyauto performance tests.
7 7
8 For tests that need to be run for multiple iterations (e.g., so that average 8 For tests that need to be run for multiple iterations (e.g., so that average
9 and standard deviation values can be reported), the default number of iterations 9 and standard deviation values can be reported), the default number of iterations
10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|. 10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|.
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 the |units_x| argument must also be specified. 369 the |units_x| argument must also be specified.
370 units: A string representing the units of the performance measurement(s). 370 units: A string representing the units of the performance measurement(s).
371 Should not include spaces. 371 Should not include spaces.
372 graph_name: A string name for the graph associated with this performance 372 graph_name: A string name for the graph associated with this performance
373 value. Only used on Chrome desktop. 373 value. Only used on Chrome desktop.
374 units_x: A string representing the units of the x-axis values associated 374 units_x: A string representing the units of the x-axis values associated
375 with the performance measurements, such as 'iteration' if the x values 375 with the performance measurements, such as 'iteration' if the x values
376 are iteration numbers. If this argument is specified, then the 376 are iteration numbers. If this argument is specified, then the
377 |value| argument must be a list of (x, y) tuples. 377 |value| argument must be a list of (x, y) tuples.
378 """ 378 """
379 if isinstance(value, list) and value[0] and isinstance(value[0], tuple): 379 if (isinstance(value, list) and value[0] is not None and
380 isinstance(value[0], tuple)):
380 assert units_x 381 assert units_x
381 if units_x: 382 if units_x:
382 assert isinstance(value, list) 383 assert isinstance(value, list)
383 384
384 if self.IsChromeOS(): 385 if self.IsChromeOS():
385 # ChromeOS results don't support lists. 386 # ChromeOS results don't support lists.
386 if (isinstance(value, list) and value[0] and 387 if (isinstance(value, list) and value[0] is not None and
387 not isinstance(value[0], tuple)): 388 not isinstance(value[0], tuple)):
388 value = Mean(value) 389 value = Mean(value)
389 390
390 if units_x: 391 if units_x:
391 # TODO(dennisjeffrey): Support long-running performance measurements on 392 # TODO(dennisjeffrey): Support long-running performance measurements on
392 # ChromeOS in a way that can be graphed: crosbug.com/21881. 393 # ChromeOS in a way that can be graphed: crosbug.com/21881.
393 pyauto_utils.PrintPerfResult(graph_name, description, value, 394 pyauto_utils.PrintPerfResult(graph_name, description, value,
394 units + ' ' + units_x) 395 units + ' ' + units_x)
395 else: 396 else:
396 # Output short-running performance results in a format understood by 397 # Output short-running performance results in a format understood by
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 """Identifies the port number to which the server is currently bound. 2510 """Identifies the port number to which the server is currently bound.
2510 2511
2511 Returns: 2512 Returns:
2512 The numeric port number to which the server is currently bound. 2513 The numeric port number to which the server is currently bound.
2513 """ 2514 """
2514 return self._server.server_address[1] 2515 return self._server.server_address[1]
2515 2516
2516 2517
2517 if __name__ == '__main__': 2518 if __name__ == '__main__':
2518 pyauto_functional.Main() 2519 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698