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

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

Issue 2854823007: Move screenshot capture to Java-side. (Closed)
Patch Set: Yoland's comments Created 3 years, 7 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/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
index 123545294772b3b0c7c667946ef031d1110dde25..080654f8bb00a9c3d1fea22f26aeae3ea3d72150 100644
--- a/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
+++ b/base/test/android/javatests/src/org/chromium/base/test/BaseJUnit4ClassRunner.java
@@ -12,6 +12,7 @@ import android.support.test.internal.util.AndroidRunnerParams;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.Statement;
import org.chromium.base.CollectionUtil;
import org.chromium.base.test.BaseTestResult.PreTestHook;
@@ -156,4 +157,12 @@ public class BaseJUnit4ClassRunner extends AndroidJUnit4ClassRunner {
}
return false;
}
+
+ /*
+ * Overriding this method to take screenshot of failure before tear down functions are run.
+ */
+ @Override
+ protected Statement withAfters(FrameworkMethod method, Object test, Statement base) {
+ return super.withAfters(method, test, new ScreenshotOnFailureStatement(base));
+ }
}
« no previous file with comments | « base/BUILD.gn ('k') | base/test/android/javatests/src/org/chromium/base/test/ScreenshotOnFailureStatement.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698