Bug 758792 - Robocop: remove waitForIdleSync calls in getActivityFromClick. r=jmaher

This commit is contained in:
Geoff Brown 2012-06-09 12:24:57 -04:00
parent 40cba13783
commit 504de523f2

View File

@ -118,14 +118,18 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
mAsserter.ok(clicked != false, "checking that awesome bar clicked", "awesome bar was clicked");
return null;
}
// wait for click to take effect before waiting for activity
// (otherwise we sometimes get the previous activity)
getInstrumentation().waitForIdleSync();
// Wait for click to take effect before waiting for activity
// (otherwise we sometimes get the previous activity).
// Previously, waitForIdleSync was used here but it was found
// to hang very occasionally.
mSolo.sleep(2000);
Activity activity = inst.waitForMonitor(monitor);
// give the activity time to render itself and initialize views
// Give the activity time to render itself and initialize views
// before continuing, so that views are created before access
// attempts are made
getInstrumentation().waitForIdleSync();
// attempts are made. Again, waitForIdleSync was used here
// previously, but replaced with a sleep to avoid hangs.
// TODO: Investigate and document why these pauses are required.
mSolo.sleep(2000);
return activity;
}