summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-02-01 22:29:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-02-01 22:29:55 +0000
commitb9759d399be4269a65b08988e50148f7d971fdf3 (patch)
tree7c47efe145895309885423402bcd98088c36f319 /tests
parentb171e5675b91e6e4fc1cf741b3b2d0313ad2fe27 (diff)
parent8a75806c1a22b79d6c343f0057f1cc55b2a62ed3 (diff)
downloadandroid_packages_apps_Trebuchet-b9759d399be4269a65b08988e50148f7d971fdf3.tar.gz
android_packages_apps_Trebuchet-b9759d399be4269a65b08988e50148f7d971fdf3.tar.bz2
android_packages_apps_Trebuchet-b9759d399be4269a65b08988e50148f7d971fdf3.zip
Merge "Add extra space for the search bar." into ub-launcher3-burnaby-polish
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/InvariantDeviceProfileTest.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java b/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java
index db3f72f3a..21df60109 100644
--- a/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java
+++ b/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java
@@ -108,15 +108,9 @@ public class InvariantDeviceProfileTest extends AndroidTestCase {
if (!android.os.Build.DEVICE.equals("hammerhead")) {
return;
}
- assertEquals(mInvariantProfile.numRows, 4);
- assertEquals(mInvariantProfile.numColumns, 4);
- assertEquals((int) mInvariantProfile.numHotseatIcons, 5);
-
- DeviceProfile landscapeProfile = mInvariantProfile.landscapeProfile;
- DeviceProfile portraitProfile = mInvariantProfile.portraitProfile;
-
- assertEquals(portraitProfile.allAppsNumCols, 3);
- assertEquals(landscapeProfile.allAppsNumCols, 5); // not used
+ assertEquals(4, mInvariantProfile.numRows);
+ assertEquals(4, mInvariantProfile.numColumns);
+ assertEquals(5, mInvariantProfile.numHotseatIcons);
}
// Add more tests for other devices, however, running them once on a single device is enough
@@ -172,10 +166,11 @@ public class InvariantDeviceProfileTest extends AndroidTestCase {
Rect landscapeBounds = landscapeProfile.getSearchBarBounds(true); // RTL shouldn't matter.
int landscapeHeight = (int) Utilities.dpiFromPx(landscapeBounds.height(),
resources.getDisplayMetrics());
- if (portraitProfile.isTablet) {
- assertEquals(8 + 80 + 24, portraitHeight);
+ if (portraitProfile.isPhone) {
+ // This fails on some devices due to http://b/26884580 (portraitHeight is 101, not 100).
+ assertEquals(4 + 94 + 2, portraitHeight);
} else {
- assertEquals(8 + 80 + 2, portraitHeight);
+ assertEquals(8 + 94 + 24, portraitHeight);
}
// Make sure the height that we pass in the widget options bundle is the height of the
// search bar + 8dps padding top and bottom.
@@ -183,7 +178,7 @@ public class InvariantDeviceProfileTest extends AndroidTestCase {
int portraitWidgetOptsHeight = portraitDimens.y;
Point landscapeDimens = landscapeProfile.getSearchBarDimensForWidgetOpts(resources);
int landscapeWidgetOptsHeight = landscapeDimens.y;
- assertEquals(8 + 80 + 8, (int) Utilities.dpiFromPx(portraitWidgetOptsHeight,
+ assertEquals(8 + 94 + 8, (int) Utilities.dpiFromPx(portraitWidgetOptsHeight,
resources.getDisplayMetrics()));
if (!landscapeProfile.isVerticalBarLayout()) {
assertEquals(portraitHeight, landscapeHeight);