Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 525163d0 authored by Andy Wickham's avatar Andy Wickham Committed by Android (Google) Code Review
Browse files

Merge "Use setFlags to disable two line toggle flag in tests." into main

parents e98d88ef b177c922
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import android.content.Context
import android.content.res.Configuration
import android.graphics.Point
import android.graphics.Rect
import android.platform.test.flag.junit.SetFlagsRule
import android.platform.test.rule.AllowedDevices
import android.platform.test.rule.DeviceProduct
import android.platform.test.rule.IgnoreLimit
@@ -33,6 +34,7 @@ import com.android.launcher3.util.MainThreadInitializedObject.SandboxContext
import com.android.launcher3.util.NavigationMode
import com.android.launcher3.util.WindowBounds
import com.android.launcher3.util.rule.TestStabilityRule
import com.android.launcher3.util.rule.setFlags
import com.android.launcher3.util.window.CachedDisplayInfo
import com.android.launcher3.util.window.WindowManagerProxy
import com.google.common.truth.Truth
@@ -64,6 +66,8 @@ abstract class AbstractDeviceProfileTest {
    private val windowManagerProxy: WindowManagerProxy = mock()
    private val launcherPrefs: LauncherPrefs = mock()

    @get:Rule val setFlagsRule = SetFlagsRule(SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT)

    @Rule @JvmField val testStabilityRule = TestStabilityRule()

    @Rule @JvmField val limitDevicesRule = LimitDevicesRule()
@@ -270,6 +274,7 @@ abstract class AbstractDeviceProfileTest {
        isGestureMode: Boolean = true,
        densityDpi: Int
    ) {
        setFlagsRule.setFlags(false, Flags.FLAG_ENABLE_TWOLINE_TOGGLE)
        val windowsBounds = perDisplayBoundsCache[displayInfo]!!
        val realBounds = windowsBounds[rotation]
        whenever(windowManagerProxy.getDisplayInfo(any())).thenReturn(displayInfo)
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ public class BubbleTextViewTest {
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        Utilities.enableRunningInTestHarnessForTests();
        mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_TWOLINE_TOGGLE);
        mContext = new ActivityContextWrapper(getApplicationContext());
        mBubbleTextView = new BubbleTextView(mContext);
        mBubbleTextView.reset();