Title: [261727] trunk
Revision
261727
Author
katherine_che...@apple.com
Date
2020-05-14 18:21:20 -0700 (Thu, 14 May 2020)

Log Message

Attribute non-network loads and loads with html strings as automatically app-bound
https://bugs.webkit.org/show_bug.cgi?id=211913
<rdar://problem/63157801

Reviewed by Brent Fulgham.

Source/WebKit:

Move logic from WebsiteDataStoreCocoa to WebPageProxy to check for
special app-bound protocols and set m_limitsNavigationToAppBoundDomains
to force these WebViews into app-bound mode.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isForcedIntoAppBoundMode:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Testing SPI to see whether m_limitsNavigationsToAppBoundDomains was
set.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadData):
Check for html string loads and force WebView into app-bound mode if needed.
No need to worry about setting this variable even if the app hasn't
opted in because setIsNavigatingToAppBoundDomainAndCheckIfPermitted
does an early return before checking this variable if
WKAppBoundDomains does not exist.

(WebKit::shouldTreatURLProtocolAsAppBound):
Adds _javascript_ protocols to this check.

(WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
Check for special protocols here and force WebView into app-bound mode.

(WebKit::WebPageProxy::isForcedIntoAppBoundModeTesting):
* UIProcess/WebPageProxy.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
(WebKit::shouldTreatURLProtocolAsAppBound): Deleted.

Tools:

Adds new tests to check that WebView loads with HTML strings have
proper behavior.

Some tests need to test behavior on app-bound domains on webviews which do not specify
limitsNavigationsToAppBoundDomains. Since local files now do this
automatically, this patch updates those to use actual app-bound
domains from the WKAppBoundDomains list instead to maintain behavior.

Remove limitsNavigationsToAppBoundDomains for local files to make sure
they are forced into this mode automatically.

* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
(-[InAppBrowserSchemeHandler webView:startURLSchemeTask:]):
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261726 => 261727)


--- trunk/Source/WebKit/ChangeLog	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/ChangeLog	2020-05-15 01:21:20 UTC (rev 261727)
@@ -1,3 +1,41 @@
+2020-05-14  Kate Cheney  <katherine_che...@apple.com>
+
+        Attribute non-network loads and loads with html strings as automatically app-bound
+        https://bugs.webkit.org/show_bug.cgi?id=211913
+        <rdar://problem/63157801
+
+        Reviewed by Brent Fulgham.
+
+        Move logic from WebsiteDataStoreCocoa to WebPageProxy to check for
+        special app-bound protocols and set m_limitsNavigationToAppBoundDomains
+        to force these WebViews into app-bound mode.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _isForcedIntoAppBoundMode:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        Testing SPI to see whether m_limitsNavigationsToAppBoundDomains was
+        set.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::loadData):
+        Check for html string loads and force WebView into app-bound mode if needed.
+        No need to worry about setting this variable even if the app hasn't
+        opted in because setIsNavigatingToAppBoundDomainAndCheckIfPermitted
+        does an early return before checking this variable if
+        WKAppBoundDomains does not exist.
+
+        (WebKit::shouldTreatURLProtocolAsAppBound):
+        Adds _javascript_ protocols to this check.
+
+        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
+        Check for special protocols here and force WebView into app-bound mode.
+
+        (WebKit::WebPageProxy::isForcedIntoAppBoundModeTesting):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
+        (WebKit::shouldTreatURLProtocolAsAppBound): Deleted.
+
 2020-05-14  Timothy Hatcher  <timo...@apple.com>
 
         Add baseURL version of _WKUserStyleSheet forWKWebView.

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (261726 => 261727)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2020-05-15 01:21:20 UTC (rev 261727)
@@ -2621,6 +2621,13 @@
     });
 }
 
