haikuwebkit/LayoutTests/media/video-presentation-mode-exp...

36 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Source/WebCore: Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): (WebKit::WebChromeClient::setUpPlaybackControlsManager): (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: Source/WebKitLegacy/mac: When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen and picture-in-picture tests in parallel. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockVideoPresentationModeEnabled): * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewInternal.h: LayoutTests: * media/video-presentation-mode-expected.txt: Added. * media/video-presentation-mode.html: Added. Canonical link: https://commits.webkit.org/224376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 22:37:36 +00:00
Test the video presentation mode (video fullscreen and picture-in-picture) API.
EVENT(canplaythrough)
EXPECTED (video.webkitSupportsFullscreen == 'true') OK
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
EXPECTED (video.webkitPresentationMode == 'inline') OK
Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Source/WebCore: Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): (WebKit::WebChromeClient::setUpPlaybackControlsManager): (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: Source/WebKitLegacy/mac: When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen and picture-in-picture tests in parallel. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockVideoPresentationModeEnabled): * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewInternal.h: LayoutTests: * media/video-presentation-mode-expected.txt: Added. * media/video-presentation-mode.html: Added. Canonical link: https://commits.webkit.org/224376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 22:37:36 +00:00
** Try to enter fullscreen
RUN(video.webkitSetPresentationMode('fullscreen'))
EVENT(webkitpresentationmodechanged)
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
** Received webkitpresentationmodechanged event
EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Source/WebCore: Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): (WebKit::WebChromeClient::setUpPlaybackControlsManager): (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: Source/WebKitLegacy/mac: When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen and picture-in-picture tests in parallel. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockVideoPresentationModeEnabled): * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewInternal.h: LayoutTests: * media/video-presentation-mode-expected.txt: Added. * media/video-presentation-mode.html: Added. Canonical link: https://commits.webkit.org/224376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 22:37:36 +00:00
EXPECTED (video.webkitPresentationMode == 'fullscreen') OK
** Try to enter picture-in-picture
RUN(video.webkitSetPresentationMode('picture-in-picture'))
EVENT(webkitpresentationmodechanged)
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
** Received webkitpresentationmodechanged event
EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Source/WebCore: Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): (WebKit::WebChromeClient::setUpPlaybackControlsManager): (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: Source/WebKitLegacy/mac: When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen and picture-in-picture tests in parallel. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockVideoPresentationModeEnabled): * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewInternal.h: LayoutTests: * media/video-presentation-mode-expected.txt: Added. * media/video-presentation-mode.html: Added. Canonical link: https://commits.webkit.org/224376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 22:37:36 +00:00
EXPECTED (video.webkitPresentationMode == 'picture-in-picture') OK
** Try to return to inline
RUN(video.webkitSetPresentationMode('inline'))
EVENT(webkitpresentationmodechanged)
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
** Received webkitpresentationmodechanged event
EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Source/WebCore: Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): (WebKit::WebChromeClient::setUpPlaybackControlsManager): (WebKit::WebChromeClient::clearPlaybackControlsManager): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: Source/WebKitLegacy/mac: When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen and picture-in-picture tests in parallel. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setMockVideoPresentationModeEnabled): * WebView/WebView.mm: * WebView/WebViewData.h: * WebView/WebViewInternal.h: LayoutTests: * media/video-presentation-mode-expected.txt: Added. * media/video-presentation-mode.html: Added. Canonical link: https://commits.webkit.org/224376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-05 22:37:36 +00:00
EXPECTED (video.webkitPresentationMode == 'inline') OK
** Test Completed
END OF TEST