Search in sources :

Example 6 with ScreenRecord

use of com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord in project android_packages_apps_404Launcher by P-404.

the class TaplTestsQuickstep method testPressBack.

// TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation)
// after the bug resolved.
@Ignore("b/205027405")
@Test
@PortraitLandscape
@ScreenRecord
public void testPressBack() throws Exception {
    mLauncher.getWorkspace().switchToAllApps();
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
    AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
    allApps.freeze();
    try {
        allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
    } finally {
        allApps.unfreeze();
    }
    mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
Also used : AllApps(com.android.launcher3.tapl.AllApps) ScreenRecord(com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord) Ignore(org.junit.Ignore) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test)

Example 7 with ScreenRecord

use of com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord in project android_packages_apps_Launcher3 by ArrowOS.

the class TaplTestsQuickstep method testPressBack.

// TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation)
// after the bug resolved.
@Ignore("b/205027405")
@Test
@PortraitLandscape
@ScreenRecord
public void testPressBack() throws Exception {
    mLauncher.getWorkspace().switchToAllApps();
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
    AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
    allApps.freeze();
    try {
        allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
    } finally {
        allApps.unfreeze();
    }
    mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
Also used : AllApps(com.android.launcher3.tapl.AllApps) ScreenRecord(com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord) Ignore(org.junit.Ignore) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test)

Example 8 with ScreenRecord

use of com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord in project android_packages_apps_Launcher3 by AOSPA.

the class TaplTestsQuickstep method testPressBack.

// TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation)
// after the bug resolved.
@Ignore("b/205027405")
@Test
@PortraitLandscape
@ScreenRecord
public void testPressBack() throws Exception {
    mLauncher.getWorkspace().switchToAllApps();
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
    AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
    allApps.freeze();
    try {
        allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
    } finally {
        allApps.unfreeze();
    }
    mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
    mLauncher.pressBack();
    mLauncher.getWorkspace();
    waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
Also used : AllApps(com.android.launcher3.tapl.AllApps) ScreenRecord(com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord) Ignore(org.junit.Ignore) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test)

Example 9 with ScreenRecord

use of com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord in project android_packages_apps_Launcher3 by AOSPA.

the class TaplTestsQuickstep method testOverviewActions.

/**
 * Smoke test for action buttons: Presses all the buttons and makes sure no crashes occur.
 */
@Test
@NavigationModeSwitch
@PortraitLandscape
// b/195673272
@ScreenRecord
public void testOverviewActions() throws Exception {
    // Experimenting for b/165029151:
    final Overview overview = mLauncher.pressHome().switchToOverview();
    if (overview.hasTasks())
        overview.dismissAllTasks();
    mLauncher.pressHome();
    // 
    startTestAppsWithCheck();
    OverviewActions actionsView = mLauncher.pressHome().switchToOverview().getOverviewActions();
    actionsView.clickAndDismissScreenshot();
}
Also used : OverviewActions(com.android.launcher3.tapl.OverviewActions) Overview(com.android.launcher3.tapl.Overview) ScreenRecord(com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test) NavigationModeSwitch(com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch)

Aggregations

LargeTest (androidx.test.filters.LargeTest)9 ScreenRecord (com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord)9 Test (org.junit.Test)9 AllApps (com.android.launcher3.tapl.AllApps)4 Overview (com.android.launcher3.tapl.Overview)4 OverviewActions (com.android.launcher3.tapl.OverviewActions)4 NavigationModeSwitch (com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch)4 Ignore (org.junit.Ignore)4 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)1 AppWidgetNoConfig (com.android.launcher3.testcomponent.AppWidgetNoConfig)1 RequestPinItemActivity (com.android.launcher3.testcomponent.RequestPinItemActivity)1 AbstractLauncherUiTest (com.android.launcher3.ui.AbstractLauncherUiTest)1