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
17package com.android.rs.image;
18
19import com.android.rs.image.ImageProcessingTest;
20import android.os.Bundle;
21import android.test.InstrumentationTestRunner;
22import android.test.InstrumentationTestSuite;
23import 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 */
30public class ImageProcessingTestRunner extends InstrumentationTestRunner {
31    public int mIteration = 5;
32
33    @Override
34    public TestSuite getAllTests() {
35        TestSuite suite = new InstrumentationTestSuite(this);
36        suite.addTestSuite(ImageProcessingTest.class);
37        return suite;
38    }
39
40    @Override
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