Chromium Code Reviews| Index: build/android/pylib/instrumentation/instrumentation_test_instance.py |
| diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| index 1d63f6b9a72ee60cd2d733460cc5a39cb7020792..12fe4309f298615ab0bfbec3e25358609875ac48 100644 |
| --- a/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| +++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py |
| @@ -588,10 +588,20 @@ class InstrumentationTestInstance(test_instance.TestInstance): |
| return not any_annotation_matches(self._excluded_annotations, |
| all_annotations) |
| - def any_annotation_matches(annotations, all_annotations): |
| + def any_annotation_matches(filter_annotations, all_annotations): |
| return any( |
| - ak in all_annotations and (av is None or av == all_annotations[ak]) |
| - for ak, av in annotations.iteritems()) |
| + ak in all_annotations |
|
rnephew (Reviews Here)
2016/06/24 14:22:43
These variables could probably be a little more de
jbudorick
2016/06/24 14:24:56
In a comprehension, I'd strongly prefer keeping th
|
| + and annotation_value_matches(av, all_annotations[ak]) |
| + for ak, av in filter_annotations.iteritems()) |
| + |
| + def annotation_value_matches(filter_av, av): |
| + if filter_av is None: |
| + return True |
| + elif isinstance(av, dict): |
| + return filter_av in av['value'] |
| + elif isinstance(av, list): |
| + return filter_av in av |
| + return filter_av == av |
| filtered_classes = [] |
| for c in tests: |