From 6923abbf9c9c34605f42d8bb21e7e7317465a881 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Fri, 21 Apr 2023 16:41:29 -0700 Subject: [PATCH] Remove obsolete test case After ag/17803201, mutable bitmap in RemoteViews will now become immutable when RemoteViews is cloned, so the original test case is no longer valid after this change. Bug: 265438526 Test: atest RemoteViewsTest Change-Id: Ie31356e75d2eee3d63b90a52974d496bd791fb13 Merged-In: Ie31356e75d2eee3d63b90a52974d496bd791fb13 (cherry picked from commit 58ca34e53997ed5c698efe70d89e67fc24d4cc87) --- .../src/android/widget/RemoteViewsTest.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/core/tests/coretests/src/android/widget/RemoteViewsTest.java b/core/tests/coretests/src/android/widget/RemoteViewsTest.java index 963014e0bb505..467222696dfb3 100644 --- a/core/tests/coretests/src/android/widget/RemoteViewsTest.java +++ b/core/tests/coretests/src/android/widget/RemoteViewsTest.java @@ -22,7 +22,6 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.spy; @@ -34,9 +33,6 @@ import android.app.PendingIntent; import android.appwidget.AppWidgetHostView; import android.content.Context; import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.AsyncTask; @@ -90,19 +86,6 @@ public class RemoteViewsTest { mContainer = new LinearLayout(mContext); } - @Test - public void clone_doesNotCopyBitmap() { - RemoteViews original = new RemoteViews(mPackage, R.layout.remote_views_test); - Bitmap bitmap = Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888); - - original.setImageViewBitmap(R.id.image, bitmap); - RemoteViews clone = original.clone(); - View inflated = clone.apply(mContext, mContainer); - - Drawable drawable = ((ImageView) inflated.findViewById(R.id.image)).getDrawable(); - assertSame(bitmap, ((BitmapDrawable)drawable).getBitmap()); - } - @Test public void clone_originalCanStillBeApplied() { RemoteViews original = new RemoteViews(mPackage, R.layout.remote_views_test);