Changeset 211174 in webkit


Ignore:
Timestamp:
Jan 25, 2017 3:43:01 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[ios-simulator] API test WebKit2.WebsitePoliciesAutoplayEnabled timing out
https://bugs.webkit.org/show_bug.cgi?id=167385

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-25
Reviewed by Alex Christensen.

  • TestWebKitAPI/Tests/WebKit2/autoplay-check.html: Avoid arbitrary timeouts in favor of promises.
  • TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html:
  • TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:

(TEST): Allow inline (rather than full screen) media playback on iOS.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r211147 r211174  
     12017-01-25  Matt Rajca  <mrajca@apple.com>
     2
     3        [ios-simulator] API test WebKit2.WebsitePoliciesAutoplayEnabled timing out
     4        https://bugs.webkit.org/show_bug.cgi?id=167385
     5
     6        Reviewed by Alex Christensen.
     7
     8        * TestWebKitAPI/Tests/WebKit2/autoplay-check.html: Avoid arbitrary timeouts in favor of promises.
     9        * TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html:
     10        * TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
     11        (TEST): Allow inline (rather than full screen) media playback on iOS.
     12
    1132017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2/autoplay-check.html

    r211097 r211174  
    33        <script>
    44            function pageLoaded() {
    5                 setTimeout(function() {
     5                document.getElementById("video").play().then(function() {
     6                    try {
     7                        window.webkit.messageHandlers.testHandler.postMessage("autoplayed");
     8                    } catch(e) { }
     9                }).catch(function() {
    610                    try {
    711                        window.webkit.messageHandlers.testHandler.postMessage("did-not-play");
    812                    } catch(e) { }
    9                 }, 100);
    10             }
    11 
    12             function beganPlaying() {
    13                 try {
    14                     window.webkit.messageHandlers.testHandler.postMessage("autoplayed");
    15                 } catch(e) { }
     13                });
    1614            }
    1715        </script>
    1816    </head>
    1917    <body onload="pageLoaded()">
    20         <video id="video" autoplay onplaying=beganPlaying() src="test.mp4" />
     18        <video id="video" playsinline src="test.mp4" />
    2119    </body>
    2220</html>
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2/autoplay-no-audio-check.html

    r211097 r211174  
    33        <script>
    44            function pageLoaded() {
    5                 setTimeout(function() {
     5                document.getElementById("video").play().then(function() {
     6                    try {
     7                        window.webkit.messageHandlers.testHandler.postMessage("autoplayed");
     8                    } catch(e) { }
     9                }).catch(function() {
    610                    try {
    711                        window.webkit.messageHandlers.testHandler.postMessage("did-not-play");
    812                    } catch(e) { }
    9                 }, 100);
    10             }
    11 
    12             function beganPlaying() {
    13                 try {
    14                     window.webkit.messageHandlers.testHandler.postMessage("autoplayed");
    15                 } catch(e) { }
     13                });
    1614            }
    1715        </script>
    1816    </head>
    1917    <body onload="pageLoaded()">
    20         <video id="video" autoplay onplaying=beganPlaying() src="test-without-audio-track.mp4" />
     18        <video id="video" playsinline src="test-without-audio-track.mp4" />
    2119    </body>
    2220</html>
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm

    r211097 r211174  
    3434#import <wtf/RetainPtr.h>
    3535
     36#if PLATFORM(IOS)
     37#import <WebKit/WKWebViewConfigurationPrivate.h>
     38#endif
     39
    3640#if WK_API_ENABLED
    3741
     
    175179{
    176180    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     181
     182#if PLATFORM(IOS)
     183    [configuration setAllowsInlineMediaPlayback:YES];
     184#endif
     185
    177186    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    178187
Note: See TracChangeset for help on using the changeset viewer.