From fd4fce73762ccb07dfa299dcf21209f7e83442da Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Fri, 25 Aug 2023 14:52:44 -0400 Subject: Disables failing tests in ChooserActionFactoryTest Currently these tests pass because there is no assertion on the return value of CountDownLatch.await(...) Once added, both timeout consistently given any amount of time. Bug: 297551329 Test: atest ChooserActionFactoryTest Change-Id: I0775d29f1eb0dd639ef6108ccccf676dabde3e2f --- .../com/android/intentresolver/ChooserActionFactoryTest.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'java') diff --git a/java/tests/src/com/android/intentresolver/ChooserActionFactoryTest.kt b/java/tests/src/com/android/intentresolver/ChooserActionFactoryTest.kt index af6e5f16..7f06e683 100644 --- a/java/tests/src/com/android/intentresolver/ChooserActionFactoryTest.kt +++ b/java/tests/src/com/android/intentresolver/ChooserActionFactoryTest.kt @@ -35,7 +35,9 @@ import java.util.concurrent.TimeUnit import java.util.function.Consumer import org.junit.After import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue import org.junit.Before +import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito @@ -75,6 +77,7 @@ class ChooserActionFactoryTest { context.unregisterReceiver(testReceiver) } + @Ignore("b/297551329") @Test fun testCreateCustomActions() { val factory = createFactory() @@ -90,7 +93,7 @@ class ChooserActionFactoryTest { Mockito.verify(logger).logCustomActionSelected(eq(0)) assertEquals(Activity.RESULT_OK, resultConsumer.latestReturn) // Verify the pending intent has been called - countdown.await(500, TimeUnit.MILLISECONDS) + assertTrue("Timed out waiting for broadcast", countdown.await(2500, TimeUnit.MILLISECONDS)) } @Test @@ -100,6 +103,7 @@ class ChooserActionFactoryTest { assertThat(factory.modifyShareAction).isNull() } + @Ignore("b/297551329") @Test fun testModifyShareAction() { val factory = createFactory(includeModifyShare = true) @@ -107,11 +111,10 @@ class ChooserActionFactoryTest { val action = factory.modifyShareAction ?: error("Modify share action should not be null") action.onClicked.run() - Mockito.verify(logger) - .logActionSelected(eq(EventLog.SELECTION_TYPE_MODIFY_SHARE)) + Mockito.verify(logger).logActionSelected(eq(EventLog.SELECTION_TYPE_MODIFY_SHARE)) assertEquals(Activity.RESULT_OK, resultConsumer.latestReturn) // Verify the pending intent has been called - countdown.await(500, TimeUnit.MILLISECONDS) + assertTrue("Timed out waiting for broadcast", countdown.await(2500, TimeUnit.MILLISECONDS)) } @Test -- cgit v1.2.3-59-g8ed1b