OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.view.View; | 10 import android.view.View; |
11 import android.view.ViewGroup.LayoutParams; | 11 import android.view.ViewGroup.LayoutParams; |
12 import android.widget.LinearLayout; | 12 import android.widget.LinearLayout; |
13 | 13 |
| 14 import org.chromium.android_webview.AwBrowserProcess; |
| 15 import org.chromium.android_webview.shell.AwShellResourceProvider; |
| 16 |
14 /** | 17 /** |
15 * This is a lightweight activity for tests that only require WebView functional
ity. | 18 * This is a lightweight activity for tests that only require WebView functional
ity. |
16 */ | 19 */ |
17 public class AwTestRunnerActivity extends Activity { | 20 public class AwTestRunnerActivity extends Activity { |
18 | 21 |
19 private LinearLayout mLinearLayout; | 22 private LinearLayout mLinearLayout; |
20 private Intent mLastSentIntent; | 23 private Intent mLastSentIntent; |
21 private boolean mIgnoreStartActivity; | 24 private boolean mIgnoreStartActivity; |
22 | 25 |
23 @Override | 26 @Override |
24 public void onCreate(Bundle savedInstanceState) { | 27 public void onCreate(Bundle savedInstanceState) { |
25 super.onCreate(savedInstanceState); | 28 super.onCreate(savedInstanceState); |
26 | 29 |
| 30 AwShellResourceProvider.registerResources(this); |
| 31 AwBrowserProcess.loadLibrary(this); |
| 32 |
27 mLinearLayout = new LinearLayout(this); | 33 mLinearLayout = new LinearLayout(this); |
28 mLinearLayout.setOrientation(LinearLayout.VERTICAL); | 34 mLinearLayout.setOrientation(LinearLayout.VERTICAL); |
29 mLinearLayout.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); | 35 mLinearLayout.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); |
30 mLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT
, | 36 mLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT
, |
31 LayoutParams.MATCH_PARENT)); | 37 LayoutParams.MATCH_PARENT)); |
32 | 38 |
33 setContentView(mLinearLayout); | 39 setContentView(mLinearLayout); |
34 } | 40 } |
35 | 41 |
36 public int getRootLayoutWidth() { | 42 public int getRootLayoutWidth() { |
(...skipping 23 matching lines...) Expand all Loading... |
60 } | 66 } |
61 | 67 |
62 public Intent getLastSentIntent() { | 68 public Intent getLastSentIntent() { |
63 return mLastSentIntent; | 69 return mLastSentIntent; |
64 } | 70 } |
65 | 71 |
66 public void setIgnoreStartActivity(boolean ignore) { | 72 public void setIgnoreStartActivity(boolean ignore) { |
67 mIgnoreStartActivity = ignore; | 73 mIgnoreStartActivity = ignore; |
68 } | 74 } |
69 } | 75 } |
OLD | NEW |