Skip to content

Commit

Permalink
For mozilla-mobile#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 df49db6 commit 0251609
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 @@ -309,7 +309,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 @@ -150,6 +150,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), true)
.apply()

controller.handleTextChanged(text)

Expand All @@ -160,6 +164,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 0251609

Please sign in to comment.