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

Unified Diff: base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java

Issue 1519523002: [Android] Support conditional test disabling based on android.os.Build values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix one outdated use of SkipCheck Created 5 years 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: base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java b/base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java
new file mode 100644
index 0000000000000000000000000000000000000000..cb21dfd98b623891bea778bb57b1b62652cf6e7f
--- /dev/null
+++ b/base/test/android/javatests/src/org/chromium/base/test/util/SkipCheck.java
@@ -0,0 +1,39 @@
+// Copyright 2015 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.base.test.util;
+
+import junit.framework.TestCase;
+
+import org.chromium.base.Log;
+
+import java.lang.reflect.Method;
+
+/**
+ * Check whether a test case should be skipped.
+ */
+public abstract class SkipCheck {
+
+ private static final String TAG = "base_test";
+
+ /**
+ *
+ * Checks whether the given test case should be skipped.
+ *
+ * @param testCase The test case to check.
+ * @return Whether the test case should be skipped.
+ */
+ public abstract boolean shouldSkip(TestCase testCase);
+
+ protected static Method getTestMethod(TestCase testCase) {
+ try {
+ return testCase.getClass().getMethod(testCase.getName(), (Class[]) null);
+ } catch (NoSuchMethodException e) {
+ Log.e(TAG, "Unable to find %s in %s", testCase.getName(),
+ testCase.getClass().getName(), e);
+ return null;
+ }
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698