1 /*
2  * Copyright (C) 2011 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.rs.image;
18 
19 import com.android.rs.image.ImageProcessingTest;
20 import android.os.Bundle;
21 import android.test.InstrumentationTestRunner;
22 import android.test.InstrumentationTestSuite;
23 import junit.framework.TestSuite;
24 
25 /**
26  * Run the ImageProcessing benchmark test
27  * adb shell am instrument -e iteration <n> -w com.android.rs.image/.ImageProcessingTestRunner
28  *
29  */
30 public class ImageProcessingTestRunner extends InstrumentationTestRunner {
31     public int mIteration = 5;
32 
33     @Override
getAllTests()34     public TestSuite getAllTests() {
35         TestSuite suite = new InstrumentationTestSuite(this);
36         suite.addTestSuite(ImageProcessingTest.class);
37         return suite;
38     }
39 
40     @Override
onCreate(Bundle icicle)41     public void onCreate(Bundle icicle) {
42         super.onCreate(icicle);
43         String strIteration = (String) icicle.get("iteration");
44         if (strIteration != null) {
45             mIteration = Integer.parseInt(strIteration);
46         }
47     }
48 }
49