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

Platinum exlude cl update: cl/572225659

Test: TaplOverviewAppIconMenuTest
Test: TaplAppIconAppChipMenuTest
Bug: 303329286
Bug: 303266562
Fix: 304470271
Change-Id: I4ca163401d6a42961e8955e06c164af0254b1231
This commit is contained in:
Pat Manning
2023-10-10 14:08:14 +01:00
parent e0a25fbd51
commit 236e738907
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 =