summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromedriver/test_expectations
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/chromedriver/test_expectations')
-rw-r--r--chrome/test/chromedriver/test_expectations24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/test/chromedriver/test_expectations b/chrome/test/chromedriver/test_expectations
index 6c59100..92dd84b 100644
--- a/chrome/test/chromedriver/test_expectations
+++ b/chrome/test/chromedriver/test_expectations
@@ -177,3 +177,27 @@ def GetPassedJavaTestFilter(operating_system, chrome_version):
"""
return '*-' + ':'.join(_OS_NEGATIVE_FILTER[operating_system] +
_REVISION_NEGATIVE_FILTER[chrome_version])
+
+def ApplyJavaTestFilter(operating_system, chrome_version, tests):
+ """Applies the test filter to the given list of tests.
+
+ Args:
+ operating_system: The operating system, one of 'linux', 'mac', 'win', or
+ 'android'.
+ chrome_version: Chrome version to test against, e.g., 'HEAD' or '26'.
+ test: list of test names to filter.
+
+ Returns:
+ Set of passed test names.
+ """
+ filters = (_OS_NEGATIVE_FILTER[operating_system] +
+ _REVISION_NEGATIVE_FILTER[chrome_version])
+ passed = set(tests)
+ for f in filters:
+ passed.difference_update(set(t for t in tests if _TestMatchesFilter(t, f)))
+ return passed
+
+def _TestMatchesFilter(test, filter):
+ if '*' in filter:
+ return test[:len(filter) - 1] == test[:-1]
+ return test == filter