Search in sources :

Example 41 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ShortButtonsTest method testScrollFromBottomToTopThroughButtons.

@LargeTest
public void testScrollFromBottomToTopThroughButtons() throws Exception {
    final int numButtons = getActivity().getNumButtons();
    final Button lastButton = getActivity().getButtonAt(numButtons - 1);
    lastButton.post(new Runnable() {

        public void run() {
            lastButton.requestFocus();
        }
    });
    getInstrumentation().waitForIdleSync();
    assertTrue("lastButton.isFocused()", lastButton.isFocused());
    for (int i = numButtons - 1; i >= 0; i--) {
        String prefix = "after " + i + " ups expected button " + i;
        final Button button = getActivity().getButtonAt(i);
        assertTrue(prefix + "  to have focus", button.isFocused());
        assertTrue(prefix + " to be on screen", isButtonOnScreen(button));
        sendKeys(KeyEvent.KEYCODE_DPAD_UP);
    }
    assertEquals("should be fully scrolled to top", 0, mScrollView.getScrollY());
}
Also used : Button(android.widget.Button) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 42 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ShortButtonsTest method testScrollDownToBottomThroughButtons.

@LargeTest
public void testScrollDownToBottomThroughButtons() throws Exception {
    final int numButtons = getActivity().getNumButtons();
    for (int i = 0; i < numButtons; i++) {
        String prefix = "after " + i + " downs expected button " + i;
        final Button button = getActivity().getButtonAt(i);
        assertTrue(prefix + "  to have focus", button.isFocused());
        assertTrue(prefix + " to be on screen", isButtonOnScreen(button));
        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
    }
    assertEquals("should be fully scrolled to bottom", getActivity().getLinearLayout().getHeight() - mScrollView.getHeight(), mScrollView.getScrollY());
}
Also used : Button(android.widget.Button) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 43 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ChangeTouchModeTest method testTouchModeChangedInOtherActivity.

@LargeTest
public void testTouchModeChangedInOtherActivity() throws Exception {
    assertFalse("touch mode", getActivity().isInTouchMode());
    LLOfButtons2 otherActivity = null;
    try {
        otherActivity = launchActivity("com.android.frameworks.coretests", LLOfButtons2.class, null);
        assertNotNull(otherActivity);
        assertFalse(otherActivity.isInTouchMode());
        assertInTouchModeAfterClick(this, otherActivity.getFirstButton());
        assertTrue(otherActivity.isInTouchMode());
    } finally {
        if (otherActivity != null) {
            otherActivity.finish();
        }
    }
    // need to wait for async update back to window to occur
    Thread.sleep(200);
    assertTrue("touch mode", getActivity().isInTouchMode());
}
Also used : LLOfButtons2(android.widget.layout.linear.LLOfButtons2) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 44 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ListGetSelectedViewTest method testGetSelectedView.

@LargeTest
public void testGetSelectedView() {
    View last = mListView.getChildAt(1);
    TouchUtils.clickView(this, last);
    assertNull(mListView.getSelectedItem());
    assertNull(mListView.getSelectedView());
    assertEquals(-1, mListView.getSelectedItemPosition());
}
Also used : View(android.view.View) ListView(android.widget.ListView) ListGetSelectedView(android.widget.listview.ListGetSelectedView) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 45 with LargeTest

use of android.test.suitebuilder.annotation.LargeTest in project android_frameworks_base by ParanoidAndroid.

the class ListSetSelectionTest method testSetSelection.

@LargeTest
public void testSetSelection() {
    TouchUtils.dragQuarterScreenDown(this);
    TouchUtils.dragQuarterScreenUp(this);
    // Nothing should be selected
    assertEquals("Selection still available after touch", -1, mListView.getSelectedItemPosition());
    final int targetPosition = mListView.getAdapter().getCount() / 2;
    mActivity.runOnUiThread(new Runnable() {

        public void run() {
            mListView.setSelection(targetPosition);
        }
    });
    getInstrumentation().waitForIdleSync();
    boolean found = false;
    int childCount = mListView.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = mListView.getChildAt(i);
        if (child.getId() == targetPosition) {
            found = true;
            break;
        }
    }
    assertTrue("Selected item not visible in list", found);
}
Also used : View(android.view.View) ListView(android.widget.ListView) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

LargeTest (android.test.suitebuilder.annotation.LargeTest)1579 AudioEffect (android.media.audiofx.AudioEffect)234 AudioTrack (android.media.AudioTrack)222 View (android.view.View)147 File (java.io.File)144 MediaVideoItem (android.media.videoeditor.MediaVideoItem)115 Uri (android.net.Uri)99 ListView (android.widget.ListView)72 Cursor (android.database.Cursor)69 Bitmap (android.graphics.Bitmap)62 Instrumentation (android.app.Instrumentation)61 MediaPlayer (android.media.MediaPlayer)60 WifiConfiguration (android.net.wifi.WifiConfiguration)53 SurfaceHolder (android.view.SurfaceHolder)50 MediaImageItem (android.media.videoeditor.MediaImageItem)49 IOException (java.io.IOException)48 AudioManager (android.media.AudioManager)42 LegacyVpnInfo (com.android.internal.net.LegacyVpnInfo)42 VpnProfile (com.android.internal.net.VpnProfile)42 Request (android.app.DownloadManager.Request)41