Esempio n. 1
0
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   mTab = getActivity().getActivityTab();
   mTab.addObserver(mTabObserver);
   mOnTitleUpdatedHelper = new CallbackHelper();
 }
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   final Semaphore semaphore = new Semaphore(0);
   ThreadUtils.runOnUiThreadBlocking(
       new Runnable() {
         @Override
         public void run() {
           Profile profile = Profile.getLastUsedProfile();
           mOfflinePageBridge = new OfflinePageBridge(profile);
           if (mOfflinePageBridge.isOfflinePageModelLoaded()) {
             semaphore.release();
           } else {
             mOfflinePageBridge.addObserver(
                 new OfflinePageModelObserver() {
                   @Override
                   public void offlinePageModelLoaded() {
                     semaphore.release();
                     mOfflinePageBridge.removeObserver(this);
                   }
                 });
           }
         }
       });
   assertTrue(semaphore.tryAcquire(TIMEOUT_MS, TimeUnit.MILLISECONDS));
 }
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    // Hook in the test binding manager.
    mBindingManager = new MockBindingManager();
    ChildProcessLauncher.setBindingManagerForTesting(mBindingManager);
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    // Register for animation notifications
    CriteriaHelper.pollForCriteria(
        new Criteria() {
          @Override
          public boolean isSatisfied() {
            if (getActivity().getActivityTab() == null) return false;
            if (getActivity().getActivityTab().getInfoBarContainer() == null) return false;
            return true;
          }
        });
    InfoBarContainer container = getActivity().getActivityTab().getInfoBarContainer();
    mListener = new InfoBarTestAnimationListener();
    container.setAnimationListener(mListener);

    mTestServer =
        EmbeddedTestServer.createAndStartFileServer(
            getInstrumentation().getContext(), Environment.getExternalStorageDirectory());
  }
 @Override
 protected void tearDown() throws Exception {
   mTestServer.stopAndDestroyServer();
   super.tearDown();
 }