+- (void)_isForcedIntoAppBoundMode:(void(^)(BOOL))completionHandler
+{
+    _page->isForcedIntoAppBoundModeTesting([completionHandler = makeBlockPtr(completionHandler)] (bool isForcedIntoAppBoundMode) {
+        completionHandler(isForcedIntoAppBoundMode);
+    });
+}
+
 - (void)_serviceWorkersEnabled:(void(^)(BOOL))completionHandler
 {
     auto enabled = [_configuration preferences]->_preferences.get()->serviceWorkersEnabled() || WebCore::RuntimeEnabledFeatures::sharedFeatures().serviceWorkerEnabled();

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (261726 => 261727)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2020-05-15 01:21:20 UTC (rev 261727)
@@ -342,6 +342,7 @@
 - (void)_getProcessDisplayNameWithCompletionHandler:(void (^)(NSString *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 - (void)_isNavigatingToAppBoundDomain:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_isForcedIntoAppBoundMode:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 - (void)_grantAccessToPreferenceService WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (261726 => 261727)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-05-15 01:21:20 UTC (rev 261727)
@@ -1391,6 +1391,9 @@
 {
     RELEASE_LOG_IF_ALLOWED(Loading, "loadData:");
 
+    if (MIMEType == "text/html"_s && !WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN)
+        m_limitsNavigationsToAppBoundDomains = true;
+
     if (m_isClosed) {
         RELEASE_LOG_IF_ALLOWED(Loading, "loadData: page is closed");
         return nullptr;
@@ -3111,6 +3114,13 @@
     PolicyCheckIdentifier m_identifier;
 };
 
+#if PLATFORM(IOS_FAMILY)
+static bool shouldTreatURLProtocolAsAppBound(const URL& requestURL)
+{
+    return requestURL.protocolIsAbout() || requestURL.protocolIsData() || requestURL.protocolIsBlob() || requestURL.isLocalFile() || requestURL.protocolIsJavaScript();
+}
+#endif
+
 bool WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
 {
 #if PLATFORM(IOS_FAMILY)
@@ -3124,6 +3134,10 @@
         if (m_ignoresAppBoundDomains)
             return true;
         
+        if (shouldTreatURLProtocolAsAppBound(requestURL)) {
+            isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;
+            m_limitsNavigationsToAppBoundDomains = true;
+        }
         if (m_limitsNavigationsToAppBoundDomains) {
             if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No)
                 return false;
@@ -3149,6 +3163,11 @@
     completionHandler(m_isNavigatingToAppBoundDomain && (*m_isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes));
 }
 
+void WebPageProxy::isForcedIntoAppBoundModeTesting(CompletionHandler<void(bool)>&& completionHandler)
+{
+    completionHandler(m_limitsNavigationsToAppBoundDomains);
+}
+
 void WebPageProxy::disableServiceWorkerEntitlementInNetworkProcess()
 {
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (261726 => 261727)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2020-05-15 01:21:20 UTC (rev 261727)
@@ -1747,6 +1747,8 @@
     void setNeedsDOMWindowResizeEvent();
 
     void isNavigatingToAppBoundDomainTesting(CompletionHandler<void(bool)>&&);
+    void isForcedIntoAppBoundModeTesting(CompletionHandler<void(bool)>&&);
+
     Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain() const { return m_isNavigatingToAppBoundDomain; }
 
     void disableServiceWorkerEntitlementInNetworkProcess();

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (261726 => 261727)


--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-05-15 01:21:20 UTC (rev 261727)
@@ -459,11 +459,6 @@
     });
 }
 
-static bool shouldTreatURLProtocolAsAppBound(const URL& requestURL)
-{
-    return requestURL.protocolIsAbout() || requestURL.protocolIsData() || requestURL.protocolIsBlob() || requestURL.isLocalFile();
-}
-
 void WebsiteDataStore::beginAppBoundDomainCheck(const URL& requestURL, WebFramePolicyListenerProxy& listener)
 {
     ASSERT(RunLoop::isMain());
@@ -476,10 +471,6 @@
             listener->didReceiveAppBoundDomainResult(WTF::nullopt);
             return;
         }
-        if (shouldTreatURLProtocolAsAppBound(requestURL)) {
-            listener->didReceiveAppBoundDomainResult(NavigatingToAppBoundDomain::Yes);
-            return;
-        }
         listener->didReceiveAppBoundDomainResult(domains.contains(WebCore::RegistrableDomain(requestURL)) ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No);
     });
 }

Modified: trunk/Tools/ChangeLog (261726 => 261727)


