| 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 cb4e8b096da8030cb36537f2486c02501c585455..1352c588e154d1a855993a2c42afdd01f0c51a9b 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
|
| @@ -18,6 +18,7 @@ import org.chromium.android_webview.AwContents;
|
| import org.chromium.android_webview.AwContentsClient;
|
| import org.chromium.android_webview.AwSettings;
|
| import org.chromium.android_webview.AwSwitches;
|
| +import org.chromium.android_webview.test.AwTestBaseUtility.TestDependencyFactory;
|
| import org.chromium.android_webview.test.util.GraphicsTestUtils;
|
| import org.chromium.android_webview.test.util.JSUtils;
|
| import org.chromium.base.ThreadUtils;
|
| @@ -374,24 +375,6 @@ public class AwTestBase
|
| return ((AnnotatedElement) method).isAnnotationPresent(clazz);
|
| }
|
|
|
| - /**
|
| - * Factory class used in creation of test AwContents instances.
|
| - *
|
| - * Test cases can provide subclass instances to the createAwTest* methods in order to create an
|
| - * AwContents instance with injected test dependencies.
|
| - */
|
| - public static class TestDependencyFactory extends AwContents.DependencyFactory {
|
| - public AwTestContainerView createAwTestContainerView(AwTestRunnerActivity activity,
|
| - boolean allowHardwareAcceleration) {
|
| - return new AwTestContainerView(activity, allowHardwareAcceleration);
|
| - }
|
| - public AwSettings createAwSettings(Context context, boolean supportsLegacyQuirks) {
|
| - return new AwSettings(context, false /* isAccessFromFileURLsGrantedByDefault */,
|
| - supportsLegacyQuirks, false /* allowEmptyDocumentPersistence */,
|
| - true /* allowGeolocationOnInsecureOrigins */);
|
| - }
|
| - }
|
| -
|
| protected TestDependencyFactory createTestDependencyFactory() {
|
| return new TestDependencyFactory();
|
| }
|
| @@ -424,17 +407,9 @@ public class AwTestBase
|
| final TestDependencyFactory testDependencyFactory = createTestDependencyFactory();
|
|
|
| boolean allowHardwareAcceleration = isHardwareAcceleratedTest();
|
| - final AwTestContainerView testContainerView =
|
| - testDependencyFactory.createAwTestContainerView(getActivity(),
|
| - allowHardwareAcceleration);
|
| -
|
| - AwSettings awSettings = testDependencyFactory.createAwSettings(getActivity(),
|
| - supportsLegacyQuirks);
|
| - testContainerView.initialize(new AwContents(mBrowserContext, testContainerView,
|
| - testContainerView.getContext(), testContainerView.getInternalAccessDelegate(),
|
| - testContainerView.getNativeDrawGLFunctorFactory(), awContentsClient, awSettings,
|
| - testDependencyFactory));
|
| - return testContainerView;
|
| + return AwTestBaseUtility.createDetachedAwTestContainerView(getActivity(), mBrowserContext,
|
| + testDependencyFactory, awContentsClient, supportsLegacyQuirks,
|
| + allowHardwareAcceleration);
|
| }
|
|
|
| protected boolean isHardwareAcceleratedTest() {
|
|
|