For #21437 - Relocated Home-related settings to its dedicated sub screen (#21722)

* For #21437 - Relocated Home-related settings to its dedicated sub screen

* For #21437 - Updated show top sites toggle text

* PR: Fixed lint warning. Reverted preference keys

* PR: added ignore for UI test

* PR: Added ignore for UI test
This commit is contained in:
Noah Bond 2021-10-06 14:01:16 -07:00 committed by GitHub
parent 3632ed77d5
commit 1f97ca6ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 221 additions and 160 deletions

View File

@ -63,6 +63,7 @@ class SettingsBasicsTest {
}
}
@Ignore // to be fixed https://github.com/mozilla-mobile/fenix/issues/21754
@Test
// Walks through settings menu and sub-menus to ensure all items are present
fun settingsMenuBasicsItemsTests() {

View File

@ -1434,10 +1434,10 @@ class SmokeTest {
}.openTabsSubMenu {
verifyTabViewOptions()
verifyCloseTabsOptions()
verifyStartOnHomeOptions()
}
}
@Ignore // to be fixed here https://github.com/mozilla-mobile/fenix/issues/21747
@Test
fun alwaysStartOnHomeTest() {
val settings = activityTestRule.activity.applicationContext.settings()

View File

@ -28,8 +28,6 @@ class SettingsSubMenuTabsRobot {
fun verifyCloseTabsOptions() = assertCloseTabsOptions()
fun verifyStartOnHomeOptions() = assertStartOnHomeOptions()
fun clickAlwaysStartOnHomeToggle() {
scrollToElementByText("Move old tabs to inactive")
alwaysStartOnHomeToggle().click()
@ -70,17 +68,6 @@ private fun assertCloseTabsOptions() {
.check(ViewAssertions.matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
private fun assertStartOnHomeOptions() {
// Scroll to ensure all the items are visible.
scrollToElementByText("Never")
startOnHomeHeading()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
afterFourHoursToggle()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
alwaysStartOnHomeToggle()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
}
private fun tabViewHeading() = onView(withText("Tab view"))
private fun listToggle() = onView(withText("List"))

View File

@ -9,7 +9,6 @@ import android.os.Build
import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import androidx.appcompat.app.AppCompatDelegate
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import org.mozilla.fenix.FeatureFlags
@ -51,7 +50,6 @@ class CustomizationFragment : PreferenceFragmentCompat() {
bindAutoBatteryTheme()
setupRadioGroups()
setupToolbarCategory()
setupHomeCategory()
setupGesturesCategory()
}
@ -140,37 +138,6 @@ class CustomizationFragment : PreferenceFragmentCompat() {
addToRadioGroup(topPreference, bottomPreference)
}
private fun setupHomeCategory() {
requirePreference<SwitchPreference>(R.string.pref_key_enable_top_frecent_sites).apply {
isChecked = context.settings().showTopFrecentSites
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_recent_tabs).apply {
isVisible = FeatureFlags.showRecentTabsFeature
isChecked = context.settings().showRecentTabsFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_recent_bookmarks).apply {
isVisible = FeatureFlags.recentBookmarksFeature
isChecked = context.settings().showRecentBookmarksFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_pocket_homescreen_recommendations).apply {
isVisible = FeatureFlags.isPocketRecommendationsFeatureEnabled(context)
isChecked = context.settings().showPocketRecommendationsFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_history_metadata_feature).apply {
isVisible = FeatureFlags.historyMetadataUIFeature
isChecked = context.settings().historyMetadataUIFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
}
private fun setupGesturesCategory() {
requirePreference<SwitchPreference>(R.string.pref_key_website_pull_to_refresh).apply {
isVisible = FeatureFlags.pullToRefreshEnabled
@ -186,22 +153,4 @@ class CustomizationFragment : PreferenceFragmentCompat() {
onPreferenceChangeListener = SharedPreferenceUpdater()
}
}
class CustomizeHomeMetricsUpdater : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
try {
val context = preference.context
context.components.analytics.metrics.track(
Event.CustomizeHomePreferenceToggled(
preference.key,
newValue as Boolean,
context
)
)
} catch (e: IllegalArgumentException) {
// The event is not tracked
}
return super.onPreferenceChange(preference, newValue)
}
}
}

View File

@ -0,0 +1,99 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.settings
import android.os.Bundle
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
import org.mozilla.fenix.utils.view.addToRadioGroup
/**
* Lets the user customize the home screen.
*/
class HomeSettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.home_preferences, rootKey)
}
override fun onResume() {
super.onResume()
showToolbar(getString(R.string.preferences_home_2))
setupPreferences()
}
private fun setupPreferences() {
requirePreference<SwitchPreference>(R.string.pref_key_enable_top_frecent_sites).apply {
isChecked = context.settings().showTopFrecentSites
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_recent_tabs).apply {
isVisible = FeatureFlags.showRecentTabsFeature
isChecked = context.settings().showRecentTabsFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_recent_bookmarks).apply {
isVisible = FeatureFlags.recentBookmarksFeature
isChecked = context.settings().showRecentBookmarksFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_pocket_homescreen_recommendations).apply {
isVisible = FeatureFlags.isPocketRecommendationsFeatureEnabled(context)
isChecked = context.settings().showPocketRecommendationsFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_history_metadata_feature).apply {
isVisible = FeatureFlags.historyMetadataUIFeature
isChecked = context.settings().historyMetadataUIFeature
onPreferenceChangeListener = CustomizeHomeMetricsUpdater()
}
val openingScreenRadioHomepage =
requirePreference<RadioButtonPreference>(R.string.pref_key_start_on_home_always)
val openingScreenLastTab =
requirePreference<RadioButtonPreference>(R.string.pref_key_start_on_home_never)
val openingScreenAfterFourHours =
requirePreference<RadioButtonPreference>(R.string.pref_key_start_on_home_after_four_hours)
requirePreference<PreferenceCategory>(R.string.pref_key_start_on_home_category).isVisible =
FeatureFlags.showStartOnHomeSettings
addToRadioGroup(
openingScreenRadioHomepage,
openingScreenLastTab,
openingScreenAfterFourHours
)
}
inner class CustomizeHomeMetricsUpdater : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
try {
val context = preference.context
context.components.analytics.metrics.track(
Event.CustomizeHomePreferenceToggled(
preference.key,
newValue as Boolean,
context
)
)
} catch (e: IllegalArgumentException) {
// The event is not tracked
}
return super.onPreferenceChange(preference, newValue)
}
}
}

