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

Commit 55549637 authored by Pierre Barbier de Reuille's avatar Pierre Barbier de Reuille
Browse files

Use isDeviceEligibleForDesktopMode in tests

Instead of isDesktopModeSupported as there are other ways to be
elligible for desktop mode now.

Bug: 393404767
Bug: 382238347
Test: atest DesktopModeWindowDecorViewModelAppHandleOnlyTest
Test: atest DesktopModeWindowDecorViewModelTests
Test: atest DesktopActivityOrientationChangeHandlerTest
Test: atest DesktopModeKeyGestureHandlerTest
Test: atest DesktopTasksControllerTest
Test: atest DesktopModeStatusTest
Test: atest DesktopModeWindowDecorViewModelAppHandleOnlyTest
Test: atest DesktopModeLaunchParamsModifierTests
Flag: EXEMPT (fix test)
Change-Id: I4b219f9fbd24b8fc52e5ed27e3d5a4009d1a8415
parent 9d4cbbde
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -113,7 +113,7 @@ class DesktopActivityOrientationChangeHandlerTest : ShellTestCase() {
                .strictness(Strictness.LENIENT)
                .strictness(Strictness.LENIENT)
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(DesktopModeStatus::class.java)
                .startMocking()
                .startMocking()
        doReturn(true).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
        doReturn(true).`when` { DesktopModeStatus.isDeviceEligibleForDesktopMode(any()) }


        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        shellInit = spy(ShellInit(testExecutor))
        shellInit = spy(ShellInit(testExecutor))
+1 −1
Original line number Original line Diff line number Diff line
@@ -112,7 +112,7 @@ class DesktopModeKeyGestureHandlerTest : ShellTestCase() {
                .strictness(Strictness.LENIENT)
                .strictness(Strictness.LENIENT)
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(DesktopModeStatus::class.java)
                .startMocking()
                .startMocking()
        doReturn(true).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
        doReturn(true).`when` { DesktopModeStatus.isDeviceEligibleForDesktopMode(any()) }


        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        shellInit = spy(ShellInit(testExecutor))
        shellInit = spy(ShellInit(testExecutor))
+1 −1
Original line number Original line Diff line number Diff line
@@ -290,7 +290,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(Toast::class.java)
                .spyStatic(Toast::class.java)
                .startMocking()
                .startMocking()
        doReturn(true).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
        doReturn(true).`when` { DesktopModeStatus.isDeviceEligibleForDesktopMode(any()) }


        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        testScope = CoroutineScope(Dispatchers.Unconfined + SupervisorJob())
        shellInit = spy(ShellInit(testExecutor))
        shellInit = spy(ShellInit(testExecutor))
+3 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,9 @@ import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
import org.mockito.kotlin.whenever


/**
 * Test class for [DesktopModeStatus].
 */
@SmallTest
@SmallTest
@Presubmit
@Presubmit
@EnableFlags(Flags.FLAG_SHOW_DESKTOP_WINDOWING_DEV_OPTION)
@EnableFlags(Flags.FLAG_SHOW_DESKTOP_WINDOWING_DEV_OPTION)
+1 −1
Original line number Original line Diff line number Diff line
@@ -67,7 +67,7 @@ class DesktopModeWindowDecorViewModelAppHandleOnlyTest :
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(DesktopModeStatus::class.java)
                .spyStatic(DragPositioningCallbackUtility::class.java)
                .spyStatic(DragPositioningCallbackUtility::class.java)
                .startMocking()
                .startMocking()
        doReturn(false).`when` { DesktopModeStatus.isDesktopModeSupported(any()) }
        doReturn(false).`when` { DesktopModeStatus.isDeviceEligibleForDesktopMode(any()) }
        doReturn(true).`when` { DesktopModeStatus.overridesShowAppHandle(any())}
        doReturn(true).`when` { DesktopModeStatus.overridesShowAppHandle(any())}
        setUpCommon()
        setUpCommon()
    }
    }
Loading