| Index: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
| index cf59ae5b62b1bc54d16b279f894d88d1b4cac59e..2e9f5601f912551344f55704c2c6f35740648076 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
| @@ -189,21 +189,27 @@ public class AwTestBase
|
| });
|
| }
|
|
|
| + // Tests should override this method if they wish to inject mock/test classes into the
|
| + // AwContents.
|
| + protected AwContents.DependencyFactory getAwContentsDependencyFactory() {
|
| + return new AwContents.DependencyFactory();
|
| + }
|
| +
|
| protected AwTestContainerView createAwTestContainerView(
|
| final AwContentsClient awContentsClient) {
|
| - return createAwTestContainerView(new AwTestContainerView(getActivity()),
|
| - awContentsClient);
|
| + AwTestContainerView testContainerView = createDetachedAwTestContainerView(awContentsClient);
|
| + getActivity().addView(testContainerView);
|
| + testContainerView.requestFocus();
|
| + return testContainerView;
|
| }
|
|
|
| - protected AwTestContainerView createAwTestContainerView(
|
| - final AwTestContainerView testContainerView,
|
| + protected AwTestContainerView createDetachedAwTestContainerView(
|
| final AwContentsClient awContentsClient) {
|
| + final AwTestContainerView testContainerView = new AwTestContainerView(getActivity());
|
| testContainerView.initialize(new AwContents(
|
| new AwBrowserContext(new InMemorySharedPreferences()),
|
| testContainerView, testContainerView.getInternalAccessDelegate(),
|
| - awContentsClient, false));
|
| - getActivity().addView(testContainerView);
|
| - testContainerView.requestFocus();
|
| + awContentsClient, false, getAwContentsDependencyFactory()));
|
| return testContainerView;
|
| }
|
|
|
|
|