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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java

Issue 2018213002: Set the Bluetooth chooser list height to cut through the middle of a list item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Remove an unnecessary cast. Created 4 years, 7 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 | « chrome/android/java/src/org/chromium/chrome/browser/UsbChooserDialog.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
index 851423ef5de98f704821a95365837f08231c46c2..ef2cd24b7639904f778dba450ef6227749787408 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
@@ -260,4 +260,21 @@ public class ItemChooserDialogTest extends ChromeActivityTestCaseBase<ChromeActi
mChooserDialog.dismiss();
}
+
+ @SmallTest
+ public void testListHeight() throws InterruptedException {
+ // 500 * .3 is 150, which is 48 * 3.125. 48 * 3.5 is 168.
+ assertEquals(168, ItemChooserDialog.getListHeight(500, 1.0f));
+
+ // 150 * .3 is 45, which rounds below the minimum height.
+ assertEquals(72, ItemChooserDialog.getListHeight(150, 1.0f));
+
+ // 1460 * .3 is 438, which rounds above the maximum height.
+ assertEquals(408, ItemChooserDialog.getListHeight(1460, 1.0f));
+
+ // 1100px is 500dp at a density of 2.2. 500 * .3 is 150dp, which is 48dp *
+ // 3.125. 48dp * 3.5 is 168dp. 168dp * 2.2px/dp is 369.6, which rounds to
+ // 370.
+ assertEquals(370, ItemChooserDialog.getListHeight(1100, 2.2f));
+ }
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/UsbChooserDialog.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698