From ba3992ed506bd1e01fdbbc576162afb143d27ad8 Mon Sep 17 00:00:00 2001 From: AndrĂ¡s Kurucz Date: Mon, 23 Oct 2023 17:03:30 +0000 Subject: Make NotificationMemoryViewWalkerTest pass on cf tablet Reduce the sizes of bitmaps used by this test to make them pass with the latest cuttlefish screen configurations. Currently they are failing, because these devices have a density, which makes to resize these bitmaps as their size is bigger than a max dimens value in pixels. Bug: 306164991 Test: abtd runs on different targets Change-Id: I2cc55c27cedb7066089e110257dac0170a32e9f1 --- .../logging/NotificationMemoryViewWalkerTest.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt index a0f50486ffff..4bb28ae46211 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt @@ -50,8 +50,8 @@ class NotificationMemoryViewWalkerTest : SysuiTestCase() { @Test fun testViewWalker_plainNotification_withPublicView() { - val icon = Icon.createWithBitmap(Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888)) - val publicIcon = Icon.createWithBitmap(Bitmap.createBitmap(40, 40, Bitmap.Config.ARGB_8888)) + val icon = Icon.createWithBitmap(Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)) + val publicIcon = Icon.createWithBitmap(Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888)) testHelper.setDefaultInflationFlags(NotificationRowContentBinder.FLAG_CONTENT_VIEW_ALL) val row = testHelper.createRow( @@ -122,9 +122,9 @@ class NotificationMemoryViewWalkerTest : SysuiTestCase() { @Test fun testViewWalker_bigPictureNotification() { - val bigPicture = Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888) - val icon = Icon.createWithBitmap(Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888)) - val largeIcon = Icon.createWithBitmap(Bitmap.createBitmap(60, 60, Bitmap.Config.ARGB_8888)) + val bigPicture = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888) + val icon = Icon.createWithBitmap(Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)) + val largeIcon = Icon.createWithBitmap(Bitmap.createBitmap(30, 30, Bitmap.Config.ARGB_8888)) val row = testHelper.createRow( Notification.Builder(mContext) @@ -182,8 +182,8 @@ class NotificationMemoryViewWalkerTest : SysuiTestCase() { @Test fun testViewWalker_customView() { - val icon = Icon.createWithBitmap(Bitmap.createBitmap(20, 20, Bitmap.Config.ARGB_8888)) - val bitmap = Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888) + val icon = Icon.createWithBitmap(Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888)) + val bitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888) val views = RemoteViews(mContext.packageName, R.layout.custom_view_dark) views.setImageViewBitmap(R.id.custom_view_dark_image, bitmap) -- cgit v1.2.3-59-g8ed1b