summaryrefslogtreecommitdiffstats
path: root/tests/src/org/cyanogenmod/tests/customtiles
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-07-31 16:23:53 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-07-31 16:27:15 -0700
commitfa82ebb308cd09bf63319241bf2457367da4ca9b (patch)
tree1f62d2ed6ead165fc1f0ac112d6a66d6c9de3e62 /tests/src/org/cyanogenmod/tests/customtiles
parente84d6568ab8198f65489a672a1995eacd2dd94a7 (diff)
downloadvendor_cmsdk-fa82ebb308cd09bf63319241bf2457367da4ca9b.zip
vendor_cmsdk-fa82ebb308cd09bf63319241bf2457367da4ca9b.tar.gz
vendor_cmsdk-fa82ebb308cd09bf63319241bf2457367da4ca9b.tar.bz2
cmsdk: Support deleteIntent and remove tiles when packages change.
Change-Id: I488410296c7579870406ea8fe289cf0b2158ea80
Diffstat (limited to 'tests/src/org/cyanogenmod/tests/customtiles')
-rw-r--r--tests/src/org/cyanogenmod/tests/customtiles/CMStatusBarTest.java16
-rw-r--r--tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java11
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/customtiles/CMStatusBarTest.java b/tests/src/org/cyanogenmod/tests/customtiles/CMStatusBarTest.java
index 4251707..20c9809 100644
--- a/tests/src/org/cyanogenmod/tests/customtiles/CMStatusBarTest.java
+++ b/tests/src/org/cyanogenmod/tests/customtiles/CMStatusBarTest.java
@@ -148,6 +148,22 @@ public class CMStatusBarTest extends TestActivity {
}
},
+ new Test("test publish tile with delete intent") {
+ public void run() {
+ Intent intent = new Intent(CMStatusBarTest.this, DummySettings.class);
+ PendingIntent pendingIntent =
+ PendingIntent.getActivity(CMStatusBarTest.this, 0, intent, 0);
+ CustomTile customTile = new CustomTile.Builder(CMStatusBarTest.this)
+ .setLabel("Test Settings From SDK")
+ .setIcon(R.drawable.ic_launcher)
+ .setDeleteIntent(pendingIntent)
+ .setContentDescription("Content description")
+ .build();
+ CMStatusBarManager.getInstance(CMStatusBarTest.this)
+ .publishTile(CUSTOM_TILE_SETTINGS_ID, customTile);
+ }
+ },
+
new Test("test publish tile with custom uri") {
public void run() {
CustomTile customTile = new CustomTile.Builder(CMStatusBarTest.this)
diff --git a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java
index 93bd132..713d607 100644
--- a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java
+++ b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java
@@ -68,6 +68,17 @@ public class CustomTileBuilderTest extends AndroidTestCase {
}
@SmallTest
+ public void testCustomTileBuilderDeleteIntent() {
+ Intent intent = new Intent(mContext, DummySettings.class);
+ PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0);
+ CustomTile customTile = new CustomTile.Builder(mContext)
+ .setDeleteIntent(pendingIntent)
+ .build();
+ assertNotNull(customTile.deleteIntent);
+ assertEquals(pendingIntent, customTile.deleteIntent);
+ }
+
+ @SmallTest
public void testCustomTileBuilderOnClickUri() {
//Calling Mike Jones, WHO!? MIKE JONES.
Uri uri = Uri.parse("2813308004");