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

Unified Diff: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java

Issue 1173363008: [Android] Refactor browser test execution. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 6 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 | « testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
diff --git a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
index 6ac7312fad3f422a6fa6bcc1b8acf226d1ae249c..0c5d3e6c08b9fc8244b1295f26adb5f4ed1d7cd7 100644
--- a/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
+++ b/testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReporter.java
@@ -24,8 +24,14 @@ public class TestStatusReporter {
"org.chromium.test.reporter.TestStatusReporter.TEST_PASSED";
public static final String ACTION_TEST_FAILED =
"org.chromium.test.reporter.TestStatusReporter.TEST_FAILED";
+ public static final String ACTION_TEST_RUN_STARTED =
+ "org.chromium.test.reporter.TestStatusReporter.TEST_RUN_STARTED";
+ public static final String ACTION_TEST_RUN_FINISHED =
+ "org.chromium.test.reporter.TestStatusReporter.TEST_RUN_FINISHED";
public static final String DATA_TYPE_HEARTBEAT = "org.chromium.test.reporter/heartbeat";
public static final String DATA_TYPE_RESULT = "org.chromium.test.reporter/result";
+ public static final String EXTRA_PID =
+ "org.chromium.test.reporter.TestStatusReporter.PID";
public static final String EXTRA_TEST_CLASS =
"org.chromium.test.reporter.TestStatusReporter.TEST_CLASS";
public static final String EXTRA_TEST_METHOD =
@@ -57,22 +63,18 @@ public class TestStatusReporter {
}
public void testStarted(String testClass, String testMethod) {
- sendBroadcast(testClass, testMethod, ACTION_TEST_STARTED);
+ sendTestBroadcast(testClass, testMethod, ACTION_TEST_STARTED);
}
public void testPassed(String testClass, String testMethod) {
- sendBroadcast(testClass, testMethod, ACTION_TEST_PASSED);
+ sendTestBroadcast(testClass, testMethod, ACTION_TEST_PASSED);
}
public void testFailed(String testClass, String testMethod) {
- sendBroadcast(testClass, testMethod, ACTION_TEST_FAILED);
+ sendTestBroadcast(testClass, testMethod, ACTION_TEST_FAILED);
}
- public void stopHeartbeat() {
- mKeepBeating.set(false);
- }
-
- private void sendBroadcast(String testClass, String testMethod, String action) {
+ private void sendTestBroadcast(String action, String testClass, String testMethod) {
Intent i = new Intent(action);
i.setType(DATA_TYPE_RESULT);
i.putExtra(EXTRA_TEST_CLASS, testClass);
@@ -80,4 +82,23 @@ public class TestStatusReporter {
mContext.sendBroadcast(i);
}
+ public void testRunStarted(int pid) {
+ sendTestRunBroadcast(ACTION_TEST_RUN_STARTED, pid);
+ }
+
+ public void testRunFinished(int pid) {
+ sendTestRunBroadcast(ACTION_TEST_RUN_FINISHED, pid);
+ }
+
+ private void sendTestRunBroadcast(String action, int pid) {
+ Intent i = new Intent(action);
+ i.setType(DATA_TYPE_RESULT);
+ i.putExtra(EXTRA_PID, pid);
+ mContext.sendBroadcast(i);
+ }
+
+ public void stopHeartbeat() {
+ mKeepBeating.set(false);
+ }
+
}
« no previous file with comments | « testing/android/reporter/java/src/org/chromium/test/reporter/TestStatusReceiver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698