For #22852 - Add a new "Storage access" permission

upstream-sync
Mugurell 2 years ago committed by mergify[bot]
parent cf31bc408a
commit 34c0a17b4d

@ -32,6 +32,7 @@ fun SitePermissions.get(field: PhoneFeature) = when (field) {
PhoneFeature.AUTOPLAY_INAUDIBLE -> autoplayInaudible.toStatus()
PhoneFeature.PERSISTENT_STORAGE -> localStorage
PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS -> mediaKeySystemAccess
PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS -> crossOriginStorageAccess
}
fun SitePermissions.update(field: PhoneFeature, value: SitePermissions.Status) = when (field) {
@ -47,6 +48,7 @@ fun SitePermissions.update(field: PhoneFeature, value: SitePermissions.Status) =
PhoneFeature.AUTOPLAY_INAUDIBLE -> copy(autoplayInaudible = value.toAutoplayStatus())
PhoneFeature.PERSISTENT_STORAGE -> copy(localStorage = value)
PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS -> copy(mediaKeySystemAccess = value)
PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS -> copy(crossOriginStorageAccess = value)
}
/**

@ -33,7 +33,8 @@ enum class PhoneFeature(val androidPermissionsList: Array<String>) : Parcelable
AUTOPLAY_AUDIBLE(emptyArray()),
AUTOPLAY_INAUDIBLE(emptyArray()),
PERSISTENT_STORAGE(emptyArray()),
MEDIA_KEY_SYSTEM_ACCESS(emptyArray());
MEDIA_KEY_SYSTEM_ACCESS(emptyArray()),
CROSS_ORIGIN_STORAGE_ACCESS(emptyArray());
fun isAndroidPermissionGranted(context: Context): Boolean {
return context.isPermissionGranted(androidPermissionsList.asIterable())
@ -82,6 +83,8 @@ enum class PhoneFeature(val androidPermissionsList: Array<String>) : Parcelable
MICROPHONE -> context.getString(R.string.preference_phone_feature_microphone)
NOTIFICATION -> context.getString(R.string.preference_phone_feature_notification)
PERSISTENT_STORAGE -> context.getString(R.string.preference_phone_feature_persistent_storage)
CROSS_ORIGIN_STORAGE_ACCESS ->
context.getString(R.string.preference_phone_feature_cross_origin_storage_access)
MEDIA_KEY_SYSTEM_ACCESS -> context.getString(R.string.preference_phone_feature_media_key_system_access)
AUTOPLAY, AUTOPLAY_AUDIBLE, AUTOPLAY_INAUDIBLE ->
context.getString(R.string.preference_browser_feature_autoplay)
@ -103,6 +106,7 @@ enum class PhoneFeature(val androidPermissionsList: Array<String>) : Parcelable
AUTOPLAY_AUDIBLE -> R.string.pref_key_browser_feature_autoplay_audible_v2
AUTOPLAY_INAUDIBLE -> R.string.pref_key_browser_feature_autoplay_inaudible_v2
PERSISTENT_STORAGE -> R.string.pref_key_browser_feature_persistent_storage
CROSS_ORIGIN_STORAGE_ACCESS -> R.string.pref_key_browser_feature_cross_origin_storage_access
MEDIA_KEY_SYSTEM_ACCESS -> R.string.pref_key_browser_feature_media_key_system_access
}
}

@ -24,6 +24,7 @@ import org.mozilla.fenix.settings.PhoneFeature.LOCATION
import org.mozilla.fenix.settings.PhoneFeature.NOTIFICATION
import org.mozilla.fenix.settings.PhoneFeature.PERSISTENT_STORAGE
import org.mozilla.fenix.settings.PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS
import org.mozilla.fenix.settings.PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS
import org.mozilla.fenix.settings.quicksettings.WebsitePermissionsView.PermissionViewHolder.SpinnerPermission
import org.mozilla.fenix.settings.quicksettings.WebsitePermissionsView.PermissionViewHolder.ToggleablePermission
import java.util.EnumMap
@ -89,6 +90,10 @@ class WebsitePermissionsView(
binding.persistentStorageLabel,
binding.persistentStorageStatus
),
CROSS_ORIGIN_STORAGE_ACCESS to ToggleablePermission(
binding.crossOriginStorageAccessLabel,
binding.crossOriginStorageAccessStatus
),
MEDIA_KEY_SYSTEM_ACCESS to ToggleablePermission(
binding.mediaKeySystemAccessLabel,
binding.mediaKeySystemAccessStatus

@ -32,6 +32,7 @@ import org.mozilla.fenix.settings.PhoneFeature.NOTIFICATION
import org.mozilla.fenix.settings.PhoneFeature.PERSISTENT_STORAGE
import org.mozilla.fenix.settings.PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS
import org.mozilla.fenix.settings.PhoneFeature.AUTOPLAY
import org.mozilla.fenix.settings.PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS
import org.mozilla.fenix.settings.quicksettings.AutoplayValue
import org.mozilla.fenix.settings.requirePreference
import org.mozilla.fenix.utils.Settings
@ -70,6 +71,7 @@ class SitePermissionsDetailsExceptionsFragment : PreferenceFragmentCompat() {
initPhoneFeature(MICROPHONE)
initPhoneFeature(NOTIFICATION)
initPhoneFeature(PERSISTENT_STORAGE)
initPhoneFeature(CROSS_ORIGIN_STORAGE_ACCESS)
initPhoneFeature(MEDIA_KEY_SYSTEM_ACCESS)
initAutoplayFeature()
bindClearPermissionsButton()

@ -940,6 +940,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = AutoplayAction.ALLOWED
),
persistentStorage = getSitePermissionsPhoneFeatureAction(PhoneFeature.PERSISTENT_STORAGE),
crossOriginStorageAccess = getSitePermissionsPhoneFeatureAction(PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS),
mediaKeySystemAccess = getSitePermissionsPhoneFeatureAction(PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS)
)
}
@ -953,6 +954,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
PhoneFeature.AUTOPLAY_AUDIBLE,
PhoneFeature.AUTOPLAY_INAUDIBLE,
PhoneFeature.PERSISTENT_STORAGE,
PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS,
PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS
).map { it.getPreferenceKey(appContext) }

@ -0,0 +1,7 @@
<!-- 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/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/enabled" android:drawable="@drawable/ic_cookies_enabled" android:state_enabled="true" />
<item android:id="@+id/disabled" android:drawable="@drawable/ic_cookies_disabled" />
</selector>

@ -0,0 +1,15 @@
<?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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:autoMirrored="true"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="?primaryText"
android:pathData="M15.379,8a0.142,0.142 0,0 0,0.02 0,7.978 7.978,0 0,1 -1.858,-0.356 0.981,0.981 0,0 1,-0.054 0.847,1 1,0 1,1 -1.735,-0.994 0.981,0.981 0,0 1,0.481 -0.407c-0.069,-0.036 -0.13,-0.083 -0.2,-0.121l-5.42,5.418a0.977,0.977 0,0 1,-0.4 0.476,0.85 0.85,0 0,1 -0.117,0.04l-2.065,2.066c0.509,0.219 1,0.24 1.161,-0.147 -0.424,1.025 2.823,1.668 2.822,0.558 0,1.11 3.246,0.461 2.821,-0.564 0.425,1.025 3.175,-0.816 2.39,-1.6 0.785,0.784 2.621,-1.97 1.6,-2.394 1.021,0.424 1.664,-2.822 0.554,-2.822zM10.306,13a1,1 0,1 1,1 -1,1 1,0 0,1 -1,1zM14.707,1.293a1,1 0,0 0,-1.414 0L9.679,4.907A7.942,7.942 0,0 1,8 0.61v0.025C8,-0.474 4.753,0.174 5.179,1.2 4.753,0.174 2,2.016 2.788,2.8 2,2.016 0.167,4.77 1.193,5.193 0.167,4.77 -0.476,8.016 0.634,8.015c-1.11,0 -0.461,3.247 0.564,2.821 -0.639,0.265 -0.163,1.428 0.475,2.077l-0.38,0.38a1,1 0,1 0,1.414 1.414l12,-12a1,1 0,0 0,0 -1.414zM5.707,2.993a1,1 0,1 1,-1 1A1,1 0,0 1,5.706 3zM2.524,7.508a1,1 0,1 1,0.37 1.364,1 1,0 0,1 -0.37,-1.364zM7.293,7.293z"/>
</vector>

@ -0,0 +1,15 @@
<?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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:autoMirrored="true"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="?primaryText"
android:pathData="M15.379,8a0.142,0.142 0,0 0,0.02 0,7.978 7.978,0 0,1 -1.858,-0.356 0.981,0.981 0,0 1,-0.054 0.847,1 1,0 1,1 -1.735,-0.994 0.981,0.981 0,0 1,0.481 -0.407A8.02,8.02 0,0 1,8 0.61v0.025C8,-0.474 4.753,0.174 5.179,1.2 4.753,0.174 2,2.016 2.788,2.8 2,2.016 0.167,4.77 1.193,5.193 0.167,4.77 -0.476,8.016 0.634,8.015c-1.11,0 -0.461,3.247 0.564,2.821 -1.025,0.426 0.817,3.175 1.6,2.39 -0.784,0.785 1.969,2.621 2.393,1.6 -0.424,1.025 2.823,1.668 2.822,0.558 0,1.11 3.246,0.461 2.821,-0.564 0.425,1.025 3.175,-0.816 2.39,-1.6 0.785,0.784 2.621,-1.97 1.6,-2.394 1.022,0.42 1.665,-2.826 0.555,-2.826zM4.259,8.5a1,1 0,1 1,-0.37 -1.365,1 1,0 0,1 0.37,1.365zM6.214,12.861a1,1 0,1 1,0.36 -1.367,1 1,0 0,1 -0.36,1.369zM5.706,5a1,1 0,1 1,1 -1,1 1,0 0,1 -1,1zM8,9a1,1 0,1 1,1 -1,1 1,0 0,1 -1,1zM10.306,13a1,1 0,1 1,1 -1,1 1,0 0,1 -1,1z" />
</vector>

@ -124,7 +124,7 @@
app:drawableStartCompat="@drawable/ic_storage"
android:text="@string/preference_phone_feature_persistent_storage"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/mediaKeySystemAccessLabel"
app:layout_constraintBottom_toTopOf="@id/crossOriginStorageAccessLabel"
app:layout_constraintEnd_toStartOf="@id/persistentStorageStatus"
app:layout_constraintStart_toStartOf="parent"
android:textColor="?primaryText"
@ -136,12 +136,38 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/quicksettings_item_height"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/mediaKeySystemAccessStatus"
app:layout_constraintBottom_toTopOf="@id/crossOriginStorageAccessStatus"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/persistentStorageLabel"
tools:text="@string/preference_option_phone_feature_blocked"
tools:visibility="visible" />
<TextView
android:id="@+id/crossOriginStorageAccessLabel"
style="@style/QuickSettingsText.Icon"
android:layout_width="0dp"
android:layout_height="@dimen/quicksettings_item_height"
app:drawableStartCompat="@drawable/ic_cookies"
android:text="@string/preference_phone_feature_cross_origin_storage_access"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/mediaKeySystemAccessLabel"
app:layout_constraintEnd_toStartOf="@id/crossOriginStorageAccessStatus"
app:layout_constraintStart_toStartOf="parent"
android:textColor="?primaryText"
tools:visibility="visible" />
<TextView
android:id="@+id/crossOriginStorageAccessStatus"
style="@style/QuickSettingsText.PermissionItemEnd"
android:layout_width="wrap_content"
android:layout_height="@dimen/quicksettings_item_height"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/mediaKeySystemAccessStatus"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/crossOriginStorageAccessLabel"
tools:text="@string/preference_option_phone_feature_blocked"
tools:visibility="visible" />
<TextView
android:id="@+id/mediaKeySystemAccessLabel"
style="@style/QuickSettingsText.Icon"

@ -111,6 +111,7 @@
<string name="pref_key_browser_feature_autoplay_audible_v2" translatable="false">pref_key_browser_feature_autoplay_v2</string>
<string name="pref_key_browser_feature_autoplay_inaudible_v2" translatable="false">pref_key_browser_feature_autoplay_inaudible_v2</string>
<string name="pref_key_browser_feature_persistent_storage" translatable="false">pref_key_browser_feature_persistent_storage</string>
<string name="pref_key_browser_feature_cross_origin_storage_access" translatable="false">pref_key_browser_feature_cross_origin_storage_access</string>
<string name="pref_key_browser_feature_media_key_system_access" translatable="false">pref_key_browser_feature_media_key_system_access</string>
<string name="pref_key_phone_feature_camera" translatable="false">pref_key_phone_feature_camera</string>
<string name="pref_key_phone_feature_location" translatable="false">pref_key_phone_feature_location</string>

@ -993,6 +993,8 @@
<string name="preference_phone_feature_notification">Notification</string>
<!-- Preference for altering the persistent storage access for all websites -->
<string name="preference_phone_feature_persistent_storage">Persistent Storage</string>
<!-- Preference for altering the storage access setting for all websites -->
<string name="preference_phone_feature_cross_origin_storage_access">Cross-site cookies</string>
<!-- Preference for altering the EME access for all websites -->
<string name="preference_phone_feature_media_key_system_access">DRM-controlled content</string>
<!-- Label that indicates that a permission must be asked always -->

@ -22,6 +22,7 @@
<item name="android:windowEnableSplitTouch">false</item>
<item name="android:splitMotionEvents">false</item>
<item name="bottomSheetDialogTheme">@style/BottomSheet</item>
<item name="android:textColorLink">@color/fx_mobile_text_color_action</item>
<item name="mozacInputLayoutErrorTextColor"
tools:ignore="UnusedResources">@color/destructive_normal_theme</item>

@ -34,6 +34,12 @@
android:title="@string/preference_phone_feature_persistent_storage"
android:summary="@string/preference_option_phone_feature_ask_to_allow"/>
<androidx.preference.Preference
android:icon="@drawable/ic_cookies"
android:key="@string/pref_key_browser_feature_cross_origin_storage_access"
android:title="@string/preference_phone_feature_cross_origin_storage_access"
android:summary="@string/preference_option_phone_feature_ask_to_allow"/>
<androidx.preference.Preference
android:icon="@drawable/ic_link"
android:key="@string/pref_key_browser_feature_media_key_system_access"

@ -43,6 +43,13 @@
android:summary="@string/preference_option_phone_feature_ask_to_allow"
app:allowDividerBelow="true"/>
<androidx.preference.Preference
android:icon="@drawable/ic_cookies"
android:key="@string/pref_key_browser_feature_cross_origin_storage_access"
android:title="@string/preference_phone_feature_cross_origin_storage_access"
android:summary="@string/preference_option_phone_feature_ask_to_allow"
app:allowDividerBelow="true"/>
<androidx.preference.Preference
android:icon="@drawable/ic_link"
android:key="@string/pref_key_browser_feature_media_key_system_access"

@ -221,6 +221,7 @@ class AutoplayValueTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -248,6 +249,7 @@ class AutoplayValueTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -275,6 +277,7 @@ class AutoplayValueTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -376,6 +379,7 @@ class AutoplayValueTest {
autoplayAudible = AutoplayAction.BLOCKED,
autoplayInaudible = AutoplayAction.BLOCKED,
persistentStorage = Action.ASK_TO_ALLOW,
mediaKeySystemAccess = Action.ASK_TO_ALLOW
mediaKeySystemAccess = Action.ASK_TO_ALLOW,
crossOriginStorageAccess = Action.ASK_TO_ALLOW,
)
}

@ -116,5 +116,6 @@ class QuickSettingsFragmentReducerTest {
SitePermissionsRules.AutoplayAction.ALLOWED,
SitePermissionsRules.Action.ALLOWED,
SitePermissionsRules.Action.ALLOWED,
SitePermissionsRules.Action.ALLOWED,
)
}

@ -139,6 +139,7 @@ class QuickSettingsFragmentStoreTest {
every { permissions.notification } returns SitePermissions.Status.BLOCKED
every { permissions.location } returns SitePermissions.Status.ALLOWED
every { permissions.localStorage } returns SitePermissions.Status.ALLOWED
every { permissions.crossOriginStorageAccess } returns SitePermissions.Status.ALLOWED
every { permissions.mediaKeySystemAccess } returns SitePermissions.Status.NO_DECISION
every { permissions.autoplayAudible } returns SitePermissions.AutoplayStatus.ALLOWED
every { permissions.autoplayInaudible } returns SitePermissions.AutoplayStatus.BLOCKED
@ -158,6 +159,7 @@ class QuickSettingsFragmentStoreTest {
assertNotNull(state[PhoneFeature.AUTOPLAY_AUDIBLE])
assertNotNull(state[PhoneFeature.AUTOPLAY_INAUDIBLE])
assertNotNull(state[PhoneFeature.PERSISTENT_STORAGE])
assertNotNull(state[PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS])
assertNotNull(state[PhoneFeature.MEDIA_KEY_SYSTEM_ACCESS])
assertNotNull(state[PhoneFeature.AUTOPLAY])
}
@ -363,6 +365,7 @@ class QuickSettingsFragmentStoreTest {
autoplayAudible = AutoplayAction.BLOCKED,
autoplayInaudible = AutoplayAction.BLOCKED,
persistentStorage = Action.ASK_TO_ALLOW,
mediaKeySystemAccess = Action.ASK_TO_ALLOW
mediaKeySystemAccess = Action.ASK_TO_ALLOW,
crossOriginStorageAccess = Action.ASK_TO_ALLOW,
)
}

@ -377,6 +377,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -404,6 +405,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -431,6 +433,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(rules.microphone.toStatus(), result.microphone)
assertEquals(rules.notification.toStatus(), result.notification)
assertEquals(rules.persistentStorage.toStatus(), result.localStorage)
assertEquals(rules.crossOriginStorageAccess.toStatus(), result.crossOriginStorageAccess)
assertEquals(rules.mediaKeySystemAccess.toStatus(), result.mediaKeySystemAccess)
}
@ -458,6 +461,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(sitePermissions.microphone, result.microphone)
assertEquals(sitePermissions.notification, result.notification)
assertEquals(sitePermissions.localStorage, result.localStorage)
assertEquals(sitePermissions.crossOriginStorageAccess, result.crossOriginStorageAccess)
assertEquals(sitePermissions.mediaKeySystemAccess, result.mediaKeySystemAccess)
}
@ -485,6 +489,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(sitePermissions.microphone, result.microphone)
assertEquals(sitePermissions.notification, result.notification)
assertEquals(sitePermissions.localStorage, result.localStorage)
assertEquals(sitePermissions.crossOriginStorageAccess, result.crossOriginStorageAccess)
assertEquals(sitePermissions.mediaKeySystemAccess, result.mediaKeySystemAccess)
}
@ -512,6 +517,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
assertEquals(sitePermissions.microphone, result.microphone)
assertEquals(sitePermissions.notification, result.notification)
assertEquals(sitePermissions.localStorage, result.localStorage)
assertEquals(sitePermissions.crossOriginStorageAccess, result.crossOriginStorageAccess)
assertEquals(sitePermissions.mediaKeySystemAccess, result.mediaKeySystemAccess)
}
@ -533,6 +539,7 @@ class SitePermissionsManageExceptionsPhoneFeatureFragmentTest {
autoplayAudible = AutoplayAction.BLOCKED,
autoplayInaudible = AutoplayAction.BLOCKED,
persistentStorage = Action.ASK_TO_ALLOW,
mediaKeySystemAccess = Action.ASK_TO_ALLOW
mediaKeySystemAccess = Action.ASK_TO_ALLOW,
crossOriginStorageAccess = Action.ASK_TO_ALLOW,
)
}

@ -36,7 +36,8 @@ class SettingsTest {
autoplayAudible = AutoplayAction.BLOCKED,
autoplayInaudible = AutoplayAction.ALLOWED,
persistentStorage = ASK_TO_ALLOW,
mediaKeySystemAccess = ASK_TO_ALLOW
mediaKeySystemAccess = ASK_TO_ALLOW,
crossOriginStorageAccess = ASK_TO_ALLOW,
)
@Before
@ -627,6 +628,22 @@ class SettingsTest {
settings.getSitePermissionsCustomSettingsRules()
)
}
@Test
fun getSitePermissionsCustomSettingsRules_crossOriginStorageAccess() {
settings.setSitePermissionsPhoneFeatureAction(PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS, ALLOWED)
assertEquals(
defaultPermissions.copy(crossOriginStorageAccess = ALLOWED),
settings.getSitePermissionsCustomSettingsRules()
)
settings.setSitePermissionsPhoneFeatureAction(PhoneFeature.CROSS_ORIGIN_STORAGE_ACCESS, BLOCKED)
assertEquals(
defaultPermissions.copy(crossOriginStorageAccess = BLOCKED),
settings.getSitePermissionsCustomSettingsRules()
)
}
@Test
fun getSitePermissionsCustomSettingsRules_mediaKeySystemAccess() {

@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
object AndroidComponents {
const val VERSION = "97.0.20211219190304"
const val VERSION = "97.0.20211221143454"
}

Loading…
Cancel
Save