blob: e058f3221080f2b3ac9e6463c8dbc5e5a09a8cef [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
Guang Zhu3e8950c2009-06-03 12:23:09 -070019import android.os.Bundle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.test.InstrumentationTestRunner;
21import android.test.InstrumentationTestSuite;
Guang Zhu3e8950c2009-06-03 12:23:09 -070022
23import junit.framework.TestSuite;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024
25
26/**
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070027 * Instrumentation Test Runner for all DumpRenderTree tests.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028 *
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);
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070040 suite.addTestSuite(LoadTestsAutoTest.class);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041 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) {
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070051 this.mTestPath = (String) icicle.get("path");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052 String timeout_str = (String) icicle.get("timeout");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053 if (timeout_str != null) {
54 try {
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070055 this.mTimeoutInMillis = Integer.parseInt(timeout_str);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 } catch (Exception e) {
57 e.printStackTrace();
58 }
59 }
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070060
Guang Zhu3e8950c2009-06-03 12:23:09 -070061 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 }
Guang Zhubfa68ab2009-11-05 15:24:10 -080068
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070069 String r = (String)icicle.get("rebaseline");
70 this.mRebaseline = (r != null && r.toLowerCase().equals("true"));
Guang Zhubfa68ab2009-11-05 15:24:10 -080071
Guang Zhu2ab6f1f2009-06-10 13:37:03 -070072 String logtime = (String) icicle.get("logtime");
73 this.mLogtime = (logtime != null
74 && logtime.toLowerCase().equals("true"));
Guang Zhubfa68ab2009-11-05 15:24:10 -080075
Guang Zhu5dc4f212009-10-29 18:24:54 -070076 String drawTime = (String) icicle.get("drawtime");
77 this.mGetDrawTime = (drawTime != null
78 && drawTime.toLowerCase().equals("true"));
79
80 mSaveImagePath = (String) icicle.get("saveimage");
81
Steve Block12077e12010-02-25 12:50:33 +000082 mJsEngine = (String) icicle.get("jsengine");
83
Guang Zhubfa68ab2009-11-05 15:24:10 -080084 super.onCreate(icicle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 }
The Android Open Source Projectba87e3e2009-03-13 13:04:22 -070086
Steve Block12077e12010-02-25 12:50:33 +000087 public String mTestPath;
88 public String mSaveImagePath;
89 public int mTimeoutInMillis;
90 public int mDelay;
91 public boolean mRebaseline;
92 public boolean mLogtime;
93 public boolean mGetDrawTime;
94 public String mJsEngine;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095}