Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ca50490 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Making some classess accessible in multivalent tests

Bug: 297950111
Flag: None
Test: Presubmit
Change-Id: I2e4b18fc279cb96b3f68d64f95703c11bb885b2a
parent 3a7432d7
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -190,16 +190,14 @@ public class TaplViewInflationDuringSwipeUp extends AbstractQuickStepTest {
            info.spanX = 2;
            info.spanY = 2;
            AtomicInteger widgetId = new AtomicInteger();
            new FavoriteItemsTransaction(mTargetContext)

            commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext)
                    .addItem(() -> {
                        LauncherAppWidgetInfo item = createWidgetInfo(info, mTargetContext, true);
                        item.screenId = FIRST_SCREEN_ID;
                        widgetId.set(item.appWidgetId);
                        return item;
                    })
                    .commitAndLoadHome(mLauncher);


                    }));

            assertTrue("Widget is not present",
                    mLauncher.goHome().tryGetWidget(info.label, DEFAULT_UI_TIMEOUT) != null);
+1 −47
Original line number Diff line number Diff line
@@ -40,32 +40,6 @@ filegroup {
    ],
}

// Source code used for screenshot tests
filegroup {
    name: "launcher-image-tests-helpers",
    srcs: [
        "src/com/android/launcher3/celllayout/board/*.java",
        "src/com/android/launcher3/celllayout/board/*.kt",
        "src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java",
        "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
        "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
        "src/com/android/launcher3/ui/TestViewHelpers.java",
        "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
        "src/com/android/launcher3/util/ModelTestExtensions.kt",
        "src/com/android/launcher3/util/TestConstants.java",
        "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
        "src/com/android/launcher3/util/Wait.java",
        "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
        "src/com/android/launcher3/util/rule/*.java",
        "src/com/android/launcher3/util/rule/*.kt",
        "multivalentTests/src/com/android/launcher3/util/rule/*.java",
        "multivalentTests/src/com/android/launcher3/util/rule/*.kt",
        "src/com/android/launcher3/util/viewcapture_analysis/*.java",
        "src/com/android/launcher3/testcomponent/*.java",
        "src/com/android/launcher3/testcomponent/*.kt",
    ],
}

// Source code used for non-quickstep tests
filegroup {
    name: "launcher-non-quickstep-tests-src",
@@ -79,35 +53,15 @@ filegroup {
filegroup {
    name: "launcher-oop-tests-src",
    srcs: [
        ":launcher-testing-helpers",
        "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java",
        "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java",
        "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java",
        "src/com/android/launcher3/dragging/TaplDragTest.java",
        "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java",
        "src/com/android/launcher3/ui/AbstractLauncherUiTest.java",
        "src/com/android/launcher3/ui/PortraitLandscapeRunner.java",
        "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java",
        "src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java",
        "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java",
        "multivalentTests/src/com/android/launcher3/util/LauncherLayoutBuilder.java",
        "src/com/android/launcher3/util/TestConstants.java",
        "multivalentTests/src/com/android/launcher3/util/TestUtil.java",
        "src/com/android/launcher3/util/Wait.java",
        "multivalentTests/src/com/android/launcher3/util/WidgetUtils.java",
        "src/com/android/launcher3/util/rule/FailureWatcher.java",
        "src/com/android/launcher3/util/rule/ViewCaptureRule.kt",
        "src/com/android/launcher3/util/rule/SamplerRule.java",
        "src/com/android/launcher3/util/rule/ScreenRecordRule.java",
        "src/com/android/launcher3/util/rule/ShellCommandRule.java",
        "src/com/android/launcher3/util/rule/TestIsolationRule.java",
        "multivalentTests/src/com/android/launcher3/util/rule/TestStabilityRule.java",
        "src/com/android/launcher3/util/viewcapture_analysis/*.java",
        "src/com/android/launcher3/testcomponent/BaseTestingActivity.java",
        "src/com/android/launcher3/testcomponent/OtherBaseTestingActivity.java",
        "src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java",
        "src/com/android/launcher3/testcomponent/TestCommandReceiver.java",
        "src/com/android/launcher3/testcomponent/TestLauncherActivity.java",
        "src/com/android/launcher3/testcomponent/ImeTestActivity.java",
    ],
}

+0 −16
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package com.android.launcher3.celllayout;

import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;

import static com.android.launcher3.LauncherSettings.Favorites.TABLE_NAME;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -24,8 +22,6 @@ import static com.android.launcher3.util.TestUtil.runOnExecutorSync;

import android.content.Context;

import androidx.test.uiautomator.UiDevice;

import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherSettings;
@@ -33,7 +29,6 @@ import com.android.launcher3.model.ModelDbController;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.provider.LauncherDbUtils.SQLiteTransaction;
import com.android.launcher3.tapl.LauncherInstrumentation;
import com.android.launcher3.util.ContentWriter;
import com.android.launcher3.util.ModelTestExtensions;

@@ -106,15 +101,4 @@ public class FavoriteItemsTransaction {
        runOnExecutorSync(MAIN_EXECUTOR, model::forceReload);
        ModelTestExtensions.INSTANCE.loadModelSync(model);
    }

    /**
     * Commits the transaction and waits for home load
     */
    public void commitAndLoadHome(LauncherInstrumentation inst) {
        commit();

        // Launch the home activity
        UiDevice.getInstance(getInstrumentation()).pressHome();
        inst.waitForLauncherInitialized();
    }
}
Loading