Loading packages/SystemUI/shared/tests/Android.mk +7 −1 Original line number Original line Diff line number Diff line Loading @@ -35,12 +35,18 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) \ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ metrics-helper-lib \ metrics-helper-lib \ android-support-test \ android-support-test \ mockito-target-minus-junit4 \ mockito-target-inline-minus-junit4 \ SystemUI-proto \ SystemUI-proto \ SystemUI-tags \ SystemUI-tags \ testables \ testables \ truth-prebuilt \ truth-prebuilt \ LOCAL_MULTILIB := both LOCAL_JNI_SHARED_LIBRARIES := \ libdexmakerjvmtiagent \ libmultiplejvmtiagentsinterferenceagent LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common # sign this with platform cert, so this test is allowed to inject key events into # sign this with platform cert, so this test is allowed to inject key events into Loading packages/SystemUI/shared/tests/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> <application> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> <uses-library android:name="android.test.runner" /> </application> </application> Loading packages/SystemUI/tests/Android.mk +8 −1 Original line number Original line Diff line number Diff line Loading @@ -56,12 +56,19 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ metrics-helper-lib \ metrics-helper-lib \ android-support-test \ android-support-test \ mockito-target-minus-junit4 \ mockito-target-inline-minus-junit4 \ SystemUI-proto \ SystemUI-proto \ SystemUI-tags \ SystemUI-tags \ testables \ testables \ truth-prebuilt \ truth-prebuilt \ LOCAL_MULTILIB := both LOCAL_JNI_SHARED_LIBRARIES := \ libdexmakerjvmtiagent \ libmultiplejvmtiagentsinterferenceagent LOCAL_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ android.test.runner \ android.test.runner \ telephony-common \ telephony-common \ Loading packages/SystemUI/tests/AndroidManifest.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -48,8 +48,9 @@ <uses-permission android:name="android.permission.REAL_GET_TASKS" /> <uses-permission android:name="android.permission.REAL_GET_TASKS" /> <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> <uses-library android:name="android.test.runner" /> <activity android:name="com.android.systemui.screenshot.ScreenshotStubActivity" /> <activity android:name="com.android.systemui.screenshot.ScreenshotStubActivity" /> Loading packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -27,8 +27,14 @@ import com.android.systemui.qs.tileimpl.SlashImageView; import org.junit.Test; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @SmallTest @SmallTest Loading Loading @@ -80,13 +86,12 @@ public class SlashImageViewTest extends SysuiTestCase { public void testSetImageDrawableUsesDrawableLevel() { public void testSetImageDrawableUsesDrawableLevel() { SlashImageView iv = new SlashImageView(mContext); SlashImageView iv = new SlashImageView(mContext); Drawable mockDrawable = mock(Drawable.class); Drawable mockDrawable = mock(Drawable.class); mockDrawable.setLevel(2); when(mockDrawable.getLevel()).thenReturn(2); assertTrue(mockDrawable.getLevel() == 2); iv.setImageDrawable(mockDrawable); iv.setImageDrawable(mockDrawable); // Make sure setting the drawable didn't reset its level to 0 // Make sure setting the drawable didn't reset its level to 0 assertTrue(mockDrawable.getLevel() == 2); verify(mockDrawable).setLevel(eq(2)); } } // Expose getSlashDrawable // Expose getSlashDrawable Loading Loading
packages/SystemUI/shared/tests/Android.mk +7 −1 Original line number Original line Diff line number Diff line Loading @@ -35,12 +35,18 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) \ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ metrics-helper-lib \ metrics-helper-lib \ android-support-test \ android-support-test \ mockito-target-minus-junit4 \ mockito-target-inline-minus-junit4 \ SystemUI-proto \ SystemUI-proto \ SystemUI-tags \ SystemUI-tags \ testables \ testables \ truth-prebuilt \ truth-prebuilt \ LOCAL_MULTILIB := both LOCAL_JNI_SHARED_LIBRARIES := \ libdexmakerjvmtiagent \ libmultiplejvmtiagentsinterferenceagent LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common LOCAL_JAVA_LIBRARIES := android.test.runner telephony-common # sign this with platform cert, so this test is allowed to inject key events into # sign this with platform cert, so this test is allowed to inject key events into Loading
packages/SystemUI/shared/tests/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> <uses-permission android:name="android.permission.READ_FRAME_BUFFER" /> <application> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> <uses-library android:name="android.test.runner" /> </application> </application> Loading
packages/SystemUI/tests/Android.mk +8 −1 Original line number Original line Diff line number Diff line Loading @@ -56,12 +56,19 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_STATIC_JAVA_LIBRARIES := \ metrics-helper-lib \ metrics-helper-lib \ android-support-test \ android-support-test \ mockito-target-minus-junit4 \ mockito-target-inline-minus-junit4 \ SystemUI-proto \ SystemUI-proto \ SystemUI-tags \ SystemUI-tags \ testables \ testables \ truth-prebuilt \ truth-prebuilt \ LOCAL_MULTILIB := both LOCAL_JNI_SHARED_LIBRARIES := \ libdexmakerjvmtiagent \ libmultiplejvmtiagentsinterferenceagent LOCAL_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ android.test.runner \ android.test.runner \ telephony-common \ telephony-common \ Loading
packages/SystemUI/tests/AndroidManifest.xml +2 −1 Original line number Original line Diff line number Diff line Loading @@ -48,8 +48,9 @@ <uses-permission android:name="android.permission.REAL_GET_TASKS" /> <uses-permission android:name="android.permission.REAL_GET_TASKS" /> <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.NETWORK_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application> <application android:debuggable="true"> <uses-library android:name="android.test.runner" /> <uses-library android:name="android.test.runner" /> <activity android:name="com.android.systemui.screenshot.ScreenshotStubActivity" /> <activity android:name="com.android.systemui.screenshot.ScreenshotStubActivity" /> Loading
packages/SystemUI/tests/src/com/android/systemui/qs/SlashImageViewTest.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -27,8 +27,14 @@ import com.android.systemui.qs.tileimpl.SlashImageView; import org.junit.Test; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @SmallTest @SmallTest Loading Loading @@ -80,13 +86,12 @@ public class SlashImageViewTest extends SysuiTestCase { public void testSetImageDrawableUsesDrawableLevel() { public void testSetImageDrawableUsesDrawableLevel() { SlashImageView iv = new SlashImageView(mContext); SlashImageView iv = new SlashImageView(mContext); Drawable mockDrawable = mock(Drawable.class); Drawable mockDrawable = mock(Drawable.class); mockDrawable.setLevel(2); when(mockDrawable.getLevel()).thenReturn(2); assertTrue(mockDrawable.getLevel() == 2); iv.setImageDrawable(mockDrawable); iv.setImageDrawable(mockDrawable); // Make sure setting the drawable didn't reset its level to 0 // Make sure setting the drawable didn't reset its level to 0 assertTrue(mockDrawable.getLevel() == 2); verify(mockDrawable).setLevel(eq(2)); } } // Expose getSlashDrawable // Expose getSlashDrawable Loading