Remove flakiness / race condition in snackbar tests
Instead of artifical timeouts and race condition in waiting
for snackbar's dismissal in a loop, use Espresso's IdlingResource
to reliably wait until the snackbar has been shown or
dismissed.
Also align the API surface of snackbar's callbacks with DrawerLayout's
listeners, allowing registering more than one callback, and removing
registered callbacks.
Bug: 32022732
Test: ./gradlew support-design:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=android.support.design.widget.CustomSnackbarTest
Test: ./gradlew support-design:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=android.support.design.widget.SnackbarTest
Change-Id: If8f8415b6453d75cb24a022b2d7d676f7649542c
7 files changed