OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_shell_apk; | 5 package org.chromium.content_shell_apk; |
6 | 6 |
7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
8 | 8 |
9 import android.app.Instrumentation; | 9 import android.app.Instrumentation; |
10 import android.content.Intent; | 10 import android.content.Intent; |
11 import android.support.test.InstrumentationRegistry; | 11 import android.support.test.InstrumentationRegistry; |
12 import android.support.test.rule.ActivityTestRule; | 12 import android.support.test.rule.ActivityTestRule; |
13 | 13 |
14 import org.junit.Assert; | 14 import org.junit.Assert; |
15 | 15 |
16 import org.chromium.base.test.util.CallbackHelper; | 16 import org.chromium.base.test.util.CallbackHelper; |
17 import org.chromium.content.browser.ContentView; | 17 import org.chromium.content.browser.ContentView; |
18 import org.chromium.content.browser.ContentViewCore; | 18 import org.chromium.content.browser.ContentViewCore; |
19 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 19 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
20 import org.chromium.content_public.browser.LoadUrlParams; | 20 import org.chromium.content_public.browser.LoadUrlParams; |
21 import org.chromium.content_public.browser.NavigationController; | 21 import org.chromium.content_public.browser.NavigationController; |
22 import org.chromium.content_public.browser.WebContents; | 22 import org.chromium.content_public.browser.WebContents; |
23 import org.chromium.content_shell.Shell; | 23 import org.chromium.content_shell.Shell; |
| 24 import org.chromium.content_shell.ShellViewAndroidDelegate.OnCursorUpdateHelper; |
24 import org.chromium.content_shell_apk.ContentShellTestCommon.TestCommonCallback; | 25 import org.chromium.content_shell_apk.ContentShellTestCommon.TestCommonCallback; |
25 | 26 |
26 import java.lang.annotation.ElementType; | 27 import java.lang.annotation.ElementType; |
27 import java.lang.annotation.Retention; | 28 import java.lang.annotation.Retention; |
28 import java.lang.annotation.RetentionPolicy; | 29 import java.lang.annotation.RetentionPolicy; |
29 import java.lang.annotation.Target; | 30 import java.lang.annotation.Target; |
30 import java.util.concurrent.ExecutionException; | 31 import java.util.concurrent.ExecutionException; |
31 | 32 |
32 /** | 33 /** |
33 * ActivityTestRule for ContentShellActivity. | 34 * ActivityTestRule for ContentShellActivity. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * Starts the content shell activity with the provided test url. | 70 * Starts the content shell activity with the provided test url. |
70 * The url is synchronously loaded. | 71 * The url is synchronously loaded. |
71 * @param url Test url to load. | 72 * @param url Test url to load. |
72 */ | 73 */ |
73 public ContentShellActivity launchContentShellWithUrlSync(String url) { | 74 public ContentShellActivity launchContentShellWithUrlSync(String url) { |
74 Assert.assertFalse(mLaunchActivity); | 75 Assert.assertFalse(mLaunchActivity); |
75 return mDelegate.launchContentShellWithUrlSync(url); | 76 return mDelegate.launchContentShellWithUrlSync(url); |
76 } | 77 } |
77 | 78 |
78 /** | 79 /** |
| 80 * Returns the OnCursorUpdateHelper. |
| 81 */ |
| 82 public OnCursorUpdateHelper getOnCursorUpdateHelper() throws ExecutionExcept
ion { |
| 83 return mDelegate.getOnCursorUpdateHelper(); |
| 84 } |
| 85 |
| 86 /** |
79 * Returns the current ContentViewCore or null if there is no ContentView. | 87 * Returns the current ContentViewCore or null if there is no ContentView. |
80 */ | 88 */ |
81 public ContentViewCore getContentViewCore() { | 89 public ContentViewCore getContentViewCore() { |
82 return mDelegate.getContentViewCore(); | 90 return mDelegate.getContentViewCore(); |
83 } | 91 } |
84 | 92 |
85 /** | 93 /** |
86 * Returns the WebContents of this Shell. | 94 * Returns the WebContents of this Shell. |
87 */ | 95 */ |
88 public WebContents getWebContents() { | 96 public WebContents getWebContents() { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 @Override | 203 @Override |
196 public void waitForActiveShellToBeDoneLoadingForTestCommon() { | 204 public void waitForActiveShellToBeDoneLoadingForTestCommon() { |
197 waitForActiveShellToBeDoneLoading(); | 205 waitForActiveShellToBeDoneLoading(); |
198 } | 206 } |
199 | 207 |
200 @Override | 208 @Override |
201 public ContentShellActivity launchContentShellWithUrlForTestCommon(String ur
l) { | 209 public ContentShellActivity launchContentShellWithUrlForTestCommon(String ur
l) { |
202 return launchContentShellWithUrl(url); | 210 return launchContentShellWithUrl(url); |
203 } | 211 } |
204 } | 212 } |
OLD | NEW |