mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Revert "TAPL: Verifying activity start/stop events"
This reverts commit 1186700c9a.
Reason for revert: Fails in the lab
Change-Id: I6715a058c76d96752b904331968b46a07ce93f85
This commit is contained in:
@@ -36,7 +36,7 @@ public abstract class DelegateInputConsumer implements InputConsumer {
|
||||
|
||||
protected void setActive(MotionEvent ev) {
|
||||
mState = STATE_ACTIVE;
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
|
||||
mInputMonitor.pilferPointers();
|
||||
|
||||
// Send cancel event
|
||||
|
||||
@@ -204,7 +204,7 @@ public class DeviceLockedInputConsumer implements InputConsumer,
|
||||
|
||||
private void startRecentsTransition() {
|
||||
mThresholdCrossed = true;
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
|
||||
mInputMonitorCompat.pilferPointers();
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN)
|
||||
|
||||
@@ -309,7 +309,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
if (mInteractionHandler == null) {
|
||||
return;
|
||||
}
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
|
||||
mInputMonitorCompat.pilferPointers();
|
||||
|
||||
mActivityInterface.closeOverlay();
|
||||
|
||||
@@ -108,7 +108,7 @@ public class OverviewInputConsumer<T extends BaseDraggingActivity>
|
||||
ActiveGestureLog.INSTANCE.addLog("startQuickstep");
|
||||
}
|
||||
if (mInputMonitor != null) {
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
|
||||
mInputMonitor.pilferPointers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class OverviewWithoutFocusInputConsumer implements InputConsumer {
|
||||
|
||||
private void onInterceptTouch() {
|
||||
if (mInputMonitor != null) {
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "pilferPointers");
|
||||
mInputMonitor.pilferPointers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ public class AppPredictionsUITests extends AbstractQuickStepTest {
|
||||
*/
|
||||
@Test
|
||||
public void testPredictionExistsInAllApps() {
|
||||
mDevice.pressHome();
|
||||
mLauncher.pressHome().switchToAllApps();
|
||||
|
||||
// Dispatch an update
|
||||
|
||||
@@ -941,7 +941,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
|
||||
|
||||
// Workaround for b/78520668, explicitly trim memory once UI is hidden
|
||||
onTrimMemory(TRIM_MEMORY_UI_HIDDEN);
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStop");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -955,7 +954,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
|
||||
|
||||
mAppWidgetHost.setListenIfResumed(true);
|
||||
TraceHelper.INSTANCE.endSection(traceToken);
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Activity.onStart");
|
||||
}
|
||||
|
||||
private void handleDeferredResume() {
|
||||
|
||||
@@ -35,7 +35,6 @@ public final class TestProtocol {
|
||||
public static final String TAPL_EVENTS_TAG = "TaplEvents";
|
||||
public static final String SEQUENCE_MAIN = "Main";
|
||||
public static final String SEQUENCE_TIS = "TIS";
|
||||
public static final String SEQUENCE_PILFER = "Pilfer";
|
||||
|
||||
public static String stateOrdinalToString(int ordinal) {
|
||||
switch (ordinal) {
|
||||
|
||||
@@ -72,7 +72,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
}
|
||||
|
||||
protected void goToOverviewUnchecked() {
|
||||
final boolean launcherWasVisible = mLauncher.isLauncherVisible();
|
||||
switch (mLauncher.getNavigationModel()) {
|
||||
case ZERO_BUTTON: {
|
||||
final int centerX = mLauncher.getDevice().getDisplayWidth() / 2;
|
||||
@@ -138,10 +137,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
OVERVIEW_STATE_ORDINAL);
|
||||
break;
|
||||
}
|
||||
if (!launcherWasVisible) {
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_START_ACTIVITY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +157,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
}
|
||||
|
||||
protected void quickSwitchToPreviousApp(int expectedState) {
|
||||
final boolean launcherWasVisible = mLauncher.isLauncherVisible();
|
||||
boolean transposeInLandscape = false;
|
||||
switch (mLauncher.getNavigationModel()) {
|
||||
case TWO_BUTTON:
|
||||
@@ -186,17 +180,15 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
endX = startX;
|
||||
endY = 0;
|
||||
}
|
||||
final boolean launcherIsVisible =
|
||||
mLauncher.hasLauncherObject(By.textStartsWith(""));
|
||||
final boolean isZeroButton = mLauncher.getNavigationModel()
|
||||
== LauncherInstrumentation.NavigationModel.ZERO_BUTTON;
|
||||
if (!launcherWasVisible) {
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN,
|
||||
LauncherInstrumentation.EVENT_START_ACTIVITY);
|
||||
}
|
||||
mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState,
|
||||
launcherWasVisible && isZeroButton
|
||||
launcherIsVisible && isZeroButton
|
||||
? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE
|
||||
: LauncherInstrumentation.GestureScope.OUTSIDE);
|
||||
: LauncherInstrumentation.GestureScope.OUTSIDE
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -204,11 +196,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
// Double press the recents button.
|
||||
UiObject2 recentsButton = mLauncher.waitForSystemUiObject("recent_apps");
|
||||
mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT);
|
||||
if (!launcherWasVisible) {
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN,
|
||||
LauncherInstrumentation.EVENT_START_ACTIVITY);
|
||||
}
|
||||
mLauncher.runToState(() -> recentsButton.click(), OVERVIEW_STATE_ORDINAL);
|
||||
mLauncher.getOverview();
|
||||
mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, SQUARE_BUTTON_EVENT);
|
||||
@@ -216,8 +203,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
|
||||
break;
|
||||
}
|
||||
mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT);
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY);
|
||||
}
|
||||
|
||||
protected String getSwipeHeightRequestName() {
|
||||
|
||||
@@ -25,8 +25,6 @@ import androidx.test.uiautomator.BySelector;
|
||||
import androidx.test.uiautomator.UiObject2;
|
||||
import androidx.test.uiautomator.Until;
|
||||
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
|
||||
/**
|
||||
* Ancestor for AppIcon and AppMenuItem.
|
||||
*/
|
||||
@@ -64,8 +62,6 @@ abstract class Launchable {
|
||||
event -> event.getEventType() == TYPE_WINDOW_STATE_CHANGED,
|
||||
() -> "Launching an app didn't open a new window: " + mObject.getText());
|
||||
expectActivityStartEvents();
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY);
|
||||
|
||||
mLauncher.assertTrue(
|
||||
"App didn't start: " + selector,
|
||||
|
||||
@@ -97,8 +97,6 @@ public final class LauncherInstrumentation {
|
||||
private static final Pattern EVENT_TOUCH_UP = getTouchEventPattern("ACTION_UP");
|
||||
private static final Pattern EVENT_TOUCH_CANCEL = getTouchEventPattern("ACTION_CANCEL");
|
||||
private static final Pattern EVENT_PILFER_POINTERS = Pattern.compile("pilferPointers");
|
||||
static final Pattern EVENT_START_ACTIVITY = Pattern.compile("Activity\\.onStart");
|
||||
static final Pattern EVENT_STOP_ACTIVITY = Pattern.compile("Activity\\.onStop");
|
||||
|
||||
static final Pattern EVENT_TOUCH_DOWN_TIS = getTouchEventPatternTIS("ACTION_DOWN");
|
||||
static final Pattern EVENT_TOUCH_UP_TIS = getTouchEventPatternTIS("ACTION_UP");
|
||||
@@ -611,7 +609,6 @@ public final class LauncherInstrumentation {
|
||||
// otherwise waitForIdle may return immediately in case when there was a big enough
|
||||
// pause in accessibility events prior to pressing Home.
|
||||
final String action;
|
||||
final boolean launcherWasVisible = isLauncherVisible();
|
||||
if (getNavigationModel() == NavigationModel.ZERO_BUTTON) {
|
||||
checkForAnomaly();
|
||||
|
||||
@@ -640,18 +637,12 @@ public final class LauncherInstrumentation {
|
||||
displaySize.x / 2, displaySize.y - 1,
|
||||
displaySize.x / 2, 0,
|
||||
ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL,
|
||||
launcherWasVisible
|
||||
hasLauncherObject(By.textStartsWith(""))
|
||||
? GestureScope.INSIDE_TO_OUTSIDE
|
||||
: GestureScope.OUTSIDE);
|
||||
}
|
||||
if (!launcherWasVisible) {
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!launcherWasVisible) {
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_START_ACTIVITY);
|
||||
}
|
||||
log("Hierarchy before clicking home:");
|
||||
dumpViewHierarchy();
|
||||
log(action = "clicking home button from " + getVisibleStateMessage());
|
||||
@@ -662,7 +653,6 @@ public final class LauncherInstrumentation {
|
||||
expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_DOWN_TIS);
|
||||
expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_UP_TIS);
|
||||
}
|
||||
|
||||
runToState(
|
||||
waitForSystemUiObject("home")::click,
|
||||
NORMAL_STATE_ORDINAL,
|
||||
@@ -679,10 +669,6 @@ public final class LauncherInstrumentation {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isLauncherVisible() {
|
||||
return hasLauncherObject(By.textStartsWith(""));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Workspace object if the current state is "active home", i.e. workspace. Fails if the
|
||||
* launcher is not in that state.
|
||||
@@ -1101,7 +1087,7 @@ public final class LauncherInstrumentation {
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (gestureScope != GestureScope.INSIDE) {
|
||||
expectEvent(TestProtocol.SEQUENCE_PILFER, EVENT_PILFER_POINTERS);
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_PILFER_POINTERS);
|
||||
}
|
||||
if (gestureScope != GestureScope.OUTSIDE) {
|
||||
expectEvent(TestProtocol.SEQUENCE_MAIN, gestureScope == GestureScope.INSIDE
|
||||
|
||||
@@ -79,8 +79,6 @@ public final class OverviewTask {
|
||||
() -> "Launching task didn't open a new window: "
|
||||
+ mTask.getParent().getContentDescription());
|
||||
mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, TASK_START_EVENT);
|
||||
mLauncher.expectEvent(
|
||||
TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_STOP_ACTIVITY);
|
||||
}
|
||||
return new Background(mLauncher);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user