From 02516095bc7ca9f3bd74b196253512a9c05881c9 Mon Sep 17 00:00:00 2001 From: Kate Glazko Date: Fri, 26 Jun 2020 15:53:51 -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 727e8d0a121c..0e0970fad534 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -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( 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 b2bc035e2e1c..314468d2c90d 100644 --- a/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/search/DefaultSearchControllerTest.kt @@ -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) @@ -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)