Changeset 238348 in webkit


Ignore:
Timestamp:
Nov 17, 2018 7:13:07 AM (5 years ago)
Author:
jer.noble@apple.com
Message:

Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>

Reviewed by Eric Carlson.

Follow-up test fix for r238322:

In ExitFullscreenOnEnterPiP.ElementFullScreen, explicitly make the video
element in element fullscreen the "main content" by playing the video during
a user gesture; only "main content" videos will cause fullscreen mode to exit
when that element is taken into PiP.

In FullscreenZoomInitialFrame.WebKit, the WebView is not visible, so the Page
is considered hidden, and fullscreen is not allowed when the WebView is hidden.
Make the WebView visible by ordering the test window on-screen.

  • TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html:
  • TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:

(TestWebKitAPI::FullscreenZoomInitialFrame::runTest):

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r238342 r238348  
     12018-11-17  Jer Noble  <jer.noble@apple.com>
     2
     3        Regression(r233865): Causes synchronous IPC in the middle of layout
     4        https://bugs.webkit.org/show_bug.cgi?id=188307
     5        <rdar://problem/42807306>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Follow-up test fix for r238322:
     10
     11        In ExitFullscreenOnEnterPiP.ElementFullScreen, explicitly make the video
     12        element in element fullscreen the "main content" by playing the video during
     13        a user gesture; only "main content" videos will cause fullscreen mode to exit
     14        when that element is taken into PiP.
     15
     16        In FullscreenZoomInitialFrame.WebKit, the WebView is not visible, so the Page
     17        is considered hidden, and fullscreen is not allowed when the WebView is hidden.
     18        Make the WebView visible by ordering the test window on-screen.
     19
     20        * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html:
     21        * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm:
     22        (TestWebKitAPI::TEST):
     23        * TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
     24        (TestWebKitAPI::FullscreenZoomInitialFrame::runTest):
     25
    1262018-11-16  Alex Christensen  <achristensen@webkit.org>
    227
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html

    r233926 r238348  
    22<html>
    33<head>
     4    <script>
     5    window.addEventListener('load', event => {
     6        let video = document.querySelector('video');
     7        video.addEventListener('playing', event => {
     8            try {
     9                window.webkit.messageHandlers.testHandler.postMessage('playing');
     10            } catch (e) { }
     11        });
     12    }, {once: true});
     13    </script>
    414</head>
    515<button id="enter-video-fullscreen" onclick="document.querySelector('video').webkitEnterFullscreen()">enter video fullscreen</button>
     
    717<button id="enter-pip" onclick="document.querySelector('video').webkitSetPresentationMode('picture-in-picture')">enter pip</button>
    818<button id="exit-pip" onclick="document.querySelector('video').webkitSetPresentationMode('inline')">exit pip</button>
    9 <body onload="load(); window.onloadcompleted = true; ">
     19<button id="play" onclick="document.querySelector('video').play()">play video</button>
     20<body>
    1021    <div id="target">
    1122        <video id="video" playsinline src="test.mp4" />
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm

    r237266 r238348  
    115115    ASSERT_TRUE(didEnterFullscreen);
    116116
     117    // Make the video the "main content" by playing with a user gesture.
     118    __block bool didBeginPlaying = false;
     119    [webView performAfterReceivingMessage:@"playing" action:^{ didBeginPlaying = true; }];
     120    [webView evaluateJavaScript:@"document.getElementById('play').click()" completionHandler:nil];
     121    TestWebKitAPI::Util::run(&didBeginPlaying);
     122
    117123    didEnterPiP = false;
    118124    didExitFullscreen = false;
  • trunk/Tools/TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm

    r219050 r238348  
    157157    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
    158158    [window.get().contentView addSubview:view];
     159    [window makeKeyAndOrderFront:view];
    159160
    160161    setPageScale(view, 2);
Note: See TracChangeset for help on using the changeset viewer.