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

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

Issue 374303002: ui: Use physical size for gfx::Display on Android if available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | ui/gfx/screen_android.cc » ('j') | 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/AwLegacyQuirksTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
index 6f70ec7f971dc088d1f9d8b5bc56295eeeacc5f0..aed910cdc82cc8f5d0fd7e8682993947906da80c 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
@@ -133,9 +133,13 @@ public class AwLegacyQuirksTest extends AwTestBase {
DeviceDisplayInfo deviceInfo =
DeviceDisplayInfo.create(getInstrumentation().getTargetContext());
float dipScale = (float) deviceInfo.getDIPScale();
- float physicalDisplayWidth = deviceInfo.getDisplayWidth();
+ float physicalDisplayWidth = deviceInfo.getPhysicalDisplayWidth() != 0 ?
+ deviceInfo.getPhysicalDisplayWidth() :
+ deviceInfo.getDisplayWidth();
float cssDisplayWidth = physicalDisplayWidth / dipScale;
- float physicalDisplayHeight = deviceInfo.getDisplayHeight();
+ float physicalDisplayHeight = deviceInfo.getPhysicalDisplayHeight() != 0 ?
+ deviceInfo.getPhysicalDisplayHeight() :
+ deviceInfo.getDisplayHeight();
float cssDisplayHeight = physicalDisplayHeight / dipScale;
float screenWidth = Integer.parseInt(
« no previous file with comments | « no previous file | ui/gfx/screen_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698