use of android.test.UiThreadTest in project platform_frameworks_base by android.
the class ViewGroupChildrenTest method testAddChildren.
@UiThreadTest
@MediumTest
public void testAddChildren() 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);
ViewAsserts.assertGroupContains(mGroup, view);
}
assertEquals(24, mGroup.getChildCount());
}
use of android.test.UiThreadTest in project platform_frameworks_base by android.
the class ViewGroupChildrenTest method testAddChildInMiddle.
@UiThreadTest
@MediumTest
public void testAddChildInMiddle() 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, 12);
assertEquals(25, mGroup.getChildCount());
ViewAsserts.assertGroupIntegrity(mGroup);
ViewAsserts.assertGroupContains(mGroup, view);
assertSame(view, mGroup.getChildAt(12));
}
use of android.test.UiThreadTest in project platform_frameworks_base by android.
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 platform_frameworks_base by android.
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 platform_frameworks_base by android.
the class WindowDecorActionBarTest method testStartActionModeFinishesPreviousMode.
@UiThreadTest
public void testStartActionModeFinishesPreviousMode() {
ActionMode mode1 = mWindowDecorActionBar.startActionMode(mCallback);
ActionMode mode2 = mWindowDecorActionBar.startActionMode(new MockActionModeCallback());
assertNotNull(mode1);
assertNotNull(mode2);
assertTrue(mCallback.mIsDestroyActionModeCalled);
}
Aggregations