Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 logging | 5 import logging |
| 6 | 6 |
| 7 | 7 |
| 8 class StoryExpectations(object): | 8 class StoryExpectations(object): |
| 9 """An object that contains disabling expectations for benchmarks and stories. | 9 """An object that contains disabling expectations for benchmarks and stories. |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 self._name = name | 212 self._name = name |
| 213 | 213 |
| 214 def __str__(self): | 214 def __str__(self): |
| 215 return self._name | 215 return self._name |
| 216 | 216 |
| 217 def ShouldDisable(self, platform, finder_options): | 217 def ShouldDisable(self, platform, finder_options): |
| 218 if platform.GetOSName() != 'mac': | 218 if platform.GetOSName() != 'mac': |
| 219 return False | 219 return False |
| 220 return platform.GetOSVersionDetailString().startswith(self._version) | 220 return platform.GetOSVersionDetailString().startswith(self._version) |
| 221 | 221 |
| 222 | |
| 223 class _TestConditionCompositeConditions(_TestCondition): | |
|
charliea (OOO until 10-5)
2017/08/23 17:43:02
I wonder if it makes sense to call this something
rnephew (Reviews Here)
2017/08/23 17:45:12
Done.
| |
| 224 def __init__(self, conditions, name): | |
| 225 self._conditions = conditions | |
| 226 self._name = name | |
| 227 | |
| 228 def __str__(self): | |
| 229 return self._name | |
| 230 | |
| 231 def ShouldDisable(self, platform, finder_options): | |
| 232 return all( | |
| 233 c.ShouldDisable(platform, finder_options) for c in self._conditions) | |
| 234 | |
| 235 | |
| 222 ALL = _AllTestCondition() | 236 ALL = _AllTestCondition() |
| 223 ALL_MAC = _TestConditionByPlatformList(['mac'], 'Mac Platforms') | 237 ALL_MAC = _TestConditionByPlatformList(['mac'], 'Mac Platforms') |
| 224 ALL_WIN = _TestConditionByPlatformList(['win'], 'Win Platforms') | 238 ALL_WIN = _TestConditionByPlatformList(['win'], 'Win Platforms') |
| 225 ALL_LINUX = _TestConditionByPlatformList(['linux'], 'Linux Platforms') | 239 ALL_LINUX = _TestConditionByPlatformList(['linux'], 'Linux Platforms') |
| 226 ALL_ANDROID = _TestConditionByPlatformList(['android'], 'Android Platforms') | 240 ALL_ANDROID = _TestConditionByPlatformList(['android'], 'Android Platforms') |
| 227 ALL_DESKTOP = _TestConditionByPlatformList( | 241 ALL_DESKTOP = _TestConditionByPlatformList( |
| 228 ['mac', 'linux', 'win'], 'Desktop Platforms') | 242 ['mac', 'linux', 'win'], 'Desktop Platforms') |
| 229 ALL_MOBILE = _TestConditionByPlatformList(['android'], 'Mobile Platforms') | 243 ALL_MOBILE = _TestConditionByPlatformList(['android'], 'Mobile Platforms') |
| 230 ANDROID_NEXUS5 = _TestConditionByAndroidModel('Nexus 5') | 244 ANDROID_NEXUS5 = _TestConditionByAndroidModel('Nexus 5') |
| 231 ANDROID_NEXUS5X = _TestConditionByAndroidModel('Nexus 5X') | 245 ANDROID_NEXUS5X = _TestConditionByAndroidModel('Nexus 5X') |
| 232 ANDROID_NEXUS6 = _TestConditionByAndroidModel('Nexus 6') | 246 ANDROID_NEXUS6 = _TestConditionByAndroidModel('Nexus 6') |
| 233 ANDROID_NEXUS6P = _TestConditionByAndroidModel('Nexus 6P') | 247 ANDROID_NEXUS6P = _TestConditionByAndroidModel('Nexus 6P') |
| 234 ANDROID_NEXUS7 = _TestConditionByAndroidModel('Nexus 7') | 248 ANDROID_NEXUS7 = _TestConditionByAndroidModel('Nexus 7') |
| 235 ANDROID_ONE = _TestConditionByAndroidModel( | 249 ANDROID_ONE = _TestConditionByAndroidModel( |
| 236 'W6210', 'Cherry Mobile Android One') | 250 'W6210', 'Cherry Mobile Android One') |
| 237 ANDROID_SVELTE = _TestConditionAndroidSvelte() | 251 ANDROID_SVELTE = _TestConditionAndroidSvelte() |
| 238 ANDROID_WEBVIEW = _TestConditionAndroidWebview() | 252 ANDROID_WEBVIEW = _TestConditionAndroidWebview() |
| 239 ANDROID_NOT_WEBVIEW = _TestConditionAndroidNotWebview() | 253 ANDROID_NOT_WEBVIEW = _TestConditionAndroidNotWebview() |
| 240 # MAC_10_11 Includes: | 254 # MAC_10_11 Includes: |
| 241 # Mac 10.11 Perf, Mac Retina Perf, Mac Pro 10.11 Perf, Mac Air 10.11 Perf | 255 # Mac 10.11 Perf, Mac Retina Perf, Mac Pro 10.11 Perf, Mac Air 10.11 Perf |
| 242 MAC_10_11 = _TestConditionByMacVersion('10.11', 'Mac 10.11') | 256 MAC_10_11 = _TestConditionByMacVersion('10.11', 'Mac 10.11') |
| 243 # Mac 10_12 Includes: | 257 # Mac 10_12 Includes: |
| 244 # Mac 10.12 Perf, Mac Mini 8GB 10.12 Perf | 258 # Mac 10.12 Perf, Mac Mini 8GB 10.12 Perf |
| 245 MAC_10_12 = _TestConditionByMacVersion('10.12', 'Mac 10.12') | 259 MAC_10_12 = _TestConditionByMacVersion('10.12', 'Mac 10.12') |
| 260 | |
| 261 ANDROID_NEXUS6_WEBVIEW = _TestConditionCompositeConditions( | |
| 262 [ANDROID_NEXUS6, ANDROID_WEBVIEW], 'Nexus6 Webview') | |
| 263 ANDROID_NEXUS5X_WEBVIEW = _TestConditionCompositeConditions( | |
| 264 [ANDROID_NEXUS5X, ANDROID_WEBVIEW], 'Nexus5X Webview') | |
| OLD | NEW |