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

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

Issue 23572016: [Android WebView] Wire up the viewport quirks settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split into 2 quirks, as per the final version of Blink's http://crrev.com/23691017 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/AwTargetDensityDpiTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTargetDensityDpiTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTargetDensityDpiTest.java
deleted file mode 100644
index 1a10196141498b1e9cd41756a3939007b46c3eb1..0000000000000000000000000000000000000000
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTargetDensityDpiTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.android_webview.test;
-
-import android.test.suitebuilder.annotation.MediumTest;
-import org.chromium.android_webview.AwContents;
-import org.chromium.android_webview.AwSettings;
-import org.chromium.base.test.util.Feature;
-import org.chromium.content.browser.test.util.CallbackHelper;
-import org.chromium.ui.gfx.DeviceDisplayInfo;
-
-public class AwTargetDensityDpiTest extends AwTestBase {
-
- @MediumTest
- @Feature({"AndroidWebView"})
- public void testTargetDensityDpi() throws Throwable {
- final TestAwContentsClient contentClient = new TestAwContentsClient();
- final AwTestContainerView testContainerView =
- createAwTestContainerViewOnMainSync(contentClient);
- final AwContents awContents = testContainerView.getAwContents();
- AwSettings settings = getAwSettingsOnUiThread(awContents);
- CallbackHelper onPageFinishedHelper = contentClient.getOnPageFinishedHelper();
-
- final String pageTemplate = "<html><head>" +
- "<meta name='viewport' content='width=device-width, target-densityDpi=%s' />" +
- "</head><body onload='document.title=document.body.clientWidth'></body></html>";
- final String pageDeviceDpi = String.format(pageTemplate, "device-dpi");
- final String pageHighDpi = String.format(pageTemplate, "high-dpi");
- final String pageDpi100 = String.format(pageTemplate, "100");
-
- settings.setJavaScriptEnabled(true);
-
- DeviceDisplayInfo deviceInfo =
- DeviceDisplayInfo.create(getInstrumentation().getTargetContext());
- loadDataSync(awContents, onPageFinishedHelper, pageDeviceDpi, "text/html", false);
- int actualWidth = Integer.parseInt(getTitleOnUiThread(awContents));
- assertEquals((float)deviceInfo.getDisplayWidth(), (float)actualWidth, 10f);
-
- float displayWidth = (float)(deviceInfo.getDisplayWidth());
- float deviceDpi = (float)(160f * deviceInfo.getDIPScale());
-
- loadDataSync(awContents, onPageFinishedHelper, pageHighDpi, "text/html", false);
- actualWidth = Integer.parseInt(getTitleOnUiThread(awContents));
- assertEquals(displayWidth * (240f / deviceDpi), (float)actualWidth, 10f);
-
- loadDataSync(awContents, onPageFinishedHelper, pageDpi100, "text/html", false);
- actualWidth = Integer.parseInt(getTitleOnUiThread(awContents));
- assertEquals(displayWidth * (100f / deviceDpi), (float)actualWidth, 10f);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698