[iOS] Video occasionally mixes with other system audio instead of interrupting
[WebKit-https.git] / Source / WebCore / testing / InternalSettings.cpp
index c9fcab9..74b2713 100644 (file)
@@ -111,6 +111,9 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_webGPUEnabled(RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled())
 #endif
     , m_shouldMockBoldSystemFontForAccessibility(RenderTheme::singleton().shouldMockBoldSystemFontForAccessibility())
+#if USE(AUDIO_SESSION)
+    , m_shouldManageAudioSessionCategory(Settings::shouldManageAudioSessionCategory())
+#endif
 {
 }
 
@@ -201,6 +204,10 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
 #if ENABLE(WEBGPU)
     RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled(m_webGPUEnabled);
 #endif
+
+#if USE(AUDIO_SESSION)
+    Settings::setShouldManageAudioSessionCategory(m_shouldManageAudioSessionCategory);
+#endif
 }
 
 class InternalSettingsWrapper : public Supplement<Page> {
@@ -804,6 +811,16 @@ ExceptionOr<void> InternalSettings::setDeferredCSSParserEnabled(bool enabled)
     return { };
 }
 
+ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool should)
+{
+#if USE(AUDIO_SESSION)
+    Settings::setShouldManageAudioSessionCategory(should);
+    return { };
+#else
+    return Exception { INVALID_ACCESS_ERR };
+#endif
+}
+
 static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value)
 {
     switch (value) {