2 * Copyright (C) 2008 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.dumprendertree;
19 import android.os.Bundle;
20 import android.test.InstrumentationTestRunner;
21 import android.test.InstrumentationTestSuite;
23 import junit.framework.TestSuite;
27 * Instrumentation Test Runner for all DumpRenderTree tests.
31 * adb shell am instrument \
32 * -w com.android.dumprendertree.LayoutTestsAutoRunner
35 public class LayoutTestsAutoRunner extends InstrumentationTestRunner {
37 public TestSuite getAllTests() {
38 TestSuite suite = new InstrumentationTestSuite(this);
39 suite.addTestSuite(LayoutTestsAutoTest.class);
40 suite.addTestSuite(LoadTestsAutoTest.class);
45 public ClassLoader getLoader() {
46 return LayoutTestsAutoRunner.class.getClassLoader();
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) {
55 this.mTimeoutInMillis = Integer.parseInt(timeout_str);
56 } catch (Exception e) {
61 String delay_str = (String) icicle.get("delay");
62 if(delay_str != null) {
64 this.mDelay = Integer.parseInt(delay_str);
65 } catch (Exception e) {
69 String r = (String)icicle.get("rebaseline");
70 this.mRebaseline = (r != null && r.toLowerCase().equals("true"));
72 String logtime = (String) icicle.get("logtime");
73 this.mLogtime = (logtime != null
74 && logtime.toLowerCase().equals("true"));
76 String drawTime = (String) icicle.get("drawtime");
77 this.mGetDrawTime = (drawTime != null
78 && drawTime.toLowerCase().equals("true"));
80 mSaveImagePath = (String) icicle.get("saveimage");
82 mJsEngine = (String) icicle.get("jsengine");
84 super.onCreate(icicle);
87 public String mTestPath;
88 public String mSaveImagePath;
89 public int mTimeoutInMillis;
91 public boolean mRebaseline;
92 public boolean mLogtime;
93 public boolean mGetDrawTime;
94 public String mJsEngine;