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

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

Issue 216873002: [Android WebView] Fix AwSettingsTest.testUseWideViewportControlsDoubleTabToZoom (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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..cf99cd04448a8e686207176bdd773c13efa5049d 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
@@ -2430,8 +2430,18 @@ public class AwSettingsTest extends AwTestBase {
AwSettings settings = getAwSettingsOnUiThread(awContents);
settings.setBuiltInZoomControls(true);
- final String page = "<html><body>Page Text</body></html>";
+ DeviceDisplayInfo deviceInfo =
+ DeviceDisplayInfo.create(testContainerView.getContext());
+ int displayWidth = (int) (deviceInfo.getDisplayWidth() / deviceInfo.getDIPScale());
+ int layoutWidth = displayWidth * 2;
+ final String page = "<html>" +
+ "<head><meta name='viewport' content='width=" + layoutWidth + "'>" +
+ "<style> body { width: " + layoutWidth + "px; }</style></head>" +
+ "<body>Page Text</body></html>";
+
assertFalse(settings.getUseWideViewPort());
+ // Without wide viewport the <meta viewport> tag will be ignored by WebView,
+ // but it doesn't really matter as we don't expect double tap to change the scale.
loadDataSync(awContents, onPageFinishedHelper, page, "text/html", false);
final float initialScale = getScaleOnUiThread(awContents);
simulateDoubleTapCenterOfWebViewOnUiThread(testContainerView);
« 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