Changeset 211072 in webkit


Ignore:
Timestamp:
Jan 23, 2017 6:19:21 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r211062.
https://bugs.webkit.org/show_bug.cgi?id=167354

broke API tests (Requested by alexchristensen on #webkit).

Reverted changeset:

"Pass down website autoplay policies to media elements"
https://bugs.webkit.org/show_bug.cgi?id=167132
http://trac.webkit.org/changeset/211062

Location:
trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r211068 r211072  
     12017-01-23  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r211062.
     4        https://bugs.webkit.org/show_bug.cgi?id=167354
     5
     6        broke API tests (Requested by alexchristensen on #webkit).
     7
     8        Reverted changeset:
     9
     10        "Pass down website autoplay policies to media elements"
     11        https://bugs.webkit.org/show_bug.cgi?id=167132
     12        http://trac.webkit.org/changeset/211062
     13
    1142017-01-23  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r211062 r211072  
    818818        documentLoader->setUserContentExtensionsEnabled(websitePolicies.contentBlockersEnabled);
    819819
    820 #if PLATFORM(MAC)
    821     coreFrame->settings().setAudioPlaybackRequiresUserGesture(!websitePolicies.autoplayEnabled);
    822 #endif
    823 
    824820    // We call this synchronously because WebCore cannot gracefully handle a frame load without a synchronous navigation policy reply.
    825821    if (receivedPolicyAction)
  • trunk/Tools/ChangeLog

    r211067 r211072  
     12017-01-23  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r211062.
     4        https://bugs.webkit.org/show_bug.cgi?id=167354
     5
     6        broke API tests (Requested by alexchristensen on #webkit).
     7
     8        Reverted changeset:
     9
     10        "Pass down website autoplay policies to media elements"
     11        https://bugs.webkit.org/show_bug.cgi?id=167132
     12        http://trac.webkit.org/changeset/211062
     13
    1142017-01-23  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r211062 r211072  
    507507                C54237F116B8957D00E638FC /* PasteboardNotifications_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */; };
    508508                C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5E1AFFD16B22179006CC1F2 /* execCopy.html */; };
    509                 C9CB7DE11E2ED6F900B26082 /* autoplayCheck.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */; };
    510509                CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; };
    511510                CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; };
     
    606605                        dstSubfolderSpec = 7;
    607606                        files = (
    608                                 C9CB7DE11E2ED6F900B26082 /* autoplayCheck.html in Copy Resources */,
    609607                                7AEAD4811E20122700416EFE /* CrossPartitionFileSchemeAccess.html in Copy Resources */,
    610608                                CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */,
     
    12681266                C5E1AFFD16B22179006CC1F2 /* execCopy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = execCopy.html; sourceTree = "<group>"; };
    12691267                C95501BE19AD2FAF0049BE3E /* Preferences.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Preferences.mm; sourceTree = "<group>"; };
    1270                 C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = autoplayCheck.html; sourceTree = "<group>"; };
    12711268                CD225C071C45A69200140761 /* ParsedContentRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentRange.cpp; sourceTree = "<group>"; };
    12721269                CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = "<group>"; };
     
    19491946                        isa = PBXGroup;
    19501947                        children = (
     1948                                9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */,
     1949                                07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */,
    19511950                                C045F9461385C2F800C0F3CD /* 18-characters.html */,
    19521951                                1C2B81851C89252300A5529F /* Ahem.ttf */,
     
    19541953                                F6B7BE9617469B7E008A3445 /* associate-form-controls.html */,
    19551954                                76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
    1956                                 C9CB7DE01E2ED2A700B26082 /* autoplayCheck.html */,
    19571955                                7C486BA01AA1254B003F6F9B /* bundle-file.html */,
    1958                                 9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */,
    19591956                                1A50AA1F1A2A4EA500F4C345 /* close-from-within-create-page.html */,
    19601957                                9B270FED1DDC25FD002D53F3 /* closed-shadow-tree-test.html */,
    19611958                                5C9E56861DF9148E00C9EE33 /* contentBlockerCheck.html */,
    19621959                                290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */,
    1963                                 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */,
    19641960                                C5E1AFFD16B22179006CC1F2 /* execCopy.html */,
    19651961                                BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm

    r211062 r211072  
    2727
    2828#import "PlatformUtilities.h"
    29 #import "TestWKWebView.h"
    3029#import <WebKit/WKUserContentControllerPrivate.h>
    3130#import <WebKit/WKWebViewPrivate.h>
     
    4039static size_t alertCount;
    4140
    42 @interface ContentBlockingWebsitePoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
     41@interface WebsitePoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
    4342@end
    4443
    45 @implementation ContentBlockingWebsitePoliciesDelegate
     44@implementation WebsitePoliciesDelegate
    4645
    4746- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
     
    125124    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    126125
    127     auto delegate = adoptNS([[ContentBlockingWebsitePoliciesDelegate alloc] init]);
     126    auto delegate = adoptNS([[WebsitePoliciesDelegate alloc] init]);
    128127    [webView setNavigationDelegate:delegate.get()];
    129128    [webView setUIDelegate:delegate.get()];
     
    150149}
    151150
    152 #if PLATFORM(MAC)
    153 
    154 @interface AutoplayPoliciesDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
    155 @property (nonatomic) BOOL allowAutoplay;
    156 @end
    157 
    158 @implementation AutoplayPoliciesDelegate
    159 
    160 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
    161 {
    162     // _webView:decidePolicyForNavigationAction:decisionHandler: should be called instead if it is implemented.
    163     EXPECT_TRUE(false);
    164     decisionHandler(WKNavigationActionPolicyAllow);
    165 }
    166 
    167 - (void)_webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy, _WKWebsitePolicies *))decisionHandler
    168 {
    169     _WKWebsitePolicies *websitePolicies = [[[_WKWebsitePolicies alloc] init] autorelease];
    170     websitePolicies.autoplayEnabled = _allowAutoplay;
    171     decisionHandler(WKNavigationActionPolicyAllow, websitePolicies);
    172 }
    173 
    174 @end
    175 
    176 TEST(WebKit2, WebsitePoliciesAutoplayEnabled)
    177 {
    178     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
    179     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
    180 
    181     auto delegate = adoptNS([[AutoplayPoliciesDelegate alloc] init]);
    182     [webView setNavigationDelegate:delegate.get()];
    183 
    184     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"autoplayCheck" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
    185    
    186     [delegate setAllowAutoplay:YES];
    187     [webView loadRequest:request];
    188     [webView waitForMessage:@"autoplayed"];
    189 
    190     [delegate setAllowAutoplay:NO];
    191     [webView loadRequest:request];
    192     [webView waitForMessage:@"did-not-play"];
    193 
    194     [delegate setAllowAutoplay:YES];
    195     [webView loadRequest:request];
    196     [webView waitForMessage:@"autoplayed"];
    197 }
    198 
    199 #endif // PLATFORM(MAC)
    200 
    201151#endif
Note: See TracChangeset for help on using the changeset viewer.