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

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

Issue 2722243002: 📰 Add tests for Tile and TileGroup (Closed)
Patch Set: Revert default Rule effect Created 3 years, 10 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
« no previous file with comments | « chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/android/junit/java/src/org/chromium/testing/local/AnnotationProcessor.java
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/AnnotationProcessor.java b/testing/android/junit/java/src/org/chromium/testing/local/AnnotationProcessor.java
index 86ac990c300d6ed5738c6728d48a38fca71b1a37..8b60b1af69e302c7949e8f0245b9c89a3b9e86a6 100644
--- a/testing/android/junit/java/src/org/chromium/testing/local/AnnotationProcessor.java
+++ b/testing/android/junit/java/src/org/chromium/testing/local/AnnotationProcessor.java
@@ -47,7 +47,7 @@ public AnnotationProcessor(Class<T> annotationClass) {
@Override
public Statement apply(Statement base, Description description) {
mTestDescription = description;
- mAnnotation = description.getAnnotation(mAnnotationClass);
+ mAnnotation = getAnnotation(description);
if (mAnnotation == null) return base;
// Return the wrapped statement to execute before() and after().
@@ -63,4 +63,12 @@ protected Description getTestDescription() {
protected T getAnnotation() {
return mAnnotation;
}
+
+ private T getAnnotation(Description description) {
+ T annotation = description.getAnnotation(mAnnotationClass);
+ if (annotation != null) return annotation;
+
+ annotation = description.getTestClass().getAnnotation(mAnnotationClass);
+ return annotation;
+ }
}
« no previous file with comments | « chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698