use of com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch in project Neo-Launcher by NeoApplications.
the class TaplTestsQuickstep method testBackground.
@Test
@NavigationModeSwitch
@PortraitLandscape
public void testBackground() throws Exception {
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
final Background background = getAndAssertBackground();
assertNotNull("Background.switchToOverview() returned null", background.switchToOverview());
assertTrue("Launcher internal state didn't switch to Overview", isInState(LauncherState.OVERVIEW));
}
use of com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch in project android_packages_apps_Trebuchet by LineageOS.
the class TaplTestsQuickstep method testBackground.
@Test
@NavigationModeSwitch
@PortraitLandscape
public void testBackground() throws Exception {
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
final Background background = getAndAssertBackground();
assertNotNull("Background.switchToOverview() returned null", background.switchToOverview());
assertTrue("Launcher internal state didn't switch to Overview", isInState(() -> LauncherState.OVERVIEW));
}
use of com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch in project android_packages_apps_Launcher3 by ArrowOS.
the class TaplTestsQuickstep method testQuickSwitchFromApp.
@Test
@NavigationModeSwitch
@PortraitLandscape
public void testQuickSwitchFromApp() throws Exception {
startTestActivity(2);
startTestActivity(3);
startTestActivity(4);
Background background = getAndAssertBackground();
background.quickSwitchToPreviousApp();
assertTrue("The first app we should have quick switched to is not running", isTestActivityRunning(3));
background = getAndAssertBackground();
background.quickSwitchToPreviousApp();
if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) {
// 3-button mode toggles between 2 apps, rather than going back further.
assertTrue("Second quick switch should have returned to the first app.", isTestActivityRunning(4));
} else {
assertTrue("The second app we should have quick switched to is not running", isTestActivityRunning(2));
}
background = getAndAssertBackground();
background.quickSwitchToPreviousAppSwipeLeft();
assertTrue("The 2nd app we should have quick switched to is not running", isTestActivityRunning(3));
background = getAndAssertBackground();
background.switchToOverview();
}
use of com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch in project android_packages_apps_Launcher3 by ArrowOS.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
use of com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch in project android_packages_apps_Launcher3 by ProtonAOSP.
the class ViewInflationDuringSwipeUp method testSwipeUp_with_list_widgets.
@Test
@NavigationModeSwitch(mode = ZERO_BUTTON)
// until b/190729479 is fixed
@Suppress
public void testSwipeUp_with_list_widgets() {
SimpleViewsFactory viewFactory = new SimpleViewsFactory();
viewFactory.viewCount = 1;
Bundle args = new Bundle();
args.putBinder(EXTRA_VALUE, viewFactory.toBinder());
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, args);
try {
executeSwipeUpTestWithWidget(widgetId -> {
// Initialize widget
RemoteViews views = createMainWidgetViews("List widget title");
views.setRemoteAdapter(android.R.id.list, new Intent(getContext(), ListViewService.class));
AppWidgetManager.getInstance(getContext()).updateAppWidget(widgetId, views);
verifyWidget(viewFactory.getLabel(0));
}, widgetId -> {
// Update widget
viewFactory.viewCount = 2;
AppWidgetManager.getInstance(getContext()).notifyAppWidgetViewDataChanged(widgetId, android.R.id.list);
}, viewFactory.getLabel(1));
} finally {
TestCommandReceiver.callCommand(SET_LIST_VIEW_SERVICE_BINDER, null, new Bundle());
}
}
Aggregations