use of android.test.UiThreadTest in project android_frameworks_base by AOSPA.
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 androidquery by androidquery.
the class AQueryImageTest method testImageBitmap.
@UiThreadTest
public void testImageBitmap() {
Bitmap bm = BitmapFactory.decodeResource(getActivity().getResources(), R.drawable.icon);
assertNotNull(bm);
aq.id(R.id.image).image(bm);
assertLoaded(aq.getImageView(), true);
}
use of android.test.UiThreadTest in project androidquery by androidquery.
the class AQueryImageTest method testImageDrawable.
@UiThreadTest
public void testImageDrawable() {
Drawable d = getActivity().getResources().getDrawable(R.drawable.icon);
assertNotNull(d);
aq.id(R.id.image).image(d);
assertLoaded(aq.getImageView(), true);
}
use of android.test.UiThreadTest in project nucleus by konmik.
the class FragmentStackTest method testReplace.
@UiThreadTest
public void testReplace() throws Exception {
FragmentManager manager = activity.getSupportFragmentManager();
FragmentStack stack = new FragmentStack(activity, manager, CONTAINER_ID);
TestFragment1 fragment = new TestFragment1();
stack.replace(fragment);
assertTopFragment(manager, stack, fragment, 0);
TestFragment2 fragment2 = new TestFragment2();
stack.replace(fragment2);
assertTopFragment(manager, stack, fragment2, 0);
}
use of android.test.UiThreadTest in project nucleus by konmik.
the class FragmentStackTest method testPushPop.
@UiThreadTest
public void testPushPop() throws Exception {
FragmentManager manager = activity.getSupportFragmentManager();
FragmentStack stack = new FragmentStack(activity, manager, CONTAINER_ID);
TestFragment1 fragment = new TestFragment1();
stack.push(fragment);
assertTopFragment(manager, stack, fragment, 0);
TestFragment2 fragment2 = new TestFragment2();
stack.push(fragment2);
assertFragment(manager, fragment, 0);
assertTopFragment(manager, stack, fragment2, 1);
assertFalse(fragment.isAdded());
assertTrue(fragment2.isAdded());
assertTrue(stack.pop());
assertTopFragment(manager, stack, fragment, 0);
assertNull(manager.findFragmentByTag("1"));
assertFalse(stack.pop());
assertTopFragment(manager, stack, fragment, 0);
}
Aggregations