diff options
author | Tony Huang <tonyychuang@google.com> | 2019-12-20 15:31:45 +0800 |
---|---|---|
committer | Tony Huang <tonyychuang@google.com> | 2019-12-20 07:43:09 +0000 |
commit | 5fb3a45a53f93b78f3097c771977e2cffb83f839 (patch) | |
tree | 60df480fe7e547b39a2c5d5f8b5ac206db5632aa | |
parent | f5aadcaaed9d98be02b7a2f22ff4ce7420db915f (diff) | |
download | android_packages_apps_DocumentsUI-5fb3a45a53f93b78f3097c771977e2cffb83f839.tar.gz android_packages_apps_DocumentsUI-5fb3a45a53f93b78f3097c771977e2cffb83f839.tar.bz2 android_packages_apps_DocumentsUI-5fb3a45a53f93b78f3097c771977e2cffb83f839.zip |
Manually close activity when SearchViewUiTest
When search bar expand then activity destroy, it has risk that
SearchFrament show caused by focus transition. This will cause
crash because fragment cannot show when stateSaved.
Bug: 142840883
Test: atest DocumentsUIGoogleTests
Change-Id: I3e37cefb0709284f02158c031fb135e9dd606662
-rw-r--r-- | tests/functional/com/android/documentsui/SearchViewUiTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/functional/com/android/documentsui/SearchViewUiTest.java b/tests/functional/com/android/documentsui/SearchViewUiTest.java index 9a151f7fb..d18ac3c02 100644 --- a/tests/functional/com/android/documentsui/SearchViewUiTest.java +++ b/tests/functional/com/android/documentsui/SearchViewUiTest.java @@ -44,6 +44,16 @@ public class SearchViewUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument(fileName1); } + @Override + public void tearDown() throws Exception { + // manually close activity to avoid SearchFragment show when Activity close. ref b/142840883 + device.waitForIdle(); + device.pressBack(); + device.pressBack(); + device.pressBack(); + super.tearDown(); + } + public void testSearchIconVisible() throws Exception { // The default root (root 0) supports search bots.search.assertInputExists(false); |