Chromium Code Reviews| Index: testing/android/java/src/org/chromium/testing/local/PackageFilter.java |
| diff --git a/testing/android/java/src/org/chromium/testing/local/PackageFilter.java b/testing/android/java/src/org/chromium/testing/local/PackageFilter.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b307624aced63ffd773915aee56dd0296ce2aa0 |
| --- /dev/null |
| +++ b/testing/android/java/src/org/chromium/testing/local/PackageFilter.java |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.testing.local; |
| + |
| +import org.junit.runner.Description; |
| +import org.junit.runner.manipulation.Filter; |
| + |
| +/** |
| + * Filters tests based on the package. |
|
nyquist
2014/09/19 01:26:04
This implementation doesn't require package only,
jbudorick
2014/09/19 20:09:08
True for this implementation. Revised implementati
|
| + */ |
| +class PackageFilter extends Filter { |
|
nyquist
2014/09/19 01:26:04
Is this missing @Override statements? I think it g
jbudorick
2014/09/19 20:09:07
Done.
|
| + |
| + private final String mFilterString; |
| + |
| + /** |
| + * Creates the filter. |
| + */ |
| + public PackageFilter(String filterString) { |
| + mFilterString = filterString; |
| + } |
| + |
| + /** |
| + * Determines whether or not a test with the provided description should |
| + * run based on its package. |
| + */ |
| + public boolean shouldRun(Description description) { |
| + return description.getClassName().startsWith(mFilterString); |
| + } |
| + |
| + /** |
| + * Returns a description of this filter. |
| + */ |
| + public String describe() { |
| + return new String("package-filter: " + mFilterString); |
|
nyquist
2014/09/19 01:26:04
Just return "package-filter: " + mFilterString;
jbudorick
2014/09/19 20:09:08
Done.
|
| + } |
| + |
| +} |