Modified: trunk/Tools/ChangeLog (221922 => 221923)
--- trunk/Tools/ChangeLog 2017-09-12 16:37:04 UTC (rev 221922)
+++ trunk/Tools/ChangeLog 2017-09-12 16:42:23 UTC (rev 221923)
@@ -1,5 +1,17 @@
2017-09-12 Alex Christensen <[email protected]>
+ Fix build after r221922.
+ https://bugs.webkit.org/show_bug.cgi?id=176728
+
+ * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
+ (-[ModalDelegate _webViewRunModal:]):
+ (-[ModalDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
+ (TEST):
+ svn-apply inserted the test too early in the file :(
+ Shift it down to where all the used static variables are declared.
+
+2017-09-12 Alex Christensen <[email protected]>
+
Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
https://bugs.webkit.org/show_bug.cgi?id=176728
<rdar://problem/29270035>
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (221922 => 221923)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm 2017-09-12 16:37:04 UTC (rev 221922)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm 2017-09-12 16:42:23 UTC (rev 221923)
@@ -148,38 +148,6 @@
TestWebKitAPI::Util::run(&done);
}
-@interface ModalDelegate : NSObject <WKUIDelegatePrivate>
-@end
-
-@implementation ModalDelegate
-
-- (void)_webViewRunModal:(WKWebView *)webView
-{
- EXPECT_EQ(webView, createdWebView.get());
- done = true;
-}
-
-- (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
-{
- createdWebView = [[[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration] autorelease];
- [createdWebView setUIDelegate:self];
- return createdWebView.get();
-}
-
-@end
-
-TEST(WebKit, RunModal)
-{
- auto delegate = adoptNS([[ModalDelegate alloc] init]);
- auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
- [webView setUIDelegate:delegate.get()];
- NSURL *url = "" mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
- NSString *html = [NSString stringWithFormat:@"%@%@%@", @"<script> function openModal() { window.showModalDialog('", url, @"'); } </script> <input type='button' value='Click to open modal' _onclick_='openModal();'>"];
- [webView synchronouslyLoadHTMLString:html];
- [webView sendClicksAtPoint:NSMakePoint(20, 600 - 20) numberOfClicks:1];
- TestWebKitAPI::Util::run(&done);
-}
-
#if PLATFORM(MAC)
@class UITestDelegate;
@@ -233,6 +201,38 @@
ASSERT_EQ(webViewFromDelegateCallback, createdWebView);
}
+@interface ModalDelegate : NSObject <WKUIDelegatePrivate>
+@end
+
+@implementation ModalDelegate
+
+- (void)_webViewRunModal:(WKWebView *)webView
+{
+ EXPECT_EQ(webView, createdWebView.get());
+ done = true;
+}
+
+- (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
+{
+ createdWebView = [[[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration] autorelease];
+ [createdWebView setUIDelegate:self];
+ return createdWebView.get();
+}
+
+@end
+
+TEST(WebKit, RunModal)
+{
+ auto delegate = adoptNS([[ModalDelegate alloc] init]);
+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+ [webView setUIDelegate:delegate.get()];
+ NSURL *url = "" mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
+ NSString *html = [NSString stringWithFormat:@"%@%@%@", @"<script> function openModal() { window.showModalDialog('", url, @"'); } </script> <input type='button' value='Click to open modal' _onclick_='openModal();'>"];
+ [webView synchronouslyLoadHTMLString:html];
+ [webView sendClicksAtPoint:NSMakePoint(20, 600 - 20) numberOfClicks:1];
+ TestWebKitAPI::Util::run(&done);
+}
+
@interface NotificationDelegate : NSObject <WKUIDelegatePrivate> {
bool _allowNotifications;
}