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

Commit 964ab035 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Automerger Merge Worker
Browse files

Merge "Make sure that views process posted messages" into udc-dev am: 8fd7f194

parents 363eb51c 8fd7f194
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -60,6 +60,12 @@ class ControlsFavoritingActivityTest : SysuiTestCase() {
            }
        val TEST_STRUCTURE: CharSequence = "TestStructure"
        val TEST_APP: CharSequence = "TestApp"

        private fun View.waitForPost() {
            val latch = CountDownLatch(1)
            post(latch::countDown)
            latch.await()
        }
    }

    @Main private val executor: Executor = MoreExecutors.directExecutor()
@@ -140,7 +146,10 @@ class ControlsFavoritingActivityTest : SysuiTestCase() {
            val rearrangeButton = requireViewById<Button>(R.id.rearrange)
            assertThat(rearrangeButton.visibility).isEqualTo(View.VISIBLE)
            assertThat(rearrangeButton.isEnabled).isFalse()
            assertThat(requireViewById<Button>(R.id.other_apps).visibility).isEqualTo(View.GONE)

            val otherAppsButton = requireViewById<Button>(R.id.other_apps)
            otherAppsButton.waitForPost()
            assertThat(otherAppsButton.visibility).isEqualTo(View.GONE)
        }
    }

@@ -160,7 +169,10 @@ class ControlsFavoritingActivityTest : SysuiTestCase() {
            val rearrangeButton = requireViewById<Button>(R.id.rearrange)
            assertThat(rearrangeButton.visibility).isEqualTo(View.GONE)
            assertThat(rearrangeButton.isEnabled).isFalse()
            assertThat(requireViewById<Button>(R.id.other_apps).visibility).isEqualTo(View.VISIBLE)

            val otherAppsButton = requireViewById<Button>(R.id.other_apps)
            otherAppsButton.waitForPost()
            assertThat(otherAppsButton.visibility).isEqualTo(View.VISIBLE)
        }
    }