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

Unified Diff: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java

Issue 888793002: Make content_browsertests for Chrome on Android running with valid Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove applying page scale factor Created 5 years, 10 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: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
index bb9a5d62c7361015499159ba821e04711c6b12a3..6c8529c29ed9b6a06aa47c8919f6116808f7f85b 100644
--- a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
+++ b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
@@ -12,8 +12,10 @@ import android.view.View;
import android.widget.FrameLayout;
import org.chromium.base.CalledByNative;
+import org.chromium.base.CommandLine;
import org.chromium.base.JNINamespace;
import org.chromium.base.ThreadUtils;
+import org.chromium.base.VisibleForTesting;
import org.chromium.content.browser.ActivityContentVideoViewClient;
import org.chromium.content.browser.ContentVideoViewClient;
import org.chromium.content.browser.ContentViewClient;
@@ -68,13 +70,22 @@ public class ShellManager extends FrameLayout {
* @param window The window used to generate all shells.
*/
public void setWindow(WindowAndroid window) {
+ setWindow(window, true);
+ }
+
+ /**
+ * @param window The window used to generate all shells.
+ * @param initialLoadingNeeded Whether initial loading is needed or not.
+ */
+ @VisibleForTesting
+ public void setWindow(WindowAndroid window, final boolean initialLoadingNeeded) {
assert window != null;
mWindow = window;
mContentViewRenderView = new ContentViewRenderView(getContext()) {
@Override
protected void onReadyToRender() {
if (sStartup) {
- mActiveShell.loadUrl(mStartupUrl);
+ if (initialLoadingNeeded) mActiveShell.loadUrl(mStartupUrl);
sStartup = false;
}
}
@@ -157,8 +168,11 @@ public class ShellManager extends FrameLayout {
private void showShell(Shell shellView) {
shellView.setContentViewRenderView(mContentViewRenderView);
- addView(shellView, new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
+ // If GPU hardware acceleration is disabled, composition shouldn't happen.
+ if (!CommandLine.getInstance().hasSwitch("disable-gpu")) {
Jaekyun Seok (inactive) 2015/02/23 10:41:34 I found that ChildDiscardableSharedMemoryManagerBr
no sievers 2015/02/24 02:02:32 --disable-gpu is not supported on Android. Let's
Jaekyun Seok (inactive) 2015/02/24 12:49:50 Then I will disable those tests as a workaround, a
+ addView(shellView, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT));
+ }
mActiveShell = shellView;
ContentViewCore contentViewCore = mActiveShell.getContentViewCore();
if (contentViewCore != null) {

Powered by Google App Engine
This is Rietveld 408576698