2 * Copyright (C) 2010 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.camera.stress;
19 import android.os.Bundle;
20 import android.test.InstrumentationTestRunner;
21 import android.test.InstrumentationTestSuite;
22 import junit.framework.TestSuite;
24 public class CameraStressTestRunner extends InstrumentationTestRunner {
26 // Default recorder settings
27 public static int mVideoDuration = 20000; // set default to 20 seconds
28 public static int mVideoIterations = 100; // set default to 100 videos
29 public static int mImageIterations = 100; // set default to 100 images
32 public TestSuite getAllTests() {
33 TestSuite suite = new InstrumentationTestSuite(this);
34 suite.addTestSuite(ImageCapture.class);
35 suite.addTestSuite(VideoCapture.class);
40 public ClassLoader getLoader() {
41 return CameraStressTestRunner.class.getClassLoader();
45 public void onCreate(Bundle icicle) {
46 super.onCreate(icicle);
47 String video_iterations = (String) icicle.get("video_iterations");
48 String image_iterations = (String) icicle.get("image_iterations");
49 String video_duration = (String) icicle.get("video_duration");
51 if ( video_iterations != null ) {
52 mVideoIterations = Integer.parseInt(video_iterations);
54 if ( image_iterations != null) {
55 mImageIterations = Integer.parseInt(image_iterations);
57 if ( video_duration != null) {
58 mVideoDuration = Integer.parseInt(video_duration);