View File

@ -242,6 +242,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
resources.getString(R.string.pref_key_tabs) -> {
SettingsFragmentDirections.actionSettingsFragmentToTabsSettingsFragment()
}
resources.getString(R.string.pref_key_home) -> {
SettingsFragmentDirections.actionSettingsFragmentToHomeSettingsFragment()
}
resources.getString(R.string.pref_key_search_settings) -> {
SettingsFragmentDirections.actionSettingsFragmentToSearchEngineFragment()
}

View File

@ -29,9 +29,6 @@ class TabsSettingsFragment : PreferenceFragmentCompat() {
private lateinit var radioOneDay: RadioButtonPreference
private lateinit var radioOneWeek: RadioButtonPreference
private lateinit var radioOneMonth: RadioButtonPreference
private lateinit var startOnHomeRadioFourHours: RadioButtonPreference
private lateinit var startOnHomeRadioAlways: RadioButtonPreference
private lateinit var startOnHomeRadioNever: RadioButtonPreference
private lateinit var inactiveTabsCategory: PreferenceCategory
private lateinit var inactiveTabs: SwitchPreference
private lateinit var searchTermTabGroups: SwitchPreference
@ -70,13 +67,6 @@ class TabsSettingsFragment : PreferenceFragmentCompat() {
radioOneWeek = requirePreference(R.string.pref_key_close_tabs_after_one_week)
radioOneDay = requirePreference(R.string.pref_key_close_tabs_after_one_day)
startOnHomeRadioFourHours = requirePreference(R.string.pref_key_start_on_home_after_four_hours)
startOnHomeRadioAlways = requirePreference(R.string.pref_key_start_on_home_always)
startOnHomeRadioNever = requirePreference(R.string.pref_key_start_on_home_never)
requirePreference<PreferenceCategory>(R.string.pref_key_start_on_home_category).isVisible =
FeatureFlags.showStartOnHomeSettings
inactiveTabs = requirePreference<SwitchPreference>(R.string.pref_key_inactive_tabs).also {
it.isChecked = it.context.settings().inactiveTabsAreEnabled
it.onPreferenceChangeListener = SharedPreferenceUpdater()
@ -110,12 +100,6 @@ class TabsSettingsFragment : PreferenceFragmentCompat() {
radioOneMonth,
radioOneWeek
)
addToRadioGroup(
startOnHomeRadioFourHours,
startOnHomeRadioAlways,
startOnHomeRadioNever
)
}
private fun sendTabViewTelemetry() {

View File

@ -381,7 +381,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
* Indicates if the user has selected the option to start on the home screen after
* four hours of inactivity.
*/
var startOnHomeAfterFourHours by booleanPreference(
var openHomepageAfterFourHoursOfInactivity by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_start_on_home_after_four_hours),
default = true
)
@ -389,15 +389,16 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates if the user has selected the option to always start on the home screen.
*/
var startOnHomeAlways by booleanPreference(
var alwaysOpenTheHomepageWhenOpeningTheApp by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_start_on_home_always),
default = false
)
/**
* Indicates if the user has selected the option to never start on the home screen.
* Indicates if the user has selected the option to never start on the home screen and have
* their last tab opened.
*/
var startOnHomeNever by booleanPreference(
var alwaysOpenTheLastTabWhenOpeningTheApp by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_start_on_home_never),
default = false
)
@ -407,9 +408,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
fun shouldStartOnHome(): Boolean {
return when {
startOnHomeAfterFourHours -> timeNowInMillis() - lastBrowseActivity >= FOUR_HOURS_MS
startOnHomeAlways -> true
startOnHomeNever -> false
openHomepageAfterFourHoursOfInactivity -> timeNowInMillis() - lastBrowseActivity >= FOUR_HOURS_MS
alwaysOpenTheHomepageWhenOpeningTheApp -> true
alwaysOpenTheLastTabWhenOpeningTheApp -> false
else -> false
}
}

