@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();
 }
 @Override
 public void onLoadComplete() {
   completionLatch.countDown();
 }
 @Override
 public void onTokenRetrieved(String token) {
   assertThat(token.equals("+\\"), is(false));
   completionLatch.countDown();
 }