| 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.core import util | 9 from telemetry.core import util |
| 10 from telemetry.page import page_measurement | 10 from telemetry.page import page_measurement |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) | 65 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) |
| 66 for suite in data['BenchmarkSuites']: | 66 for suite in data['BenchmarkSuites']: |
| 67 # Skip benchmarks that we didn't actually run this time around. | 67 # Skip benchmarks that we didn't actually run this time around. |
| 68 if len(suite['Benchmarks']) or suite['score']: | 68 if len(suite['Benchmarks']) or suite['score']: |
| 69 results.Add(SCORE_TRACE_NAME, SCORE_UNIT, | 69 results.Add(SCORE_TRACE_NAME, SCORE_UNIT, |
| 70 suite['score'], suite['name'], 'unimportant') | 70 suite['score'], suite['name'], 'unimportant') |
| 71 finally: | 71 finally: |
| 72 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') | 72 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') |
| 73 | 73 |
| 74 def DidRunPageSet(self, tab, results): | 74 def DidRunTest(self, tab, results): |
| 75 # Now give the geometric mean as the total for the combined runs. | 75 # Now give the geometric mean as the total for the combined runs. |
| 76 scores = [] | 76 scores = [] |
| 77 for result in results.page_results: | 77 for result in results.page_results: |
| 78 scores.append(result[SCORE_TRACE_NAME].output_value) | 78 scores.append(result[SCORE_TRACE_NAME].output_value) |
| 79 total = _GeometricMean(scores) | 79 total = _GeometricMean(scores) |
| 80 results.AddSummary(SCORE_TRACE_NAME, SCORE_UNIT, total, 'Total') | 80 results.AddSummary(SCORE_TRACE_NAME, SCORE_UNIT, total, 'Total') |
| OLD | NEW |