[iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of showing the extension UI
https://bugs.webkit.org/show_bug.cgi?id=199790
<rdar://problem/52790112>
Reviewed by Brent Fulgham.
Source/WebKit:
On iOS, WebKit relies on a SPI -[WKUIDelegatePrivate _presentingViewControllerForWebView:] to present the
extension UI. However, third party clients often don't implement this SPI. Therefore, WebKit will not be
able to present the extension UI for them.
To be able to show the extension UI for third party WebKit clients, WebKit should unset SOAuthorization.enableEmbeddedAuthorizationViewController
whenever clients don't implement the above SPI such that AppSSO could show the UI in their UI process.
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::start):
Tools:
Add tests to check SOAuthorization.enableEmbeddedAuthorizationViewController accordingly.
* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationDelegate _presentingViewControllerForWebView:]):
(configureSOAuthorizationWebView):
(TestWebKitAPI::TEST):
(-[TestSOAuthorizationNavigationDelegate init]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:didFinishNavigation:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): Deleted.
(-[TestSOAuthorizationNavigationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]): Deleted.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@247437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index bdb285d..ff94b3c 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2019-07-15 Jiewen Tan <jiewen_tan@apple.com>
+
+ [iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of showing the extension UI
+ https://bugs.webkit.org/show_bug.cgi?id=199790
+ <rdar://problem/52790112>
+
+ Reviewed by Brent Fulgham.
+
+ On iOS, WebKit relies on a SPI -[WKUIDelegatePrivate _presentingViewControllerForWebView:] to present the
+ extension UI. However, third party clients often don't implement this SPI. Therefore, WebKit will not be
+ able to present the extension UI for them.
+
+ To be able to show the extension UI for third party WebKit clients, WebKit should unset SOAuthorization.enableEmbeddedAuthorizationViewController
+ whenever clients don't implement the above SPI such that AppSSO could show the UI in their UI process.
+
+ * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
+ (WebKit::SOAuthorizationSession::start):
+
2019-07-15 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION: Chase app crashes immediately after authentication
diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
index bcdb0c2..dc5d449 100644
--- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
+++ b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
@@ -33,7 +33,7 @@
#import "APINavigationAction.h"
#import "APIUIClient.h"
#import "SOAuthorizationLoadPolicy.h"
-#import "WKUIDelegate.h"
+#import "WKUIDelegatePrivate.h"
#import "WebPageProxy.h"
#import "WebSiteDataStore.h"
#import <WebCore/ResourceResponse.h>
@@ -129,6 +129,11 @@
};
[m_soAuthorization setAuthorizationOptions:authorizationOptions];
+#if PLATFORM(IOS)
+ if (![fromWebPageProxy(*m_page).UIDelegate respondsToSelector:@selector(_presentingViewControllerForWebView:)])
+ [m_soAuthorization setEnableEmbeddedAuthorizationViewController:NO];
+#endif
+
auto *nsRequest = m_navigationAction->request().nsURLRequest(WebCore::HTTPBodyUpdatePolicy::UpdateHTTPBody);
[m_soAuthorization beginAuthorizationWithURL:nsRequest.URL httpHeaders:nsRequest.allHTTPHeaderFields httpBody:nsRequest.HTTPBody];
});
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index b099bce..9b19636 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,23 @@
+2019-07-15 Jiewen Tan <jiewen_tan@apple.com>
+
+ [iOS] SOAuthorizationSession should tell AppSSO whether the UIClient is capable of showing the extension UI
+ https://bugs.webkit.org/show_bug.cgi?id=199790
+ <rdar://problem/52790112>
+
+ Reviewed by Brent Fulgham.
+
+ Add tests to check SOAuthorization.enableEmbeddedAuthorizationViewController accordingly.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
+ (-[TestSOAuthorizationDelegate _presentingViewControllerForWebView:]):
+ (configureSOAuthorizationWebView):
+ (TestWebKitAPI::TEST):
+ (-[TestSOAuthorizationNavigationDelegate init]): Deleted.
+ (-[TestSOAuthorizationNavigationDelegate webView:didFinishNavigation:]): Deleted.
+ (-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
+ (-[TestSOAuthorizationNavigationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): Deleted.
+ (-[TestSOAuthorizationNavigationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]): Deleted.
+
2019-07-15 Sihui Liu <sihui_liu@apple.com>
window.openDatabase is not writable
diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
index ab15331..2d1a25a 100644
--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
@@ -139,7 +139,7 @@
@end
-@interface TestSOAuthorizationNavigationDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
+@interface TestSOAuthorizationDelegate : NSObject <WKNavigationDelegate, WKUIDelegate>
@property bool isDefaultPolicy;
@property bool shouldOpenExternalSchemes;
@property bool allowSOAuthorizationLoad;
@@ -147,7 +147,7 @@
- (instancetype)init;
@end
-@implementation TestSOAuthorizationNavigationDelegate
+@implementation TestSOAuthorizationDelegate
- (instancetype)init
{
@@ -207,6 +207,11 @@
});
}
+- (UIViewController *)_presentingViewControllerForWebView:(WKWebView *)webView
+{
+ return nil;
+}
+
@end
#if PLATFORM(MAC)
@@ -296,7 +301,7 @@
Disallow
};
-static void configureSOAuthorizationWebView(TestWKWebView *webView, TestSOAuthorizationNavigationDelegate *delegate, OpenExternalSchemesPolicy policy = OpenExternalSchemesPolicy::Disallow)
+static void configureSOAuthorizationWebView(TestWKWebView *webView, TestSOAuthorizationDelegate *delegate, OpenExternalSchemesPolicy policy = OpenExternalSchemesPolicy::Disallow)
{
[webView setNavigationDelegate:delegate];
[webView setUIDelegate:delegate];
@@ -331,7 +336,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -348,7 +353,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -367,7 +372,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -390,7 +395,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -413,7 +418,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -436,7 +441,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -466,6 +471,11 @@
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
Util::run(&authorizationPerformed);
checkAuthorizationOptions(false, "", 0);
+#if PLATFORM(MAC)
+ EXPECT_TRUE(gAuthorization.enableEmbeddedAuthorizationViewController);
+#elif PLATFORM(IOS)
+ EXPECT_FALSE(gAuthorization.enableEmbeddedAuthorizationViewController);
+#endif
RetainPtr<NSURL> redirectURL = [[NSBundle mainBundle] URLForResource:@"simple2" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:testURL.get() statusCode:302 HTTPVersion:@"HTTP/1.1" headerFields:@{ @"Location" : [redirectURL absoluteString] }]);
@@ -521,8 +531,9 @@
InstanceMethodSwizzler swizzler3(PAL::getSOAuthorizationClass(), @selector(beginAuthorizationWithURL:httpHeaders:httpBody:), reinterpret_cast<IMP>(overrideBeginAuthorizationWithURL));
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
+ EXPECT_TRUE(gAuthorization.enableEmbeddedAuthorizationViewController);
// Force App Links with a request.URL that has a different host than the current one (empty host) and ShouldOpenExternalURLsPolicy::ShouldAllow.
auto testURL = URL(URL(), "https://www.example.com");
@@ -558,7 +569,7 @@
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
// A separate delegate that implements decidePolicyForNavigationAction.
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[delegate setIsDefaultPolicy:false];
@@ -587,7 +598,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -611,7 +622,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -646,7 +657,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -680,7 +691,7 @@
InstanceMethodSwizzler swizzler3(PAL::getSOAuthorizationClass(), @selector(beginAuthorizationWithURL:httpHeaders:httpBody:), reinterpret_cast<IMP>(overrideBeginAuthorizationWithURL));
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
auto testURL = URL(URL(), "https://www.example.com");
@@ -721,7 +732,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -745,7 +756,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
// The session will be waiting since the web view is is not int the window.
@@ -780,7 +791,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -811,7 +822,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
for (int i = 0; i < 2; i++) {
@@ -844,7 +855,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -879,7 +890,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
// The session will be waiting since the web view is is not int the window.
@@ -919,7 +930,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
// Add a http body to the request to mimic a SAML request.
@@ -945,7 +956,7 @@
InstanceMethodSwizzler swizzler3(PAL::getSOAuthorizationClass(), @selector(beginAuthorizationWithURL:httpHeaders:httpBody:), reinterpret_cast<IMP>(overrideBeginAuthorizationWithURL));
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:@"" baseURL:(NSURL *)URL(URL(), "http://www.webkit.org")];
@@ -967,7 +978,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -988,7 +999,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1009,7 +1020,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[delegate setAllowSOAuthorizationLoad:false];
@@ -1029,7 +1040,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1055,7 +1066,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[delegate setAllowSOAuthorizationLoad:false];
[delegate setIsAsyncExecution:true];
@@ -1079,7 +1090,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1112,7 +1123,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1144,7 +1155,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1176,7 +1187,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1215,7 +1226,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1252,7 +1263,7 @@
RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow);
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
@@ -1282,7 +1293,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:testURL.get()];
@@ -1315,7 +1326,7 @@
auto testHtml = makeString("<iframe style='width:400px;height:400px' srcdoc=\"", iframeTestHtml, "\" />");
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1340,7 +1351,7 @@
configuration.get().preferences.javaScriptCanOpenWindowsAutomatically = YES;
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400) configuration:configuration.get()]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView _evaluateJavaScriptWithoutUserGesture: @"window.open('http://www.example.com')" completionHandler:nil];
@@ -1360,7 +1371,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1396,7 +1407,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1429,7 +1440,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1465,7 +1476,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string(), "", "event.source.close();"); // The parent closes the pop up.
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1501,7 +1512,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1537,7 +1548,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1577,7 +1588,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1613,7 +1624,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1653,7 +1664,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1714,7 +1725,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string(), makeString("newWindow.location = '", baseURL.get().absoluteString.UTF8String, "';")); // Starts a new navigation on the new window.
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1749,7 +1760,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:(NSURL *)URL(URL(), "http://www.webkit.org")];
@@ -1773,7 +1784,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setAllowSOAuthorizationLoad:false];
@@ -1801,7 +1812,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setIsAsyncExecution:true];
@@ -1836,7 +1847,7 @@
auto testHtml = generateHtml(openerTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setAllowSOAuthorizationLoad:false];
[delegate setIsAsyncExecution:true];
@@ -1861,7 +1872,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1878,7 +1889,7 @@
auto testHtml = generateHtml(parentTemplate, URL(URL(), "http://www.example.com").string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:(NSURL *)URL(URL(), "http://www.webkit.org")];
@@ -1901,7 +1912,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1931,7 +1942,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:nil];
@@ -1959,7 +1970,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.get().absoluteString);
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:baseURL.get()];
@@ -1993,7 +2004,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:nil];
@@ -2020,7 +2031,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
for (int i = 0; i < 2; i++) {
@@ -2051,7 +2062,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[webView loadHTMLString:testHtml baseURL:(NSURL *)URL(URL(), "http://www.apple.com")];
@@ -2069,7 +2080,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setAllowSOAuthorizationLoad:false];
@@ -2092,7 +2103,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setIsAsyncExecution:true];
@@ -2117,7 +2128,7 @@
auto testHtml = generateHtml(parentTemplate, testURL.string());
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
[delegate setAllowSOAuthorizationLoad:false];
[delegate setIsAsyncExecution:true];
@@ -2160,7 +2171,7 @@
});
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
- auto delegate = adoptNS([[TestSOAuthorizationNavigationDelegate alloc] init]);
+ auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
configureSOAuthorizationWebView(webView.get(), delegate.get());
auto origin = makeString("http://127.0.0.1:", static_cast<unsigned>(server.port()));