WebKit Bugzilla
Attachment 346430 Details for
Bug 188282
: Control center controls disappear when pausing, locking device.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-188282-20180802164012.patch (text/plain), 22.56 KB, created by
Jer Noble
on 2018-08-02 16:40:13 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2018-08-02 16:40:13 PDT
Size:
22.56 KB
patch
obsolete
>Subversion Revision: 234483 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3f08c2ab7a0febeabf8f8e1358c4928c0e8cd35e..9c0c86cd0c65b393d9850ff69f3dd4d792a989d7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,51 @@ >+2018-08-02 Jer Noble <jer.noble@apple.com> >+ >+ Control center controls disappear when pausing, locking device. >+ https://bugs.webkit.org/show_bug.cgi?id=188282 >+ <rdar://problem/42497809> >+ >+ Reviewed by Eric Carlson. >+ >+ Test: platform/mac/media/audio-session-category-video-paused.html >+ >+ MediaRemote will set any app whose audio session category changes from MediaPlayback to >+ Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of >+ events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that >+ was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote. >+ >+ To solve the new issue, make our audio session category policy more explicit: once we are in >+ MediaPlayback category, we will remain so as long as the media element in queston stays >+ loaded, has played, and is never interrupted by the system. >+ >+ Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make >+ MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new >+ m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes >+ to Playing, and cleared during an interruption. Check this flag when deciding what audio >+ sessino category to set in MediaSessionManagerCocoa. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * platform/audio/PlatformMediaSession.cpp: >+ (WebCore::PlatformMediaSession::setState): >+ * platform/audio/PlatformMediaSession.h: >+ (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const): >+ (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption): >+ * platform/audio/PlatformMediaSessionManager.cpp: >+ (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted. >+ * platform/audio/PlatformMediaSessionManager.h: >+ (WebCore::PlatformMediaSessionManager::audioHardwareListener): >+ (WebCore::PlatformMediaSessionManager::updateSessionState): >+ * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: >+ (MediaSessionManagerCocoa::updateSessionState): >+ (MediaSessionManagerCocoa::beginInterruption): >+ (PlatformMediaSessionManager::updateSessionState): Deleted. >+ * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added. >+ * platform/audio/ios/MediaSessionManagerIOS.h: >+ * platform/audio/ios/MediaSessionManagerIOS.mm: >+ (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): >+ * platform/audio/mac/MediaSessionManagerMac.h: >+ * platform/audio/mac/MediaSessionManagerMac.mm: >+ (WebCore::MediaSessionManagerMac::MediaSessionManagerMac): >+ > 2018-07-20 Jer Noble <jer.noble@apple.com> > > [iOS] PiP gets into a bad state if entering PiP fails >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 4876ac80c14b7906478a68f91af27c464c8984db..85288cd4748bbfe477a16f6b888408e1fb384f44 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -3951,6 +3951,7 @@ > CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */; }; > CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */; }; > CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ CD227E3A2113C86200D285AF /* MediaSessionManagerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CD2F4A2418D89F700063746D /* AudioHardwareListener.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2218D89F700063746D /* AudioHardwareListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CD2F4A2818D8A3490063746D /* AudioHardwareListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2618D8A3490063746D /* AudioHardwareListenerMac.h */; }; > CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD318620199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm */; }; >@@ -13186,6 +13187,7 @@ > CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRepresentation.cpp; sourceTree = "<group>"; }; > CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = "<group>"; }; > CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSURLSession.h; sourceTree = "<group>"; }; >+ CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MediaSessionManagerCocoa.h; path = cocoa/MediaSessionManagerCocoa.h; sourceTree = "<group>"; }; > CD27F6E014575C1B0078207D /* MediaController.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaController.idl; sourceTree = "<group>"; }; > CD27F6E2145767580078207D /* JSMediaController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaController.cpp; sourceTree = "<group>"; }; > CD27F6E3145767580078207D /* JSMediaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaController.h; sourceTree = "<group>"; }; >@@ -24670,6 +24672,7 @@ > isa = PBXGroup; > children = ( > CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */, >+ CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */, > CDE667A21E4BBF1500E8154A /* WebAudioBufferList.cpp */, > CDE667A31E4BBF1500E8154A /* WebAudioBufferList.h */, > ); >@@ -27867,6 +27870,7 @@ > 8371AC3B1F509BE400FBF284 /* ErrorCallback.h in Headers */, > 2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */, > 85031B420A44EFC700F992E0 /* Event.h in Headers */, >+ CD227E3A2113C86200D285AF /* MediaSessionManagerCocoa.h in Headers */, > 4138D3351244054800323D33 /* EventContext.h in Headers */, > 418A06D0133C04D500CD379C /* EventDispatcher.h in Headers */, > 93C09A530B064DB3005ABD4D /* EventHandler.h in Headers */, >diff --git a/Source/WebCore/platform/audio/PlatformMediaSession.cpp b/Source/WebCore/platform/audio/PlatformMediaSession.cpp >index ee19b67530ecc1cbc742d5ce9435b71499a0eb88..fa99fee3cb90cc06b4c97938aa3e03d72c5c19b4 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.cpp >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.cpp >@@ -117,6 +117,8 @@ void PlatformMediaSession::setState(State state) > > INFO_LOG(LOGIDENTIFIER, state); > m_state = state; >+ if (m_state == State::Playing) >+ m_hasPlayedSinceLastInterruption = true; > PlatformMediaSessionManager::sharedManager().sessionStateChanged(*this); > } > >diff --git a/Source/WebCore/platform/audio/PlatformMediaSession.h b/Source/WebCore/platform/audio/PlatformMediaSession.h >index fd6f08cdfbd9ea78991d5966634c08732e8808ca..d97679db94591af1210e007258b67c9da0fadc9f 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.h >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.h >@@ -176,6 +176,9 @@ public: > > virtual bool allowsNowPlayingControlsVisibility() const { return false; } > >+ bool hasPlayedSinceLastInterruption() const { return m_hasPlayedSinceLastInterruption; } >+ void clearHasPlayedSinceLastInterruption() { m_hasPlayedSinceLastInterruption = false; } >+ > protected: > PlatformMediaSessionClient& client() const { return m_client; } > >@@ -194,6 +197,7 @@ private: > int m_interruptionCount { 0 }; > bool m_notifyingClient; > bool m_isPlayingToWirelessPlaybackTarget { false }; >+ bool m_hasPlayedSinceLastInterruption { false }; > > #if !RELEASE_LOG_DISABLED > Ref<const Logger> m_logger; >diff --git a/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp b/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp >index 95317311190472fca1b77f3b2292973a46df10aa..89fe550a761ddfebcad7c42030d5312f14464e1b 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp >+++ b/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp >@@ -357,12 +357,6 @@ void PlatformMediaSessionManager::sessionCanProduceAudioChanged(PlatformMediaSes > updateSessionState(); > } > >-#if !PLATFORM(COCOA) >-void PlatformMediaSessionManager::updateSessionState() >-{ >-} >-#endif >- > void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument) > { > PlatformMediaSession* activeSession = currentSession(); >diff --git a/Source/WebCore/platform/audio/PlatformMediaSessionManager.h b/Source/WebCore/platform/audio/PlatformMediaSessionManager.h >index ad363839683371268476b0b853b60bbf6f50dcb4..4c9fe6ef25e8d45bc9c1b8bee02911321339aa00 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSessionManager.h >+++ b/Source/WebCore/platform/audio/PlatformMediaSessionManager.h >@@ -66,7 +66,7 @@ public: > bool willIgnoreSystemInterruptions() const { return m_willIgnoreSystemInterruptions; } > void setWillIgnoreSystemInterruptions(bool ignore) { m_willIgnoreSystemInterruptions = ignore; } > >- WEBCORE_EXPORT void beginInterruption(PlatformMediaSession::InterruptionType); >+ WEBCORE_EXPORT virtual void beginInterruption(PlatformMediaSession::InterruptionType); > WEBCORE_EXPORT void endInterruption(PlatformMediaSession::EndInterruptionFlags); > > WEBCORE_EXPORT void applicationWillBecomeInactive() const; >@@ -123,10 +123,12 @@ protected: > PlatformMediaSession* findSession(const Function<bool(PlatformMediaSession&, size_t)>&) const; > bool anyOfSessions(const Function<bool(PlatformMediaSession&, size_t)>& predicate) const { return findSession(predicate); } > >+ AudioHardwareListener* audioHardwareListener() { return m_audioHardwareListener.get(); } >+ > private: > friend class Internals; > >- void updateSessionState(); >+ virtual void updateSessionState() { } > > // RemoteCommandListenerClient > WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override; >diff --git a/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp b/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp >index b3e16279df8b95c51526d5772f5480b8a37dcd1a..5da5127cb6391e3fa0fb6cae035db7162281bdda 100644 >--- a/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp >+++ b/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp >@@ -24,7 +24,7 @@ > */ > > #include "config.h" >-#include "PlatformMediaSessionManager.h" >+#include "MediaSessionManagerCocoa.h" > > #if USE(AUDIO_SESSION) > >@@ -38,7 +38,7 @@ using namespace WebCore; > static const size_t kWebAudioBufferSize = 128; > static const size_t kLowPowerVideoBufferSize = 4096; > >-void PlatformMediaSessionManager::updateSessionState() >+void MediaSessionManagerCocoa::updateSessionState() > { > LOG(Media, "PlatformMediaSessionManager::scheduleUpdateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio)); > >@@ -53,7 +53,7 @@ void PlatformMediaSessionManager::updateSessionState() > // causes media LayoutTests to fail on 10.8. > > size_t bufferSize; >- if (m_audioHardwareListener && m_audioHardwareListener->outputDeviceSupportsLowPowerMode()) >+ if (audioHardwareListener() && audioHardwareListener()->outputDeviceSupportsLowPowerMode()) > bufferSize = kLowPowerVideoBufferSize; > else > bufferSize = kWebAudioBufferSize; >@@ -70,7 +70,7 @@ void PlatformMediaSessionManager::updateSessionState() > auto type = session.mediaType(); > if (type == PlatformMediaSession::WebAudio) > hasWebAudioType = true; >- if ((type == PlatformMediaSession::VideoAudio || type == PlatformMediaSession::Audio) && session.canProduceAudio() && session.state() == PlatformMediaSession::Playing) >+ if ((type == PlatformMediaSession::VideoAudio || type == PlatformMediaSession::Audio) && session.canProduceAudio() && session.hasPlayedSinceLastInterruption()) > hasAudibleAudioOrVideoMediaType = true; > if (session.isPlayingToWirelessPlaybackTarget()) > hasAudibleAudioOrVideoMediaType = true; >@@ -87,4 +87,15 @@ void PlatformMediaSessionManager::updateSessionState() > AudioSession::sharedSession().setCategory(AudioSession::None); > } > >+void MediaSessionManagerCocoa::beginInterruption(PlatformMediaSession::InterruptionType type) >+{ >+ if (type == PlatformMediaSession::InterruptionType::SystemInterruption) { >+ forEachSession([] (PlatformMediaSession& session, size_t) { >+ session.clearHasPlayedSinceLastInterruption(); >+ }); >+ } >+ >+ PlatformMediaSessionManager::beginInterruption(type); >+} >+ > #endif // USE(AUDIO_SESSION) >diff --git a/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h b/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h >new file mode 100644 >index 0000000000000000000000000000000000000000..41fea1454d7dbd1d535ecd7570cf2b990f030f91 >--- /dev/null >+++ b/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h >@@ -0,0 +1,42 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if PLATFORM(COCOA) >+ >+#include "PlatformMediaSessionManager.h" >+ >+namespace WebCore { >+ >+class MediaSessionManagerCocoa : public PlatformMediaSessionManager { >+public: >+ void updateSessionState() override; >+ void beginInterruption(PlatformMediaSession::InterruptionType) override; >+}; >+ >+} >+ >+#endif // PLATFORM(COCOA) >diff --git a/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h b/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h >index ee193f4f5275065418a9844aa6dcb2510186a45d..b9a86084eec2be93196e77d050f5b27d3d860380 100644 >--- a/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h >+++ b/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h >@@ -27,7 +27,7 @@ > > #if PLATFORM(IOS) > >-#include "PlatformMediaSessionManager.h" >+#include "MediaSessionManagerCocoa.h" > #include <wtf/RetainPtr.h> > > OBJC_CLASS WebMediaSessionHelper; >@@ -41,7 +41,7 @@ extern NSString* WebUIApplicationDidEnterBackgroundNotification; > > namespace WebCore { > >-class MediaSessionManageriOS : public PlatformMediaSessionManager { >+class MediaSessionManageriOS : public MediaSessionManagerCocoa { > public: > virtual ~MediaSessionManageriOS(); > >diff --git a/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm b/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm >index ca634b7dfe2091435713a38098f724b7960d84f5..1cbfc6592d049f72a47ae74bb044dd9a9c4f0a1d 100644 >--- a/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm >+++ b/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm >@@ -144,7 +144,7 @@ PlatformMediaSessionManager* PlatformMediaSessionManager::sharedManagerIfExists( > } > > MediaSessionManageriOS::MediaSessionManageriOS() >- : PlatformMediaSessionManager() >+ : MediaSessionManagerCocoa() > { > BEGIN_BLOCK_OBJC_EXCEPTIONS > m_objcObserver = adoptNS([[WebMediaSessionHelper alloc] initWithCallback:this]); >diff --git a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h >index 499f05b7b255e810cc715fbccde46f14ea8c3a14..29076950e1acec269cfa74fedc0ef175ac528776 100644 >--- a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h >+++ b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h >@@ -28,11 +28,11 @@ > #if PLATFORM(MAC) > > #include "GenericTaskQueue.h" >-#include "PlatformMediaSessionManager.h" >+#include "MediaSessionManagerCocoa.h" > > namespace WebCore { > >-class MediaSessionManagerMac : public PlatformMediaSessionManager { >+class MediaSessionManagerMac : public MediaSessionManagerCocoa { > public: > virtual ~MediaSessionManagerMac(); > >diff --git a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm >index 67af08b63cadac8694e88eb28ca6c8753c5dab4c..cb83304cf89adcae007d290981d342981d69eb39 100644 >--- a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm >+++ b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm >@@ -55,7 +55,7 @@ PlatformMediaSessionManager* PlatformMediaSessionManager::sharedManagerIfExists( > } > > MediaSessionManagerMac::MediaSessionManagerMac() >- : PlatformMediaSessionManager() >+ : MediaSessionManagerCocoa() > { > resetRestrictions(); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1cc66a82d8436e4eef7f371ba89c046f460ef606..efe083d52ad63e26d5861ce8eb9ff41be43dedf0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-08-02 Jer Noble <jer.noble@apple.com> >+ >+ Control center controls disappear when pausing, locking device. >+ https://bugs.webkit.org/show_bug.cgi?id=188282 >+ <rdar://problem/42497809> >+ >+ Reviewed by Eric Carlson. >+ >+ * platform/mac/media/audio-session-category-video-paused-expected.txt: Added. >+ * platform/mac/media/audio-session-category-video-paused.html: Added. >+ * platform/ios/TestExpectations: >+ > 2018-08-01 Nan Wang <n_wang@apple.com> > > AX: AOM: Add ARIA IDL Attribute Reflection >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 4812e2fd5c9427f6ac439e32ea0b68a0c1a2fe77..b881ed004ec01727d1f518b93076e9f9cf48a032 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3338,3 +3338,6 @@ webkit.org/b/186714 fast/forms/datalist/datalist-textinput-keydown.html [ Skip ] > > # We are only accepting GLSL3 for macOS. > webkit.org/b/187982 webgl/2.0.0/conformance2/glsl3 [ Skip ] >+ >+# Audio session does not have a "none" category on iOS [ Skip ] >+webkit.org/b/188285 platform/mac/media/audio-session-category-video-paused.html [ Skip ] >diff --git a/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt b/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9ea07551e2a8494ae2964c50de326a45b879f6d2 >--- /dev/null >+++ b/LayoutTests/platform/mac/media/audio-session-category-video-paused-expected.txt >@@ -0,0 +1,19 @@ >+ >+RUN(internals.settings.setShouldManageAudioSessionCategory(true)) >+RUN(video.src = findMediaFile("video", "../../../media/content/test")) >+RUN(video.play()) >+EVENT(playing) >+EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK >+RUN(video.pause()) >+EVENT(pause) >+EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK >+RUN(internals.beginMediaSessionInterruption("system")) >+EXPECTED (internals.audioSessionCategory() == 'None') OK >+RUN(video.play()) >+EVENT(playing) >+EXPECTED (internals.audioSessionCategory() == 'MediaPlayback') OK >+RUN(video.src = "") >+RUN(video.load()) >+EXPECTED (internals.audioSessionCategory() == 'None') OK >+END OF TEST >+ >diff --git a/LayoutTests/platform/mac/media/audio-session-category-video-paused.html b/LayoutTests/platform/mac/media/audio-session-category-video-paused.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5f5daa571525291174cfc9491c0a638df5795f61 >--- /dev/null >+++ b/LayoutTests/platform/mac/media/audio-session-category-video-paused.html >@@ -0,0 +1,38 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <title>audio-session-category-track-change</title> >+ <script src="../../../media/video-test.js"></script> >+ <script src="../../../media/media-file.js"></script> >+ <script> >+ window.addEventListener('load', async event => { >+ findMediaElement(); >+ run('internals.settings.setShouldManageAudioSessionCategory(true)'); >+ run('video.src = findMediaFile("video", "../../../media/content/test")'); >+ run('video.play()'); >+ await waitFor(video, 'playing'); >+ await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback'); >+ >+ run('video.pause()'); >+ await waitFor(video, 'pause'); >+ await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback'); >+ >+ run('internals.beginMediaSessionInterruption("system")'); >+ await testExpectedEventually('internals.audioSessionCategory()', 'None'); >+ >+ run('video.play()'); >+ await waitFor(video, 'playing'); >+ await testExpectedEventually('internals.audioSessionCategory()', 'MediaPlayback'); >+ >+ run('video.src = ""'); >+ run('video.load()'); >+ await testExpectedEventually('internals.audioSessionCategory()', 'None'); >+ >+ endTest(); >+ }); >+ </script> >+</head> >+<body> >+ <video controls></video> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188282
:
346425
|
346426
| 346430