View File

@ -592,11 +592,22 @@
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
<action
android:id="@+id/action_settingsFragment_to_homeSettingsFragment"
app:destination="@id/homeSettingsFragment"
app:enterAnim="@anim/slide_in_right"
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right" />
</fragment>
<fragment
android:id="@+id/tabsSettingsFragment"
android:name="org.mozilla.fenix.settings.TabsSettingsFragment"
android:label="@string/preferences_tabs" />
<fragment
android:id="@+id/homeSettingsFragment"
android:name="org.mozilla.fenix.settings.HomeSettingsFragment"
android:label="@string/preferences_home_2" />
<fragment
android:id="@+id/dataChoicesFragment"
android:name="org.mozilla.fenix.settings.DataChoicesFragment"

View File

@ -264,6 +264,7 @@
<string name="pref_key_tab_view_list_do_not_use" translatable="false">pref_key_tab_view_list</string>
<string name="pref_key_tab_view_grid" translatable="false">pref_key_tab_view_grid</string>
<string name="pref_key_tabs" translatable="false">pref_key_tabs</string>
<string name="pref_key_home" translatable="false">pref_key_home</string>
<string name="pref_key_close_tabs_manually" translatable="false">pref_key_close_tabs_manually</string>
<string name="pref_key_close_tabs_after_one_day" translatable="false">pref_key_close_tabs_after_one_day</string>
<string name="pref_key_close_tabs_after_one_week" translatable="false">pref_key_close_tabs_after_one_week</string>

View File

