Changeset 222672 in webkit
- Timestamp:
- Sep 29, 2017 5:29:19 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r222667 r222672 1 2017-09-29 Alex Christensen <achristensen@webkit.org> 2 3 Expose WebPreferences::webGLEnabled through WKPreferences 4 https://bugs.webkit.org/show_bug.cgi?id=177692 5 <rdar://problem/24110556> 6 7 Reviewed by Andy Estes. 8 9 * UIProcess/API/Cocoa/WKPreferences.mm: 10 (-[WKPreferences _setWebGLEnabled:]): 11 (-[WKPreferences _webGLEnabled]): 12 * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 13 1 14 2017-09-29 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
r222533 r222672 648 648 } 649 649 650 #if PLATFORM(MAC) 650 651 - (void)_setPlugInsEnabled:(BOOL)enabled 651 652 { … … 658 659 } 659 660 661 - (void)_setWebGLEnabled:(BOOL)enabled 662 { 663 _preferences->setWebGLEnabled(enabled); 664 } 665 666 - (BOOL)_webGLEnabled 667 { 668 return _preferences->webGLEnabled(); 669 } 670 #endif // PLATFORM(MAC) 671 660 672 - (BOOL)_javaScriptCanAccessClipboard 661 673 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
r222533 r222672 121 121 #if !TARGET_OS_IPHONE 122 122 @property (nonatomic, setter=_setPlugInsEnabled:) BOOL _plugInsEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 123 @property (nonatomic, setter=_setWebGLEnabled:) BOOL _webGLEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 123 124 #endif 124 125 -
trunk/Tools/ChangeLog
r222666 r222672 1 2017-09-29 Alex Christensen <achristensen@webkit.org> 2 3 Expose WebPreferences::webGLEnabled through WKPreferences 4 https://bugs.webkit.org/show_bug.cgi?id=177692 5 <rdar://problem/24110556> 6 7 Reviewed by Andy Estes. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/Preferences.mm: 10 (-[AlertSaver alert]): 11 (-[AlertSaver webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): 12 (TEST): 13 1 14 2017-09-29 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Preferences.mm
r221505 r222672 29 29 30 30 #import "Test.h" 31 #import "Utilities.h" 31 32 #import <WebKit/WKFoundation.h> 32 33 #import <WebKit/WKPreferencesPrivate.h> 34 #import <WebKit/WKUIDelegate.h> 33 35 #import <WebKit/_WKExperimentalFeature.h> 34 36 #import <wtf/RetainPtr.h> … … 67 69 } 68 70 69 #endif 71 #if PLATFORM(MAC) 72 73 static bool receivedAlert; 74 75 @interface AlertSaver : NSObject <WKUIDelegate> 76 @end 77 78 @implementation AlertSaver { 79 RetainPtr<NSString> alert; 80 } 81 82 - (NSString *)alert 83 { 84 return alert.get(); 85 } 86 87 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler 88 { 89 alert = message; 90 completionHandler(); 91 receivedAlert = true; 92 } 93 94 @end 95 96 TEST(WebKit, WebGLEnabled) 97 { 98 NSString *html = @"<script>if(document.createElement('canvas').getContext('webgl')){alert('enabled')}else{alert('disabled')}</script>"; 99 auto delegate = adoptNS([[AlertSaver alloc] init]); 100 101 auto webView = adoptNS([[WKWebView alloc] init]); 102 [webView setUIDelegate:delegate.get()]; 103 [webView loadHTMLString:html baseURL:nil]; 104 TestWebKitAPI::Util::run(&receivedAlert); 105 EXPECT_STREQ([delegate alert].UTF8String, "enabled"); 106 107 receivedAlert = false; 108 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 109 [[configuration preferences] _setWebGLEnabled:NO]; 110 webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 111 [webView setUIDelegate:delegate.get()]; 112 [webView loadHTMLString:html baseURL:nil]; 113 TestWebKitAPI::Util::run(&receivedAlert); 114 EXPECT_STREQ([delegate alert].UTF8String, "disabled"); 115 } 116 117 #endif // PLATFORM(MAC) 118 119 #endif // WK_API_ENABLED
Note: See TracChangeset
for help on using the changeset viewer.