Diff
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/ChangeLog (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/ChangeLog 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/ChangeLog 2020-09-22 18:30:53 UTC (rev 267423)
@@ -35,98 +35,6 @@
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
-2020-09-15 Alan Coon <[email protected]>
-
- Cherry-pick r266121. rdar://problem/68949249
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- Source/WebCore:
-
- No new tests, updated AudioRoutingArbitration API test.
-
- * platform/audio/AudioSession.cpp:
- (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method.
- (WebCore::setIsPlayingToBluetoothOverride): Ditto.
- * platform/audio/AudioSession.h:
-
- * platform/audio/cocoa/MediaSessionManagerCocoa.h:
- * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
- (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged.
-
- * platform/audio/mac/AudioSessionMac.mm:
- (WebCore::defaultDeviceTransportIsBluetooth): New.
- (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth
- if bluetooth transport has changed since the last arbitration update.
- (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth
- transport for testing.
- (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category
- or bluetooth transport changes.
-
- * testing/Internals.cpp:
- (WebCore::Internals::setIsPlayingToBluetoothOverride):
- * testing/Internals.h:
- * testing/Internals.idl:
-
- Source/WebKit:
-
- * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
- * UIProcess/API/Cocoa/WKWebViewTesting.mm:
- (-[WKWebView _audioRoutingArbitrationUpdateTime]):
-
- * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
- (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):
-
- * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
- (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
-
- Tools:
-
- * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
- (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add message string to help
- debugging when the test fails.
- * TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2020-08-25 Eric Carlson <[email protected]>
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- No new tests, updated AudioRoutingArbitration API test.
-
- * platform/audio/AudioSession.cpp:
- (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method.
- (WebCore::setIsPlayingToBluetoothOverride): Ditto.
- * platform/audio/AudioSession.h:
-
- * platform/audio/cocoa/MediaSessionManagerCocoa.h:
- * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
- (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged.
-
- * platform/audio/mac/AudioSessionMac.mm:
- (WebCore::defaultDeviceTransportIsBluetooth): New.
- (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth
- if bluetooth transport has changed since the last arbitration update.
- (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth
- transport for testing.
- (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category
- or bluetooth transport changes.
-
- * testing/Internals.cpp:
- (WebCore::Internals::setIsPlayingToBluetoothOverride):
- * testing/Internals.h:
- * testing/Internals.idl:
-
2020-09-11 Alan Coon <[email protected]>
Cherry-pick r266901. rdar://problem/68740506
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.cpp (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.cpp 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.cpp 2020-09-22 18:30:53 UTC (rev 267423)
@@ -163,19 +163,6 @@
#endif // !PLATFORM(COCOA)
-#if !PLATFORM(MAC)
-void AudioSession::audioOutputDeviceChanged()
-{
- notImplemented();
-}
-
-void AudioSession::setIsPlayingToBluetoothOverride(Optional<bool>)
-{
- notImplemented();
-}
-#endif // !PLATFORM(COCOA)
-
-
String convertEnumerationToString(RouteSharingPolicy enumerationValue)
{
static const NeverDestroyed<String> values[] = {
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.h (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.h 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/AudioSession.h 2020-09-22 18:30:53 UTC (rev 267423)
@@ -97,9 +97,6 @@
void addMutedStateObserver(MutedStateObserver*);
void removeMutedStateObserver(MutedStateObserver*);
- void audioOutputDeviceChanged();
- void setIsPlayingToBluetoothOverride(Optional<bool>);
-
virtual bool isMuted() const;
virtual void handleMutedStateChange();
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h 2020-09-22 18:30:53 UTC (rev 267423)
@@ -96,7 +96,7 @@
// AudioHardwareListenerClient
void audioHardwareDidBecomeActive() final { }
void audioHardwareDidBecomeInactive() final { }
- void audioOutputDeviceChanged() final;
+ void audioOutputDeviceChanged() final { updateSessionState(); }
// PAL::SystemSleepListener
void systemWillSleep() final { processSystemWillSleep(); }
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm 2020-09-22 18:30:53 UTC (rev 267423)
@@ -366,12 +366,6 @@
END_BLOCK_OBJC_EXCEPTIONS
}
-void MediaSessionManagerCocoa::audioOutputDeviceChanged()
-{
- AudioSession::sharedSession().audioOutputDeviceChanged();
- updateSessionState();
-}
-
} // namespace WebCore
#endif // USE(AUDIO_SESSION) && PLATFORM(COCOA)
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.mm (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.mm 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/platform/audio/mac/AudioSessionMac.mm 2020-09-22 18:30:53 UTC (rev 267423)
@@ -54,28 +54,6 @@
return deviceID;
}
-#if ENABLE(ROUTING_ARBITRATION)
-static Optional<bool> isPlayingToBluetoothOverride;
-
-static float defaultDeviceTransportIsBluetooth()
-{
- if (isPlayingToBluetoothOverride)
- return *isPlayingToBluetoothOverride;
-
- static const AudioObjectPropertyAddress audioDeviceTransportTypeProperty = {
- kAudioDevicePropertyTransportType,
- kAudioObjectPropertyScopeGlobal,
- kAudioObjectPropertyElementMaster,
- };
- UInt32 transportType = kAudioDeviceTransportTypeUnknown;
- UInt32 transportSize = sizeof(transportType);
- if (AudioObjectGetPropertyData(defaultDevice(), &audioDeviceTransportTypeProperty, 0, 0, &transportSize, &transportType))
- return false;
-
- return transportType == kAudioDeviceTransportTypeBluetooth || transportType == kAudioDeviceTransportTypeBluetoothLE;
-}
-#endif
-
class AudioSessionPrivate {
WTF_MAKE_FAST_ALLOCATED;
public:
@@ -84,8 +62,6 @@
AudioSession::CategoryType category { AudioSession::None };
#if ENABLE(ROUTING_ARBITRATION)
bool setupArbitrationOngoing { false };
- Optional<bool> playingToBluetooth;
- Optional<bool> playingToBluetoothOverride;
#endif
AudioSession::CategoryType m_categoryOverride;
bool inRoutingArbitration { false };
@@ -103,32 +79,11 @@
return m_private->category;
}
-void AudioSession::audioOutputDeviceChanged()
-{
-#if ENABLE(ROUTING_ARBITRATION)
- if (!m_private->playingToBluetooth || *m_private->playingToBluetooth == defaultDeviceTransportIsBluetooth())
- return;
-
- m_private->playingToBluetooth = WTF::nullopt;
-#endif
-}
-
-void AudioSession::setIsPlayingToBluetoothOverride(Optional<bool> value)
-{
-#if ENABLE(ROUTING_ARBITRATION)
- isPlayingToBluetoothOverride = value;
-#else
- UNUSED_PARAM(value);
-#endif
-}
-
void AudioSession::setCategory(CategoryType category, RouteSharingPolicy)
{
#if ENABLE(ROUTING_ARBITRATION)
- bool playingToBluetooth = defaultDeviceTransportIsBluetooth();
- if (category == m_private->category && m_private->playingToBluetooth && *m_private->playingToBluetooth == playingToBluetooth)
+ if (category == m_private->category)
return;
-
m_private->category = category;
if (m_private->setupArbitrationOngoing) {
@@ -150,7 +105,6 @@
using RoutingArbitrationError = AudioSessionRoutingArbitrationClient::RoutingArbitrationError;
using DefaultRouteChanged = AudioSessionRoutingArbitrationClient::DefaultRouteChanged;
- m_private->playingToBluetooth = playingToBluetooth;
m_private->setupArbitrationOngoing = true;
m_routingArbitrationClient->beginRoutingArbitrationWithCategory(m_private->category, [this] (RoutingArbitrationError error, DefaultRouteChanged defaultRouteChanged) {
m_private->setupArbitrationOngoing = false;
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.cpp (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.cpp 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.cpp 2020-09-22 18:30:53 UTC (rev 267423)
@@ -4943,17 +4943,6 @@
#endif
-ExceptionOr<void> Internals::setIsPlayingToBluetoothOverride(Optional<bool> isPlaying)
-{
-#if ENABLE(ROUTING_ARBITRATION)
- AudioSession::sharedSession().setIsPlayingToBluetoothOverride(isPlaying);
- return { };
-#else
- UNUSED_PARAM(isPlaying);
- return Exception { NotSupportedError };
-#endif
-}
-
void Internals::reportBacktrace()
{
WTFReportBacktrace();
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.h (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.h 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.h 2020-09-22 18:30:53 UTC (rev 267423)
@@ -624,8 +624,6 @@
double privatePlayerVolume(const HTMLMediaElement&);
#endif
- ExceptionOr<void> setIsPlayingToBluetoothOverride(Optional<bool>);
-
bool isSelectPopupVisible(HTMLSelectElement&);
ExceptionOr<String> captionsStyleSheetOverride();
Modified: branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.idl (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.idl 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebCore/testing/Internals.idl 2020-09-22 18:30:53 UTC (rev 267423)
@@ -652,8 +652,6 @@
[Conditional=VIDEO] DOMString elementBufferingPolicy(HTMLMediaElement media);
[Conditional=VIDEO] double privatePlayerVolume(HTMLMediaElement media);
- [MayThrowException] void setIsPlayingToBluetoothOverride(optional boolean? isPlaying = null);
-
[Conditional=LEGACY_ENCRYPTED_MEDIA] void initializeMockCDM();
[Conditional=ENCRYPTED_MEDIA] MockCDMFactory registerMockCDM();
void enableMockMediaCapabilities();
Modified: branches/safari-610.2.5.1-branch/Source/WebKit/ChangeLog (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebKit/ChangeLog 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebKit/ChangeLog 2020-09-22 18:30:53 UTC (rev 267423)
@@ -1,80 +1,3 @@
-2020-09-15 Alan Coon <[email protected]>
-
- Cherry-pick r266121. rdar://problem/68949249
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- Source/WebCore:
-
- No new tests, updated AudioRoutingArbitration API test.
-
- * platform/audio/AudioSession.cpp:
- (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method.
- (WebCore::setIsPlayingToBluetoothOverride): Ditto.
- * platform/audio/AudioSession.h:
-
- * platform/audio/cocoa/MediaSessionManagerCocoa.h:
- * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
- (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged.
-
- * platform/audio/mac/AudioSessionMac.mm:
- (WebCore::defaultDeviceTransportIsBluetooth): New.
- (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth
- if bluetooth transport has changed since the last arbitration update.
- (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth
- transport for testing.
- (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category
- or bluetooth transport changes.
-
- * testing/Internals.cpp:
- (WebCore::Internals::setIsPlayingToBluetoothOverride):
- * testing/Internals.h:
- * testing/Internals.idl:
-
- Source/WebKit:
-
- * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
- * UIProcess/API/Cocoa/WKWebViewTesting.mm:
- (-[WKWebView _audioRoutingArbitrationUpdateTime]):
-
- * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
- (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):
-
- * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
- (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
-
- Tools:
-
- * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
- (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add message string to help
- debugging when the test fails.
- * TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2020-08-25 Eric Carlson <[email protected]>
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
- * UIProcess/API/Cocoa/WKWebViewTesting.mm:
- (-[WKWebView _audioRoutingArbitrationUpdateTime]):
-
- * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
- (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):
-
- * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
- (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
-
2020-09-11 Alan Coon <[email protected]>
Cherry-pick r266677. rdar://problem/68740526
Modified: branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h 2020-09-22 18:30:53 UTC (rev 267423)
@@ -74,5 +74,4 @@
- (BOOL)_hasSleepDisabler;
- (WKWebViewAudioRoutingArbitrationStatus)_audioRoutingArbitrationStatus;
-- (double)_audioRoutingArbitrationUpdateTime;
@end
Modified: branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm 2020-09-22 18:30:53 UTC (rev 267423)
@@ -262,13 +262,4 @@
#endif
}
-- (double)_audioRoutingArbitrationUpdateTime
-{
-#if ENABLE(ROUTING_ARBITRATION)
- return _page->process().audioSessionRoutingArbitrator().arbitrationUpdateTime().secondsSinceEpoch().seconds();
-#else
- return 0;
-#endif
-}
-
@end
Modified: branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/AudioSessionRoutingArbitratorProxy.h (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/AudioSessionRoutingArbitratorProxy.h 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/AudioSessionRoutingArbitratorProxy.h 2020-09-22 18:30:53 UTC (rev 267423)
@@ -29,7 +29,6 @@
#include "MessageReceiver.h"
#include <WebCore/AudioSession.h>
-#include <wtf/WallTime.h>
#include <wtf/WeakPtr.h>
namespace WebKit {
@@ -60,7 +59,6 @@
};
ArbitrationStatus arbitrationStatus() const { return m_arbitrationStatus; }
- WallTime arbitrationUpdateTime() const { return m_arbitrationUpdateTime; }
private:
// IPC::MessageReceiver
@@ -73,7 +71,6 @@
WebProcessProxy& m_process;
WebCore::AudioSession::CategoryType m_category { WebCore::AudioSession::None };
ArbitrationStatus m_arbitrationStatus { ArbitrationStatus::None };
- WallTime m_arbitrationUpdateTime;
};
}
Modified: branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm 2020-09-22 18:30:53 UTC (rev 267423)
@@ -178,7 +178,6 @@
{
m_category = category;
m_arbitrationStatus = ArbitrationStatus::Pending;
- m_arbitrationUpdateTime = WallTime::now();
SharedArbitrator::sharedInstance().beginRoutingArbitrationForArbitrator(*this, [weakThis = makeWeakPtr(*this), callback = WTFMove(callback)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
if (weakThis)
weakThis->m_arbitrationStatus = error == RoutingArbitrationError::None ? ArbitrationStatus::Active : ArbitrationStatus::None;
Modified: branches/safari-610.2.5.1-branch/Tools/ChangeLog (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Tools/ChangeLog 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Tools/ChangeLog 2020-09-22 18:30:53 UTC (rev 267423)
@@ -1,75 +1,3 @@
-2020-09-15 Alan Coon <[email protected]>
-
- Cherry-pick r266121. rdar://problem/68949249
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- Source/WebCore:
-
- No new tests, updated AudioRoutingArbitration API test.
-
- * platform/audio/AudioSession.cpp:
- (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method.
- (WebCore::setIsPlayingToBluetoothOverride): Ditto.
- * platform/audio/AudioSession.h:
-
- * platform/audio/cocoa/MediaSessionManagerCocoa.h:
- * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
- (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged.
-
- * platform/audio/mac/AudioSessionMac.mm:
- (WebCore::defaultDeviceTransportIsBluetooth): New.
- (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth
- if bluetooth transport has changed since the last arbitration update.
- (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth
- transport for testing.
- (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category
- or bluetooth transport changes.
-
- * testing/Internals.cpp:
- (WebCore::Internals::setIsPlayingToBluetoothOverride):
- * testing/Internals.h:
- * testing/Internals.idl:
-
- Source/WebKit:
-
- * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
- * UIProcess/API/Cocoa/WKWebViewTesting.mm:
- (-[WKWebView _audioRoutingArbitrationUpdateTime]):
-
- * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
- (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):
-
- * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
- (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
-
- Tools:
-
- * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
- (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add message string to help
- debugging when the test fails.
- * TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2020-08-25 Eric Carlson <[email protected]>
-
- [macOS] Update audio arbitration manager when audio transport changes
- https://bugs.webkit.org/show_bug.cgi?id=215781
- <rdar://problem/65920613>
-
- Reviewed by Jer Noble.
-
- * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
- (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add message string to help
- debugging when the test fails.
- * TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:
-
2020-09-03 Alan Coon <[email protected]>
Cherry-pick r266265. rdar://problem/68168939
Modified: branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm 2020-09-22 18:30:53 UTC (rev 267423)
@@ -33,7 +33,6 @@
#import <WebKit/WKWebViewConfigurationPrivate.h>
#import <WebKit/WKWebViewPrivate.h>
#import <WebKit/WKWebViewPrivateForTesting.h>
-#import <wtf/WallTime.h>
class AudioRoutingArbitration : public testing::Test {
public:
@@ -42,8 +41,6 @@
void SetUp() final
{
auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
- WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
- configuration.get().processPool = (WKProcessPool *)context.get();
configuration.get()._mediaDataLoadsAutomatically = YES;
configuration.get().mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration.get() addToWindow:YES]);
@@ -59,7 +56,7 @@
[webView _close];
}
- void statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatus status, const char* message)
+ void statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatus status)
{
int tries = 0;
do {
@@ -69,86 +66,54 @@
TestWebKitAPI::Util::sleep(0.1);
} while (++tries <= 100);
- EXPECT_EQ(status, [webView _audioRoutingArbitrationStatus]) << message;
+ EXPECT_EQ(status, [webView _audioRoutingArbitrationStatus]);
}
};
TEST_F(AudioRoutingArbitration, Basic)
{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Basic");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
}
TEST_F(AudioRoutingArbitration, Mute)
{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Mute 1");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
[webView objectByEvaluatingJavaScriptWithUserGesture:@"document.querySelector('video').muted = true"];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Mute 2");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone);
[webView objectByEvaluatingJavaScriptWithUserGesture:@"document.querySelector('video').muted = false"];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Mute 3");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
}
TEST_F(AudioRoutingArbitration, Navigation)
{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Navigation 1");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
[webView synchronouslyLoadHTMLString:@"<html>no contents</html>"];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Navigation 2");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone);
}
TEST_F(AudioRoutingArbitration, Deletion)
{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Deletion 1");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
[webView objectByEvaluatingJavaScriptWithUserGesture:@"document.querySelector('video').parentNode.innerHTML = ''"];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Deletion 2");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone);
}
TEST_F(AudioRoutingArbitration, Close)
{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Close 1");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive);
[webView _close];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Close 2");
+ statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone);
}
-TEST_F(AudioRoutingArbitration, Updating)
-{
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Updating 1");
- [webView evaluateJavaScript:@"document.querySelector('video').pause()" completionHandler:nil];
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Updating 2");
-
- auto start = WallTime::now().secondsSinceEpoch().seconds();
- auto arbitrationUpdateTime = [webView _audioRoutingArbitrationUpdateTime];
- ASSERT_TRUE(arbitrationUpdateTime < start);
-
- [webView evaluateJavaScript:@"document.querySelector('video').play()" completionHandler:nil];
- EXPECT_EQ(arbitrationUpdateTime, [webView _audioRoutingArbitrationUpdateTime]) << "Arbitration was unexpectedly updated";
- statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusActive, "Updating 3");
-
- [webView evaluateJavaScript:@"document.querySelector('video').pause()" completionHandler:nil];
- [webView stringByEvaluatingJavaScript:@"window.internals.setIsPlayingToBluetoothOverride(true)"];
-
- [webView evaluateJavaScript:@"document.querySelector('video').play()" completionHandler:nil];
-
- int tries = 0;
- do {
- if ([webView _audioRoutingArbitrationUpdateTime] > arbitrationUpdateTime)
- break;
-
- TestWebKitAPI::Util::sleep(0.1);
- } while (++tries <= 100);
-
- EXPECT_LT(arbitrationUpdateTime, [webView _audioRoutingArbitrationUpdateTime]) << "Arbitration was not updated";
-
- [webView stringByEvaluatingJavaScript:@"window.internals.setIsPlayingToBluetoothOverride()"];
-}
-
#endif
Modified: branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html (267422 => 267423)
--- branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html 2020-09-22 18:25:00 UTC (rev 267422)
+++ branches/safari-610.2.5.1-branch/Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html 2020-09-22 18:30:53 UTC (rev 267423)
@@ -2,6 +2,8 @@
<html>
<head>
<script>
+ var timeout;
+
function go() {
var video = document.getElementsByTagName('video')[0];
video.play().then(playing).catch(notPlaying);
@@ -27,16 +29,6 @@
} catch(e) { }
}
- function pause() {
- let video = document.getElementsByTagName('video')[0];
- video.addEventListener("pause", paused, { once: true });
- video.pause();
- }
-
- function play() {
- go();
- }
-
document.addEventListener('pageshow', go);
</script>
</head>