From 9a16ca52151d538b0aed81070fa1ce0951faaf51 Mon Sep 17 00:00:00 2001 From: fbaron Date: Mon, 22 Jan 2024 11:22:06 -0800 Subject: [PATCH] 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 --- .../com/android/launcher3/util/TestConstants.java | 1 + .../android/launcher3/dragging/TaplDragTest.java | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/multivalentTests/src/com/android/launcher3/util/TestConstants.java b/tests/multivalentTests/src/com/android/launcher3/util/TestConstants.java index 6f3c63ae02..bf5ccd0655 100644 --- a/tests/multivalentTests/src/com/android/launcher3/util/TestConstants.java +++ b/tests/multivalentTests/src/com/android/launcher3/util/TestConstants.java @@ -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"; } diff --git a/tests/src/com/android/launcher3/dragging/TaplDragTest.java b/tests/src/com/android/launcher3/dragging/TaplDragTest.java index 94a96aad4f..b633452bce 100644 --- a/tests/src/com/android/launcher3/dragging/TaplDragTest.java +++ b/tests/src/com/android/launcher3/dragging/TaplDragTest.java @@ -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);