AOSP/Messaging - Changes to make unit tests to run and pass. am: b1aa213ce9 am: 4c12eb471c am: 0875a1420e am: 4671bcc558
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1360018 Change-Id: I2801bfaba651e69bb6a3034c781d53c784cba2f7
This commit is contained in:
@@ -23,14 +23,16 @@ LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
|
||||
LOCAL_USE_AAPT2 := true
|
||||
|
||||
LOCAL_STATIC_ANDROID_LIBRARIES := \
|
||||
androidx.appcompat_appcompat \
|
||||
androidx.collection_collection \
|
||||
androidx.core_core \
|
||||
androidx.fragment_fragment \
|
||||
androidx.media_media \
|
||||
androidx.legacy_legacy-support-core-utils \
|
||||
androidx.legacy_legacy-support-core-ui \
|
||||
androidx.fragment_fragment \
|
||||
androidx.appcompat_appcompat \
|
||||
androidx.palette_palette \
|
||||
androidx.recyclerview_recyclerview \
|
||||
androidx.viewpager_viewpager \
|
||||
androidx.legacy_legacy-support-v13 \
|
||||
colorpicker \
|
||||
libchips \
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
-dontobfuscate
|
||||
-dontoptimize
|
||||
|
||||
|
||||
|
||||
# FLAG(dnotario): Until we rationalize how to handle tests (extensive unit tests will want similar
|
||||
# settings to these, but maybe we want to require VisibleForTesting attribute), just expose all
|
||||
# non-private methods. This means we cannot run tests on user builds for the moment.
|
||||
@@ -35,7 +33,7 @@
|
||||
!private *;
|
||||
}
|
||||
|
||||
-keep class com.android.messaging.ui.contact.* { *; }
|
||||
-keep class com.android.messaging.ui.*.* { *; }
|
||||
|
||||
# Keep the classes needed by emma
|
||||
-keep class com.vladium.** { *; }
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
-keepclassmembers class * {
|
||||
@com.google.common.annotations.VisibleForTesting *;
|
||||
}
|
||||
-keep class com.android.messaging.ui.contact.* { *; }
|
||||
-keep class com.android.messaging.* { *; }
|
||||
-keep class com.android.messaging.*.* { *; }
|
||||
-keep class com.android.messaging.*.*.* { *; }
|
||||
|
||||
# Keep methods that have the @VisibleForAnimation annotation
|
||||
-keep @interface com.android.messaging.annotation.VisibleForAnimation
|
||||
@@ -39,10 +41,13 @@
|
||||
-keep public class * extends androidx.fragment.app.Fragment
|
||||
-keep public class com.android.vcard.* { *; }
|
||||
|
||||
-keep class androidx.collection.* { *; }
|
||||
-keep class androidx.core.* { *; }
|
||||
-keep class androidx.core.*.* { *; }
|
||||
-keep class androidx.appcompat.* { *; }
|
||||
-keep class androidx.appcompat.*.* { *; }
|
||||
-keep class androidx.recyclerview.widget.* { *; }
|
||||
-keep class androidx.viewpager.widget.* { *; }
|
||||
|
||||
# Keep rastermill classes that need to be accessed from native code (JNI)
|
||||
-keep class android.support.rastermill.** { *; }
|
||||
|
||||
@@ -603,7 +603,6 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
||||
*/
|
||||
@VisibleForTesting
|
||||
static DatabaseHelper getNewInstanceForTest(final Context context) {
|
||||
Assert.isEngBuild();
|
||||
Assert.isTrue(BugleApplication.isRunningTests());
|
||||
return new DatabaseHelper(context);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.messaging.ui.contact;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
import android.view.View;
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.database.Cursor;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.RecyclerView.Adapter;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import com.android.messaging.FakeFactory;
|
||||
|
||||
Reference in New Issue
Block a user