• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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         return suite;
38     }
39 
40     @Override
getLoader()41     public ClassLoader getLoader() {
42         return CameraStressTestRunner.class.getClassLoader();
43     }
44 
45     @Override
onCreate(Bundle icicle)46     public void onCreate(Bundle icicle) {
47         super.onCreate(icicle);
48         String video_iterations = (String) icicle.get("video_iterations");
49         String image_iterations = (String) icicle.get("image_iterations");
50         String video_duration = (String) icicle.get("video_duration");
51 
52         if ( video_iterations != null ) {
53             mVideoIterations = Integer.parseInt(video_iterations);
54         }
55         if ( image_iterations != null) {
56             mImageIterations = Integer.parseInt(image_iterations);
57         }
58         if ( video_duration != null) {
59             mVideoDuration = Integer.parseInt(video_duration);
60         }
61     }
62 }
63