Android系统单元测试方法(5)
发表于:2011-06-30来源:未知作者:领测软件测试网采编点击数:
标签:
super .setUp(); } @Override protected void tearDown() throws Exception{ super .tearDown(); } @LargeTest public void testImageCapture(){ Instrumentationinst=getInstrumentation(); try { for ( int i= 0 ;
super.setUp();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
@LargeTest
public void testImageCapture() {
Instrumentation inst = getInstrumentation();
try {
for (int i = 0; i < TOTAL_NUMBER_OF_IMAGECAPTURE; i++) {
Thread.sleep(WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
Thread.sleep(WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);
}
} catch (Exception e) {
Log.v(TAG, e.toString());
}
assertTrue("testImageCapture", true);
}
@LargeTest
public void testVideoCapture() {
Instrumentation inst = getInstrumentation();
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
try {
for (int i = 0; i < TOTAL_NUMBER_OF_VIDEOCAPTURE; i++) {
原文转自:http://www.ltesting.net