Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a16ca52 authored by fbaron's avatar fbaron
Browse files

Fix testDragToFolder test

The issue seems to be that when we begin drag we enter spring loaded mode which triggers the 'app swap' interaction, leading us to getting the wrong position for the app icon we're trying to drag into. Using photos app instead of gmail should make it so that we don't enter the app swap operation with playstore, meaning we would get the correct position for play store and we will drag the app there

Fix: 320484402
Flag: NONE
Test: TaplDragTest#testDragToFolder
Change-Id: Id6f09be997046e7c450a2760ee95cc5735ad5673
parent e5d943e8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ public class TestConstants {
        public static final String MAPS_APP_NAME = "Maps";
        public static final String STORE_APP_NAME = "Play Store";
        public static final String GMAIL_APP_NAME = "Gmail";
        public static final String PHOTOS_APP_NAME = "Photos";
        public static final String CHROME_APP_NAME = "Chrome";
        public static final String MESSAGES_APP_NAME = "Messages";
    }
+7 −7
Original line number Diff line number Diff line
@@ -15,11 +15,11 @@
 */
package com.android.launcher3.dragging;

import static com.android.launcher3.util.TestConstants.AppNames.TEST_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.GMAIL_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.PHOTOS_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.STORE_APP_NAME;
import static com.android.launcher3.ui.AbstractLauncherUiTest.initialize;
import static com.android.launcher3.util.TestConstants.AppNames.TEST_APP_NAME;
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;

@@ -80,18 +80,18 @@ public class TaplDragTest extends AbstractLauncherUiTest {
        // TODO: add the use case to drag an icon to an existing folder. Currently it either fails
        // on tablets or phones due to difference in resolution.
        final HomeAppIcon playStoreIcon = createShortcutIfNotExist(STORE_APP_NAME, 0, 1);
        final HomeAppIcon gmailIcon = createShortcutInCenterIfNotExist(GMAIL_APP_NAME);
        final HomeAppIcon photosIcon = createShortcutInCenterIfNotExist(PHOTOS_APP_NAME);

        FolderIcon folderIcon = gmailIcon.dragToIcon(playStoreIcon);
        FolderIcon folderIcon = photosIcon.dragToIcon(playStoreIcon);
        Folder folder = folderIcon.open();
        folder.getAppIcon(STORE_APP_NAME);
        folder.getAppIcon(GMAIL_APP_NAME);
        folder.getAppIcon(PHOTOS_APP_NAME);
        Workspace workspace = folder.close();

        workspace.verifyWorkspaceAppIconIsGone(STORE_APP_NAME + " should be moved to a folder.",
                STORE_APP_NAME);
        workspace.verifyWorkspaceAppIconIsGone(GMAIL_APP_NAME + " should be moved to a folder.",
                GMAIL_APP_NAME);
        workspace.verifyWorkspaceAppIconIsGone(PHOTOS_APP_NAME + " should be moved to a folder.",
                PHOTOS_APP_NAME);

        final HomeAppIcon mapIcon = createShortcutInCenterIfNotExist(MAPS_APP_NAME);
        folderIcon = mapIcon.dragToIcon(folderIcon);