Make sure to wait first and then check the expected state rather than check the expected state first and then waiting. Bug 6293413 Change-Id: Ibcb1127b935708c51fafdc8624cb3a7eefc01bda