use of android.test.UiThreadTest in project android_frameworks_base by DirtyUnicorns.
the class ViewStubTest method testInflated.
@UiThreadTest
@MediumTest
public void testInflated() throws Exception {
final StubbedView activity = getActivity();
final ViewStub stub = (ViewStub) activity.findViewById(R.id.viewStub);
final View swapped = stub.inflate();
assertNotNull("The inflated view is null", swapped);
}
use of android.test.UiThreadTest in project android_frameworks_base by DirtyUnicorns.
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 android_frameworks_base by DirtyUnicorns.
the class WindowDecorActionBarTest method testStartActionModeWhenCreateReturnsFalse.
@UiThreadTest
public void testStartActionModeWhenCreateReturnsFalse() {
mCallback.mShouldCreateActionMode = false;
ActionMode mode = mWindowDecorActionBar.startActionMode(mCallback);
assertNull(mode);
assertTrue(mCallback.mIsCreateActionModeCalled);
}
use of android.test.UiThreadTest in project android_frameworks_base by DirtyUnicorns.
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 android_frameworks_base by AOSPA.
the class ViewGroupChildrenTest method testAddChildAtFront.
@UiThreadTest
@MediumTest
public void testAddChildAtFront() throws Exception {
// 24 should be greater than ViewGroup.ARRAY_CAPACITY_INCREMENT
for (int i = 0; i < 24; i++) {
View view = createView(String.valueOf(i + 1));
mGroup.addView(view);
}
View view = createView("X");
mGroup.addView(view, 0);
assertEquals(25, mGroup.getChildCount());
ViewAsserts.assertGroupIntegrity(mGroup);
ViewAsserts.assertGroupContains(mGroup, view);
assertSame(view, mGroup.getChildAt(0));
}
Aggregations