summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-06-22 09:50:21 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-06-22 09:51:07 -0700
commit803896767b37e447bcdff7be6b9872612e93b7bf (patch)
tree185a69f66dc153114abd60255e1119bb9e773943 /tests
parent4efaed56372085c5fa473b9e83bb497940ffbaaf (diff)
downloadandroid_packages_apps_Trebuchet-803896767b37e447bcdff7be6b9872612e93b7bf.tar.gz
android_packages_apps_Trebuchet-803896767b37e447bcdff7be6b9872612e93b7bf.tar.bz2
android_packages_apps_Trebuchet-803896767b37e447bcdff7be6b9872612e93b7bf.zip
Fixing bug in GridSizeMigrationTask, where it was not accounting for
an extra space when there is no all-apps icon Bug: 29569843 Change-Id: Ib768f0d069aed413bd8f4c2aa86ab1d3d657680e
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
index 08a81f0c8..c250cb291 100644
--- a/tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
+++ b/tests/src/com/android/launcher3/model/GridSizeMigrationTaskTest.java
@@ -10,6 +10,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.util.TestLauncherProvider;
@@ -61,8 +62,13 @@ public class GridSizeMigrationTaskTest extends ProviderTestCase2<TestLauncherPro
mIdp.numHotseatIcons = 3;
new GridSizeMigrationTask(getMockContext(), mIdp, mValidPackages, 5, 3)
.migrateHotseat();
- // First & last items are dropped as they have the least weight.
- verifyHotseat(hotseatItems[1], -1, hotseatItems[3]);
+ if (FeatureFlags.NO_ALL_APPS_ICON) {
+ // First item is dropped as it has the least weight.
+ verifyHotseat(hotseatItems[1], hotseatItems[3], hotseatItems[4]);
+ } else {
+ // First & last items are dropped as they have the least weight.
+ verifyHotseat(hotseatItems[1], -1, hotseatItems[3]);
+ }
}
public void testHotseatMigration_shortcuts_dropped() throws Exception {
@@ -77,8 +83,13 @@ public class GridSizeMigrationTaskTest extends ProviderTestCase2<TestLauncherPro
mIdp.numHotseatIcons = 3;
new GridSizeMigrationTask(getMockContext(), mIdp, mValidPackages, 5, 3)
.migrateHotseat();
- // First & third items are dropped as they have the least weight.
- verifyHotseat(hotseatItems[1], -1, hotseatItems[4]);
+ if (FeatureFlags.NO_ALL_APPS_ICON) {
+ // First item is dropped as it has the least weight.
+ verifyHotseat(hotseatItems[1], hotseatItems[3], hotseatItems[4]);
+ } else {
+ // First & third items are dropped as they have the least weight.
+ verifyHotseat(hotseatItems[1], -1, hotseatItems[4]);
+ }
}
private void verifyHotseat(long... sortedIds) {