Changeset 261203 in webkit
- Timestamp:
- May 5, 2020 3:37:36 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r261193 r261203 1 2020-05-05 Peng Liu <peng.liu6@apple.com> 2 3 Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously 4 https://bugs.webkit.org/show_bug.cgi?id=203723 5 6 Reviewed by Jer Noble. 7 8 * media/video-presentation-mode-expected.txt: Added. 9 * media/video-presentation-mode.html: Added. 10 1 11 2020-05-05 Said Abou-Hallawa <sabouhallawa@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r261202 r261203 1 2020-05-05 Peng Liu <peng.liu6@apple.com> 2 3 Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously 4 https://bugs.webkit.org/show_bug.cgi?id=203723 5 6 Reviewed by Jer Noble. 7 8 Test: media/video-presentation-mode.html 9 10 Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen 11 and picture-in-picture tests. 12 13 * page/ChromeClient.h: 14 (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): 15 * testing/Internals.cpp: 16 (WebCore::Internals::setMockVideoPresentationModeEnabled): 17 * testing/Internals.h: 18 * testing/Internals.idl: 19 1 20 2020-05-05 Darin Adler <darin@apple.com> 2 21 -
trunk/Source/WebCore/page/ChromeClient.h
r260182 r261203 379 379 #endif 380 380 381 #if ENABLE(VIDEO_PRESENTATION_MODE) 382 virtual void setMockVideoPresentationModeEnabled(bool) { } 383 #endif 384 381 385 #if USE(COORDINATED_GRAPHICS) 382 386 virtual IntRect visibleRectForTiledBackingStore() const { return IntRect(); } -
trunk/Source/WebCore/testing/Internals.cpp
r261113 r261203 3276 3276 } 3277 3277 3278 #if ENABLE(VIDEO_PRESENTATION_MODE) 3279 void Internals::setMockVideoPresentationModeEnabled(bool enabled) 3280 { 3281 Document* document = contextDocument(); 3282 if (!document || !document->page()) 3283 return; 3284 3285 document->page()->chrome().client().setMockVideoPresentationModeEnabled(enabled); 3286 } 3287 #endif 3288 3278 3289 void Internals::setApplicationCacheOriginQuota(unsigned long long quota) 3279 3290 { -
trunk/Source/WebCore/testing/Internals.h
r261153 r261203 498 498 void setFullscreenControlsHidden(bool); 499 499 500 #if ENABLE(VIDEO_PRESENTATION_MODE) 501 void setMockVideoPresentationModeEnabled(bool); 502 #endif 503 500 504 WEBCORE_TESTSUPPORT_EXPORT void setApplicationCacheOriginQuota(unsigned long long); 501 505 -
trunk/Source/WebCore/testing/Internals.idl
r261113 r261203 534 534 void setFullscreenControlsHidden(boolean hidden); 535 535 536 [Conditional=VIDEO_PRESENTATION_MODE] void setMockVideoPresentationModeEnabled(boolean enabled); 537 536 538 void setApplicationCacheOriginQuota(unsigned long long quota); 537 539 -
trunk/Source/WebKit/ChangeLog
r261195 r261203 1 2020-05-05 Peng Liu <peng.liu6@apple.com> 2 3 Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously 4 https://bugs.webkit.org/show_bug.cgi?id=203723 5 6 Reviewed by Jer Noble. 7 8 When the flag MockVideoPresentationModeEnabled is true, the VideoFullscreenManagerProxy in the UI process 9 will mock the behavior of the VideoFullscreenInterface[Mac|AVKit]. 10 11 * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: 12 (WebKit::VideoFullscreenManagerProxy::setMockVideoPresentationModeEnabled): 13 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: 14 (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): 15 (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive): 16 (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): 17 (WebKit::VideoFullscreenManagerProxy::setHasVideo): 18 (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): 19 (WebKit::VideoFullscreenManagerProxy::enterFullscreen): 20 (WebKit::VideoFullscreenManagerProxy::exitFullscreen): 21 (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): 22 (WebKit::VideoFullscreenManagerProxy::setInlineRect): 23 (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): 24 (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): 25 (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): 26 (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen): 27 * UIProcess/WebPageProxy.cpp: 28 (WebKit::WebPageProxy::didAttachToRunningProcess): 29 (WebKit::WebPageProxy::setMockVideoPresentationModeEnabled): 30 * UIProcess/WebPageProxy.h: 31 * UIProcess/WebPageProxy.messages.in: 32 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 33 (WebKit::WebChromeClient::setMockVideoPresentationModeEnabled): 34 (WebKit::WebChromeClient::setUpPlaybackControlsManager): 35 (WebKit::WebChromeClient::clearPlaybackControlsManager): 36 * WebProcess/WebCoreSupport/WebChromeClient.h: 37 * WebProcess/cocoa/VideoFullscreenManager.h: 38 1 39 2020-05-05 Per Arne Vollan <pvollan@apple.com> 2 40 -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.h
r261001 r261203 131 131 bool isVisible() const; 132 132 133 void setMockVideoPresentationModeEnabled(bool enabled) { m_mockVideoPresentationModeEnabled = enabled; } 134 133 135 void requestRouteSharingPolicyAndContextUID(uint64_t contextId, CompletionHandler<void(WebCore::RouteSharingPolicy, String)>&&); 134 136 … … 181 183 void fullscreenMayReturnToInline(uint64_t contextId); 182 184 185 bool m_mockVideoPresentationModeEnabled { false }; 186 183 187 WebPageProxy* m_page; 184 188 Ref<PlaybackSessionManagerProxy> m_playbackSessionManagerProxy; -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
r261001 r261203 151 151 void VideoFullscreenManagerProxy::requestHideAndExitFullscreen() 152 152 { 153 154 153 } 155 154 156 155 void VideoFullscreenManagerProxy::applicationDidBecomeActive() 157 156 { 158 159 157 } 160 158 #else … … 498 496 addClientForContext(contextId); 499 497 498 if (m_mockVideoPresentationModeEnabled) { 499 #if PLATFORM(IOS_FAMILY) 500 requestVideoContentLayer(contextId); 501 #else 502 didSetupFullscreen(contextId); 503 #endif 504 return; 505 } 506 500 507 RetainPtr<WKLayerHostView> view = static_cast<WKLayerHostView*>(model->layerHostView()); 501 508 if (!view) { … … 528 535 { 529 536 MESSAGE_CHECK_CONTEXTID(contextId); 537 if (m_mockVideoPresentationModeEnabled) 538 return; 539 530 540 ensureInterface(contextId).hasVideoChanged(hasVideo); 531 541 } … … 534 544 { 535 545 MESSAGE_CHECK_CONTEXTID(contextId); 546 if (m_mockVideoPresentationModeEnabled) 547 return; 548 536 549 ensureInterface(contextId).videoDimensionsChanged(videoDimensions); 537 550 } … … 540 553 { 541 554 MESSAGE_CHECK_CONTEXTID(contextId); 555 if (m_mockVideoPresentationModeEnabled) { 556 didEnterFullscreen(contextId); 557 return; 558 } 542 559 543 560 auto& interface = ensureInterface(contextId); … … 564 581 return; 565 582 566 #if PLATFORM(IOS_FAMILY) 567 ensureInterface(contextId).exitFullscreen(finalRect); 568 #else 583 #if !PLATFORM(IOS_FAMILY) 569 584 IntRect finalWindowRect; 570 585 m_page->rootViewToWindow(finalRect, finalWindowRect); 586 #endif 587 588 if (m_mockVideoPresentationModeEnabled) { 589 #if PLATFORM(IOS_FAMILY) 590 returnVideoContentLayer(contextId); 591 #else 592 didExitFullscreen(contextId); 593 #endif 594 return; 595 } 596 597 #if PLATFORM(IOS_FAMILY) 598 ensureInterface(contextId).exitFullscreen(finalRect); 599 #else 571 600 ensureInterface(contextId).exitFullscreen(finalWindowRect, m_page->platformWindow()); 572 601 #endif … … 576 605 { 577 606 MESSAGE_CHECK_CONTEXTID(contextId); 607 if (m_mockVideoPresentationModeEnabled) 608 return; 609 578 610 #if PLATFORM(MAC) 579 611 ensureInterface(contextId).exitFullscreenWithoutAnimationToMode(targetMode); … … 593 625 { 594 626 MESSAGE_CHECK_CONTEXTID(contextId); 627 if (m_mockVideoPresentationModeEnabled) 628 return; 629 595 630 ensureInterface(contextId).setInlineRect(inlineRect, visible); 596 631 } … … 599 634 { 600 635 MESSAGE_CHECK_CONTEXTID(contextId); 636 if (m_mockVideoPresentationModeEnabled) { 637 if (value) 638 didSetupFullscreen(contextId); 639 else 640 didExitFullscreen(contextId); 641 642 return; 643 } 644 601 645 ensureInterface(contextId).setHasVideoContentLayer(value); 602 646 } … … 619 663 { 620 664 MESSAGE_CHECK_CONTEXTID(contextId); 665 if (m_mockVideoPresentationModeEnabled) { 666 didCleanupFullscreen(contextId); 667 return; 668 } 669 621 670 ensureInterface(contextId).cleanupFullscreen(); 622 671 } … … 627 676 m_page->fullscreenMayReturnToInline(); 628 677 629 #if PLATFORM(IOS_FAMILY) 630 ensureInterface(contextId).preparedToReturnToInline(visible, inlineRect); 631 #else 678 #if !PLATFORM(IOS_FAMILY) 632 679 IntRect inlineWindowRect; 633 680 m_page->rootViewToWindow(inlineRect, inlineWindowRect); 681 #endif 682 683 if (m_mockVideoPresentationModeEnabled) 684 return; 685 686 #if PLATFORM(IOS_FAMILY) 687 ensureInterface(contextId).preparedToReturnToInline(visible, inlineRect); 688 #else 634 689 ensureInterface(contextId).preparedToReturnToInline(visible, inlineWindowRect, m_page->platformWindow()); 635 690 #endif … … 639 694 { 640 695 MESSAGE_CHECK_CONTEXTID(contextId); 696 if (m_mockVideoPresentationModeEnabled) 697 return; 698 641 699 ensureInterface(contextId).preparedToExitFullscreen(); 642 700 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r261107 r261203 962 962 ASSERT(!m_videoFullscreenManager); 963 963 m_videoFullscreenManager = VideoFullscreenManagerProxy::create(*this, *m_playbackSessionManager); 964 if (m_videoFullscreenManager) 965 m_videoFullscreenManager->setMockVideoPresentationModeEnabled(m_mockVideoPresentationModeEnabled); 964 966 #endif 965 967 … … 6225 6227 { 6226 6228 return m_videoFullscreenManager.get(); 6229 } 6230 6231 void WebPageProxy::setMockVideoPresentationModeEnabled(bool enabled) 6232 { 6233 m_mockVideoPresentationModeEnabled = enabled; 6234 if (m_videoFullscreenManager) 6235 m_videoFullscreenManager->setMockVideoPresentationModeEnabled(enabled); 6227 6236 } 6228 6237 #endif -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r261044 r261203 528 528 PlaybackSessionManagerProxy* playbackSessionManager(); 529 529 VideoFullscreenManagerProxy* videoFullscreenManager(); 530 void setMockVideoPresentationModeEnabled(bool); 530 531 #endif 531 532 … … 2385 2386 RefPtr<PlaybackSessionManagerProxy> m_playbackSessionManager; 2386 2387 RefPtr<VideoFullscreenManagerProxy> m_videoFullscreenManager; 2388 bool m_mockVideoPresentationModeEnabled { false }; 2387 2389 #endif 2388 2390 -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r260752 r261203 509 509 #endif 510 510 511 #if ENABLE(VIDEO_PRESENTATION_MODE) 512 SetMockVideoPresentationModeEnabled(bool enabled) 513 #endif 514 511 515 #if ENABLE(POINTER_LOCK) 512 516 RequestPointerLock() -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
r261001 r261203 988 988 } 989 989 990 void WebChromeClient::setUpPlaybackControlsManager(HTMLMediaElement& mediaElement) 991 { 992 m_page.playbackSessionManager().setUpPlaybackControlsManager(mediaElement); 993 } 994 995 void WebChromeClient::clearPlaybackControlsManager() 996 { 997 m_page.playbackSessionManager().clearPlaybackControlsManager(); 990 void WebChromeClient::setMockVideoPresentationModeEnabled(bool enabled) 991 { 992 m_page.send(Messages::WebPageProxy::SetMockVideoPresentationModeEnabled(enabled)); 998 993 } 999 994 … … 1012 1007 m_page.videoFullscreenManager().exitVideoFullscreenForVideoElement(videoElement); 1013 1008 } 1009 1010 void WebChromeClient::setUpPlaybackControlsManager(HTMLMediaElement& mediaElement) 1011 { 1012 m_page.playbackSessionManager().setUpPlaybackControlsManager(mediaElement); 1013 } 1014 1015 void WebChromeClient::clearPlaybackControlsManager() 1016 { 1017 m_page.playbackSessionManager().clearPlaybackControlsManager(); 1018 } 1019 1014 1020 #endif 1015 1021 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
r261001 r261203 265 265 bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) final; 266 266 bool supportsVideoFullscreenStandby() final; 267 void setMockVideoPresentationModeEnabled(bool) final; 268 void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool standby) final; 269 void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) final; 267 270 void setUpPlaybackControlsManager(WebCore::HTMLMediaElement&) final; 268 271 void clearPlaybackControlsManager() final; 269 void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool standby) final;270 void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) final;271 272 #endif 272 273 -
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.h
r260259 r261203 116 116 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 117 117 118 // Interface to ChromeClient118 // Interface to WebChromeClient 119 119 bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) const; 120 120 bool supportsVideoFullscreenStandby() const; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r261168 r261203 1 2020-05-05 Peng Liu <peng.liu6@apple.com> 2 3 Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously 4 https://bugs.webkit.org/show_bug.cgi?id=203723 5 6 Reviewed by Jer Noble. 7 8 When the flag MockVideoPresentationModeEnabled is true, WebView will ignore the requests to 9 WebVideoFullscreenController, so that the DumpRenderTree can run multiple video fullscreen 10 and picture-in-picture tests in parallel. 11 12 * WebCoreSupport/WebChromeClient.h: 13 * WebCoreSupport/WebChromeClient.mm: 14 (WebChromeClient::setMockVideoPresentationModeEnabled): 15 * WebView/WebView.mm: 16 * WebView/WebViewData.h: 17 * WebView/WebViewInternal.h: 18 1 19 2020-05-05 Darin Adler <darin@apple.com> 2 20 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
r259330 r261203 194 194 #if ENABLE(VIDEO) 195 195 bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) final; 196 #if ENABLE(VIDEO_PRESENTATION_MODE) 197 void setMockVideoPresentationModeEnabled(bool) final; 196 198 void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool standby) final; 197 199 void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) final; 198 200 void exitVideoFullscreenToModeWithoutAnimation(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode) final; 201 #endif 199 202 #endif 200 203 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm
r259843 r261203 966 966 } 967 967 968 #if ENABLE(VIDEO_PRESENTATION_MODE) 969 970 void WebChromeClient::setMockVideoPresentationModeEnabled(bool enabled) 971 { 972 [m_webView _setMockVideoPresentationModeEnabled:enabled]; 973 } 974 968 975 void WebChromeClient::enterVideoFullscreenForVideoElement(HTMLVideoElement& videoElement, HTMLMediaElementEnums::VideoFullscreenMode mode, bool standby) 969 976 { … … 988 995 END_BLOCK_OBJC_EXCEPTIONS; 989 996 } 997 998 #endif // ENABLE(VIDEO_PRESENTATION_MODE) 990 999 991 1000 #endif // ENABLE(VIDEO) -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r261168 r261203 2352 2352 } 2353 2353 2354 #if ENABLE(VIDEO ) && !PLATFORM(IOS_FAMILY)2354 #if ENABLE(VIDEO_PRESENTATION_MODE) && !PLATFORM(IOS_FAMILY) 2355 2355 [self _exitVideoFullscreen]; 2356 2356 #endif … … 9260 9260 9261 9261 #if ENABLE(VIDEO) 9262 9263 #if ENABLE(VIDEO_PRESENTATION_MODE) 9264 9265 - (void)_setMockVideoPresentationModeEnabled:(BOOL)enabled 9266 { 9267 _private->mockVideoPresentationModeEnabled = enabled; 9268 } 9269 9262 9270 - (void)_enterVideoFullscreenForVideoElement:(NakedPtr<WebCore::HTMLVideoElement>)videoElement mode:(WebCore::HTMLMediaElementEnums::VideoFullscreenMode)mode 9263 9271 { 9272 if (_private->mockVideoPresentationModeEnabled) 9273 return; 9274 9264 9275 if (_private->fullscreenController) { 9265 9276 if ([_private->fullscreenController videoElement] == videoElement) { … … 9290 9301 - (void)_exitVideoFullscreen 9291 9302 { 9303 if (_private->mockVideoPresentationModeEnabled) 9304 return; 9305 9292 9306 if (!_private->fullscreenController && _private->fullscreenControllersExiting.isEmpty()) 9293 9307 return; … … 9307 9321 } 9308 9322 9309 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)9323 #if PLATFORM(MAC) 9310 9324 - (BOOL)_hasActiveVideoForControlsInterface 9311 9325 { … … 9347 9361 [self updateTouchBar]; 9348 9362 } 9349 #endif // PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE) 9363 9364 #endif // PLATFORM(MAC) 9365 9366 #endif // ENABLE(VIDEO_PRESENTATION_MODE) 9367 9350 9368 #endif // ENABLE(VIDEO) 9351 9369 -
trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h
r259531 r261203 217 217 218 218 BOOL allowsUndo; 219 219 220 220 float zoomMultiplier; 221 221 BOOL zoomsTextOnly; … … 294 294 #endif 295 295 296 297 296 #if !PLATFORM(IOS_FAMILY) 298 297 // WebKit has both a global plug-in database and a separate, per WebView plug-in database. Dashboard uses the per WebView database. … … 325 324 #endif 326 325 326 #if ENABLE(VIDEO_PRESENTATION_MODE) 327 BOOL mockVideoPresentationModeEnabled; 328 #endif 329 327 330 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE) 328 331 RefPtr<WebCore::PlaybackSessionModelMediaElement> playbackSessionModel; -
trunk/Source/WebKitLegacy/mac/WebView/WebViewInternal.h
r256834 r261203 274 274 275 275 #if ENABLE(VIDEO) && defined(__cplusplus) 276 #if ENABLE(VIDEO_PRESENTATION_MODE) 277 - (void)_setMockVideoPresentationModeEnabled:(BOOL)enabled; 276 278 - (void)_enterVideoFullscreenForVideoElement:(NakedPtr<WebCore::HTMLVideoElement>)videoElement mode:(WebCore::HTMLMediaElementEnums::VideoFullscreenMode)mode; 277 279 - (void)_exitVideoFullscreen; 278 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)280 #if PLATFORM(MAC) 279 281 - (BOOL)_hasActiveVideoForControlsInterface; 280 282 - (void)_setUpPlaybackControlsManagerForMediaElement:(NakedRef<WebCore::HTMLMediaElement>)mediaElement; 281 283 - (void)_clearPlaybackControlsManager; 284 #endif 282 285 #endif 283 286 #endif
Note: See TracChangeset
for help on using the changeset viewer.