--- trunk/Tools/ChangeLog	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Tools/ChangeLog	2020-05-15 01:21:20 UTC (rev 261727)
@@ -1,3 +1,26 @@
+2020-05-14  Kate Cheney  <katherine_che...@apple.com>
+
+        Attribute non-network loads and loads with html strings as automatically app-bound
+        https://bugs.webkit.org/show_bug.cgi?id=211913
+        <rdar://problem/63157801
+
+        Reviewed by Brent Fulgham.
+
+        Adds new tests to check that WebView loads with HTML strings have
+        proper behavior.
+
+        Some tests need to test behavior on app-bound domains on webviews which do not specify
+        limitsNavigationsToAppBoundDomains. Since local files now do this
+        automatically, this patch updates those to use actual app-bound
+        domains from the WKAppBoundDomains list instead to maintain behavior.
+
+        Remove limitsNavigationsToAppBoundDomains for local files to make sure
+        they are forced into this mode automatically.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
+        (-[InAppBrowserSchemeHandler webView:startURLSchemeTask:]):
+        (TEST):
+
 2020-05-14  Jiewen Tan  <jiewen_...@apple.com>
 
         [WebAuthn] Relaxing signature length requirements for U2fRegister

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm (261726 => 261727)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm	2020-05-15 00:33:37 UTC (rev 261726)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm	2020-05-15 01:21:20 UTC (rev 261727)
@@ -102,6 +102,8 @@
         response = @"<body style='background-color: red;'><iframe src=''></iframe></body>";
     else if ([task.request.URL.path isEqualToString:@"/in-app-browser-privacy-test-message-handler"])
         response = @"<body style='background-color: green;'></body><script>if (window.webkit.messageHandlers)\nwindow.webkit.messageHandlers.testHandler.postMessage('Failed'); \nelse \n document.body.style.background = '';</script>";
+    else if ([task.request.URL.path isEqualToString:@"/app-bound-domain-load"])
+        response = @"<body></body>";
 
     [task didReceiveResponse:[[[NSURLResponse alloc] initWithURL:task.request.URL MIMEType:@"text/html" expectedContentLength:response.length textEncodingName:nil] autorelease]];
     [task didReceiveData:[response dataUsingEncoding:NSUTF8StringEncoding]];
@@ -272,7 +274,6 @@
 {
     initializeInAppBrowserPrivacyTestSettings();
     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    [configuration setLimitsNavigationsToAppBoundDomains:YES];
 
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
     NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
@@ -280,8 +281,8 @@
     [webView _test_waitForDidFinishNavigation];
 
     isDone = false;
-    [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) {
-        EXPECT_TRUE(isAppBound);
+    [webView _isForcedIntoAppBoundMode:^(BOOL isForcedIntoAppBoundMode) {
+        EXPECT_TRUE(isForcedIntoAppBoundMode);
         cleanUpInAppBrowserPrivacyTestSettings();
         isDone = true;
     }];
@@ -292,7 +293,6 @@
 {
     initializeInAppBrowserPrivacyTestSettings();
     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    [configuration setLimitsNavigationsToAppBoundDomains:YES];
 
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"data:text/html,start"]]];
@@ -299,8 +299,8 @@
     [webView _test_waitForDidFinishNavigation];
 
     isDone = false;
