Merge "Combine icon app tests to allow overriding flag for new icon app chip menu testing as well." into main

This commit is contained in:
Pat Manning
2023-10-12 15:59:17 +00:00
committed by Android (Google) Code Review
7 changed files with 168 additions and 74 deletions
@@ -39,6 +39,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.platform.test.flag.junit.SetFlagsRule;
import android.system.OsConstants;
import android.util.Log;
@@ -48,6 +49,7 @@ import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.Until;
import com.android.launcher3.Flags;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
@@ -202,6 +204,22 @@ public abstract class AbstractLauncherUiTest {
@Rule
public ScreenRecordRule mScreenRecordRule = new ScreenRecordRule();
@Rule
public SetFlagsRule mSetFlagsRule = getFlagsRule();
// TODO(b/301555714): Remove when SetFlagsRule initializes flags to their default values.
private SetFlagsRule getFlagsRule() {
SetFlagsRule flagsRule = new SetFlagsRule();
flagsRule.disableFlags(
Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW,
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU,
Flags.FLAG_ENABLE_RESPONSIVE_WORKSPACE,
Flags.FLAG_ENABLE_CURSOR_HOVER_STATES,
Flags.FLAG_ENABLE_TWOLINE_ALLAPPS,
Flags.FLAG_ENABLE_EXPANDING_PAUSE_WORK_BUTTON);
return flagsRule;
}
protected void clearPackageData(String pkg) throws IOException, InterruptedException {
final CountDownLatch count = new CountDownLatch(2);
final SimpleBroadcastReceiver broadcastReceiver =