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 import android.os.Bundle;
20 import android.test.InstrumentationTestRunner;
21 import android.test.InstrumentationTestSuite;
22 import junit.framework.TestSuite;
23 
24 public class CameraStressTestRunner extends InstrumentationTestRunner {
25 
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
30 
31     @Override
getAllTests()32     public TestSuite getAllTests() {
33         TestSuite suite = new InstrumentationTestSuite(this);
34         suite.addTestSuite(ImageCapture.class);
35         suite.addTestSuite(VideoCapture.class);
36         return suite;
37     }
38 
39     @Override
getLoader()40     public ClassLoader getLoader() {
41         return CameraStressTestRunner.class.getClassLoader();
42     }
43 
44     @Override
onCreate(Bundle icicle)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");
50 
51         if ( video_iterations != null ) {
52             mVideoIterations = Integer.parseInt(video_iterations);
53         }
54         if ( image_iterations != null) {
55             mImageIterations = Integer.parseInt(image_iterations);
56         }
57         if ( video_duration != null) {
58             mVideoDuration = Integer.parseInt(video_duration);
59         }
60     }
61 }
62