Merge "Not assuming reverse order of menu shortcuts" into sc-dev
This commit is contained in:
commit
5c97cb689d
|
@ -334,20 +334,31 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
|||
// 1. Open all apps and wait for load complete.
|
||||
// 2. Find the app and long press it to show shortcuts.
|
||||
// 3. Press icon center until shortcuts appear
|
||||
final AllApps allApps = mLauncher.
|
||||
getWorkspace().
|
||||
switchToAllApps();
|
||||
final AllApps allApps = mLauncher
|
||||
.getWorkspace()
|
||||
.switchToAllApps();
|
||||
allApps.freeze();
|
||||
try {
|
||||
final AppIconMenuItem menuItem = allApps.
|
||||
getAppIcon(APP_NAME).
|
||||
openMenu().
|
||||
getMenuItem(0);
|
||||
final String shortcutName = menuItem.getText();
|
||||
assertEquals("Wrong menu item", "Shortcut 3", shortcutName);
|
||||
final AppIconMenu menu = allApps
|
||||
.getAppIcon(APP_NAME)
|
||||
.openMenu();
|
||||
final AppIconMenuItem menuItem0 = menu.getMenuItem(0);
|
||||
final AppIconMenuItem menuItem2 = menu.getMenuItem(2);
|
||||
|
||||
final AppIconMenuItem menuItem;
|
||||
|
||||
final String expectedShortcutName = "Shortcut 3";
|
||||
if (menuItem0.getText().equals(expectedShortcutName)) {
|
||||
menuItem = menuItem0;
|
||||
} else {
|
||||
final String shortcutName2 = menuItem2.getText();
|
||||
assertEquals("Wrong menu item", expectedShortcutName, shortcutName2);
|
||||
menuItem = menuItem2;
|
||||
}
|
||||
|
||||
menuItem.dragToWorkspace(false, false);
|
||||
mLauncher.getWorkspace().getWorkspaceAppIcon(shortcutName).launch(getAppPackageName());
|
||||
mLauncher.getWorkspace().getWorkspaceAppIcon(expectedShortcutName)
|
||||
.launch(getAppPackageName());
|
||||
} finally {
|
||||
allApps.unfreeze();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue