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

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

Issue 2933623002: Create AwJUnit4ClassRunner AwActivityTestRule and convert AwContentsTest (Closed)
Patch Set: address bo's comments Created 3 years, 5 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/TestListInstrumentationRunListener.java
diff --git a/base/test/android/javatests/src/org/chromium/base/test/TestListInstrumentationRunListener.java b/base/test/android/javatests/src/org/chromium/base/test/TestListInstrumentationRunListener.java
index 71fa4e0aaf7c29b249e4d0e71892a1238578efa3..8cde57003c3bd3028284255a30c553cd43a2e597 100644
--- a/base/test/android/javatests/src/org/chromium/base/test/TestListInstrumentationRunListener.java
+++ b/base/test/android/javatests/src/org/chromium/base/test/TestListInstrumentationRunListener.java
@@ -9,7 +9,6 @@ import android.support.test.internal.runner.listener.InstrumentationRunListener;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.runner.Description;
-import org.junit.runner.Result;
import org.chromium.base.Log;
@@ -36,12 +35,6 @@ public class TestListInstrumentationRunListener extends InstrumentationRunListen
Arrays.asList(new String[] {"toString", "hashCode", "annotationType", "equals"}));
private final Map<Class<?>, JSONObject> mTestClassJsonMap = new HashMap<>();
- private final String mOutputPath;
-
- public TestListInstrumentationRunListener(String outputPath) {
- super();
- mOutputPath = outputPath;
- }
/**
* Store the test method description to a Map at the beginning of a test run.
@@ -65,10 +58,9 @@ public class TestListInstrumentationRunListener extends InstrumentationRunListen
/**
* Create a JSONArray with all the test class JSONObjects and save it to listed output path.
*/
- @Override
- public void testRunFinished(Result result) throws IOException {
+ public void saveTestsToJson(String outputPath) throws IOException {
Writer writer = null;
- File file = new File(mOutputPath);
+ File file = new File(outputPath);
try {
writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
JSONArray allTestClassesJSON = new JSONArray(mTestClassJsonMap.values());

Powered by Google App Engine
This is Rietveld 408576698