Fix API test WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming after 193354
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 03:09:22 +0000 (03:09 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2019 03:09:22 +0000 (03:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193451

Reviewed by Geoffrey Garen.

* TestWebKitAPI/Tests/WebKitCocoa/DuplicateCompletionHandlerCalls.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(runWebsiteDataStoreCustomPaths):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240025 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/DuplicateCompletionHandlerCalls.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm

index f44b05e..2ad03e1 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-15  Sihui Liu  <sihui_liu@apple.com>
+
+        Fix API test WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming after 193354
+        https://bugs.webkit.org/show_bug.cgi?id=193451
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/DuplicateCompletionHandlerCalls.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
+        (runWebsiteDataStoreCustomPaths):
+
 2019-01-15  Jonathan Bedard  <jbedard@apple.com>
 
         webkitpy: Support boolean simctl isAvailable
index ac7082f..6129141 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "PlatformUtilities.h"
 #import "Utilities.h"
+#import <WebKit/WKPreferencesRef.h>
 #import <WebKit/WKUIDelegatePrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/_WKInputDelegate.h>
@@ -126,6 +127,9 @@ static void expectException(void (^completionHandler)())
 TEST(WebKit, DuplicateCompletionHandlerCalls)
 {
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    auto preferences = (__bridge WKPreferencesRef)[[webView configuration] preferences];
+    WKPreferencesSetWebSQLDisabled(preferences, false);
+
     auto delegate = adoptNS([[DuplicateCompletionHandlerCallsDelegate alloc] init]);
     [webView setNavigationDelegate:delegate.get()];
     [webView setUIDelegate:delegate.get()];
index 764edf4..fa1d9f8 100644 (file)
@@ -28,6 +28,7 @@
 #import "PlatformUtilities.h"
 #import "Test.h"
 #import "TestNavigationDelegate.h"
+#import <WebKit/WKPreferencesRef.h>
 #import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKUserContentControllerPrivate.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
@@ -129,6 +130,9 @@ static void runWebsiteDataStoreCustomPaths(ShouldEnableProcessPrewarming shouldE
     RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
     [webView setNavigationDelegate:handler.get()];
 
+    auto preferences = (__bridge WKPreferencesRef)[[webView configuration] preferences];
+    WKPreferencesSetWebSQLDisabled(preferences, false);
+
     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"WebsiteDataStoreCustomPaths" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
     [webView loadRequest:request];