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

Unified Diff: base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java

Issue 2273553002: Create BaseJUnitClassRunner to run junit4 style tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not obfuscate junit Created 4 years, 2 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: base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java
diff --git a/base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java b/base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java
index efca73402ebd05f289498f397dbf05c6a0eb70e6..a749184926119902805d0dd9ff0f65c8d7543957 100644
--- a/base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java
+++ b/base/test/android/junit/src/org/chromium/base/test/util/SkipCheckTest.java
@@ -6,12 +6,15 @@ package org.chromium.base.test.util;
import junit.framework.TestCase;
-import org.chromium.testing.local.LocalRobolectricTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.junit.runners.model.FrameworkMethod;
+
import org.robolectric.annotation.Config;
+import org.chromium.testing.local.LocalRobolectricTestRunner;
+
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -31,7 +34,7 @@ public class SkipCheckTest {
}
@Override
- public boolean shouldSkip(TestCase t) {
+ public boolean shouldSkip(FrameworkMethod m) {
return false;
}
}
@@ -39,11 +42,6 @@ public class SkipCheckTest {
@Retention(RetentionPolicy.RUNTIME)
private @interface TestAnnotation {}
- private class UnannotatedBaseClass {
- public void unannotatedMethod() {}
- @TestAnnotation public void annotatedMethod() {}
- }
-
@TestAnnotation
private class AnnotatedBaseClass {
public void unannotatedMethod() {}
@@ -54,6 +52,18 @@ public class SkipCheckTest {
public void anotherUnannotatedMethod() {}
}
+ private class ExtendsTestCaseClass extends TestCase {
+ public ExtendsTestCaseClass(String name) {
+ super(name);
+ }
+ public void testMethodA() {}
+ }
+
+ private class UnannotatedBaseClass {
+ public void unannotatedMethod() {}
+ @TestAnnotation public void annotatedMethod() {}
+ }
+
@Test
public void getAnnotationsForClassNone() {
List<TestAnnotation> annotations = TestableSkipCheck.getAnnotationsForTesting(
@@ -119,5 +129,4 @@ public class SkipCheckTest {
testMethod, TestAnnotation.class);
Assert.assertEquals(2, annotations.size());
}
-
}
« no previous file with comments | « base/test/android/junit/src/org/chromium/base/test/util/RestrictionSkipCheckTest.java ('k') | third_party/junit/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698