LayoutTestsAutoRunner.java revision 3e8950c0c73f9c1574ce3388c754009edf6bc930
1/* 2 * Copyright (C) 2008 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.dumprendertree; 18 19import android.os.Bundle; 20import android.test.InstrumentationTestRunner; 21import android.test.InstrumentationTestSuite; 22 23import junit.framework.TestSuite; 24 25 26/** 27 * Instrumentation Test Runner for all DumpRenderTree tests. 28 * 29 * Running all tests: 30 * 31 * adb shell am instrument \ 32 * -w com.android.dumprendertree.LayoutTestsAutoRunner 33 */ 34 35public class LayoutTestsAutoRunner extends InstrumentationTestRunner { 36 @Override 37 public TestSuite getAllTests() { 38 TestSuite suite = new InstrumentationTestSuite(this); 39 suite.addTestSuite(LayoutTestsAutoTest.class); 40 suite.addTestSuite(LoadTestsAutoTest.class); 41 return suite; 42 } 43 44 @Override 45 public ClassLoader getLoader() { 46 return LayoutTestsAutoRunner.class.getClassLoader(); 47 } 48 49 @Override 50 public void onCreate(Bundle icicle) { 51 this.mTestPath = (String) icicle.get("path"); 52 String timeout_str = (String) icicle.get("timeout"); 53 if (timeout_str != null) { 54 try { 55 this.mTimeoutInMillis = Integer.parseInt(timeout_str); 56 } catch (Exception e) { 57 e.printStackTrace(); 58 } 59 } 60 61 String delay_str = (String) icicle.get("delay"); 62 if(delay_str != null) { 63 try { 64 this.mDelay = Integer.parseInt(delay_str); 65 } catch (Exception e) { 66 } 67 } 68 69 String r = (String)icicle.get("rebaseline"); 70 this.mRebaseline = (r != null && r.toLowerCase().equals("true")); 71 super.onCreate(icicle); 72 } 73 74 public String mTestPath = null; 75 public int mTimeoutInMillis = 0; 76 public int mDelay = 0; 77 public boolean mRebaseline = false; 78} 79 80