-
- if hasattr(test, '_testMethodName'):
- method = getattr(test, test._testMethodName) # pylint: disable=W0212
- if hasattr(method, '_requires_browser_types'):
- types = method._requires_browser_types # pylint: disable=W0212
- if options_for_unittests.GetBrowserType() not in types:
- logging.debug('Skipping test %s because it requires %s' %
- (test.id(), types))
- return False
-
- if (not run_disabled_tests and
- (hasattr(method, '_disabled_test') or
- (hasattr(method, '_disabled_test_on_cros') and
- cros_interface.IsRunningOnCrosDevice()))):
- return False
-
- return True
-
+ if default_options.run_disabled_tests:
+ return True
+ # pylint: disable=W0212
+ if not hasattr(test, '_testMethodName'):
+ return True
+ method = getattr(test, test._testMethodName)
+ return decorators.IsEnabled(method, options.GetBrowserType(), platform)