OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.content_browsertests_apk; |
| 6 |
| 7 import android.app.Activity; |
| 8 import android.content.Context; |
| 9 import android.os.Bundle; |
| 10 import android.util.Log; |
| 11 |
| 12 import org.chromium.content.app.LibraryLoader; |
| 13 import org.chromium.content.common.ProcessInitException; |
| 14 import org.chromium.ui.gfx.ActivityNativeWindow; |
| 15 import org.chromium.content_shell.ShellManager; |
| 16 |
| 17 public class ContentBrowserTestsActivity extends Activity { |
| 18 private static final String TAG = "ChromeBrowserTestsActivity"; |
| 19 |
| 20 private ShellManager mShellManager; |
| 21 private ActivityNativeWindow mActivityNativeWindow; |
| 22 |
| 23 @Override |
| 24 public void onCreate(Bundle savedInstanceState) { |
| 25 super.onCreate(savedInstanceState); |
| 26 |
| 27 try { |
| 28 LibraryLoader.ensureInitialized(); |
| 29 } catch (ProcessInitException e) { |
| 30 Log.i(TAG, "Cannot load content_browsertests:" + e); |
| 31 } |
| 32 |
| 33 setContentView(R.layout.test_activity); |
| 34 mShellManager = (ShellManager) findViewById(R.id.shell_container); |
| 35 mActivityNativeWindow = new ActivityNativeWindow(this); |
| 36 mShellManager.setWindow(mActivityNativeWindow); |
| 37 |
| 38 runTests(); |
| 39 } |
| 40 |
| 41 private void runTests() { |
| 42 nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext())
; |
| 43 } |
| 44 |
| 45 private native void nativeRunTests(String filesDir, Context appContext); |
| 46 } |
OLD | NEW |