Search in sources :

Example 1 with ScreenRecord

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

the class RequestPinItemTest method testPinWidgetNoConfig_customPreview.

@Test
// b/192005114
@ScreenRecord
public void testPinWidgetNoConfig_customPreview() throws Throwable {
    // Command to set custom preview
    Intent command = RequestPinItemActivity.getCommandIntent(RequestPinItemActivity.class, "setRemoteViewColor").putExtra(RequestPinItemActivity.EXTRA_PARAM + "0", Color.RED);
    runTest("pinWidgetNoConfig", true, (info, view) -> info instanceof LauncherAppWidgetInfo && ((LauncherAppWidgetInfo) info).appWidgetId == mAppWidgetId && ((LauncherAppWidgetInfo) info).providerName.getClassName().equals(AppWidgetNoConfig.class.getName()), command);
}
Also used : Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) LauncherAppWidgetInfo(com.android.launcher3.model.data.LauncherAppWidgetInfo) RequestPinItemActivity(com.android.launcher3.testcomponent.RequestPinItemActivity) AppWidgetNoConfig(com.android.launcher3.testcomponent.AppWidgetNoConfig) ScreenRecord(com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord) AbstractLauncherUiTest(com.android.launcher3.ui.AbstractLauncherUiTest) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test)

Example 2 with ScreenRecord

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

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)

Example 3 with ScreenRecord

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

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 4 with ScreenRecord

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

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)

Example 5 with ScreenRecord

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

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