diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-01 20:15:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-01 20:15:01 -0700 |
commit | 565664f274abbe19b3a04962711d33868541a3da (patch) | |
tree | 385096c95862c04574d5890f883f94cec652ee5f /tests | |
parent | 7be9981dfa9a94276e373074c3191974e3c6778c (diff) | |
parent | 3ec4b6040078fc26b09defd55e3f5f9ac84aba28 (diff) | |
download | LegacyCamera-565664f274abbe19b3a04962711d33868541a3da.zip LegacyCamera-565664f274abbe19b3a04962711d33868541a3da.tar.gz LegacyCamera-565664f274abbe19b3a04962711d33868541a3da.tar.bz2 |
Merge change 1531 into donut
* changes:
new file: ../../../../tests/src/com/android/camera/stress/CameraLatency.java
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/src/com/android/camera/stress/CameraLatency.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/src/com/android/camera/stress/CameraLatency.java b/tests/src/com/android/camera/stress/CameraLatency.java new file mode 100755 index 0000000..4baaeb3 --- /dev/null +++ b/tests/src/com/android/camera/stress/CameraLatency.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera.stress; + +import com.android.camera.Camera; + +import android.app.Instrumentation; +import android.test.ActivityInstrumentationTestCase2; +import android.test.suitebuilder.annotation.LargeTest; +import android.util.Log; +import android.view.KeyEvent; + +/** + * Junit / Instrumentation test case for camera test + * + */ + +public class CameraLatency extends ActivityInstrumentationTestCase2 <Camera> { + private String TAG = "CameraLatency"; + private static final int TOTAL_NUMBER_OF_IMAGECAPTURE = 5; + private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 3000; + + public CameraLatency() { + super("com.android.camera", Camera.class); + } + + @Override + protected void setUp() throws Exception { + getActivity(); + 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); + } +} + |