Commit 613b13c8 authored by Emily Kager's avatar Emily Kager Committed by Sebastian Kaspari
Browse files

Remove getSearchEngineByName function

parent a37ab9ad
......@@ -72,16 +72,6 @@ class SearchEngineManager(
}
}
/**
* Returns search engine corresponding to name passed to this method, or null if not found.
*/
@Synchronized
fun getSearchEngineByName(context: Context, name: String): SearchEngine? {
val searchEngines = getSearchEngines(context)
return searchEngines.find { it.name == name }
}
/**
* Registers for ACTION_LOCALE_CHANGED broadcasts and automatically reloads the search engines
* whenever the locale changes.
......
......@@ -114,29 +114,6 @@ class SearchEngineManagerTest {
}
}
@Test
fun `manager returns engine by name if it exists`() {
runBlocking {
val mozSearch = mockSearchEngine("mozsearch", "Mozilla Search")
val googleSearch = mockSearchEngine("google", "Google Search")
val provider = mockProvider(
listOf(
googleSearch, mozSearch
)
)
val manager = SearchEngineManager(listOf(provider))
val searchEngine =
manager.getSearchEngineByName(RuntimeEnvironment.application, mozSearch.name)
assertEquals(mozSearch, searchEngine)
val noSuchSearchEngine =
manager.getSearchEngineByName(RuntimeEnvironment.application, "Fake Search")
assertEquals(null, noSuchSearchEngine)
}
}
@Test
fun `manager returns set default engine as default when no identifier is specified`() {
runBlocking {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment