liudonghua123 / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Strange OutOfMemory #174

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

i have the following test

@RunWith(AndroidJUnit4.class) @LargeTest public class JobTests {

MyApp app;

@Rule
public ActivityTestRule<MainActivity> mActivity = new ActivityTestRule<>(MainActivity.class, false, false);

@Before
public void setUp() throws Exception {
    app = (MyApp)
            InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext();
}}

@Test
public void testActivityAndWait2Sec() {
    mActivity.launchActivity(new Intent());
    onView(isRoot()).perform(waitAtLeast(2000));
}

public ViewAction waitAtLeast(final long millis) { return new ViewAction() { @Override public Matcher getConstraints() { return allOf(anything()); }

        @Override
        public String getDescription() {
            return "wait for at least " + millis + " millis.";
        }

        @Override
        public void perform(final UiController uiController, final View view) {
            uiController.loopMainThreadUntilIdle();
            uiController.loopMainThreadForAtLeast(millis);
        }
    };
}

}


Why is this happening?

Original issue reported on code.google.com by bmpa...@gmail.com on 24 Aug 2015 at 1:54

Attachments:

GoogleCodeExporter commented 9 years ago
this is happening if i have compileSdkVersion 23

Original comment by bmpa...@gmail.com on 24 Aug 2015 at 2:49