[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
Loading
Please register or sign in to comment