FileDocCategorySizeDatePackage
GoneParentFocusedChildTest.javaAPI DocAndroid 1.5 API2032Wed May 06 22:42:02 BST 2009com.android.frameworktest.focus

GoneParentFocusedChildTest

public class GoneParentFocusedChildTest extends android.test.ActivityInstrumentationTestCase
When a parent is GONE, key events shouldn't go to its children, even if they have focus. (part of investigation into issue 945150).

Fields Summary
Constructors Summary
public GoneParentFocusedChildTest()

        super("com.android.frameworktest", GoneParentFocusedChild.class);
    
Methods Summary
public voidtestKeyEventGoesToActivity()

        sendKeys(KeyEvent.KEYCODE_J);
        assertTrue(getActivity().isUnhandledKeyEvent());
    
public voidtestPreconditinos()

        assertNotNull(getActivity().getLayout());
        assertNotNull(getActivity().getGoneGroup());
        assertNotNull(getActivity().getButton());
        assertTrue("button should have focus",
                getActivity().getButton().hasFocus());
        assertEquals("gone group should be, well, gone!",
                View.GONE,
                getActivity().getGoneGroup().getVisibility());
        assertFalse("the activity should have received no key events",
                getActivity().isUnhandledKeyEvent());