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);
}
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);
}
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);
}
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);
}
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));
}
Aggregations