Merge "Fixing TaplTests" into udc-dev
This commit is contained in:
@@ -23,6 +23,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.tapl.Overview;
|
||||
import com.android.launcher3.tapl.Taskbar;
|
||||
import com.android.launcher3.ui.AbstractLauncherUiTest;
|
||||
import com.android.launcher3.ui.TaplTestsLauncher3;
|
||||
@@ -57,7 +58,10 @@ public class AbstractTaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
"com.android.launcher3.testcomponent.BaseTestingActivity");
|
||||
mLauncherLayout = TestUtil.setLauncherDefaultLayout(mTargetContext, layoutBuilder);
|
||||
TaplTestsLauncher3.initialize(this);
|
||||
|
||||
Overview overview = mLauncher.getWorkspace().switchToOverview();
|
||||
if (overview.hasTasks()) {
|
||||
overview.dismissAllTasks();
|
||||
}
|
||||
startAppFast(CALCULATOR_APP_PACKAGE);
|
||||
mLauncher.enableBlockTimeout(true);
|
||||
mLauncher.showTaskbarIfHidden();
|
||||
@@ -65,7 +69,6 @@ public class AbstractTaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
setTaskbarMode(mLauncher, mTaskbarWasInTransientMode);
|
||||
mLauncher.enableBlockTimeout(false);
|
||||
if (mLauncherLayout != null) {
|
||||
mLauncherLayout.close();
|
||||
|
||||
@@ -29,13 +29,6 @@ import org.junit.runner.RunWith;
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class TaplTestsPersistentTaskbar extends AbstractTaplTestsTaskbar {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
mTaskbarWasInTransientMode = isTaskbarInTransientMode(mTargetContext);
|
||||
setTaskbarMode(mLauncher, false);
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch(mode = PERSISTENT)
|
||||
public void testHideShowTaskbar() {
|
||||
|
||||
@@ -20,7 +20,6 @@ import static com.android.quickstep.TaplTestsTaskbar.TaskbarMode.TRANSIENT;
|
||||
|
||||
import androidx.test.filters.LargeTest;
|
||||
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -58,14 +57,19 @@ public class TaplTestsTaskbar extends AbstractTaplTestsTaskbar {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
setTaskbarMode(mLauncher, mTaskbarWasInTransientMode);
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLaunchApp() {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
|
||||
// We are using parameterized test runner to share code between different test cases with
|
||||
// taskbar variants. But, sometimes we only need to assert things for particular Taskbar
|
||||
// variants.
|
||||
if (isTaskbarTestModeTransient() && mLauncher.getNavigationModel()
|
||||
!= LauncherInstrumentation.NavigationModel.THREE_BUTTON) {
|
||||
if (isTaskbarTestModeTransient()) {
|
||||
mLauncher.getLaunchedAppState().assertTaskbarHidden();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,6 @@ import org.junit.runner.RunWith;
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class TaplTestsTransientTaskbar extends AbstractTaplTestsTaskbar {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
mTaskbarWasInTransientMode = isTaskbarInTransientMode(mTargetContext);
|
||||
setTaskbarMode(mLauncher, true);
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch(mode = TRANSIENT)
|
||||
public void testShowTaskbarUnstashHintOnHover() {
|
||||
|
||||
Reference in New Issue
Block a user