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

Commit 5cec59a4 authored by Toshiki Kikuchi's avatar Toshiki Kikuchi
Browse files

Reset taskbarModePreference on tearDown()

This CL forcefully resets taskbarModePreference on tearDown() to ensure
the following tests are not affected by the changes made by
`testTaskbarPinningChangeInLockedTaskbarChange`.

Bug: 368322666
Flag: EXEMPT bug fix
Test: nexus_unit_test_multi_device_platform
Change-Id: I8bd8e8ca8b4b832ed17e86fbdfc9bda7bf9ab16e
parent 49699b73
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.launcher3.util.window.WindowManagerProxy
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
import kotlin.math.min
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -137,6 +138,13 @@ class DisplayControllerTest {
        displayController.addChangeListener(displayInfoChangeListener)
    }

    @After
    fun tearDown() {
        // We need to reset the taskbar mode preference override even if a test throws an exception.
        // Otherwise, it may break the following tests' assumptions.
        DisplayController.enableTaskbarModePreferenceForTests(false)
    }

    @Test
    @UiThreadTest
    fun testRotation() {