Wait for an autofill snackbar closed after each iteration

LoginActivityTest#testCommitMultipleTimes has waited 'onDisconnect'
after each iteration. But the internal states in AutofillManager
are cleared asynchronously after onDisconnect. If next iteration
starts before the states are creared, the next iteration could
not connect to the autofill service.

This Cl adds a code to wait until the autofill window closed so
that we ensure the state are cleared correctly until next iteration
is started.

Bug: 134662826
Test: Ram LoginActivityTest#testCommitMultipleTimes 100 times
   and observes no failure on ARC device (nocturne).

Change-Id: I8165715414fb925c480051f17729d9eb1f160495
1 file changed