Changeset 260408 in webkit
- Timestamp:
- Apr 20, 2020 7:36:27 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r260407 r260408 1 2020-04-20 Kate Cheney <katherine_cheney@apple.com> 2 3 App-bound domain behavior should abide by the limitsNavigationsToAppBoundDomains argument in WKWebView configuration 4 https://bugs.webkit.org/show_bug.cgi?id=210769 5 <rdar://problem/62065241> 6 7 Reviewed by Brent Fulgham. 8 9 Changes app-bound domain behavior to be triggered by the value of 10 limitsNavigationsToAppBoundDomains, a WebView configuration flag. 11 If the WebView has this parameter set and is currently navigating to 12 an app bound domain, then app-bound privileges will be granted. 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted): 16 Update this function to return a boolean to indicate whether the 17 navigation should fail. A failure should occur if a WebView has set 18 the limitsNavigationsToAppBoundDomains flag and attempts to navigate 19 away from an app-bound domain. 20 21 If the limitsNavigationsToAppBoundDomains value has not been set to 22 true, maintain non-app bound behavior regardless of whether the domain 23 is app-bound or not. 24 25 (WebKit::WebPageProxy::decidePolicyForNavigationAction): 26 Check the result of setIsNavigatingToAppBoundDomainAndCheckIfPermitted and fail the 27 navigation if needed, with both RELEASE logging and an appropriate 28 error message. 29 30 (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain): Deleted. 31 * UIProcess/WebPageProxy.h: 32 Renamed for clarity. 33 1 34 2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com> 2 35 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r260407 r260408 3128 3128 }; 3129 3129 3130 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)3130 bool WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) 3131 3131 { 3132 3132 #if PLATFORM(IOS_FAMILY) 3133 3133 if (isMainFrame) { 3134 3134 if (WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN) 3135 return ;3135 return true; 3136 3136 if (!isNavigatingToAppBoundDomain) { 3137 3137 m_isNavigatingToAppBoundDomain = WTF::nullopt; 3138 return ;3138 return true; 3139 3139 } 3140 3140 if (m_ignoresAppBoundDomains) 3141 return; 3142 if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) { 3141 return true; 3142 3143 if (m_limitsNavigationsToAppBoundDomains) { 3144 if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) 3145 return false; 3146 m_configuration->setWebViewCategory(WebViewCategory::AppBoundDomain); 3147 m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes; 3148 } else { 3143 3149 m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser); 3144 3150 m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No; 3145 3151 m_hasNavigatedAwayFromAppBoundDomain = NavigatedAwayFromAppBoundDomain::Yes; 3146 return;3147 3152 } 3148 m_configuration->setWebViewCategory(WebViewCategory::AppBoundDomain);3149 m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;3150 3153 } 3151 3154 #else … … 3154 3157 UNUSED_PARAM(isNavigatingToAppBoundDomain); 3155 3158 #endif 3159 return true; 3156 3160 } 3157 3161 … … 5156 5160 #endif 5157 5161 5158 auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isAppBoundDomain) mutable { 5159 5160 if (policyAction != PolicyAction::Ignore) 5161 setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain); 5162 auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation, frameInfo, userDataObject = process->transformHandlesToObjects(userData.object()).get()] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isAppBoundDomain) mutable { 5162 5163 5163 5164 auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable { … … 5172 5173 receivedNavigationPolicyDecision(policyAction, navigation.get(), processSwapRequestedByClient, frame, WTFMove(policies), WTFMove(sender)); 5173 5174 }; 5175 5176 if (policyAction != PolicyAction::Ignore) { 5177 if (!setIsNavigatingToAppBoundDomainAndCheckIfPermitted(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain)) { 5178 auto error = ResourceError { String { }, 0, navigation->currentRequest().url(), "Attempted navigation away from app-bound domain"_s }; 5179 m_navigationClient->didFailProvisionalNavigationWithError(*this, FrameInfoData { frameInfo }, navigation.get(), error, userDataObject); 5180 RELEASE_LOG_ERROR_IF_ALLOWED(Loading, "Ignoring request to load this main resource because it is attempting to navigate away from an app-bound domain"); 5181 completionHandler(PolicyAction::Ignore); 5182 return; 5183 } 5184 } 5174 5185 5175 5186 if (!m_pageClient) -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r260407 r260408 2312 2312 void makeStorageSpaceRequest(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&&); 2313 2313 2314 void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>);2314 bool setIsNavigatingToAppBoundDomainAndCheckIfPermitted(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>); 2315 2315 NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; } 2316 2316 -
trunk/Tools/ChangeLog
r260402 r260408 1 2020-04-20 Kate Cheney <katherine_cheney@apple.com> 2 3 App-bound domain behavior should abide by the limitsNavigationsToAppBoundDomains argument in WKWebView configuration 4 https://bugs.webkit.org/show_bug.cgi?id=210769 5 <rdar://problem/62065241> 6 7 Reviewed by Brent Fulgham. 8 9 Removes any tests for swapping between app-bound and non app-bound 10 domains as this behavior is no longer supported. 11 12 Sets the limitsNavigationsToAppBoundDomains flag for tests which should 13 have app-bound behavior to maintain test functionality. 14 15 Adds 5 new tests for new behavior. 16 17 * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: 18 (TEST): 19 (-[AppBoundDomainDelegate webView:didFinishNavigation:]): 20 (-[AppBoundDomainDelegate webView:didFailProvisionalNavigation:withError:]): 21 (-[AppBoundDomainDelegate waitForDidFinishNavigation]): 22 (-[AppBoundDomainDelegate waitForDidFailProvisionalNavigationError]): 23 1 24 2020-04-20 Megan Gardner <megan_gardner@apple.com> 2 25 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
r260366 r260408 221 221 } 222 222 223 TEST(InAppBrowserPrivacy, SwapBackToAppBoundRejectsUserScript)224 {225 initializeInAppBrowserPrivacyTestSettings();226 auto userScript = adoptNS([[WKUserScript alloc] initWithSource:userScriptSource injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES]);227 228 WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES];229 [[configuration preferences] _setNeedsInAppBrowserPrivacyQuirks:NO];230 [[configuration preferences] _setInAppBrowserPrivacyEnabled:YES];231 232 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]);233 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"];234 235 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration]);236 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-script"]];237 [webView loadRequest:request];238 [webView _test_waitForDidFinishNavigation];239 240 [configuration.userContentController _addUserScriptImmediately:userScript.get()];241 [webView evaluateJavaScript:@"window.wkUserScriptInjected" completionHandler:^(id _Nullable result, NSError * _Nullable error) {242 EXPECT_FALSE(result);243 EXPECT_TRUE(!!error);244 isDone = true;245 }];246 247 isDone = false;248 TestWebKitAPI::Util::run(&isDone);249 250 request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]];251 [webView loadRequest:request];252 [webView _test_waitForDidFinishNavigation];253 254 isDone = false;255 [configuration.userContentController _addUserScriptImmediately:userScript.get()];256 [webView evaluateJavaScript:@"window.wkUserScriptInjected" completionHandler:^(id _Nullable result, NSError * _Nullable error) {257 EXPECT_FALSE(result);258 EXPECT_TRUE(!!error);259 cleanUpInAppBrowserPrivacyTestSettings();260 isDone = true;261 }];262 263 TestWebKitAPI::Util::run(&isDone);264 }265 266 223 TEST(InAppBrowserPrivacy, AppBoundDomains) 267 224 { … … 289 246 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 290 247 [[configuration preferences] _setInAppBrowserPrivacyEnabled:YES]; 248 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 291 249 292 250 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]); … … 309 267 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 310 268 [[configuration preferences] _setInAppBrowserPrivacyEnabled:YES]; 269 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 311 270 312 271 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]); … … 328 287 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 329 288 [[configuration preferences] _setInAppBrowserPrivacyEnabled:YES]; 289 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 330 290 331 291 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]); … … 346 306 static NSString *frameBackgroundColorScript = @"window.getComputedStyle(document.getElementsByTagName('iframe')[0].contentDocument.body, null).getPropertyValue('background-color')"; 347 307 static const char* redInRGB = "rgb(255, 0, 0)"; 308 static const char* blackInRGB = "rgba(0, 0, 0, 0)"; 348 309 349 310 static void expectScriptEvaluatesToColor(WKWebView *webView, NSString *script, const char* color) … … 459 420 } 460 421 461 TEST(InAppBrowserPrivacy, AppBound ToNonAppBoundDomainCannotAccessMessageHandlers)422 TEST(InAppBrowserPrivacy, AppBoundDomainCanAccessMessageHandlers) 462 423 { 463 424 initializeInAppBrowserPrivacyTestSettings(); … … 469 430 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 470 431 [[configuration preferences] _setInAppBrowserPrivacyEnabled:YES]; 432 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 471 433 472 434 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]); … … 487 449 }]; 488 450 489 // Navigate away from an app-bound domain.490 NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-message-handler"]];491 [webView loadRequest:request2];492 [webView _test_waitForDidFinishNavigation];493 494 // Set the background color to red if message handlers returned null so we can495 // check without needing a message handler.496 expectScriptEvaluatesToColor(webView.get(), backgroundColorScript, redInRGB);497 451 cleanUpInAppBrowserPrivacyTestSettings(); 498 452 } … … 876 830 } 877 831 832 @interface AppBoundDomainDelegate : NSObject <WKNavigationDelegate> 833 - (void)waitForDidFinishNavigation; 834 - (NSError *)waitForDidFailProvisionalNavigationError; 835 @end 836 837 @implementation AppBoundDomainDelegate { 838 bool _navigationFinished; 839 RetainPtr<NSError> _provisionalNavigationFailedError; 840 } 841 842 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation 843 { 844 _navigationFinished = true; 845 } 846 847 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(NSError *)error 848 { 849 _provisionalNavigationFailedError = error; 850 } 851 852 - (void)waitForDidFinishNavigation 853 { 854 TestWebKitAPI::Util::run(&_navigationFinished); 855 } 856 857 - (NSError *)waitForDidFailProvisionalNavigationError 858 { 859 while (!_provisionalNavigationFailedError) 860 TestWebKitAPI::Util::spinRunLoop(); 861 return _provisionalNavigationFailedError.autorelease(); 862 } 863 864 @end 865 866 TEST(InAppBrowserPrivacy, AppBoundFlagForNonAppBoundDomainFails) 867 { 868 initializeInAppBrowserPrivacyTestSettings(); 869 isDone = false; 870 871 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 872 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]); 873 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 874 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 875 876 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 877 auto delegate = adoptNS([AppBoundDomainDelegate new]); 878 [webView setNavigationDelegate:delegate.get()]; 879 880 // Load a non-app bound domain. 881 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-style-sheets"]]; 882 [webView loadRequest:request]; 883 NSError *error = [delegate waitForDidFailProvisionalNavigationError]; 884 EXPECT_WK_STREQ(error.localizedDescription, @"Attempted navigation away from app-bound domain"); 885 886 // Make sure the load didn't complete by checking the background color. 887 // Red would indicate it finished loading. 888 expectScriptEvaluatesToColor(webView.get(), backgroundColorScript, blackInRGB); 889 cleanUpInAppBrowserPrivacyTestSettings(); 890 } 891 892 TEST(InAppBrowserPrivacy, NavigateAwayFromAppBoundDomainWithAppBoundFlagFails) 893 { 894 initializeInAppBrowserPrivacyTestSettings(); 895 isDone = false; 896 897 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 898 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]); 899 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 900 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 901 902 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 903 auto delegate = adoptNS([AppBoundDomainDelegate new]); 904 [webView setNavigationDelegate:delegate.get()]; 905 906 // Navigate to an app-bound domain and expect a successful load. 907 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 908 [webView loadRequest:request]; 909 [delegate waitForDidFinishNavigation]; 910 911 // Now try to load a non-app bound domain and make sure it fails. 912 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-style-sheets"]]; 913 [webView loadRequest:request]; 914 NSError *error = [delegate waitForDidFailProvisionalNavigationError]; 915 EXPECT_WK_STREQ(error.localizedDescription, @"Attempted navigation away from app-bound domain"); 916 917 // Make sure the load didn't complete by checking the background color. 918 // Red would indicate it finished loading. 919 expectScriptEvaluatesToColor(webView.get(), backgroundColorScript, blackInRGB); 920 cleanUpInAppBrowserPrivacyTestSettings(); 921 } 922 923 TEST(InAppBrowserPrivacy, AppBoundDomainWithoutFlagTreatedAsNonAppBound) 924 { 925 initializeInAppBrowserPrivacyTestSettings(); 926 isDone = false; 927 928 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 929 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]); 930 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 931 932 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 933 auto delegate = adoptNS([AppBoundDomainDelegate new]); 934 [webView setNavigationDelegate:delegate.get()]; 935 936 // Navigate to an app-bound domain and expect a successful load. 937 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 938 [webView loadRequest:request]; 939 [delegate waitForDidFinishNavigation]; 940 941 // But the navigation should not have been considered app-bound because the WebView configuration 942 // specification was not set. 943 isDone = false; 944 [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) { 945 EXPECT_FALSE(isAppBound); 946 cleanUpInAppBrowserPrivacyTestSettings(); 947 isDone = true; 948 }]; 949 TestWebKitAPI::Util::run(&isDone); 950 } 951 952 TEST(InAppBrowserPrivacy, WebViewWithoutAppBoundFlagCanFreelyNavigate) 953 { 954 initializeInAppBrowserPrivacyTestSettings(); 955 isDone = false; 956 957 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 958 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]); 959 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 960 961 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 962 auto delegate = adoptNS([AppBoundDomainDelegate new]); 963 [webView setNavigationDelegate:delegate.get()]; 964 965 // Navigate to an app-bound domain and expect a successful load. 966 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 967 [webView loadRequest:request]; 968 [delegate waitForDidFinishNavigation]; 969 970 isDone = false; 971 [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) { 972 EXPECT_FALSE(isAppBound); 973 isDone = true; 974 }]; 975 TestWebKitAPI::Util::run(&isDone); 976 977 // Navigate to an non app-bound domain and expect a successful load. 978 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-style-sheets"]]; 979 [webView loadRequest:request]; 980 [delegate waitForDidFinishNavigation]; 981 982 isDone = false; 983 [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) { 984 EXPECT_FALSE(isAppBound); 985 isDone = true; 986 }]; 987 TestWebKitAPI::Util::run(&isDone); 988 989 // Navigation should be successful, but this WebView should not get app-bound domain 990 // privileges like user style sheets. 991 expectScriptEvaluatesToColor(webView.get(), backgroundColorScript, blackInRGB); 992 cleanUpInAppBrowserPrivacyTestSettings(); 993 } 994 995 TEST(InAppBrowserPrivacy, WebViewCannotUpdateAppBoundFlagOnceSet) 996 { 997 initializeInAppBrowserPrivacyTestSettings(); 998 isDone = false; 999 1000 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 1001 auto schemeHandler = adoptNS([[InAppBrowserSchemeHandler alloc] init]); 1002 [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"in-app-browser"]; 1003 [configuration setLimitsNavigationsToAppBoundDomains:YES]; 1004 1005 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 1006 auto delegate = adoptNS([AppBoundDomainDelegate new]); 1007 [webView setNavigationDelegate:delegate.get()]; 1008 1009 // Navigate to an app-bound domain and expect a successful load. 1010 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"in-app-browser-privacy-local-file" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 1011 [webView loadRequest:request]; 1012 [delegate waitForDidFinishNavigation]; 1013 1014 isDone = false; 1015 [webView _isNavigatingToAppBoundDomain:^(BOOL isAppBound) { 1016 EXPECT_TRUE(isAppBound); 1017 isDone = true; 1018 }]; 1019 TestWebKitAPI::Util::run(&isDone); 1020 1021 [[webView configuration] setLimitsNavigationsToAppBoundDomains:NO]; 1022 // Now try to load a non-app bound domain and make sure it fails. 1023 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"in-app-browser:///in-app-browser-privacy-test-user-style-sheets"]]; 1024 [webView loadRequest:request]; 1025 NSError *error = [delegate waitForDidFailProvisionalNavigationError]; 1026 EXPECT_WK_STREQ(error.localizedDescription, @"Attempted navigation away from app-bound domain"); 1027 1028 cleanUpInAppBrowserPrivacyTestSettings(); 1029 } 1030 878 1031 #endif // USE(APPLE_INTERNAL_SDK) 879 1032
Note: See TracChangeset
for help on using the changeset viewer.