public Activity waitForNextActivity(String methodExt, long timeOut) throws InterruptedException {
   Activity nextActivity = mInstrumentation.waitForMonitorWithTimeout(activityMonitor, timeOut);
   MyLog.v(methodExt, "After waitForMonitor: " + nextActivity);
   assertNotNull("Next activity is opened and captured", nextActivity);
   TestSuite.waitForListLoaded(mInstrumentation, nextActivity, 2);
   activityMonitor = null;
   return nextActivity;
 }
Beispiel #2
0
  public void testItemClick() throws Exception {
    ds.writeNote("Note 1", "test");
    start();
    Instrumentation.ActivityMonitor monitor =
        instrumentation.addMonitor(Editor.class.getName(), null, false);

    notes.runOnUiThread(
        new Runnable() {
          @Override
          public void run() {
            listView.performItemClick(listView, 0, 0);
          }
        });

    instrumentation.waitForIdleSync();
    Activity editor = instrumentation.waitForMonitorWithTimeout(monitor, 3 * 1000);
    notes.finishActivity(1);
    assertNotNull("Editor not started in 3 sec.", editor);
  }