Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #12025 Set Search Shortcuts Off By Default
Browse files Browse the repository at this point in the history
  • Loading branch information
Kate Glazko authored and Kate Glazko committed Jun 26, 2020
1 parent d81aa62 commit 7a6b5a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/org/mozilla/fenix/utils/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class Settings private constructor(

val shouldShowSearchShortcuts by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_search_shortcuts),
default = true
default = false
)

val shouldUseDarkTheme by booleanPreference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ class DefaultSearchControllerTest {
@Test
fun `show search shortcuts when setting enabled AND query empty`() {
val text = ""
testContext.settings().preferences
.edit()
.putBoolean(testContext.getString(R.string.pref_key_show_search_shortcuts), false)
.apply()

controller.handleTextChanged(text)

Expand All @@ -168,6 +172,10 @@ class DefaultSearchControllerTest {
fun `show search shortcuts when setting enabled AND query equals url`() {
val text = "mozilla.org"
every { session?.url } returns "mozilla.org"
testContext.settings().preferences
.edit()
.putBoolean(testContext.getString(R.string.pref_key_show_search_shortcuts), true)
.apply()

assertEquals(text, session?.url)

Expand Down

0 comments on commit 7a6b5a5

Please sign in to comment.