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

Commit 40b9d0ee authored by Cassy Chun-Crogan's avatar Cassy Chun-Crogan
Browse files

[DocsUI] Wait for saver activity to finish in test

In the picker/saver tests, when the bot is used to click a button to
select a file which asynchronously leads to Activity.finish() being
called. Based on the documentation [1], getActivityResult() can be
called only after Activity.finish().

The test testActionCreate_TextFile() has been failing because of
"java.lang.IllegalStateException: Activity is not finishing!" caused by
getActivityResult() being called before Activity.finish(). To fix this,
copy the same solution as the other picker tests by adding
SystemClock.sleep(3000); between clicking the save button and
calling getActivityResult() to ensure that there is enough time
for Activity.finish() to execute.

[1] https://developer.android.com/reference/androidx/test/rule/ActivityTestRule#getActivityResult()

Bug: 431760772
Test: atest ActionCreateDocumentUiTest#testActionCreate_TextFile
Flag: EXEMPT this change is not behind a flag
Change-Id: Ic967786b7d872a96f04a5283c7f2fa094c5841c5
parent e8ba3f9e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment