summaryrefslogtreecommitdiff
path: root/packages/Shell/tests
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Shell/tests')
-rw-r--r--packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
index 89cdeaea199c..947691206741 100644
--- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
+++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
@@ -40,6 +40,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import android.app.ActivityManager;
@@ -534,6 +535,18 @@ public class BugreportReceiverTest {
assertActionSendMultiple(extras);
}
+ @Test
+ public void testBugreportRequestTwice_oneStartBugreportInvoked() throws Exception {
+ sendBugreportStarted();
+ new BugreportRequestedReceiver().onReceive(mContext,
+ new Intent(INTENT_BUGREPORT_REQUESTED));
+ getInstrumentation().waitForIdleSync();
+
+ verify(mMockIDumpstate, times(1)).startBugreport(anyInt(), any(), any(), any(),
+ anyInt(), any(), anyBoolean());
+ sendBugreportFinished();
+ }
+
private void cancelExistingNotifications() {
// Must kill service first, because notifications from a foreground service cannot be
// canceled.