Diff
Modified: trunk/Source/WebCore/ChangeLog (227421 => 227422)
--- trunk/Source/WebCore/ChangeLog 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/ChangeLog 2018-01-23 17:52:53 UTC (rev 227422)
@@ -1,3 +1,21 @@
+2018-01-23 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r227279 and r227373.
+ https://bugs.webkit.org/show_bug.cgi?id=181988
+
+ The LayoutTest crash fix introduced an API test failure.
+ (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227279
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227373
+
2018-01-23 Michael Catanzaro <[email protected]>
Unreviewed, fix some format specifiers added in r227190
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (227421 => 227422)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2018-01-23 17:52:53 UTC (rev 227422)
@@ -971,9 +971,6 @@
m_pauseAfterDetachedTaskQueue.enqueueTask(std::bind(&HTMLMediaElement::pauseAfterDetachedTask, this));
}
- if (m_mediaSession)
- m_mediaSession->clientCharacteristicsChanged();
-
HTMLElement::removedFromAncestor(removalType, oldParentOfRemovedTree);
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (227421 => 227422)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -551,8 +551,6 @@
bool willLog(WTFLogLevel) const;
- bool isSuspended() const final;
-
protected:
HTMLMediaElement(const QualifiedName&, Document&, bool createdByParser);
virtual void finishInitialization();
@@ -866,6 +864,7 @@
bool shouldOverrideBackgroundLoadingRestriction() const override;
bool canProduceAudio() const final;
bool processingUserGestureForMedia() const final;
+ bool isSuspended() const final;
void pageMutedStateDidChange() override;
Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (227421 => 227422)
--- trunk/Source/WebCore/html/MediaElementSession.cpp 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp 2018-01-23 17:52:53 UTC (rev 227422)
@@ -162,9 +162,6 @@
SuccessOr<MediaPlaybackDenialReason> MediaElementSession::playbackPermitted(const HTMLMediaElement& element) const
{
- if (m_element.isSuspended())
- return { };
-
if (element.document().isMediaDocument() && !element.document().ownerElement())
return { };
@@ -298,11 +295,6 @@
bool MediaElementSession::canShowControlsManager(PlaybackControlsPurpose purpose) const
{
- if (m_element.isSuspended()) {
- LOG(Media, "MediaElementSession::canShowControlsManager - returning FALSE: isSuspended()");
- return false;
- }
-
if (m_element.isFullscreen()) {
LOG(Media, "MediaElementSession::canShowControlsManager - returning TRUE: Is fullscreen");
return true;
@@ -343,6 +335,11 @@
return false;
}
+ if (m_element.document().activeDOMObjectsAreSuspended()) {
+ LOG(Media, "MediaElementSession::canShowControlsManager - returning FALSE: activeDOMObjectsAreSuspended()");
+ return false;
+ }
+
if (!playbackPermitted(m_element)) {
LOG(Media, "MediaElementSession::canShowControlsManager - returning FALSE: Playback not permitted");
return false;
@@ -694,8 +691,7 @@
static bool isMainContentForPurposesOfAutoplay(const HTMLMediaElement& element)
{
- Document& document = element.document();
- if (!document.isSafeToUpdateStyleOrLayout() || !element.hasAudio() || !element.hasVideo())
+ if (!element.hasAudio() || !element.hasVideo())
return false;
// Elements which have not yet been laid out, or which are not yet in the DOM, cannot be main content.
@@ -715,6 +711,7 @@
return false;
// Main content elements must be in the main frame.
+ Document& document = element.document();
if (!document.frame() || !document.frame()->isMainFrame())
return false;
@@ -821,9 +818,6 @@
bool MediaElementSession::updateIsMainContent() const
{
- if (m_element.isSuspended())
- return false;
-
bool wasMainContent = m_isMainContent;
m_isMainContent = isMainContentForPurposesOfAutoplay(m_element);
Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (227421 => 227422)
--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2018-01-23 17:52:53 UTC (rev 227422)
@@ -33,6 +33,12 @@
namespace WebCore {
+#if !PLATFORM(MAC)
+void PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary()
+{
+}
+#endif
+
#if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
#if !PLATFORM(COCOA)
@@ -51,12 +57,6 @@
}
#endif // !PLATFORM(COCOA)
-void PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary()
-{
- if (auto existingManager = PlatformMediaSessionManager::sharedManagerIfExists())
- existingManager->scheduleUpdateNowPlayingInfo();
-}
-
PlatformMediaSessionManager::PlatformMediaSessionManager()
: m_systemSleepListener(PAL::SystemSleepListener::create(*this))
{
Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (227421 => 227422)
--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -61,7 +61,6 @@
WEBCORE_EXPORT virtual double lastUpdatedNowPlayingDuration() const { return NAN; }
WEBCORE_EXPORT virtual double lastUpdatedNowPlayingElapsedTime() const { return NAN; }
WEBCORE_EXPORT virtual uint64_t lastUpdatedNowPlayingInfoUniqueIdentifier() const { return 0; }
- WEBCORE_EXPORT virtual bool registeredAsNowPlayingApplication() const { return false; }
bool willIgnoreSystemInterruptions() const { return m_willIgnoreSystemInterruptions; }
void setWillIgnoreSystemInterruptions(bool ignore) { m_willIgnoreSystemInterruptions = ignore; }
Modified: trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (227421 => 227422)
--- trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -73,7 +73,6 @@
double lastUpdatedNowPlayingDuration() const final { return m_reportedDuration; }
double lastUpdatedNowPlayingElapsedTime() const final { return m_reportedCurrentTime; }
uint64_t lastUpdatedNowPlayingInfoUniqueIdentifier() const final { return m_lastUpdatedNowPlayingInfoUniqueIdentifier; }
- bool registeredAsNowPlayingApplication() const final { return m_nowPlayingActive; }
PlatformMediaSession* nowPlayingEligibleSession();
Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h (227421 => 227422)
--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -41,7 +41,6 @@
double lastUpdatedNowPlayingDuration() const final { return m_lastUpdatedNowPlayingDuration; }
double lastUpdatedNowPlayingElapsedTime() const final { return m_lastUpdatedNowPlayingElapsedTime; }
uint64_t lastUpdatedNowPlayingInfoUniqueIdentifier() const final { return m_lastUpdatedNowPlayingInfoUniqueIdentifier; }
- bool registeredAsNowPlayingApplication() const final { return m_registeredAsNowPlayingApplication; }
private:
friend class PlatformMediaSessionManager;
@@ -62,7 +61,6 @@
bool m_nowPlayingActive { false };
bool m_isInBackground { false };
- bool m_registeredAsNowPlayingApplication { false };
// For testing purposes only.
String m_lastUpdatedNowPlayingTitle;
Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (227421 => 227422)
--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm 2018-01-23 17:52:53 UTC (rev 227422)
@@ -54,6 +54,12 @@
return platformMediaSessionManager;
}
+void PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary()
+{
+ if (auto existingManager = (MediaSessionManagerMac *)PlatformMediaSessionManager::sharedManagerIfExists())
+ existingManager->scheduleUpdateNowPlayingInfo();
+}
+
MediaSessionManagerMac::MediaSessionManagerMac()
: PlatformMediaSessionManager()
{
@@ -130,10 +136,6 @@
MRMediaRemoteSetNowPlayingVisibility(MRMediaRemoteGetLocalOrigin(), MRNowPlayingClientVisibilityNeverVisible);
LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info");
-
- MRMediaRemoteSetCanBeNowPlayingApplication(false);
- m_registeredAsNowPlayingApplication = false;
-
MRMediaRemoteSetNowPlayingInfo(nullptr);
m_nowPlayingActive = false;
m_lastUpdatedNowPlayingTitle = emptyString();
@@ -152,10 +154,10 @@
return;
}
- if (!m_registeredAsNowPlayingApplication) {
- m_registeredAsNowPlayingApplication = true;
+ static dispatch_once_t enableNowPlayingToken;
+ dispatch_once(&enableNowPlayingToken, ^() {
MRMediaRemoteSetCanBeNowPlayingApplication(true);
- }
+ });
String title = currentSession->title();
double duration = currentSession->supportsSeeking() ? currentSession->duration() : MediaPlayer::invalidTime();
Modified: trunk/Source/WebKit/ChangeLog (227421 => 227422)
--- trunk/Source/WebKit/ChangeLog 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/ChangeLog 2018-01-23 17:52:53 UTC (rev 227422)
@@ -1,3 +1,21 @@
+2018-01-23 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r227279 and r227373.
+ https://bugs.webkit.org/show_bug.cgi?id=181988
+
+ The LayoutTest crash fix introduced an API test failure.
+ (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227279
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227373
+
2018-01-23 Youenn Fablet <[email protected]>
REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (227421 => 227422)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-01-23 17:52:53 UTC (rev 227422)
@@ -6074,16 +6074,16 @@
#endif // PLATFORM(MAC)
-- (void)_requestActiveNowPlayingSessionInfo:(void(^)(BOOL, BOOL, NSString*, double, double, NSInteger))callback
+- (void)_requestActiveNowPlayingSessionInfo:(void(^)(BOOL, NSString*, double, double, NSInteger))callback
{
if (!_page) {
- callback(NO, NO, @"", std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(), 0);
+ callback(NO, @"", std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(), 0);
return;
}
auto handler = makeBlockPtr(callback);
- auto localCallback = WebKit::NowPlayingInfoCallback::create([handler](bool active, bool registeredAsNowPlayingApplication, String title, double duration, double elapsedTime, uint64_t uniqueIdentifier, WebKit::CallbackBase::Error) {
- handler(active, registeredAsNowPlayingApplication, title, duration, elapsedTime, uniqueIdentifier);
+ auto localCallback = WebKit::NowPlayingInfoCallback::create([handler](bool active, String title, double duration, double elapsedTime, uint64_t uniqueIdentifier, WebKit::CallbackBase::Error) {
+ handler(active, title, duration, elapsedTime, uniqueIdentifier);
});
_page->requestActiveNowPlayingSessionInfo(WTFMove(localCallback));
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (227421 => 227422)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -442,7 +442,7 @@
- (void)_setFooterBannerHeight:(int)height WK_API_AVAILABLE(macosx(10.12.3));
#endif
-- (void)_requestActiveNowPlayingSessionInfo:(void(^)(BOOL, BOOL, NSString*, double, double, NSInteger))callback WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_requestActiveNowPlayingSessionInfo:(void(^)(BOOL, NSString*, double, double, NSInteger))callback WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
- (void)_setPageScale:(CGFloat)scale withOrigin:(CGPoint)origin WK_API_AVAILABLE(ios(10.3));
- (CGFloat)_pageScale WK_API_AVAILABLE(ios(10.3));
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (227421 => 227422)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-01-23 17:52:53 UTC (rev 227422)
@@ -6813,7 +6813,7 @@
m_process->send(Messages::WebPage::RequestActiveNowPlayingSessionInfo(callbackID), m_pageID);
}
-void WebPageProxy::nowPlayingInfoCallback(bool hasActiveSession, bool registeredAsNowPlayingApplication, const String& title, double duration, double elapsedTime, uint64_t uniqueIdentifier, CallbackID callbackID)
+void WebPageProxy::nowPlayingInfoCallback(bool hasActiveSession, const String& title, double duration, double elapsedTime, uint64_t uniqueIdentifier, CallbackID callbackID)
{
auto callback = m_callbacks.take<NowPlayingInfoCallback>(callbackID);
if (!callback) {
@@ -6821,7 +6821,7 @@
return;
}
- callback->performCallbackWithReturnValue(hasActiveSession, registeredAsNowPlayingApplication, title, duration, elapsedTime, uniqueIdentifier);
+ callback->performCallbackWithReturnValue(hasActiveSession, title, duration, elapsedTime, uniqueIdentifier);
}
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (227421 => 227422)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-01-23 17:52:53 UTC (rev 227422)
@@ -297,7 +297,7 @@
#if PLATFORM(COCOA)
typedef GenericCallback<const WebCore::MachSendRight&> MachSendRightCallback;
-typedef GenericCallback<bool, bool, String, double, double, uint64_t> NowPlayingInfoCallback;
+typedef GenericCallback<bool, String, double, double, uint64_t> NowPlayingInfoCallback;
#endif
class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
@@ -1126,7 +1126,7 @@
#if PLATFORM(COCOA)
void requestActiveNowPlayingSessionInfo(Ref<NowPlayingInfoCallback>&&);
- void nowPlayingInfoCallback(bool, bool, const String&, double, double, uint64_t, CallbackID);
+ void nowPlayingInfoCallback(bool, const String&, double, double, uint64_t, CallbackID);
#endif
#if ENABLE(MEDIA_SESSION)
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (227421 => 227422)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-01-23 17:52:53 UTC (rev 227422)
@@ -204,7 +204,7 @@
#endif
#if PLATFORM(COCOA)
MachSendRightCallback(WebCore::MachSendRight sendRight, WebKit::CallbackID callbackID)
- NowPlayingInfoCallback(bool active, bool registeredAsNowPlayingApplication, String title, double duration, double elapsedTime, uint64_t uniqueIdentifier, WebKit::CallbackID callbackID)
+ NowPlayingInfoCallback(bool active, String title, double duration, double elapsedTime, uint64_t uniqueIdentifier, WebKit::CallbackID callbackID)
#endif
PageScaleFactorDidChange(double scaleFactor)
Modified: trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (227421 => 227422)
--- trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2018-01-23 17:52:53 UTC (rev 227422)
@@ -48,7 +48,6 @@
double duration = NAN;
double elapsedTime = NAN;
uint64_t uniqueIdentifier = 0;
- bool registeredAsNowPlayingApplication = false;
if (auto* sharedManager = WebCore::PlatformMediaSessionManager::sharedManagerIfExists()) {
hasActiveSession = sharedManager->hasActiveNowPlayingSession();
title = sharedManager->lastUpdatedNowPlayingTitle();
@@ -55,10 +54,9 @@
duration = sharedManager->lastUpdatedNowPlayingDuration();
elapsedTime = sharedManager->lastUpdatedNowPlayingElapsedTime();
uniqueIdentifier = sharedManager->lastUpdatedNowPlayingInfoUniqueIdentifier();
- registeredAsNowPlayingApplication = sharedManager->registeredAsNowPlayingApplication();
}
- send(Messages::WebPageProxy::NowPlayingInfoCallback(hasActiveSession, registeredAsNowPlayingApplication, title, duration, elapsedTime, uniqueIdentifier, callbackID));
+ send(Messages::WebPageProxy::NowPlayingInfoCallback(hasActiveSession, title, duration, elapsedTime, uniqueIdentifier, callbackID));
}
} // namespace WebKit
Modified: trunk/Tools/ChangeLog (227421 => 227422)
--- trunk/Tools/ChangeLog 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Tools/ChangeLog 2018-01-23 17:52:53 UTC (rev 227422)
@@ -1,3 +1,21 @@
+2018-01-23 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r227279 and r227373.
+ https://bugs.webkit.org/show_bug.cgi?id=181988
+
+ The LayoutTest crash fix introduced an API test failure.
+ (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227279
+
+ "Resign NowPlaying status when no media element is eligible"
+ https://bugs.webkit.org/show_bug.cgi?id=181914
+ https://trac.webkit.org/changeset/227373
+
2018-01-22 Carlos Garcia Campos <[email protected]>
Unreviewed. Add test case for slow in test_expectations.py.
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm (227421 => 227422)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm 2018-01-23 17:52:53 UTC (rev 227422)
@@ -35,7 +35,6 @@
@interface NowPlayingTestWebView : TestWKWebView
@property (nonatomic, readonly) BOOL hasActiveNowPlayingSession;
-@property (nonatomic, readonly) BOOL registeredAsNowPlayingApplication;
@property (readonly) NSString *lastUpdatedTitle;
@property (readonly) double lastUpdatedDuration;
@property (readonly) double lastUpdatedElapsedTime;
@@ -45,15 +44,13 @@
@implementation NowPlayingTestWebView {
bool _receivedNowPlayingInfoResponse;
BOOL _hasActiveNowPlayingSession;
- BOOL _registeredAsNowPlayingApplication;
}
- (BOOL)hasActiveNowPlayingSession
{
_receivedNowPlayingInfoResponse = false;
- auto completionHandler = [retainedSelf = retainPtr(self), self](BOOL active, BOOL registeredAsNowPlayingApplication, NSString *title, double duration, double elapsedTime, NSInteger uniqueIdentifier) {
+ auto completionHandler = [retainedSelf = retainPtr(self), self](BOOL active, NSString *title, double duration, double elapsedTime, NSInteger uniqueIdentifier) {
_hasActiveNowPlayingSession = active;
- _registeredAsNowPlayingApplication = registeredAsNowPlayingApplication;
_lastUpdatedTitle = [title copy];
_lastUpdatedDuration = duration;
_lastUpdatedElapsedTime = elapsedTime;
@@ -188,31 +185,6 @@
ASSERT_TRUE(isnan(webView.get().lastUpdatedElapsedTime));
ASSERT_TRUE(!webView.get().lastUniqueIdentifier);
}
-
-TEST(NowPlayingControlsTests, NowPlayingControlsCheckRegistered)
-{
- WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
- configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
- auto webView = adoptNS([[NowPlayingTestWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration]);
- [webView loadTestPageNamed:@"large-video-test-now-playing"];
- [webView waitForMessage:@"playing"];
- [webView setWindowVisible:NO];
- [webView.get().window resignKeyWindow];
-
- [webView expectHasActiveNowPlayingSession:YES];
- ASSERT_TRUE(webView.get().registeredAsNowPlayingApplication);
-
- [webView stringByEvaluatingJavaScript:@"pause()"];
- [webView waitForMessage:@"paused"];
- [webView expectHasActiveNowPlayingSession:YES];
- ASSERT_TRUE(webView.get().registeredAsNowPlayingApplication);
-
- auto result = [webView stringByEvaluatingJavaScript:@"removeVideoElement()"];
- ASSERT_STREQ("<null>", result.UTF8String);
- [webView expectHasActiveNowPlayingSession:NO];
- ASSERT_FALSE(webView.get().registeredAsNowPlayingApplication);
-}
-
#endif // PLATFORM(MAC)
#if PLATFORM(IOS)
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html (227421 => 227422)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html 2018-01-23 17:38:53 UTC (rev 227421)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html 2018-01-23 17:52:53 UTC (rev 227422)
@@ -8,12 +8,6 @@
position: absolute;
}
- button {
- top: 320px;
- left: 20px;
- position: absolute;
- }
-
body {
margin: 0;
}
@@ -31,30 +25,9 @@
function mousedown() {
document.querySelector("video").muted = true;
}
-
- function removeVideoElement() {
- document.body.removeChild(document.querySelector("video"));
- return document.querySelector("video");
- }
-
- function pause() {
- document.querySelector("video").pause();
- }
-
- function stopped() {
- setTimeout(function() {
- try {
- window.webkit.messageHandlers.testHandler.postMessage("paused");
- } catch(e) {
- console.debug(`error: ${e}`);
- }
- }, 0);
- }
-
</script>
</head>
<body>
- <video autoplay title="foo" _onmousedown_=mousedown() _onplaying_=playing() _onpause_=stopped()><source src=""
- <button _onclick_="console.log(removeVideoElement())">Stop!</button>
+ <video autoplay title="foo" _onmousedown_=mousedown() _onplaying_=playing()><source src=""
</body>
<html>