FileDocCategorySizeDatePackage
RequestRectangleVisibleWithInternalScrollTest.javaAPI DocAndroid 5.1 API2726Thu Mar 12 22:22:12 GMT 2015android.widget.scroll

RequestRectangleVisibleWithInternalScrollTest

public class RequestRectangleVisibleWithInternalScrollTest extends android.test.ActivityInstrumentationTestCase
This is suppressed because {@link TextView#scrollBy} isn't working.

Fields Summary
private android.widget.TextView
mTextBlob
private android.widget.Button
mScrollToBlob
private android.widget.ScrollView
mScrollView
Constructors Summary
public RequestRectangleVisibleWithInternalScrollTest()

        super("com.android.frameworks.coretests",
                RequestRectangleVisibleWithInternalScroll.class);
    
Methods Summary
protected voidsetUp()

        super.setUp();
        mTextBlob = getActivity().getTextBlob();
        mScrollToBlob = getActivity().getScrollToBlob();

        mScrollView = (ScrollView) getActivity().findViewById(R.id.scrollView);
    
public voidtestMoveToChildWithScrollYBelow()

        assertTrue(mScrollToBlob.hasFocus());

        ViewAsserts.assertOffScreenBelow(mScrollView, mTextBlob);

        // click
        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
        getInstrumentation().waitForIdleSync();  // wait for scrolling to finish

        // should be on screen, positioned at the bottom (with enough room for
        // fading edge)
        ViewAsserts.assertOnScreen(mScrollView, mTextBlob);
        ViewAsserts.assertHasScreenCoordinates(
                mScrollView, mTextBlob,
                0,
                mScrollView.getHeight()
                        - mTextBlob.getHeight()
                        - mScrollView.getVerticalFadingEdgeLength());

    
public voidtestPreconditions()

        assertNotNull(mTextBlob);
        assertNotNull(mScrollToBlob);
        assertEquals(getActivity().getScrollYofBlob(), mTextBlob.getScrollY());