Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: tools/chrome_proxy/webdriver/common.py

Issue 2823253002: Refactor decorators into thier own python class (Closed)
Patch Set: Forgot to add new decorators class Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/chrome_proxy/webdriver/common.py
diff --git a/tools/chrome_proxy/webdriver/common.py b/tools/chrome_proxy/webdriver/common.py
index 9f2cb9825c8c0a3ba7ddfb788835d8dc827b51c0..75769bf0752363a21dcc926b281e4692bcc85c49 100644
--- a/tools/chrome_proxy/webdriver/common.py
+++ b/tools/chrome_proxy/webdriver/common.py
@@ -674,71 +674,3 @@ class IntegrationTest(unittest.TestCase):
testRunner = unittest.runner.TextTestRunner(verbosity=2,
failfast=flags.failfast, buffer=(not flags.disable_buffer))
testRunner.run(tests)
-
-# Platform-specific decorators.
-# These decorators can be used to only run a test function for certain platforms
-# by annotating the function with them.
-
-def AndroidOnly(func):
- def wrapper(*args, **kwargs):
- if ParseFlags().android:
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test runs on Android only.')
- return wrapper
-
-def NotAndroid(func):
- def wrapper(*args, **kwargs):
- if not ParseFlags().android:
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test does not run on Android.')
- return wrapper
-
-def WindowsOnly(func):
- def wrapper(*args, **kwargs):
- if sys.platform == 'win32':
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test runs on Windows only.')
- return wrapper
-
-def NotWindows(func):
- def wrapper(*args, **kwargs):
- if sys.platform != 'win32':
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test does not run on Windows.')
- return wrapper
-
-def LinuxOnly(func):
- def wrapper(*args, **kwargs):
- if sys.platform.startswith('linux'):
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test runs on Linux only.')
- return wrapper
-
-def NotLinux(func):
- def wrapper(*args, **kwargs):
- if sys.platform.startswith('linux'):
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test does not run on Linux.')
- return wrapper
-
-def MacOnly(func):
- def wrapper(*args, **kwargs):
- if sys.platform == 'darwin':
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test runs on Mac OS only.')
- return wrapper
-
-def NotMac(func):
- def wrapper(*args, **kwargs):
- if sys.platform == 'darwin':
- func(*args, **kwargs)
- else:
- args[0].skipTest('This test does not run on Mac OS.')
- return wrapper
« no previous file with comments | « no previous file | tools/chrome_proxy/webdriver/compression_regression.py » ('j') | tools/chrome_proxy/webdriver/quic.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698