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

Unified Diff: testing/android/junit/java/src/org/chromium/testing/local/PackageFilter.java

Issue 596303002: Revert of Revert of [Android] JUnit runner + gyp changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@deps-changes
Patch Set: Created 6 years, 3 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: testing/android/junit/java/src/org/chromium/testing/local/PackageFilter.java
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/PackageFilter.java b/testing/android/junit/java/src/org/chromium/testing/local/PackageFilter.java
new file mode 100644
index 0000000000000000000000000000000000000000..4d6a580d47f587708ac2f4b0301c276837b89b6c
--- /dev/null
+++ b/testing/android/junit/java/src/org/chromium/testing/local/PackageFilter.java
@@ -0,0 +1,41 @@
+// 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.
+ */
+class PackageFilter extends Filter {
+
+ 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.
+ */
+ @Override
+ public boolean shouldRun(Description description) {
+ return description.getTestClass().getPackage().getName().equals(mFilterString);
+ }
+
+ /**
+ * Returns a description of this filter.
+ */
+ @Override
+ public String describe() {
+ return "package-filter: " + mFilterString;
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698