Index: base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java |
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java b/base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java |
index b4beef2bf4b3b8dc32ddcc66bdbabee70592c8d6..b56ca961bb30944ddca398519269dd27e4e070b2 100644 |
--- a/base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java |
+++ b/base/test/android/javatests/src/org/chromium/base/test/util/RestrictionSkipCheck.java |
@@ -9,12 +9,9 @@ import android.net.ConnectivityManager; |
import android.net.NetworkInfo; |
import android.text.TextUtils; |
-import junit.framework.TestCase; |
- |
import org.chromium.base.Log; |
import org.chromium.base.SysUtils; |
- |
-import java.lang.reflect.Method; |
+import org.junit.runners.model.FrameworkMethod; |
/** |
* Checks if any restrictions exist and skip the test if it meets those restrictions. |
@@ -30,15 +27,14 @@ public class RestrictionSkipCheck extends SkipCheck { |
} |
@Override |
- public boolean shouldSkip(TestCase testCase) { |
- Method method = getTestMethod(testCase); |
- if (method == null) return true; |
+ public boolean shouldSkip(FrameworkMethod frameworkMethod) { |
+ if (frameworkMethod == null) return true; |
- for (Restriction restriction : getAnnotations(method, Restriction.class)) { |
+ for (Restriction restriction : getAnnotations(frameworkMethod, Restriction.class)) { |
for (String restrictionVal : restriction.value()) { |
if (restrictionApplies(restrictionVal)) { |
- Log.i(TAG, "Test " + testCase.getClass().getName() + "#" |
- + testCase.getName() + " skipped because of restriction " |
+ Log.i(TAG, "Test " + frameworkMethod.getDeclaringClass().getName() + "#" |
+ + frameworkMethod.getName() + " skipped because of restriction " |
+ restriction); |
return true; |
} |