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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.util.Log; | 7 import android.util.Log; |
8 | 8 |
9 import org.chromium.base.test.util.UrlUtils; | 9 import org.chromium.base.test.util.UrlUtils; |
10 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 10 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
| 11 import org.chromium.content_public.browser.LoadUrlParams; |
11 import org.chromium.content_shell_apk.ContentShellActivity; | 12 import org.chromium.content_shell_apk.ContentShellActivity; |
12 import org.chromium.content_shell_apk.ContentShellTestBase; | 13 import org.chromium.content_shell_apk.ContentShellTestBase; |
13 | 14 |
| 15 /** |
| 16 * Provides test environment for ContentView Test Shell. |
| 17 * This is a helper class for Content Shell tests. |
| 18 */ |
14 public class ContentViewTestBase extends ContentShellTestBase { | 19 public class ContentViewTestBase extends ContentShellTestBase { |
15 | 20 |
16 protected TestCallbackHelperContainer mTestCallbackHelperContainer; | 21 protected TestCallbackHelperContainer mTestCallbackHelperContainer; |
17 | 22 |
18 /** | 23 /** |
19 * Sets up the ContentView and injects the supplied object. Intended to be c
alled from setUp(). | 24 * Sets up the ContentView and injects the supplied object. Intended to be c
alled from setUp(). |
20 */ | 25 */ |
21 protected void setUpContentView(final Object object, final String name) thro
ws Exception { | 26 protected void setUpContentView(final Object object, final String name) thro
ws Exception { |
22 // This starts the activity, so must be called on the test thread. | 27 // This starts the activity, so must be called on the test thread. |
23 final ContentShellActivity activity = launchContentShellWithUrl( | 28 final ContentShellActivity activity = launchContentShellWithUrl( |
(...skipping 24 matching lines...) Expand all Loading... |
48 /** | 53 /** |
49 * Loads data on the UI thread and blocks until onPageFinished is called. | 54 * Loads data on the UI thread and blocks until onPageFinished is called. |
50 * TODO(cramya): Move method to a separate util file once UiUtils.java moves
into base. | 55 * TODO(cramya): Move method to a separate util file once UiUtils.java moves
into base. |
51 */ | 56 */ |
52 protected void loadDataSync(final ContentViewCore contentViewCore, final Str
ing data, | 57 protected void loadDataSync(final ContentViewCore contentViewCore, final Str
ing data, |
53 final String mimeType, final boolean isBase64Encoded) throws Throwab
le { | 58 final String mimeType, final boolean isBase64Encoded) throws Throwab
le { |
54 loadUrl(contentViewCore, mTestCallbackHelperContainer, LoadUrlParams.cre
ateLoadDataParams( | 59 loadUrl(contentViewCore, mTestCallbackHelperContainer, LoadUrlParams.cre
ateLoadDataParams( |
55 data, mimeType, isBase64Encoded)); | 60 data, mimeType, isBase64Encoded)); |
56 } | 61 } |
57 } | 62 } |
OLD | NEW |