зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 1 changesets (bug 1851037) for causing failures at TabsUseCasesTest.kt. CLOSED TREE
Backed out changeset 75c4613ada94 (bug 1851037)
This commit is contained in:
Родитель
0e260ae3ee
Коммит
58c198dd51
|
@ -124,7 +124,7 @@ class BookmarksStorageSuggestionProvider(
|
|||
editSuggestion = if (showEditSuggestion) result.url else null,
|
||||
onSuggestionClicked = {
|
||||
val flags = LoadUrlFlags.select(LoadUrlFlags.ALLOW_JAVASCRIPT_URL)
|
||||
loadUrlUseCase(result.url!!, flags = flags)
|
||||
loadUrlUseCase.invoke(result.url!!, flags = flags)
|
||||
emitBookmarkSuggestionClickedFact()
|
||||
},
|
||||
)
|
||||
|
|
|
@ -72,7 +72,7 @@ class ClipboardSuggestionProvider(
|
|||
icon = icon ?: getSearchIcon(),
|
||||
title = title,
|
||||
onSuggestionClicked = {
|
||||
loadUrlUseCase(url)
|
||||
loadUrlUseCase.invoke(url)
|
||||
emitClipboardSuggestionClickedFact()
|
||||
},
|
||||
),
|
||||
|
|
|
@ -119,7 +119,7 @@ internal suspend fun Iterable<HistoryMetadata>.into(
|
|||
description = result.key.url,
|
||||
editSuggestion = if (showEditSuggestion) result.key.url else null,
|
||||
onSuggestionClicked = {
|
||||
loadUrlUseCase(result.key.url)
|
||||
loadUrlUseCase.invoke(result.key.url)
|
||||
emitHistorySuggestionClickedFact()
|
||||
},
|
||||
)
|
||||
|
|
|
@ -150,7 +150,7 @@ internal suspend fun Iterable<SearchResult>.into(
|
|||
editSuggestion = if (showEditSuggestion) result.url else null,
|
||||
score = result.score,
|
||||
onSuggestionClicked = {
|
||||
loadUrlUseCase(result.url)
|
||||
loadUrlUseCase.invoke(result.url)
|
||||
emitHistorySuggestionClickedFact()
|
||||
},
|
||||
)
|
||||
|
|
|
@ -175,12 +175,12 @@ class ClipboardSuggestionProviderTest {
|
|||
|
||||
val suggestion = suggestions.first()
|
||||
|
||||
verify(useCase, never())(any(), any(), any())
|
||||
verify(useCase, never()).invoke(any(), any(), any())
|
||||
|
||||
assertNotNull(suggestion.onSuggestionClicked)
|
||||
suggestion.onSuggestionClicked!!.invoke()
|
||||
|
||||
verify(useCase)(eq("https://www.mozilla.org"), any(), any())
|
||||
verify(useCase).invoke(eq("https://www.mozilla.org"), any(), any())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -133,7 +133,7 @@ class FxSuggestSuggestionProvider(
|
|||
null
|
||||
},
|
||||
onSuggestionClicked = {
|
||||
loadUrlUseCase(details.url)
|
||||
loadUrlUseCase.invoke(details.url)
|
||||
},
|
||||
metadata = buildMap {
|
||||
details.clickInfo?.let { put(MetadataKeys.CLICK_INFO, it) }
|
||||
|
|
|
@ -33,7 +33,7 @@ class SessionUseCases(
|
|||
/**
|
||||
* Loads the provided URL using the currently selected session.
|
||||
*/
|
||||
operator fun invoke(
|
||||
fun invoke(
|
||||
url: String,
|
||||
flags: LoadUrlFlags = LoadUrlFlags.none(),
|
||||
additionalHeaders: Map<String, String>? = null,
|
||||
|
|
|
@ -74,7 +74,7 @@ class SyncedTabsStorageSuggestionProvider(
|
|||
title = result.tab.title,
|
||||
description = result.clientName,
|
||||
onSuggestionClicked = {
|
||||
loadUrlUseCase(result.tab.url)
|
||||
loadUrlUseCase.invoke(result.tab.url)
|
||||
emitSyncedTabSuggestionClickedFact()
|
||||
},
|
||||
)
|
||||
|
|
|
@ -124,7 +124,7 @@ class TabsUseCases(
|
|||
* @param url The URL to be loaded in the new tab.
|
||||
* @param flags the [LoadUrlFlags] to use when loading the provided URL.
|
||||
*/
|
||||
override operator fun invoke(
|
||||
override fun invoke(
|
||||
url: String,
|
||||
flags: LoadUrlFlags,
|
||||
additionalHeaders: Map<String, String>?,
|
||||
|
|
|
@ -26,9 +26,9 @@ class ToolbarInteractor(
|
|||
fun start() {
|
||||
toolbar.setOnUrlCommitListener { text ->
|
||||
when {
|
||||
text.isUrl() -> loadUrlUseCase(text.toNormalizedUrl())
|
||||
text.isUrl() -> loadUrlUseCase.invoke(text.toNormalizedUrl())
|
||||
searchUseCase != null -> searchUseCase.invoke(text)
|
||||
else -> loadUrlUseCase(text)
|
||||
else -> loadUrlUseCase.invoke(text)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ class ToolbarInteractorTest {
|
|||
fun `provide custom use case for loading url`() {
|
||||
var useCaseInvokedWithUrl = ""
|
||||
val loadUrlUseCase = object : SessionUseCases.LoadUrlUseCase {
|
||||
override operator fun invoke(
|
||||
override fun invoke(
|
||||
url: String,
|
||||
flags: EngineSession.LoadUrlFlags,
|
||||
additionalHeaders: Map<String, String>?,
|
||||
|
|
|
@ -125,7 +125,7 @@ class DefaultBrowserToolbarController(
|
|||
override fun handleToolbarPasteAndGo(text: String) {
|
||||
if (text.isUrl()) {
|
||||
store.updateSearchTermsOfSelectedSession("")
|
||||
activity.components.useCases.sessionUseCases.loadUrl(text)
|
||||
activity.components.useCases.sessionUseCases.loadUrl.invoke(text)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ class DefaultSessionControlController(
|
|||
engine,
|
||||
collection,
|
||||
onFailure = { url ->
|
||||
addTabUseCase(url)
|
||||
addTabUseCase.invoke(url)
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class AwesomeBarView(
|
|||
private val searchSuggestionProviderMap: MutableMap<SearchEngine, List<AwesomeBar.SuggestionProvider>>
|
||||
|
||||
private val loadUrlUseCase = object : SessionUseCases.LoadUrlUseCase {
|
||||
override operator fun invoke(
|
||||
override fun invoke(
|
||||
url: String,
|
||||
flags: EngineSession.LoadUrlFlags,
|
||||
additionalHeaders: Map<String, String>?,
|
||||
|
|
Загрузка…
Ссылка в новой задаче