diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-07-22 13:35:20 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-07-27 13:16:38 -0700 |
commit | 5aa4db2e904702fdd2256cf516796270503cb361 (patch) | |
tree | bce0225526a156e0a2d5d723b941a5513b11e2ef /tests/src | |
parent | 3290540468c1e46d4bb345f5fd82db86dad04afb (diff) | |
download | vendor_cmsdk-5aa4db2e904702fdd2256cf516796270503cb361.zip vendor_cmsdk-5aa4db2e904702fdd2256cf516796270503cb361.tar.gz vendor_cmsdk-5aa4db2e904702fdd2256cf516796270503cb361.tar.bz2 |
cmsdk: Add unit tests for shouldCollapsePanel
Change-Id: If9997c1be005f962dc628888f1090cb973588bb4
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java | 9 | ||||
-rw-r--r-- | tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileTest.java | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java index 7be857b..f2a5e31 100644 --- a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java +++ b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileBuilderTest.java @@ -106,6 +106,15 @@ public class CustomTileBuilderTest extends AndroidTestCase { assertEquals(resourceInt, customTile.icon); } + @SmallTest + public void testCustomTileBuilderCollapsePanelSet() { + boolean collapsePanel = true; + CustomTile customTile = new CustomTile.Builder(mContext) + .shouldCollapsePanel(collapsePanel) + .build(); + assertEquals(collapsePanel, customTile.collapsePanel); + } + @MediumTest public void testCustomTileBuilderExpandedListStyleSet() { PendingIntent intent = PendingIntent.getActivity(mContext, 0, diff --git a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileTest.java b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileTest.java index 862808d..e1c7036 100644 --- a/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileTest.java +++ b/tests/src/org/cyanogenmod/tests/customtiles/unit/CustomTileTest.java @@ -169,6 +169,25 @@ public class CustomTileTest extends AndroidTestCase { assertEquals(expectedCustomTile.icon, fromParcel.icon); } + @SmallTest + public void testCustomTileCollapsePanelUnravelFromParcel() { + CustomTile expectedCustomTile = new CustomTile.Builder(mContext) + .shouldCollapsePanel(true) + .build(); + + // Write to parcel + Parcel parcel = Parcel.obtain(); + expectedCustomTile.writeToParcel(parcel, 0); + + // Rewind + parcel.setDataPosition(0); + + // Verify data when unraveling + CustomTile fromParcel = CustomTile.CREATOR.createFromParcel(parcel); + + assertEquals(expectedCustomTile.collapsePanel, fromParcel.collapsePanel); + } + @MediumTest public void testCustomTileExpandedListStyleUnravelFromParcel() { PendingIntent intent = PendingIntent.getActivity(mContext, 0, |