194b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng/*
294b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * Copyright (C) 2007 The Android Open Source Project
394b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng *
494b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * Licensed under the Apache License, Version 2.0 (the "License");
594b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * you may not use this file except in compliance with the License.
694b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * You may obtain a copy of the License at
794b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng *
894b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng *      http://www.apache.org/licenses/LICENSE-2.0
994b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng *
1094b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * Unless required by applicable law or agreed to in writing, software
1194b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * distributed under the License is distributed on an "AS IS" BASIS,
1294b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * See the License for the specific language governing permissions and
1494b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * limitations under the License.
1594b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng */
1694b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
1794b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengpackage com.android.dialer;
1894b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
1994b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengimport android.app.Activity;
2094b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengimport android.content.ComponentName;
2194b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengimport android.content.Intent;
2294b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengimport android.os.Bundle;
2316b68491261362737752e6babc95f89e2b468f49Jay Shrauner
2416b68491261362737752e6babc95f89e2b468f49Jay Shraunerimport com.android.contacts.common.test.LaunchPerformanceBase;
2594b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
2694b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng/**
2794b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng * Instrumentation class for Address Book launch performance testing.
2894b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng */
2994b10b530c0fc297e2974e57e094c500d3ee6003Chiao Chengpublic class DialerLaunchPerformance extends LaunchPerformanceBase {
3094b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
3194b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    @Override
3294b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    public void onCreate(Bundle arguments) {
3394b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        mIntent.setAction(Intent.ACTION_MAIN);
3494b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        mIntent.addCategory(Intent.CATEGORY_LAUNCHER);
3594b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        mIntent.setComponent(new ComponentName("com.android.contacts",
3694b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng                "testcom.android.dialer.DialtactsActivity"));
3794b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
3894b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        start();
3994b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    }
4094b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng
4194b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    /**
4294b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng     * Calls LaunchApp and finish.
4394b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng     */
4494b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    @Override
4594b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    public void onStart() {
4694b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        super.onStart();
4794b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        LaunchApp();
4894b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng        finish(Activity.RESULT_OK, mResults);
4994b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng    }
5094b10b530c0fc297e2974e57e094c500d3ee6003Chiao Cheng}
51