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

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

Issue 23899004: Use contents size for android_webview layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: always use contents size (preferred size is no more) Created 7 years, 3 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 c0f6387693aafafc62d5b9525364c00907348d8b..505ced9a97b9296dcc828b776019a386602bebb6 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
@@ -35,6 +35,8 @@ public class AwTestBase
protected static final int WAIT_TIMEOUT_SECONDS = 15;
protected static final int CHECK_INTERVAL = 100;
+ private boolean mQuirksMode = true;
+
public AwTestBase() {
super(AwTestRunnerActivity.class);
}
@@ -230,7 +232,7 @@ public class AwTestBase
// See http://crbug.com/278106
testContainerView.initialize(new AwContents(
mBrowserContext, testContainerView, testContainerView.getInternalAccessDelegate(),
- awContentsClient, false, testDependencyFactory.createLayoutSizer(), true));
+ awContentsClient, false, testDependencyFactory.createLayoutSizer(), mQuirksMode));
return testContainerView;
}
@@ -257,6 +259,17 @@ public class AwTestBase
});
}
+ /**
+ * Sets whether subsequent calls to create*AwTestContainerView will create a quirks-mode or
+ * no-quirks-mode AwContents.
+ * It is strongly advised to call this method only once, at the beginning of the test. It is
+ * also advised to have two versions of the same test - one for quirks mode and one for
+ * no quirks mode.
+ */
+ protected void setQuirksMode(boolean value) {
+ mQuirksMode = value;
+ }
+
protected String getTitleOnUiThread(final AwContents awContents) throws Exception {
return runTestOnUiThreadAndGetResult(new Callable<String>() {
@Override

Powered by Google App Engine
This is Rietveld 408576698