Search in sources :

Example 61 with UiThreadTest

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());
}
Also used : TextView(android.widget.TextView) View(android.view.View) UiThreadTest(android.test.UiThreadTest) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 62 with UiThreadTest

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);
}
Also used : Bitmap(android.graphics.Bitmap) UiThreadTest(android.test.UiThreadTest)

Example 63 with UiThreadTest

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);
}
Also used : Drawable(android.graphics.drawable.Drawable) UiThreadTest(android.test.UiThreadTest)

Example 64 with UiThreadTest

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);
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) UiThreadTest(android.test.UiThreadTest)

Example 65 with UiThreadTest

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);
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) 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