summaryrefslogtreecommitdiff
path: root/packages/Shell/tests
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2016-01-29 13:55:35 -0800
committerFelipe Leme <felipeal@google.com>2016-01-29 14:05:31 -0800
commitc8e2b6092c0fbf87e71f81fd2cffbb29ff8d9039 (patch)
tree45095a711d91dbd0e7fb87984aa5e18701c7103f /packages/Shell/tests
parent18b5892950b7f21e66c9268129323cbc0e865699 (diff)
Fixed check for empty title.
Otherwise, if user entered "Details" but not "Summary", the ACTION_SEND_MULTIPLE subject would be empty. BUG: 26768595 Change-Id: I955ab5e8f05eba9fbfa6fe65eabb6a8a8e28c5b4
Diffstat (limited to 'packages/Shell/tests')
-rw-r--r--packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java37
1 files changed, 28 insertions, 9 deletions
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
index 5908d02b738d..ea85c6183fad 100644
--- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
+++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
@@ -114,6 +114,8 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
private static final String NO_SCREENSHOT = null;
private static final String NO_TITLE = null;
private static final Integer NO_PID = null;
+ private static final boolean RENAMED_SCREENSHOTS = true;
+ private static final boolean DIDNT_RENAME_SCREENSHOTS = false;
private String mDescription;
@@ -171,7 +173,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
Bundle extras =
sendBugreportFinishedAndGetSharedIntent(PID, mPlainTextPath, mScreenshotPath);
assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, ZIP_FILE,
- NAME, NO_TITLE, NO_DESCRIPTION, 1, true);
+ NAME, NO_TITLE, NO_DESCRIPTION, 1, RENAMED_SCREENSHOTS);
assertServiceNotRunning();
}
@@ -202,7 +204,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
Bundle extras = acceptBugreportAndGetSharedIntent();
assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, ZIP_FILE,
- NAME, NO_TITLE, NO_DESCRIPTION, 2, true);
+ NAME, NO_TITLE, NO_DESCRIPTION, 2, RENAMED_SCREENSHOTS);
assertServiceNotRunning();
}
@@ -231,13 +233,12 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
Bundle extras = acceptBugreportAndGetSharedIntent();
assertActionSendMultiple(extras, BUGREPORT_CONTENT, NO_SCREENSHOT, PID, ZIP_FILE,
- NAME, NO_TITLE, NO_DESCRIPTION, 1, true);
+ NAME, NO_TITLE, NO_DESCRIPTION, 1, RENAMED_SCREENSHOTS);
assertServiceNotRunning();
}
public void testProgress_changeDetailsInvalidInput() throws Exception {
-
resetProperties();
sendBugreportStarted(1000);
waitForScreenshotButtonEnabled(true);
@@ -277,7 +278,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
Bundle extras = sendBugreportFinishedAndGetSharedIntent(PID, mPlainTextPath,
mScreenshotPath);
assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, TITLE,
- NEW_NAME, TITLE, mDescription, 1, true);
+ NEW_NAME, TITLE, mDescription, 1, RENAMED_SCREENSHOTS);
assertServiceNotRunning();
}
@@ -291,7 +292,6 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
}
public void changeDetailsTest(boolean plainText) throws Exception {
-
resetProperties();
sendBugreportStarted(1000);
waitForScreenshotButtonEnabled(true);
@@ -316,7 +316,26 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
Bundle extras = sendBugreportFinishedAndGetSharedIntent(PID,
plainText? mPlainTextPath : mZipPath, mScreenshotPath);
assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, TITLE,
- NEW_NAME, TITLE, mDescription, 1, true);
+ NEW_NAME, TITLE, mDescription, 1, RENAMED_SCREENSHOTS);
+
+ assertServiceNotRunning();
+ }
+
+ public void testProgress_changeJustDetails() throws Exception {
+ resetProperties();
+ sendBugreportStarted(1000);
+ waitForScreenshotButtonEnabled(true);
+
+ DetailsUi detailsUi = new DetailsUi(mUiBot);
+
+ detailsUi.nameField.setText("");
+ detailsUi.titleField.setText("");
+ detailsUi.descField.setText(mDescription);
+ detailsUi.clickOk();
+
+ Bundle extras = sendBugreportFinishedAndGetSharedIntent(PID, mZipPath, mScreenshotPath);
+ assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, ZIP_FILE,
+ NO_NAME, NO_TITLE, mDescription, 1, DIDNT_RENAME_SCREENSHOTS);
assertServiceNotRunning();
}
@@ -367,7 +386,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
// Finally, share bugreport.
Bundle extras = acceptBugreportAndGetSharedIntent();
assertActionSendMultiple(extras, BUGREPORT_CONTENT, SCREENSHOT_CONTENT, PID, TITLE,
- NAME, TITLE, mDescription, 1, true);
+ NAME, TITLE, mDescription, 1, RENAMED_SCREENSHOTS);
assertServiceNotRunning();
}
@@ -539,7 +558,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
private void assertActionSendMultiple(Bundle extras, String bugreportContent,
String screenshotContent) throws IOException {
assertActionSendMultiple(extras, bugreportContent, screenshotContent, PID, ZIP_FILE,
- NO_NAME, NO_TITLE, NO_DESCRIPTION, 0, false);
+ NO_NAME, NO_TITLE, NO_DESCRIPTION, 0, DIDNT_RENAME_SCREENSHOTS);
}
/**