Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fb3a45a authored by Tony Huang's avatar Tony Huang
Browse files

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
parent f5aadcaa
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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);