Android系统单元测试方法(8)
发表于:2011-06-30来源:未知作者:领测软件测试网采编点击数:
标签:
super .setUp(); } @Override protected void tearDown() throws Exception{ getActivity().finish(); super .tearDown(); } @LargeTest public void testSwitchMode(){ //Switchingthevideoandthevideorecordermode
super.setUp();
}
@Override
protected void tearDown() throws Exception {
getActivity().finish();
super.tearDown();
}
@LargeTest
public void testSwitchMode() {
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);
}
}