FileDocCategorySizeDatePackage
SwitchPreview.javaAPI DocAndroid 1.5 API2348Wed May 06 22:42:42 BST 2009com.android.camera.tests.stress

SwitchPreview

public class SwitchPreview extends android.test.ActivityInstrumentationTestCase2
Junit / Instrumentation test case for camera test

Fields Summary
private String
TAG
private static final int
TOTAL_NUMBER_OF_SWITCHING
private static final long
WAIT_FOR_PREVIEW
Constructors Summary
public SwitchPreview()

    
    
      
        super("com.android.camera", VideoCamera.class);      
    
Methods Summary
protected voidsetUp()

  
        getActivity();
        super.setUp();
    
protected voidtearDown()

   
        getActivity().finish();
        super.tearDown();              
    
public voidtestSwitchMode()

        //Switching the video and the video recorder mode
        Instrumentation inst = getInstrumentation();
        try{
            for (int i=0; i< TOTAL_NUMBER_OF_SWITCHING; i++) {
                Thread.sleep(WAIT_FOR_PREVIEW);
                inst.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
                inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_LEFT);
                inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
                Thread.sleep(WAIT_FOR_PREVIEW);
            }
        } catch (Exception e){
            Log.v(TAG, e.toString());
        }
            assertTrue("testSwitchMode",true);