Search in sources :

Example 81 with UiThreadTest

use of android.test.UiThreadTest in project platform_frameworks_base by android.

the class ViewGroupChildrenTest method testAddChild.

@UiThreadTest
@MediumTest
public void testAddChild() throws Exception {
    View view = createView("1");
    mGroup.addView(view);
    assertEquals(1, mGroup.getChildCount());
    ViewAsserts.assertGroupIntegrity(mGroup);
    ViewAsserts.assertGroupContains(mGroup, view);
}
Also used : TextView(android.widget.TextView) View(android.view.View) UiThreadTest(android.test.UiThreadTest) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 82 with UiThreadTest

use of android.test.UiThreadTest in project platform_frameworks_base by android.

the class WindowDecorActionBarTest method testStartActionMode.

@UiThreadTest
public void testStartActionMode() {
    ActionMode mode = mWindowDecorActionBar.startActionMode(mCallback);
    assertNotNull(mode);
    assertTrue(mCallback.mIsCreateActionModeCalled);
}
Also used : ActionMode(android.view.ActionMode) UiThreadTest(android.test.UiThreadTest)

Example 83 with UiThreadTest

use of android.test.UiThreadTest in project platform_frameworks_base by android.

the class PhoneWindowActionModeTest method testCreatedModeIsNotStartedIfCreateReturnsFalse.

@UiThreadTest
public void testCreatedModeIsNotStartedIfCreateReturnsFalse() {
    mWindowCallback.mShouldReturnOwnActionMode = false;
    mActionModeCallback.mShouldCreateActionMode = false;
    ActionMode mode = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
    assertTrue(mActionModeCallback.mIsCreateActionModeCalled);
    assertFalse(mWindowCallback.mIsActionModeStarted);
    assertNull(mode);
}
Also used : ActionMode(android.view.ActionMode) UiThreadTest(android.test.UiThreadTest)

Example 84 with UiThreadTest

use of android.test.UiThreadTest in project platform_frameworks_base by android.

the class PhoneWindowActionModeTest method testCreatedFloatingModeLifecycleIsHandled.

@UiThreadTest
public void testCreatedFloatingModeLifecycleIsHandled() {
    mWindowCallback.mShouldReturnOwnActionMode = false;
    ActionMode mode = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
    assertNotNull(mode);
    assertEquals(ActionMode.TYPE_FLOATING, mode.getType());
    assertTrue(mActionModeCallback.mIsCreateActionModeCalled);
    assertTrue(mWindowCallback.mIsActionModeStarted);
}
Also used : ActionMode(android.view.ActionMode) UiThreadTest(android.test.UiThreadTest)

Example 85 with UiThreadTest

use of android.test.UiThreadTest in project double-espresso by JakeWharton.

the class ViewFinderImplTest method testGetView_present.

@UiThreadTest
public void testGetView_present() {
    ViewFinder finder = new ViewFinderImpl(sameInstance(nestedChild), testViewProvider);
    assertThat(finder.getView(), sameInstance(nestedChild));
}
Also used : ViewFinder(com.google.android.apps.common.testing.ui.espresso.ViewFinder) UiThreadTest(android.test.UiThreadTest)

Aggregations

UiThreadTest (android.test.UiThreadTest)127 View (android.view.View)69 MediumTest (android.test.suitebuilder.annotation.MediumTest)48 TextView (android.widget.TextView)32 ActionMode (android.view.ActionMode)30 StubbedView (android.view.StubbedView)18 ViewStub (android.view.ViewStub)18 GitHubEvent (com.meisolsson.githubsdk.model.GitHubEvent)15 Button (android.widget.Button)14 InOrder (com.google.testing.littlemock.LittleMock.InOrder)10 FragmentManager (android.support.v4.app.FragmentManager)5 ViewGroup (android.view.ViewGroup)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 WindowManager (android.view.WindowManager)4 ViewFinder (com.google.android.apps.common.testing.ui.espresso.ViewFinder)3 Issue (com.meisolsson.githubsdk.model.Issue)2 User (com.meisolsson.githubsdk.model.User)2 CreatePayload (com.meisolsson.githubsdk.model.payload.CreatePayload)2 Computer (com.octo.android.sample.model.Computer)2 DummyComputer (com.octo.android.sample.model.DummyComputer)2