OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import json | 5 import json |
6 import math | 6 import math |
7 import os | 7 import os |
8 | 8 |
9 from telemetry import test | 9 from telemetry import test |
10 from telemetry.core import util | 10 from telemetry.core import util |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) | 49 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) |
50 for suite in data['BenchmarkSuites']: | 50 for suite in data['BenchmarkSuites']: |
51 # Skip benchmarks that we didn't actually run this time around. | 51 # Skip benchmarks that we didn't actually run this time around. |
52 if len(suite['Benchmarks']) or suite['score']: | 52 if len(suite['Benchmarks']) or suite['score']: |
53 results.Add(SCORE_TRACE_NAME, SCORE_UNIT, | 53 results.Add(SCORE_TRACE_NAME, SCORE_UNIT, |
54 suite['score'], suite['name'], 'unimportant') | 54 suite['score'], suite['name'], 'unimportant') |
55 finally: | 55 finally: |
56 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') | 56 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') |
57 | 57 |
58 def DidRunPageSet(self, tab, results): | 58 def DidRunTest(self, tab, results): |
59 # Now give the geometric mean as the total for the combined runs. | 59 # Now give the geometric mean as the total for the combined runs. |
60 scores = [] | 60 scores = [] |
61 for result in results.page_results: | 61 for result in results.page_results: |
62 scores.append(result[SCORE_TRACE_NAME].output_value) | 62 scores.append(result[SCORE_TRACE_NAME].output_value) |
63 total = _GeometricMean(scores) | 63 total = _GeometricMean(scores) |
64 results.AddSummary(SCORE_TRACE_NAME, SCORE_UNIT, total, 'Total') | 64 results.AddSummary(SCORE_TRACE_NAME, SCORE_UNIT, total, 'Total') |
65 | 65 |
66 | 66 |
67 class DomPerf(test.Test): | 67 class DomPerf(test.Test): |
68 """A suite of JavaScript benchmarks for exercising the browser's DOM. | 68 """A suite of JavaScript benchmarks for exercising the browser's DOM. |
(...skipping 13 matching lines...) Expand all Loading... |
82 { 'url': base_page + 'CreateNodes' }, | 82 { 'url': base_page + 'CreateNodes' }, |
83 { 'url': base_page + 'DOMDivWalk' }, | 83 { 'url': base_page + 'DOMDivWalk' }, |
84 { 'url': base_page + 'DOMTable' }, | 84 { 'url': base_page + 'DOMTable' }, |
85 { 'url': base_page + 'DOMWalk' }, | 85 { 'url': base_page + 'DOMWalk' }, |
86 { 'url': base_page + 'Events' }, | 86 { 'url': base_page + 'Events' }, |
87 { 'url': base_page + 'Get+Elements' }, | 87 { 'url': base_page + 'Get+Elements' }, |
88 { 'url': base_page + 'GridSort' }, | 88 { 'url': base_page + 'GridSort' }, |
89 { 'url': base_page + 'Template' } | 89 { 'url': base_page + 'Template' } |
90 ] | 90 ] |
91 }, dom_perf_dir) | 91 }, dom_perf_dir) |
OLD | NEW |