1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 package com.android.camera.stress; 18 19 20 import android.os.Bundle; 21 import android.test.InstrumentationTestRunner; 22 import android.test.InstrumentationTestSuite; 23 import android.util.Log; 24 import junit.framework.TestSuite; 25 26 public class CameraStressTestRunner extends InstrumentationTestRunner { 27 28 // Default recorder settings 29 public static int mVideoDuration = 20000; // set default to 20 seconds 30 public static int mVideoIterations = 100; // set default to 100 videos 31 public static int mImageIterations = 100; // set default to 100 images 32 33 @Override getAllTests()34 public TestSuite getAllTests() { 35 TestSuite suite = new InstrumentationTestSuite(this); 36 suite.addTestSuite(ImageCapture.class); 37 suite.addTestSuite(VideoCapture.class); 38 return suite; 39 } 40 41 @Override getLoader()42 public ClassLoader getLoader() { 43 return CameraStressTestRunner.class.getClassLoader(); 44 } 45 46 @Override onCreate(Bundle icicle)47 public void onCreate(Bundle icicle) { 48 super.onCreate(icicle); 49 String video_iterations = (String) icicle.get("video_iterations"); 50 String image_iterations = (String) icicle.get("image_iterations"); 51 String video_duration = (String) icicle.get("video_duration"); 52 53 if ( video_iterations != null ) { 54 mVideoIterations = Integer.parseInt(video_iterations); 55 } 56 if ( image_iterations != null) { 57 mImageIterations = Integer.parseInt(image_iterations); 58 } 59 if ( video_duration != null) { 60 mVideoDuration = Integer.parseInt(video_duration); 61 } 62 } 63 } 64