Added appropriate synchronization methods to MainActivityTest to avoid
non-deterministic test failures.