@ -367,7 +367,9 @@
<!-- Preference for changing default theme to dark or light mode -->
<string name="preferences_theme">Theme</string>
<!-- Preference for customizing the home screen -->
<string name="preferences_home">Home</string>
<string name="preferences_home" moz:removedIn="94" tools:ignore="UnusedResources">Home</string>
<!-- Preference for customizing the home screen -->
<string name="preferences_home_2">Homepage</string>
<!-- Preference for gestures based actions -->
<string name="preferences_gestures">Gestures</string>
<!-- Preference for settings related to visual options -->
@ -678,15 +680,23 @@
<!-- Title of preference that allows a user to specify the auto-close settings for open tabs -->
<string name="preference_auto_close_tabs" tools:ignore="UnusedResources">Auto-close open tabs</string>
<!-- Start on Home -->
<!-- Opening screen -->
<!-- Title of a preference that allows a user to indicate after a specified amount of time when the app should start on the home screen -->
<string name="preferences_start_on_home">Start on home</string>
<string name="preferences_start_on_home" moz:removedIn="94" tools:ignore="UnusedResources">Start on home</string>
<!-- Title of a preference that allows a user to choose what screen to show after opening the app -->
<string name="preferences_opening_screen">Opening screen</string>
<!-- Option for starting on the home screen after after four hours or inactivity -->
<string name="start_on_home_after_four_hours">After four hours</string>
<string name="start_on_home_after_four_hours" moz:removedIn="94" tools:ignore="UnusedResources">After four hours</string>
<!-- Option for always opening the homepage when re-opening the app -->
<string name="opening_screen_homepage">Homepage</string>
<!-- Option for always starting on the home screen -->
<string name="start_on_home_always">Always</string>
<string name="start_on_home_always" moz:removedIn="94" tools:ignore="UnusedResources">Always</string>
<!-- Option for always opening the user's last-open tab when re-opening the app -->
<string name="opening_screen_last_tab">Last tab</string>
<!-- Option for never starting on the home screen -->
<string name="start_on_home_never">Never</string>
<string name="start_on_home_never" moz:removedIn="94" tools:ignore="UnusedResources">Never</string>
<!-- Option for always opening the homepage when re-opening the app after four hours of inactivity -->
<string name="opening_screen_after_four_hours_of_inactivity">Homepage after four hours of inactivity</string>
<!-- Summary for tabs preference when auto closing tabs setting is set to manual close-->
<string name="close_tabs_manually_summary">Close manually</string>
<!-- Summary for tabs preference when auto closing tabs setting is set to auto close tabs after one day-->
@ -1909,8 +1919,10 @@
<string name="top_sites_max_limit_content_2">To add a new top site, remove one. Touch and hold the site and select remove.</string>
<!-- Confirmation dialog button text when top sites limit is reached. -->
<string name="top_sites_max_limit_confirmation_button">OK, Got It</string>
<!-- Label for the preference to show the most visited top sites on the homepage -->
<string name="top_sites_toggle_top_recent_sites_3">Most visited top sites</string>
<!-- Label for the show most visited top sites preference -->
<string name="top_sites_toggle_top_frecent_sites_2">Show most visited top sites</string>
<string name="top_sites_toggle_top_frecent_sites_2" moz:removedIn="94" tools:ignore="UnusedResources">Show most visited top sites</string>
<!-- Label for the show most visited sites preference -->
<string name="top_sites_toggle_top_frecent_sites" moz:removedIn="93" tools:ignore="UnusedResources">Show most visited sites</string>
<!-- Title text displayed in the rename top site dialog. -->

View File

@ -43,35 +43,6 @@
android:title="@string/preference_bottom_toolbar" />
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_home"
app:iconSpaceReserved="false">
<androidx.preference.SwitchPreference
android:key="@string/pref_key_enable_top_frecent_sites"
android:title="@string/top_sites_toggle_top_frecent_sites_2" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_recent_tabs"
android:title="@string/customize_toggle_jump_back_in"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_recent_bookmarks"
android:title="@string/customize_toggle_recent_bookmarks"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_history_metadata_feature"
android:title="@string/customize_toggle_recent_searches"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_pocket_homescreen_recommendations"
android:title="@string/customize_toggle_pocket"
app:isPreferenceVisible="false" />
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_gestures"

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.preference.PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.preference.SwitchPreference
android:key="@string/pref_key_enable_top_frecent_sites"
android:title="@string/top_sites_toggle_top_recent_sites_3" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_recent_tabs"
android:title="@string/customize_toggle_jump_back_in"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_recent_bookmarks"
android:title="@string/customize_toggle_recent_bookmarks"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_history_metadata_feature"
android:title="@string/customize_toggle_recent_searches"
app:isPreferenceVisible="false" />
<androidx.preference.SwitchPreference
android:key="@string/pref_key_pocket_homescreen_recommendations"
android:title="@string/customize_toggle_pocket"
app:isPreferenceVisible="false" />
<androidx.preference.PreferenceCategory
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_opening_screen"
app:allowDividerAbove="true"
app:isPreferenceVisible="false"
android:key="pref_key_start_on_home_category"
app:iconSpaceReserved="false">
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="true"
android:key="@string/pref_key_start_on_home_always"
android:title="@string/opening_screen_homepage" />
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="false"
android:key="@string/pref_key_start_on_home_never"
android:title="@string/opening_screen_last_tab" />
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="false"
android:key="@string/pref_key_start_on_home_after_four_hours"
android:title="@string/opening_screen_after_four_hours_of_inactivity" />
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>

