diff options
Diffstat (limited to 'tests/src/com/android/launcher3/InvariantDeviceProfileTest.java')
-rw-r--r-- | tests/src/com/android/launcher3/InvariantDeviceProfileTest.java | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java b/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java index 476eb0afb..35f686f55 100644 --- a/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java +++ b/tests/src/com/android/launcher3/InvariantDeviceProfileTest.java @@ -116,75 +116,4 @@ public class InvariantDeviceProfileTest extends AndroidTestCase { // Add more tests for other devices, however, running them once on a single device is enough // for verifying that for a platform version, the WindowManager and DisplayMetrics is // working as intended. - - /** - * Make sure that the height for the QSB is what we expect in normal mode. - */ - public void testQsbNormalHeight() { - Resources resources = getContext().getResources(); - DeviceProfile landscapeProfile = mInvariantProfile.landscapeProfile; - DeviceProfile portraitProfile = mInvariantProfile.portraitProfile; - landscapeProfile.setSearchBarHeight(LauncherCallbacks.SEARCH_BAR_HEIGHT_NORMAL); - portraitProfile.setSearchBarHeight(LauncherCallbacks.SEARCH_BAR_HEIGHT_NORMAL); - Rect portraitBounds = portraitProfile.getSearchBarBounds(true); // RTL shouldn't matter. - int portraitHeight = (int) Utilities.dpiFromPx(portraitBounds.height(), - resources.getDisplayMetrics()); - Rect landscapeBounds = landscapeProfile.getSearchBarBounds(true); // RTL shouldn't matter. - int landscapeHeight = (int) Utilities.dpiFromPx(landscapeBounds.height(), - resources.getDisplayMetrics()); - if (portraitProfile.isTablet) { - assertEquals(8 + 48 + 24, portraitHeight); - } else { - assertEquals(8 + 48 + 12, 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. - Point portraitDimens = portraitProfile.getSearchBarDimensForWidgetOpts(resources); - int portraitWidgetOptsHeight = portraitDimens.y; - Point landscapeDimens = landscapeProfile.getSearchBarDimensForWidgetOpts(resources); - int landscapeWidgetOptsHeight = landscapeDimens.y; - assertEquals(8 + 48 + 8, (int) Utilities.dpiFromPx(portraitWidgetOptsHeight, - resources.getDisplayMetrics())); - if (!landscapeProfile.isVerticalBarLayout()) { - assertEquals(portraitHeight, landscapeHeight); - assertEquals(portraitWidgetOptsHeight, landscapeWidgetOptsHeight); - } - } - - /** - * Make sure that the height for the QSB is what we expect in tall mode. - */ - public void testQsbTallHeight() { - Resources resources = getContext().getResources(); - DeviceProfile landscapeProfile = mInvariantProfile.landscapeProfile; - DeviceProfile portraitProfile = mInvariantProfile.portraitProfile; - landscapeProfile.setSearchBarHeight(LauncherCallbacks.SEARCH_BAR_HEIGHT_TALL); - portraitProfile.setSearchBarHeight(LauncherCallbacks.SEARCH_BAR_HEIGHT_TALL); - Rect portraitBounds = portraitProfile.getSearchBarBounds(true); // RTL shouldn't matter. - int portraitHeight = (int) Utilities.dpiFromPx(portraitBounds.height(), - resources.getDisplayMetrics()); - Rect landscapeBounds = landscapeProfile.getSearchBarBounds(true); // RTL shouldn't matter. - int landscapeHeight = (int) Utilities.dpiFromPx(landscapeBounds.height(), - resources.getDisplayMetrics()); - if (portraitProfile.isPhone) { - // This fails on some devices due to http://b/26884580 (portraitHeight is 101, not 100). - // TODO: Remove the comparision against 101 once b/26884580 is fixed - // assertEquals(4 + 94 + 2, portraitHeight); - assertTrue(portraitHeight == (4 + 94 + 2) || portraitHeight == (4 + 95 + 2)); - } else { - 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. - Point portraitDimens = portraitProfile.getSearchBarDimensForWidgetOpts(resources); - int portraitWidgetOptsHeight = portraitDimens.y; - Point landscapeDimens = landscapeProfile.getSearchBarDimensForWidgetOpts(resources); - int landscapeWidgetOptsHeight = landscapeDimens.y; - assertEquals(8 + 94 + 8, (int) Utilities.dpiFromPx(portraitWidgetOptsHeight, - resources.getDisplayMetrics())); - if (!landscapeProfile.isVerticalBarLayout()) { - assertEquals(portraitHeight, landscapeHeight); - assertEquals(portraitWidgetOptsHeight, landscapeWidgetOptsHeight); - } - } } |