@Test
 public void testLogin() throws Throwable {
   runOnMainSync(
       new Runnable() {
         @Override
         public void run() {
           loginTestTask.execute();
         }
       });
   completionLatch.await();
 }
 private void loadPage(final String title) throws Throwable {
   completionLatch = new TestLatch();
   getInstrumentation()
       .runOnMainSync(
           new Runnable() {
             @Override
             public void run() {
               fragment = (PageFragment) activity.getTopFragment();
               fragment.setPageLoadCallbacks(callback);
               loadPage(fragment, title);
             }
           });
   completionLatch.await();
 }