OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 # pylint: disable=protected-access | 4 # pylint: disable=protected-access |
5 | 5 |
6 import datetime | 6 import datetime |
7 import functools | 7 import functools |
8 import os | 8 import os |
9 import inspect | 9 import inspect |
10 import types | 10 import types |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 name = _TestName(test) | 288 name = _TestName(test) |
289 skip = 'Skipping %s (%s) because' % (name, str(test)) | 289 skip = 'Skipping %s (%s) because' % (name, str(test)) |
290 running = 'You are running %r.' % platform_attributes | 290 running = 'You are running %r.' % platform_attributes |
291 | 291 |
292 disabled_attr_name = DisabledAttributeName(test) | 292 disabled_attr_name = DisabledAttributeName(test) |
293 if hasattr(test, disabled_attr_name): | 293 if hasattr(test, disabled_attr_name): |
294 disabled_strings = getattr(test, disabled_attr_name) | 294 disabled_strings = getattr(test, disabled_attr_name) |
295 if 'all' in disabled_strings: | 295 if 'all' in disabled_strings: |
296 return (True, '%s it is unconditionally disabled.' % skip) | 296 return (True, '%s it is unconditionally disabled.' % skip) |
297 if set(disabled_strings) & set(platform_attributes): | 297 if set(disabled_strings) & set(platform_attributes): |
298 return (True, '%s it is disabled for %s. %s' % | 298 return (True, '%s it is disabled for %s. %s' % \ |
299 (skip, ' and '.join(disabled_strings), running)) | 299 (skip, ' and '.join(disabled_strings), running)) |
300 | 300 |
301 enabled_attr_name = EnabledAttributeName(test) | 301 enabled_attr_name = EnabledAttributeName(test) |
302 if hasattr(test, enabled_attr_name): | 302 if hasattr(test, enabled_attr_name): |
303 enabled_strings = getattr(test, enabled_attr_name) | 303 enabled_strings = getattr(test, enabled_attr_name) |
304 if 'all' in enabled_strings: | 304 if 'all' in enabled_strings: |
305 return False, None # No arguments to @Enabled means always enable. | 305 return False, None # No arguments to @Enabled means always enable. |
306 if not set(enabled_strings) & set(platform_attributes): | 306 if not set(enabled_strings) & set(platform_attributes): |
307 return (True, '%s it is only enabled for %s. %s' % | 307 return (True, '%s it is only enabled for %s. %s' % \ |
308 (skip, ' or '.join(enabled_strings), running)) | 308 (skip, ' or '.join(enabled_strings), running)) |
309 | 309 |
310 return False, None | 310 return False, None |
311 | 311 |
312 | 312 |
313 def ShouldBeIsolated(test, possible_browser): | 313 def ShouldBeIsolated(test, possible_browser): |
314 platform_attributes = _PlatformAttributes(possible_browser) | 314 platform_attributes = _PlatformAttributes(possible_browser) |
315 if hasattr(test, '_isolated_strings'): | 315 if hasattr(test, '_isolated_strings'): |
316 isolated_strings = test._isolated_strings | 316 isolated_strings = test._isolated_strings |
317 if not isolated_strings: | 317 if not isolated_strings: |
(...skipping 16 matching lines...) Expand all Loading... |
334 attributes.append('has tabs') | 334 attributes.append('has tabs') |
335 if 'content-shell' in possible_browser.browser_type: | 335 if 'content-shell' in possible_browser.browser_type: |
336 attributes.append('content-shell') | 336 attributes.append('content-shell') |
337 if possible_browser.browser_type == 'reference': | 337 if possible_browser.browser_type == 'reference': |
338 ref_attributes = [] | 338 ref_attributes = [] |
339 for attribute in attributes: | 339 for attribute in attributes: |
340 if attribute != 'reference': | 340 if attribute != 'reference': |
341 ref_attributes.append('%s-reference' % attribute) | 341 ref_attributes.append('%s-reference' % attribute) |
342 attributes.extend(ref_attributes) | 342 attributes.extend(ref_attributes) |
343 return attributes | 343 return attributes |
OLD | NEW |