125df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller// Copyright 2015 The Chromium Authors. All rights reserved.
225df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller// Use of this source code is governed by a BSD-style license that can be
325df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller// found in the LICENSE file.
425df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
525df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerpackage org.chromium.webview_shell;
625df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
725df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerimport android.app.Activity;
825df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerimport android.os.Bundle;
925df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerimport android.os.SystemClock;
1025df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerimport android.webkit.WebView;
1125df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
1225df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller/**
1325df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller * This activity is designed for startup time testing of the WebView.
1425df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller */
1525df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Millerpublic class StartupTimeActivity extends Activity {
1625df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
1725df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller    @Override
1825df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller    public void onCreate(Bundle savedInstanceState) {
1925df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        super.onCreate(savedInstanceState);
2025df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        getWindow().setTitle(
2125df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller                getResources().getString(R.string.title_activity_startup_time));
2225df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
2325df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        long t1 = SystemClock.elapsedRealtime();
2425df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        WebView webView = new WebView(this);
2525df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        setContentView(webView);
2625df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        long t2 = SystemClock.elapsedRealtime();
2725df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller        android.util.Log.i("WebViewShell", "WebViewStartupTimeMillis=" + (t2 - t1));
2825df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller    }
2925df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
3025df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller}
3125df6673f1c51e755dd4d08cf64666cdff5e0f18Paul Miller
32