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

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

Issue 214543009: [Android WebView] Fix AwSettingsTest.testLayoutAlgorithmWithTwoViews for wide screens (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
index fed65240df207bd9303242acfe21703dc28d0ccf..853a3dd4df786e7f919712342ad18c3d97081f75 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java
@@ -938,9 +938,18 @@ public class AwSettingsTest extends AwTestBase {
}
protected String getData() {
+ DeviceDisplayInfo deviceInfo =
+ DeviceDisplayInfo.create(getInstrumentation().getTargetContext());
+ int displayWidth = (int) (deviceInfo.getDisplayWidth() / deviceInfo.getDIPScale());
+ int layoutWidth = (int) (displayWidth * 2.5f); // Use 2.5 as autosizing layout tests do.
StringBuilder sb = new StringBuilder();
sb.append("<html>" +
- "<head><script>" +
+ "<head>" +
+ "<meta name=\"viewport\" content=\"width=" + layoutWidth + "\">" +
+ "<style>" +
+ "body { width: " + layoutWidth + "px; margin: 0; overflow-y: hidden; }" +
+ "</style>" +
+ "<script>" +
"function setTitleToActualFontSize() {" +
// parseFloat is used to trim out the "px" suffix.
" document.title = parseFloat(getComputedStyle(" +
@@ -951,7 +960,7 @@ public class AwSettingsTest extends AwTestBase {
sb.append(PARAGRAPH_FONT_SIZE);
sb.append("px;\">");
// Make the paragraph wide enough for being processed by the font autosizer.
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 500; i++) {
sb.append("Hello, World! ");
}
sb.append("</p></body></html>");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698