| Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
|
| diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
|
| index 701106ec2f7148d81cf2ede3c5f2fd217dca445d..c06fa6c0658d4374a04085dd645dcc05feb92d87 100644
|
| --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
|
| +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
|
| @@ -17,9 +17,12 @@
|
| * This class is used to provide callback hooks for tests and related classes.
|
| */
|
| public class TestCallbackHelperContainer {
|
| + private final TestContentViewClient mTestContentViewClient;
|
| private TestWebContentsObserver mTestWebContentsObserver;
|
|
|
| public TestCallbackHelperContainer(final ContentViewCore contentViewCore) {
|
| + mTestContentViewClient = new TestContentViewClient();
|
| + contentViewCore.setContentViewClient(mTestContentViewClient);
|
| // TODO(yfriedman): Change callers to be executed on the UI thread. Unfortunately this is
|
| // super convenient as the caller is nearly always on the test thread which is fine to block
|
| // and it's cumbersome to keep bouncing to the UI thread.
|
| @@ -32,6 +35,12 @@
|
| });
|
| }
|
|
|
| + protected TestCallbackHelperContainer(
|
| + TestContentViewClient viewClient, TestWebContentsObserver contentsObserver) {
|
| + mTestContentViewClient = viewClient;
|
| + mTestWebContentsObserver = contentsObserver;
|
| + }
|
| +
|
| /**
|
| * CallbackHelper for OnPageCommitVisible.
|
| */
|
| @@ -172,6 +181,21 @@
|
| }
|
| }
|
|
|
| + /**
|
| + * CallbackHelper for OnStartContentIntent.
|
| + */
|
| + public static class OnStartContentIntentHelper extends CallbackHelper {
|
| + private String mIntentUrl;
|
| + public void notifyCalled(String intentUrl) {
|
| + mIntentUrl = intentUrl;
|
| + notifyCalled();
|
| + }
|
| + public String getIntentUrl() {
|
| + assert getCallCount() > 0;
|
| + return mIntentUrl;
|
| + }
|
| + }
|
| +
|
| public OnPageStartedHelper getOnPageStartedHelper() {
|
| return mTestWebContentsObserver.getOnPageStartedHelper();
|
| }
|
| @@ -183,4 +207,8 @@
|
| public OnReceivedErrorHelper getOnReceivedErrorHelper() {
|
| return mTestWebContentsObserver.getOnReceivedErrorHelper();
|
| }
|
| +
|
| + public OnStartContentIntentHelper getOnStartContentIntentHelper() {
|
| + return mTestContentViewClient.getOnStartContentIntentHelper();
|
| + }
|
| }
|
|
|