| Index: tools/perf/measurements/rasterize_and_record_micro.py
|
| diff --git a/tools/perf/measurements/rasterize_and_record_micro.py b/tools/perf/measurements/rasterize_and_record_micro.py
|
| index 4c875bf05bcfbf3bc2eb79866b89bea33a92140f..7b7b5feed626e74b92064d163b34d023d542304a 100644
|
| --- a/tools/perf/measurements/rasterize_and_record_micro.py
|
| +++ b/tools/perf/measurements/rasterize_and_record_micro.py
|
| @@ -11,15 +11,31 @@
|
|
|
|
|
| class RasterizeAndRecordMicro(page_test.PageTest):
|
| - def __init__(self, start_wait_time=2, rasterize_repeat=100, record_repeat=100,
|
| - timeout=120, report_detailed_results=False):
|
| + def __init__(self):
|
| super(RasterizeAndRecordMicro, self).__init__('')
|
| self._chrome_branch_number = None
|
| - self._start_wait_time = start_wait_time
|
| - self._rasterize_repeat = rasterize_repeat
|
| - self._record_repeat = record_repeat
|
| - self._timeout = timeout
|
| - self._report_detailed_results = report_detailed_results
|
| +
|
| + @classmethod
|
| + def AddCommandLineArgs(cls, parser):
|
| + parser.add_option('--start-wait-time', type='float',
|
| + default=2,
|
| + help='Wait time before the benchmark is started '
|
| + '(must be long enought to load all content)')
|
| + parser.add_option('--rasterize-repeat', type='int',
|
| + default=100,
|
| + help='Repeat each raster this many times. Increase '
|
| + 'this value to reduce variance.')
|
| + parser.add_option('--record-repeat', type='int',
|
| + default=100,
|
| + help='Repeat each record this many times. Increase '
|
| + 'this value to reduce variance.')
|
| + parser.add_option('--timeout', type='int',
|
| + default=120,
|
| + help='The length of time to wait for the micro '
|
| + 'benchmark to finish, expressed in seconds.')
|
| + parser.add_option('--report-detailed-results',
|
| + action='store_true',
|
| + help='Whether to report additional detailed results.')
|
|
|
| def CustomizeBrowserOptions(self, options):
|
| options.AppendExtraBrowserArgs([
|
| @@ -44,8 +60,10 @@
|
| tab.WaitForDocumentReadyStateToBeComplete()
|
| except TimeoutException:
|
| pass
|
| - time.sleep(self._start_wait_time)
|
| + time.sleep(self.options.start_wait_time)
|
|
|
| + record_repeat = self.options.record_repeat
|
| + rasterize_repeat = self.options.rasterize_repeat
|
| # Enqueue benchmark
|
| tab.ExecuteJavaScript("""
|
| window.benchmark_results = {};
|
| @@ -57,10 +75,10 @@
|
| window.benchmark_results.done = true;
|
| window.benchmark_results.results = value;
|
| }, {
|
| - "record_repeat_count": %i,
|
| - "rasterize_repeat_count": %i
|
| + "record_repeat_count": """ + str(record_repeat) + """,
|
| + "rasterize_repeat_count": """ + str(rasterize_repeat) + """
|
| });
|
| - """ % (self._record_repeat, self._rasterize_repeat))
|
| + """)
|
|
|
| benchmark_id = tab.EvaluateJavaScript('window.benchmark_results.id')
|
| if (not benchmark_id):
|
| @@ -68,7 +86,7 @@
|
| 'Failed to schedule rasterize_and_record_micro')
|
|
|
| tab.WaitForJavaScriptExpression(
|
| - 'window.benchmark_results.done', self._timeout)
|
| + 'window.benchmark_results.done', self.options.timeout)
|
|
|
| data = tab.EvaluateJavaScript('window.benchmark_results.results')
|
|
|
| @@ -99,7 +117,7 @@
|
| results.current_page, 'record_time_painting_disabled', 'ms',
|
| record_time_painting_disabled))
|
|
|
| - if self._report_detailed_results:
|
| + if self.options.report_detailed_results:
|
| pixels_rasterized_with_non_solid_color = \
|
| data['pixels_rasterized_with_non_solid_color']
|
| pixels_rasterized_as_opaque = \
|
|
|