diff options
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/bugreports/src/com/android/os/bugreports/tests/BugreportManagerTest.java | 16 |
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() { |