FileDocCategorySizeDatePackage
RequestRectangleVisibleWithInternalScrollTest.javaAPI DocAndroid 1.5 API2723Wed May 06 22:42:02 BST 2009com.android.frameworktest.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.frameworktest",
                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());