OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from telemetry import page_test | 4 from telemetry import page_test |
5 | 5 |
6 class MeasurementFailure(page_test.Failure): | 6 class MeasurementFailure(page_test.Failure): |
7 """Exception that can be thrown from MeasurePage to indicate an undesired but | 7 """Exception that can be thrown from MeasurePage to indicate an undesired but |
8 designed-for problem.""" | 8 designed-for problem.""" |
9 pass | 9 pass |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 Put together: | 78 Put together: |
79 | 79 |
80 def MeasurePage(self, page, tab, results): | 80 def MeasurePage(self, page, tab, results): |
81 res = tab.EvaluateJavaScript('2+2') | 81 res = tab.EvaluateJavaScript('2+2') |
82 if res != 4: | 82 if res != 4: |
83 raise Exception('Oh, wow.') | 83 raise Exception('Oh, wow.') |
84 results.Add('two_plus_two', 'count', res) | 84 results.Add('two_plus_two', 'count', res) |
85 """ | 85 """ |
86 raise NotImplementedError() | 86 raise NotImplementedError() |
OLD | NEW |