View File

@ -60,6 +60,11 @@
android:key="@string/pref_key_tabs"
android:title="@string/preferences_tabs" />
<androidx.preference.Preference
app:iconSpaceReserved="false"
android:key="@string/pref_key_home"
android:title="@string/preferences_home_2" />
<androidx.preference.Preference
android:key="@string/pref_key_customize"
app:iconSpaceReserved="false"

View File

@ -44,6 +44,11 @@
android:title="@string/preferences_tabs"
app:iconSpaceReserved="false" />
<androidx.preference.Preference
app:iconSpaceReserved="false"
android:key="@string/pref_key_home"
android:title="@string/preferences_home_2" />
<androidx.preference.Preference
android:key="@string/pref_key_customize"
android:title="@string/preferences_customize"

View File

@ -53,30 +53,6 @@
android:title="@string/close_tabs_after_one_month" />
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_start_on_home"
app:allowDividerAbove="true"
app:isPreferenceVisible="false"
android:key="pref_key_start_on_home_category"
app:iconSpaceReserved="false">
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="true"
android:key="@string/pref_key_start_on_home_after_four_hours"
android:title="@string/start_on_home_after_four_hours" />
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="false"
android:key="@string/pref_key_start_on_home_always"
android:title="@string/start_on_home_always" />
<org.mozilla.fenix.settings.RadioButtonPreference
android:defaultValue="false"
android:key="@string/pref_key_start_on_home_never"
android:title="@string/start_on_home_never" />
</androidx.preference.PreferenceCategory>
<androidx.preference.PreferenceCategory
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_inactive_tabs"

View File

@ -677,18 +677,18 @@ class SettingsTest {
@Test
fun `GIVEN startOnHomeAlways is selected WHEN calling shouldStartOnHome THEN return true`() {
settings.startOnHomeAlways = true
settings.startOnHomeNever = false
settings.startOnHomeAfterFourHours = false
settings.alwaysOpenTheHomepageWhenOpeningTheApp = true
settings.alwaysOpenTheLastTabWhenOpeningTheApp = false
settings.openHomepageAfterFourHoursOfInactivity = false
assertTrue(settings.shouldStartOnHome())
}
@Test
fun `GIVEN startOnHomeNever is selected WHEN calling shouldStartOnHome THEN return be false`() {
settings.startOnHomeNever = true
settings.startOnHomeAlways = false
settings.startOnHomeAfterFourHours = false
settings.alwaysOpenTheLastTabWhenOpeningTheApp = true
settings.alwaysOpenTheHomepageWhenOpeningTheApp = false
settings.openHomepageAfterFourHoursOfInactivity = false
assertFalse(settings.shouldStartOnHome())
}
@ -698,9 +698,9 @@ class SettingsTest {
val localSetting = spyk(settings)
val now = Calendar.getInstance()
localSetting.startOnHomeAfterFourHours = true
localSetting.startOnHomeNever = false
localSetting.startOnHomeAlways = false
localSetting.openHomepageAfterFourHoursOfInactivity = true
localSetting.alwaysOpenTheLastTabWhenOpeningTheApp = false
localSetting.alwaysOpenTheHomepageWhenOpeningTheApp = false
now.timeInMillis = System.currentTimeMillis()
localSetting.lastBrowseActivity = now.timeInMillis
@ -716,9 +716,9 @@ class SettingsTest {
val localSetting = spyk(settings)
val now = System.currentTimeMillis()
localSetting.startOnHomeAfterFourHours = true
localSetting.startOnHomeNever = false
localSetting.startOnHomeAlways = false
localSetting.openHomepageAfterFourHoursOfInactivity = true
localSetting.alwaysOpenTheLastTabWhenOpeningTheApp = false
localSetting.alwaysOpenTheHomepageWhenOpeningTheApp = false
localSetting.lastBrowseActivity = now