summaryrefslogtreecommitdiff
path: root/core/tests
diff options
context:
space:
mode:
authorGavin Corkery <gavincorkery@google.com>2020-12-14 18:55:55 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-12-14 18:55:55 +0000
commitd45d533b6ec1bb16440b35039c324f9a29dea03b (patch)
tree416f67fb265a4488d31d5c8a89a71f6711299f48 /core/tests
parent85ebf98dcf011e30e41f0bb6369e5168fa639581 (diff)
parent00dff9634c671ff2d1759f0600414bce1e0646c6 (diff)
Merge "Replace broadcast with adding a method in BugreportCallback"
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java b/core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java
index 9246a2335050..f9e3bc60561c 100644
--- a/core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java
+++ b/core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java
@@ -118,6 +118,7 @@ public class BugreportManagerTest {
// Wifi bugreports should not receive any progress.
assertThat(callback.hasReceivedProgress()).isFalse();
assertThat(mBugreportFile.length()).isGreaterThan(0L);
+ assertThat(callback.hasEarlyReportFinished()).isTrue();
assertFdsAreClosed(mBugreportFd);
}
@@ -135,6 +136,7 @@ public class BugreportManagerTest {
// Interactive bugreports show progress updates.
assertThat(callback.hasReceivedProgress()).isTrue();
assertThat(mBugreportFile.length()).isGreaterThan(0L);
+ assertThat(callback.hasEarlyReportFinished()).isTrue();
assertFdsAreClosed(mBugreportFd);
}
@@ -246,6 +248,7 @@ public class BugreportManagerTest {
private int mErrorCode = -1;
private boolean mSuccess = false;
private boolean mReceivedProgress = false;
+ private boolean mEarlyReportFinished = false;
private final Object mLock = new Object();
@Override
@@ -271,6 +274,13 @@ public class BugreportManagerTest {
}
}
+ @Override
+ public void onEarlyReportFinished() {
+ synchronized (mLock) {
+ mEarlyReportFinished = true;
+ }
+ }
+
/* Indicates completion; and ended up with a success or error. */
public boolean isDone() {
synchronized (mLock) {
@@ -295,6 +305,12 @@ public class BugreportManagerTest {
return mReceivedProgress;
}
}
+
+ public boolean hasEarlyReportFinished() {
+ synchronized (mLock) {
+ return mEarlyReportFinished;
+ }
+ }
}
public static BugreportManager getBugreportManager() {