Exemplo n.º 1
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    clearAppData();

    // Mock out the account manager on the device.
    mContext = new SyncTestUtil.SyncTestContext(getInstrumentation().getTargetContext());
    mAccountManager = new MockAccountManager(mContext, getInstrumentation().getContext());
    AccountManagerHelper.overrideAccountManagerHelperForTests(mContext, mAccountManager);
    MockSyncContentResolverDelegate syncContentResolverDelegate =
        new MockSyncContentResolverDelegate();
    syncContentResolverDelegate.setMasterSyncAutomatically(true);
    SyncStatusHelper.overrideSyncStatusHelperForTests(mContext, syncContentResolverDelegate);
    // This call initializes the ChromeSigninController to use our test context.
    ChromeSigninController.get(mContext);
    startChromeBrowserProcessSync(getInstrumentation().getTargetContext());
    ThreadUtils.runOnUiThreadBlocking(
        new Runnable() {
          @Override
          public void run() {
            mSyncController = SyncController.get(mContext);
          }
        });
    SyncTestUtil.verifySyncServerIsRunning();
  }
 @Override
 public void setUp() throws Exception {
   super.setUp();
   mActivity = launchChromeShellWithBlankPage();
   assertTrue(waitForActiveShellToBeDoneLoading());
   ThreadUtils.runOnUiThreadBlocking(
       new Runnable() {
         @Override
         public void run() {
           ChromeShellTab tab = mActivity.getActiveTab();
           mProfile = tab.getProfile();
           mResources = mActivity.getResources();
         }
       });
 }
  @Override
  public void setUp() throws Exception {
    super.setUp();
    ChromeShellActivity activity = launchChromeShellWithBlankPage();
    assertNotNull(activity);
    waitForActiveShellToBeDoneLoading();

    mMockAutofillCallback = new MockAutofillCallback();
    mWindowAndroid = new ActivityWindowAndroid(activity);
    final ViewAndroidDelegate viewDelegate =
        activity.getActiveContentViewCore().getViewAndroidDelegate();

    UiUtils.runOnUiThread(
        getActivity(),
        new Runnable() {
          @Override
          public void run() {
            mAutofillPopup =
                new AutofillPopup(
                    mWindowAndroid.getActivity().get(), viewDelegate, mMockAutofillCallback);
            mAutofillPopup.setAnchorRect(50, 500, 500, 50);
          }
        });
  }