OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 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 | 4 |
5 import re | 5 import re |
6 | 6 |
7 from telemetry import decorators | 7 from telemetry import decorators |
8 | 8 |
| 9 |
9 class PageActionNotSupported(Exception): | 10 class PageActionNotSupported(Exception): |
10 pass | 11 pass |
11 | 12 |
12 class PageActionFailed(Exception): | 13 class PageActionFailed(Exception): |
13 pass | 14 pass |
14 | 15 |
15 | 16 |
16 class PageAction(object): | 17 class PageAction(object): |
17 """Represents an action that a user might try to perform to a page.""" | 18 """Represents an action that a user might try to perform to a page.""" |
18 | 19 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if tab.EvaluateJavaScript(""" | 124 if tab.EvaluateJavaScript(""" |
124 typeof chrome.gpuBenchmarking.gestureSourceTypeSupported === | 125 typeof chrome.gpuBenchmarking.gestureSourceTypeSupported === |
125 'undefined'"""): | 126 'undefined'"""): |
126 return (tab.browser.platform.GetOSName() != 'mac' or | 127 return (tab.browser.platform.GetOSName() != 'mac' or |
127 gesture_source_type.lower() != 'touch') | 128 gesture_source_type.lower() != 'touch') |
128 | 129 |
129 return tab.EvaluateJavaScript(""" | 130 return tab.EvaluateJavaScript(""" |
130 chrome.gpuBenchmarking.gestureSourceTypeSupported( | 131 chrome.gpuBenchmarking.gestureSourceTypeSupported( |
131 chrome.gpuBenchmarking.%s_INPUT)""" | 132 chrome.gpuBenchmarking.%s_INPUT)""" |
132 % (gesture_source_type.upper())) | 133 % (gesture_source_type.upper())) |
OLD | NEW |