Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2093)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java

Issue 12567020: [android] Resize the android_webview if it's 0x0 initially. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't re-layout while pinch-zooming Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698