From 7a6b5a52d181ff37b9f6deb48bee7282ce8ad5ec Mon Sep 17 00:00:00 2001 From: Kate Glazko Date: Fri, 26 Jun 2020 13:18:15 -0700 Subject: [PATCH] For #12025 Set Search Shortcuts Off By Default --- app/src/main/java/org/mozilla/fenix/utils/Settings.kt | 2 +- .../mozilla/fenix/search/DefaultSearchControllerTest.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index ea139b4b0809..b9ec6df3d41c 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -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( diff --git a/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt b/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt index d5f9d159a4b7..c83c94b19447 100644 --- a/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt @@ -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) @@ -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)