use of com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE in project android_packages_apps_Launcher3 by crdroidandroid.
the class ModelMultiCallbacksTest method setUp.
@Before
public void setUp() throws Exception {
mModelHelper = new LauncherModelHelper();
mModelHelper.installApp(TEST_PACKAGE);
mSpm = shadowOf(RuntimeEnvironment.application.getPackageManager());
// Since robolectric tests run on main thread, we run the loader-UI calls on a temp thread,
// so that we can wait appropriately for the loader to complete.
mTempMainExecutor = new LooperExecutor(createAndStartNewLooper("tempMain"));
ShadowLooperExecutor sle = Shadow.extract(Executors.MAIN_EXECUTOR);
sle.setHandler(mTempMainExecutor.getHandler());
}
use of com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE in project android_packages_apps_Launcher3 by crdroidandroid.
the class SDWorkModeTest method setup.
@Before
public void setup() throws Exception {
mModelHelper = new LauncherModelHelper();
mTargetContext = RuntimeEnvironment.application;
mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
Settings.Global.putFloat(mTargetContext.getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, 0);
mModelHelper.installApp(TEST_PACKAGE);
}
use of com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherUIScrollTest method testAllAppsScroll.
@Test
public void testAllAppsScroll() throws Exception {
// Install 100 apps
for (int i = 0; i < 100; i++) {
mModelHelper.installApp(TEST_PACKAGE + i);
}
// Bind and open all-apps
Launcher launcher = loadLauncher();
launcher.getStateManager().goToState(LauncherState.ALL_APPS, false);
doLayout(launcher);
int currentScroll = launcher.getAppsView().getActiveRecyclerView().getCurrentScrollY();
launcher.dispatchGenericMotionEvent(createScrollEvent(-1));
int newScroll = launcher.getAppsView().getActiveRecyclerView().getCurrentScrollY();
assertNotEquals("All Apps was not scrolled", currentScroll, newScroll);
assertEquals("Workspace was scrolled", 0, launcher.getWorkspace().getNextPage());
}
use of com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherUIScrollTest method setup.
@Before
public void setup() throws Exception {
mModelHelper = new LauncherModelHelper();
mTargetContext = RuntimeEnvironment.application;
mIdp = InvariantDeviceProfile.INSTANCE.get(mTargetContext);
Settings.Global.putFloat(mTargetContext.getContentResolver(), Settings.Global.WINDOW_ANIMATION_SCALE, 0);
mModelHelper.installApp(TEST_PACKAGE);
// LayoutBuilder with 3 workspace pages
mLayoutBuilder = new LauncherLayoutBuilder().atWorkspace(0, mIdp.numRows - 1, 0).putApp(TEST_PACKAGE, TEST_PACKAGE).atWorkspace(0, mIdp.numRows - 1, 1).putApp(TEST_PACKAGE, TEST_PACKAGE).atWorkspace(0, mIdp.numRows - 1, 2).putApp(TEST_PACKAGE, TEST_PACKAGE);
}
use of com.android.launcher3.util.LauncherModelHelper.TEST_PACKAGE in project Neo-Launcher by NeoApplications.
the class GridSizeMigrationTaskTest method setUp.
@Before
public void setUp() {
mValidPackages = new HashSet<>();
mValidPackages.add(TEST_PACKAGE);
mIdp = new InvariantDeviceProfile();
}
Aggregations