For #25808: Suppress deprecations in tests.

This commit is contained in:
mcarare 2022-11-16 14:01:44 +02:00 committed by mergify[bot]
parent 5ddeba154c
commit 3472933c37
5 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,7 @@ class SupportUtilsTest {
every { context.packageName } returns "org.mozilla.fenix"
every { context.packageManager } returns packageManager
@Suppress("DEPRECATION")
every { packageManager.getPackageInfo("org.mozilla.fenix", 0) } returns packageInfo
packageInfo.versionName = versionName

View File

@ -111,7 +111,9 @@ class ShareControllerTest {
// Check that the Intent used for querying apps has the expected structure
assertTrue(shareIntent.isCaptured)
assertEquals(Intent.ACTION_SEND, shareIntent.captured.action)
@Suppress("DEPRECATION")
assertEquals(shareSubject, shareIntent.captured.extras!![Intent.EXTRA_SUBJECT])
@Suppress("DEPRECATION")
assertEquals(textToShare, shareIntent.captured.extras!![Intent.EXTRA_TEXT])
assertEquals("text/plain", shareIntent.captured.type)
assertEquals(Intent.FLAG_ACTIVITY_NEW_DOCUMENT + Intent.FLAG_ACTIVITY_MULTIPLE_TASK, shareIntent.captured.flags)

View File

@ -17,6 +17,7 @@ class TabsTrayDialogTest {
val interactor = mockk<BrowserTrayInteractor>(relaxed = true)
val dialog = TabsTrayDialog(context, 0) { interactor }
@Suppress("DEPRECATION")
dialog.onBackPressed()
verify { interactor.onBackPressed() }

View File

@ -160,6 +160,7 @@ class SearchWidgetProviderTest {
assertEquals(SearchWidgetProvider::class.java.name, componentNameCaptor.captured.className)
assertEquals(SearchWidgetProvider::class.java.name, intentCaptor.captured.component!!.className)
assertEquals(AppWidgetManager.ACTION_APPWIDGET_UPDATE, intentCaptor.captured.action)
@Suppress("DEPRECATION")
assertEquals(widgetsToUpdate, intentCaptor.captured.extras!!.get(AppWidgetManager.EXTRA_APPWIDGET_IDS))
} finally {
unmockkStatic(AppWidgetManager::class)

View File

@ -122,6 +122,7 @@ class VoiceSearchActivityTest {
controller.create(savedInstanceState)
controller.saveInstanceState(outState)
@Suppress("DEPRECATION")
assertEquals(previousIntent, outState.getParcelable<Intent>(PREVIOUS_INTENT))
}