| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 fnmatch | 5 import fnmatch |
| 6 import urlparse | 6 import urlparse |
| 7 | 7 |
| 8 # Valid expectation conditions are: | 8 # Valid expectation conditions are: |
| 9 # | 9 # |
| 10 # Operating systems: | 10 # Operating systems: |
| 11 # win, xp, vista, win7, win8, win10, mac, leopard, snowleopard, | 11 # win, xp, vista, win7, win8, win10, mac, leopard, snowleopard, |
| 12 # lion, mountainlion, mavericks, yosemite, sierra, linux, chromeos, | 12 # lion, mountainlion, mavericks, yosemite, sierra, linux, chromeos, |
| 13 # android | 13 # android |
| 14 # | 14 # |
| 15 # Browser types: | 15 # Browser types: |
| 16 # android-webview-shell, android-content-shell, debug, release | 16 # android-webview-instrumentation, android-content-shell, debug, release |
| 17 # | 17 # |
| 18 # ASAN conditions: | 18 # ASAN conditions: |
| 19 # asan, no_asan | 19 # asan, no_asan |
| 20 # | 20 # |
| 21 # Sample usage in SetExpectations in subclasses: | 21 # Sample usage in SetExpectations in subclasses: |
| 22 # self.Fail('gl-enable-vertex-attrib.html', | 22 # self.Fail('gl-enable-vertex-attrib.html', |
| 23 # ['mac', 'release'], bug=123) | 23 # ['mac', 'release'], bug=123) |
| 24 | 24 |
| 25 WIN_CONDITIONS = ['xp', 'vista', 'win7', 'win8', 'win10'] | 25 WIN_CONDITIONS = ['xp', 'vista', 'win7', 'win8', 'win10'] |
| 26 MAC_CONDITIONS = ['leopard', 'snowleopard', 'lion', 'mountainlion', | 26 MAC_CONDITIONS = ['leopard', 'snowleopard', 'lion', 'mountainlion', |
| 27 'mavericks', 'yosemite', 'sierra'] | 27 'mavericks', 'yosemite', 'sierra'] |
| 28 | 28 |
| 29 OS_CONDITIONS = ['win', 'mac', 'linux', 'chromeos', 'android'] + \ | 29 OS_CONDITIONS = ['win', 'mac', 'linux', 'chromeos', 'android'] + \ |
| 30 WIN_CONDITIONS + MAC_CONDITIONS | 30 WIN_CONDITIONS + MAC_CONDITIONS |
| 31 | 31 |
| 32 BROWSER_TYPE_CONDITIONS = [ | 32 BROWSER_TYPE_CONDITIONS = [ |
| 33 'android-webview-shell', 'android-content-shell', 'android-chromium', | 33 'android-webview-instrumentation', 'android-content-shell', |
| 34 'debug', 'release'] | 34 'android-chromium', 'debug', 'release'] |
| 35 | 35 |
| 36 ASAN_CONDITIONS = ['asan', 'no_asan'] | 36 ASAN_CONDITIONS = ['asan', 'no_asan'] |
| 37 | 37 |
| 38 def _SafeLower(opt_str): | 38 def _SafeLower(opt_str): |
| 39 if not opt_str: | 39 if not opt_str: |
| 40 return opt_str | 40 return opt_str |
| 41 return opt_str.lower() | 41 return opt_str.lower() |
| 42 | 42 |
| 43 | 43 |
| 44 class Expectation(object): | 44 class Expectation(object): |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 unsupported. | 83 unsupported. |
| 84 | 84 |
| 85 Valid expectation conditions are: | 85 Valid expectation conditions are: |
| 86 | 86 |
| 87 Operating systems: | 87 Operating systems: |
| 88 win, xp, vista, win7, mac, leopard, snowleopard, lion, | 88 win, xp, vista, win7, mac, leopard, snowleopard, lion, |
| 89 mountainlion, mavericks, yosemite, sierra, linux, chromeos, | 89 mountainlion, mavericks, yosemite, sierra, linux, chromeos, |
| 90 android | 90 android |
| 91 | 91 |
| 92 Browser types: | 92 Browser types: |
| 93 android-webview-shell, android-content-shell, android-chromium, | 93 android-webview-instrumentation, android-content-shell, |
| 94 debug, release | 94 android-chromium, debug, release |
| 95 | 95 |
| 96 Sample usage in SetExpectations in subclasses: | 96 Sample usage in SetExpectations in subclasses: |
| 97 self.Fail('gl-enable-vertex-attrib.html', | 97 self.Fail('gl-enable-vertex-attrib.html', |
| 98 ['mac', 'release'], bug=123) | 98 ['mac', 'release'], bug=123) |
| 99 | 99 |
| 100 """ | 100 """ |
| 101 cl = condition.lower() | 101 cl = condition.lower() |
| 102 if cl in OS_CONDITIONS: | 102 if cl in OS_CONDITIONS: |
| 103 self.os_conditions.append(cl) | 103 self.os_conditions.append(cl) |
| 104 elif cl in BROWSER_TYPE_CONDITIONS: | 104 elif cl in BROWSER_TYPE_CONDITIONS: |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 browser_matches = ( | 301 browser_matches = ( |
| 302 (not expectation.browser_conditions) or | 302 (not expectation.browser_conditions) or |
| 303 _SafeLower(browser.browser_type) in expectation.browser_conditions) | 303 _SafeLower(browser.browser_type) in expectation.browser_conditions) |
| 304 | 304 |
| 305 asan_matches = ( | 305 asan_matches = ( |
| 306 (not expectation.asan_conditions) or | 306 (not expectation.asan_conditions) or |
| 307 ('asan' in expectation.asan_conditions and self._is_asan) or | 307 ('asan' in expectation.asan_conditions and self._is_asan) or |
| 308 ('no_asan' in expectation.asan_conditions and not self._is_asan)) | 308 ('no_asan' in expectation.asan_conditions and not self._is_asan)) |
| 309 | 309 |
| 310 return os_matches and browser_matches and asan_matches | 310 return os_matches and browser_matches and asan_matches |
| OLD | NEW |