summaryrefslogtreecommitdiff
path: root/packages/Shell/tests
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-03-09 10:14:27 -0800
committerFelipe Leme <felipeal@google.com>2016-03-09 10:41:32 -0800
commit5ee846dd18022307341c9808c9aacded2b2f60fd (patch)
tree41af25ed97d3fce716255f3d4ef20b40836f7fe2 /packages/Shell/tests
parent0997873effb57b17c27e7698aa6667bda1ab8d77 (diff)
Warn user when bugreport is finished but screenshot is pending.
BUG: 27524556 Change-Id: Iaecdd01605dc4b01cdf669baf443eaee7fb20f6f
Diffstat (limited to 'packages/Shell/tests')
-rw-r--r--packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
index a629aac33d25..47e3b3b8f8f3 100644
--- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
+++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
@@ -130,6 +130,9 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
private static final boolean RENAMED_SCREENSHOTS = true;
private static final boolean DIDNT_RENAME_SCREENSHOTS = false;
+ private static final boolean PENDING_SCREENSHOT = true;
+ private static final boolean NOT_PENDING_SCREENSHOT = false;
+
private String mDescription;
private String mPlainTextPath;
@@ -409,9 +412,8 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
sendBugreportStarted(ID2, PID2, NAME2, 1000);
- Bundle extras = sendBugreportFinishedAndGetSharedIntent(ID, mZipPath, mScreenshotPath);
- assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, ID, PID, TITLE,
- NEW_NAME, TITLE, DESCRIPTION, 1, RENAMED_SCREENSHOTS);
+ sendBugreportFinished(ID, mZipPath, mScreenshotPath);
+ Bundle extras = acceptBugreportAndGetSharedIntent(ID, PENDING_SCREENSHOT);
detailsUi = new DetailsUi(mUiBot, ID2);
detailsUi.assertName(NAME2);
@@ -602,7 +604,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
private Bundle sendBugreportFinishedAndGetSharedIntent(int id, String bugreportPath,
String screenshotPath) {
sendBugreportFinished(id, bugreportPath, screenshotPath);
- return acceptBugreportAndGetSharedIntent(id);
+ return acceptBugreportAndGetSharedIntent(id, NOT_PENDING_SCREENSHOT);
}
/**
@@ -611,7 +613,11 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
* @return extras sent in the shared intent.
*/
private Bundle acceptBugreportAndGetSharedIntent(int id) {
- acceptBugreport(id);
+ return acceptBugreportAndGetSharedIntent(id, NOT_PENDING_SCREENSHOT);
+ }
+
+ private Bundle acceptBugreportAndGetSharedIntent(int id, boolean pendingScreenshot) {
+ acceptBugreport(id, pendingScreenshot);
mUiBot.chooseActivity(UI_NAME);
return mListener.getExtras();
}
@@ -627,7 +633,13 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
* Accepts the notification to share the finished bugreport.
*/
private void acceptBugreport(int id) {
- mUiBot.clickOnNotification(mContext.getString(R.string.bugreport_finished_title, id));
+ acceptBugreport(id, NOT_PENDING_SCREENSHOT);
+ }
+
+ private void acceptBugreport(int id, boolean pendingScreenshot) {
+ final int res = pendingScreenshot ? R.string.bugreport_finished_pending_screenshot_title
+ : R.string.bugreport_finished_title;
+ mUiBot.clickOnNotification(mContext.getString(res, id));
}
/**