-    [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) {
-        EXPECT_TRUE(isAppBound);
+    [webView _isForcedIntoAppBoundMode:^(BOOL isForcedIntoAppBoundMode) {
+        EXPECT_TRUE(isForcedIntoAppBoundMode);
         cleanUpInAppBrowserPrivacyTestSettings();
         isDone = true;
     }];
@@ -311,7 +311,6 @@
 {
     initializeInAppBrowserPrivacyTestSettings();
     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    [configuration setLimitsNavigationsToAppBoundDomains:YES];
 
     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
@@ -318,8 +317,8 @@
     [webView _test_waitForDidFinishNavigation];
 
     isDone = false;
-    [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) {
-        EXPECT_TRUE(isAppBound);
+    [webView _isForcedIntoAppBoundMode:^(BOOL isForcedIntoAppBoundMode) {
+        EXPECT_TRUE(isForcedIntoAppBoundMode);
         cleanUpInAppBrowserPrivacyTestSettings();
         isDone = true;
     }];
@@ -894,7 +893,7 @@
     [webView setNavigationDelegate:delegate.get()];
     
     // Navigate to an app-bound domain and expect a successful load.
-    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser://apple.com/app-bound-domain-load"]];
     [webView loadRequest:request];
     [delegate waitForDidFinishNavigation];
     
@@ -924,7 +923,7 @@
     [webView setNavigationDelegate:delegate.get()];
     
     // Navigate to an app-bound domain and expect a successful load.
-    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser://apple.com/app-bound-domain-load"]];
     [webView loadRequest:request];
     [delegate waitForDidFinishNavigation];
 
@@ -953,7 +952,7 @@
     [webView setNavigationDelegate:delegate.get()];
     
     // Navigate to an app-bound domain and expect a successful load.
-    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser://apple.com/app-bound-domain-load"]];
     [webView loadRequest:request];
     [delegate waitForDidFinishNavigation];
 
@@ -965,7 +964,7 @@
     TestWebKitAPI::Util::run(&isDone);
 
     // Navigate to an non app-bound domain and expect a successful load.
-    request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-style-sheets"]];
+    request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser://in-app-browser-privacy-test-user-style-sheets"]];
     [webView loadRequest:request];
     [delegate waitForDidFinishNavigation];
     
@@ -1002,7 +1001,7 @@
     [webView setNavigationDelegate:delegate.get()];
     
     // Navigate to an app-bound domain and expect a successful load.
-    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];
+    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser://apple.com/app-bound-domain-load"]];
     [webView loadRequest:request];
     [delegate waitForDidFinishNavigation];
 
@@ -1073,6 +1072,82 @@
     cleanUpInAppBrowserPrivacyTestSettings();
 }
 
+TEST(InAppBrowserPrivacy, LoadFromHTMLStringsSucceedsIfAppBound)
+{
+    initializeInAppBrowserPrivacyTestSettings();
+    isDone = false;
+
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]);
+    [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"];
+
+    auto delegate = adoptNS([AppBoundDomainDelegate new]);
+
+    NSString *HTML = @"<html><head></head><body><img src=''></img></body></html>";
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+    [webView setNavigationDelegate:delegate.get()];
+
+    [webView loadHTMLString:HTML baseURL:[NSURL URLWithString:@"in-app-browser://apple.com/"]];
+    [delegate waitForDidFinishNavigation];
+
+    cleanUpInAppBrowserPrivacyTestSettings();
+}
+
+TEST(InAppBrowserPrivacy, LoadFromHTMLStringNoBaseURLIsAppBound)
+{
+    initializeInAppBrowserPrivacyTestSettings();
+    isDone = false;
+
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]);
+    [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"];
+
+    auto delegate = adoptNS([AppBoundDomainDelegate new]);
+
+    NSString *HTML = @"<html><head></head><body><img src=''></img></body></html>";
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+    [webView setNavigationDelegate:delegate.get()];
+
+    [webView loadHTMLString:HTML baseURL:nil];
+    [delegate waitForDidFinishNavigation];
+
+    isDone = false;
+    [webView _isForcedIntoAppBoundMode:^(BOOL isForcedIntoAppBoundMode) {
+        EXPECT_TRUE(isForcedIntoAppBoundMode);
+        cleanUpInAppBrowserPrivacyTestSettings();
+        isDone = true;
+    }];
+    TestWebKitAPI::Util::run(&isDone);
+}
+
+TEST(InAppBrowserPrivacy, LoadFromHTMLStringsFailsIfNotAppBound)
+{
+    initializeInAppBrowserPrivacyTestSettings();
+    isDone = false;
+
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]);
+    [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"];
+
+    auto delegate = adoptNS([AppBoundDomainDelegate new]);
+
+    NSString *HTML = @"<html><head></head><body><img src=''></img></body></html>";
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+    [webView setNavigationDelegate:delegate.get()];
+
+    [webView loadHTMLString:HTML baseURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-agent-script"]];
+    NSError *error = [delegate waitForDidFailProvisionalNavigationError];
+    EXPECT_WK_STREQ(error.localizedDescription, @"App-bound domain failure");
+
+    isDone = false;
+    [webView _isForcedIntoAppBoundMode:^(BOOL isForcedIntoAppBoundMode) {
+        EXPECT_TRUE(isForcedIntoAppBoundMode);
+        cleanUpInAppBrowserPrivacyTestSettings();
+        isDone = true;
+    }];
+    TestWebKitAPI::Util::run(&isDone);
+}
+
 #endif // USE(APPLE_INTERNAL_SDK)
 
 #endif // PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to