Changeset 251859 in webkit
- Timestamp:
- Oct 31, 2019 10:49:54 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r251855 r251859 1 2019-10-31 Alex Christensen <achristensen@webkit.org> 2 3 Expose more WKPreferences SPI 4 https://bugs.webkit.org/show_bug.cgi?id=203631 5 <rdar://problem/56717160> 6 7 Reviewed by Brady Eidson. 8 9 I added a unit test for the one that can be easily tested. 10 11 * UIProcess/API/Cocoa/WKPreferences.mm: 12 (-[WKPreferences _setWebAudioEnabled:]): 13 (-[WKPreferences _webAudioEnabled]): 14 (-[WKPreferences _setAcceleratedCompositingEnabled:]): 15 (-[WKPreferences _acceleratedCompositingEnabled]): 16 (-[WKPreferences _setRequestAnimationFrameEnabled:]): 17 (-[WKPreferences _requestAnimationFrameEnabled]): 18 * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 19 1 20 2019-10-31 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
r251737 r251859 863 863 } 864 864 865 - (void)_setWebAudioEnabled:(BOOL)enabled 866 { 867 _preferences->setWebAudioEnabled(enabled); 868 } 869 870 - (BOOL)_webAudioEnabled 871 { 872 return _preferences->webAudioEnabled(); 873 } 874 875 - (void)_setAcceleratedCompositingEnabled:(BOOL)enabled 876 { 877 _preferences->setAcceleratedCompositingEnabled(enabled); 878 } 879 880 - (BOOL)_acceleratedCompositingEnabled 881 { 882 return _preferences->acceleratedCompositingEnabled(); 883 } 884 885 - (void)_setRequestAnimationFrameEnabled:(BOOL)enabled 886 { 887 _preferences->setRequestAnimationFrameEnabled(enabled); 888 } 889 890 - (BOOL)_requestAnimationFrameEnabled 891 { 892 return _preferences->requestAnimationFrameEnabled(); 893 } 894 865 895 - (BOOL)_remotePlaybackEnabled 866 896 { … … 892 922 { 893 923 return _preferences->canvasUsesAcceleratedDrawing(); 894 }895 896 - (void)_setAcceleratedCompositingEnabled:(BOOL)enabled897 {898 _preferences->setAcceleratedCompositingEnabled(enabled);899 }900 901 - (BOOL)_acceleratedCompositingEnabled902 {903 return _preferences->acceleratedCompositingEnabled();904 924 } 905 925 … … 1295 1315 { 1296 1316 return _preferences->wantsBalancedSetDefersLoadingBehavior(); 1297 }1298 1299 - (void)_setWebAudioEnabled:(BOOL)enabled1300 {1301 _preferences->setWebAudioEnabled(enabled);1302 }1303 1304 - (BOOL)_webAudioEnabled1305 {1306 return _preferences->webAudioEnabled();1307 1317 } 1308 1318 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
r251737 r251859 159 159 @property (nonatomic, setter=_setSecureContextChecksEnabled:) BOOL _secureContextChecksEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 160 160 @property (nonatomic, setter=_setRemotePlaybackEnabled:) BOOL _remotePlaybackEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 161 @property (nonatomic, setter=_setWebAudioEnabled:) BOOL _webAudioEnabled WK_API_AVAILABLE(macos(10.14), ios(WK_IOS_TBA)); 162 @property (nonatomic, setter=_setAcceleratedCompositingEnabled:) BOOL _acceleratedCompositingEnabled WK_API_AVAILABLE(macos(10.13.4), ios(WK_IOS_TBA)); 163 @property (nonatomic, setter=_setRequestAnimationFrameEnabled:) BOOL _requestAnimationFrameEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 161 164 162 165 #if !TARGET_OS_IPHONE … … 164 167 @property (nonatomic, setter=_setJavaEnabledForLocalFiles:) BOOL _javaEnabledForLocalFiles WK_API_AVAILABLE(macos(10.13.4)); 165 168 @property (nonatomic, setter=_setCanvasUsesAcceleratedDrawing:) BOOL _canvasUsesAcceleratedDrawing WK_API_AVAILABLE(macos(10.13.4)); 166 @property (nonatomic, setter=_setAcceleratedCompositingEnabled:) BOOL _acceleratedCompositingEnabled WK_API_AVAILABLE(macos(10.13.4));167 169 @property (nonatomic, setter=_setDefaultTextEncodingName:) NSString *_defaultTextEncodingName WK_API_AVAILABLE(macos(10.13.4)); 168 170 @property (nonatomic, setter=_setAuthorAndUserStylesEnabled:) BOOL _authorAndUserStylesEnabled WK_API_AVAILABLE(macos(10.13.4)); … … 203 205 @property (nonatomic, setter=_setUseGiantTiles:) BOOL _useGiantTiles WK_API_AVAILABLE(macos(10.14)); 204 206 @property (nonatomic, setter=_setWantsBalancedSetDefersLoadingBehavior:) BOOL _wantsBalancedSetDefersLoadingBehavior WK_API_AVAILABLE(macos(10.14)); 205 @property (nonatomic, setter=_setWebAudioEnabled:) BOOL _webAudioEnabled WK_API_AVAILABLE(macos(10.14));206 207 @property (nonatomic, setter=_setAggressiveTileRetentionEnabled:) BOOL _aggressiveTileRetentionEnabled WK_API_AVAILABLE(macos(10.14)); 207 208 @property (nonatomic, setter=_setAppNapEnabled:) BOOL _appNapEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA)); -
trunk/Tools/ChangeLog
r251858 r251859 1 2019-10-31 Alex Christensen <achristensen@webkit.org> 2 3 Expose more WKPreferences SPI 4 https://bugs.webkit.org/show_bug.cgi?id=203631 5 <rdar://problem/56717160> 6 7 Reviewed by Brady Eidson. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/Preferences.mm: 10 (TEST): 11 1 12 2019-10-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Preferences.mm
r242339 r251859 26 26 #import "config.h" 27 27 28 #import "PlatformUtilities.h" 28 29 #import "Test.h" 29 30 #import "Utilities.h" … … 65 66 [preferences _setEnabled:value forFeature:feature]; 66 67 } 68 } 69 70 TEST(WebKit, WebAudioPreference) 71 { 72 auto check = [](bool value) { 73 WKWebViewConfiguration *configuration = [[[WKWebViewConfiguration alloc] init] autorelease]; 74 configuration.preferences._webAudioEnabled = value; 75 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration]); 76 __block bool done = false; 77 __block RetainPtr<NSString> result; 78 [webView evaluateJavaScript:@"new Boolean(window.webkitAudioContext).toString()" completionHandler:^(id resultFromJS, NSError *error) { 79 result = resultFromJS; 80 done = true; 81 }]; 82 TestWebKitAPI::Util::run(&done); 83 return result.autorelease(); 84 }; 85 EXPECT_WK_STREQ(check(true), "true"); 86 EXPECT_WK_STREQ(check(false), "false"); 67 87 } 68 88
Note: See TracChangeset
for help on using the changeset viewer.