From a935dda783a76ffb1f9a95cdb4c23cd4f2e6d521 Mon Sep 17 00:00:00 2001 From: mcarare Date: Tue, 12 Jul 2022 09:38:36 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/25980: Replace deprecated popUpTo var. --- .../org/mozilla/fenix/home/intent/StartSearchIntentProcessor.kt | 2 +- app/src/test/java/org/mozilla/fenix/ext/MockKMatcherScope.kt | 2 +- .../mozilla/fenix/home/intent/StartSearchIntentProcessorTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessor.kt b/app/src/main/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessor.kt index feadb19004..adde11b877 100644 --- a/app/src/main/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessor.kt +++ b/app/src/main/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessor.kt @@ -48,7 +48,7 @@ class StartSearchIntentProcessor : HomeIntentProcessor { } directions?.let { val options = navOptions { - popUpTo = R.id.homeFragment + popUpTo(R.id.homeFragment) } navController.nav(null, it, options) } diff --git a/app/src/test/java/org/mozilla/fenix/ext/MockKMatcherScope.kt b/app/src/test/java/org/mozilla/fenix/ext/MockKMatcherScope.kt index 81e810676d..ace18a0e70 100644 --- a/app/src/test/java/org/mozilla/fenix/ext/MockKMatcherScope.kt +++ b/app/src/test/java/org/mozilla/fenix/ext/MockKMatcherScope.kt @@ -41,7 +41,7 @@ private data class EqNavDirectionsMatcher(private val value: NavDirections) : Ma private data class EqNavOptionsMatcher(private val value: NavOptions) : Matcher { override fun match(arg: NavOptions?): Boolean = - value.popUpTo == arg?.popUpTo && value.isPopUpToInclusive == arg.isPopUpToInclusive + value.popUpToId == arg?.popUpToId && value.isPopUpToInclusive() == arg.isPopUpToInclusive() override fun substitute(map: Map) = copy(value = value.internalSubstitute(map)) diff --git a/app/src/test/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessorTest.kt b/app/src/test/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessorTest.kt index bd200c1380..c3ab274657 100644 --- a/app/src/test/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessorTest.kt +++ b/app/src/test/java/org/mozilla/fenix/home/intent/StartSearchIntentProcessorTest.kt @@ -58,7 +58,7 @@ class StartSearchIntentProcessorTest { } StartSearchIntentProcessor().process(intent, navController, out) val options = navOptions { - popUpTo = R.id.homeFragment + popUpTo(R.id.homeFragment) } assertNotNull(SearchWidget.newTabButton.testGetValue())