Title: [268214] trunk
Revision
268214
Author
commit-qu...@webkit.org
Date
2020-10-08 15:20:42 -0700 (Thu, 08 Oct 2020)

Log Message

REGRESSION (r267763): [ iOS wk2 ] http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=217386

Patch by Alex Christensen <achristen...@webkit.org> on 2020-10-08
Reviewed by Brent Fulgham.

Source/WebKit:

Use SPI instead of NSUserDefaults to turn on test mode for app browser privacy.
This is more reliable with the timing change of when a WebsiteDataStore's parameters are sent to the network process.

* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration enableInAppBrowserPrivacyForTesting]):
(-[_WKWebsiteDataStoreConfiguration setEnableInAppBrowserPrivacyForTesting:]):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
(WebKit::WebsiteDataStore::ensureAppBoundDomains const):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::enableInAppBrowserPrivacyForTesting const):
(WebKit::WebsiteDataStoreConfiguration::setEnableInAppBrowserPrivacyForTesting):

Source/WTF:

* Scripts/Preferences/WebPreferencesDebug.yaml:

Tools:

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformAddTestOptions const):
(WTR::TestController::platformInitializeDataStore):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

LayoutTests:

* platform/ios-simulator-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268213 => 268214)


--- trunk/LayoutTests/ChangeLog	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/LayoutTests/ChangeLog	2020-10-08 22:20:42 UTC (rev 268214)
@@ -1,3 +1,12 @@
+2020-10-08  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION (r267763): [ iOS wk2 ] http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html is a constant failure
+        https://bugs.webkit.org/show_bug.cgi?id=217386
+
+        Reviewed by Brent Fulgham.
+
+        * platform/ios-simulator-wk2/TestExpectations:
+
 2020-10-08  Zalan Bujtas  <za...@apple.com>
 
         [LFC][Integration] Enable float clear for <br>

Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (268213 => 268214)


--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2020-10-08 22:20:42 UTC (rev 268214)
@@ -135,8 +135,6 @@
 
 webkit.org/b/217114 [ Release ] compositing/debug-borders-dynamic.html [ Pass ImageOnlyFailure ]
 
-webkit.org/b/217184 http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html [ Failure ]
-webkit.org/b/217184 http/tests/in-app-browser-privacy/top-frame-redirect-to-non-app-bound-domain-blocked.html [ Failure ]
 webkit.org/b/217184 imported/w3c/web-platform-tests/xhr/event-timeout.any.html [ Failure ]
 
 webkit.org/b/217414 [ Release ] imported/w3c/web-platform-tests/user-timing/measure-l3.any.html [ Pass Failure ]

Modified: trunk/Source/WTF/ChangeLog (268213 => 268214)


--- trunk/Source/WTF/ChangeLog	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WTF/ChangeLog	2020-10-08 22:20:42 UTC (rev 268214)
@@ -1,3 +1,12 @@
+2020-10-08  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION (r267763): [ iOS wk2 ] http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html is a constant failure
+        https://bugs.webkit.org/show_bug.cgi?id=217386
+
+        Reviewed by Brent Fulgham.
+
+        * Scripts/Preferences/WebPreferencesDebug.yaml:
+
 2020-10-08  Yusuke Suzuki  <ysuz...@apple.com>
 
         Unreviewed, build fix for ARM64E

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml (268213 => 268214)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesDebug.yaml	2020-10-08 22:20:42 UTC (rev 268214)
@@ -89,18 +89,6 @@
     WebKit:
       default: false
 
-# FIXME: This is not relevent for WebKitLegacy, so should be excluded from WebKitLegacy entirely.
-# FIXME: The 'Is' prefix is inconsistent with most other preferences and should be removed.
-IsInAppBrowserPrivacyEnabled:
-  type: bool
-  humanReadableName: "In-App Browser Privacy"
-  humanReadableDescription: "Enable In-App Browser Privacy"
-  defaultValue:
-    WebKitLegacy:
-      default: false
-    WebKit:
-      default: WebKit::defaultInAppBrowserPrivacy()
-
 LogsPageMessagesToSystemConsoleEnabled:
   type: bool
   defaultValue:

Modified: trunk/Source/WebKit/ChangeLog (268213 => 268214)


--- trunk/Source/WebKit/ChangeLog	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/ChangeLog	2020-10-08 22:20:42 UTC (rev 268214)
@@ -1,3 +1,27 @@
+2020-10-08  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION (r267763): [ iOS wk2 ] http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html is a constant failure
+        https://bugs.webkit.org/show_bug.cgi?id=217386
+
+        Reviewed by Brent Fulgham.
+
+        Use SPI instead of NSUserDefaults to turn on test mode for app browser privacy.
+        This is more reliable with the timing change of when a WebsiteDataStore's parameters are sent to the network process.
+
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
+        (-[_WKWebsiteDataStoreConfiguration enableInAppBrowserPrivacyForTesting]):
+        (-[_WKWebsiteDataStoreConfiguration setEnableInAppBrowserPrivacyForTesting:]):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
+        (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
+        (WebKit::WebsiteDataStoreConfiguration::copy const):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
+        (WebKit::WebsiteDataStoreConfiguration::enableInAppBrowserPrivacyForTesting const):
+        (WebKit::WebsiteDataStoreConfiguration::setEnableInAppBrowserPrivacyForTesting):
+
 2020-10-08  Chris Dumez  <cdu...@apple.com>
 
         Crash under WebKit::WebProcessCache::clear()

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2020-10-08 22:20:42 UTC (rev 268214)
@@ -355,16 +355,6 @@
     _preferences->setLargeImageAsyncDecodingEnabled(_largeImageAsyncDecodingEnabled);
 }
 
-- (BOOL)_inAppBrowserPrivacyEnabled
-{
-    return _preferences->isInAppBrowserPrivacyEnabled();
-}
-
-- (void)_setInAppBrowserPrivacyEnabled:(BOOL)enabled
-{
-    _preferences->setIsInAppBrowserPrivacyEnabled(enabled);
-}
-
 - (BOOL)_needsInAppBrowserPrivacyQuirks
 {
     return _preferences->needsInAppBrowserPrivacyQuirks();

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2020-10-08 22:20:42 UTC (rev 268214)
@@ -74,7 +74,6 @@
 @property (nonatomic, setter=_setAcceleratedDrawingEnabled:) BOOL _acceleratedDrawingEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
 @property (nonatomic, setter=_setDisplayListDrawingEnabled:) BOOL _displayListDrawingEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));
 @property (nonatomic, setter=_setLargeImageAsyncDecodingEnabled:) BOOL _largeImageAsyncDecodingEnabled WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
-@property (nonatomic, setter=_setInAppBrowserPrivacyEnabled:) BOOL _inAppBrowserPrivacyEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, setter=_setNeedsInAppBrowserPrivacyQuirks:) BOOL _needsInAppBrowserPrivacyQuirks WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, setter=_setAnimatedImageAsyncDecodingEnabled:) BOOL _animatedImageAsyncDecodingEnabled WK_API_AVAILABLE(macos(10.12.3), ios(10.3));
 @property (nonatomic, setter=_setTextAutosizingEnabled:) BOOL _textAutosizingEnabled WK_API_AVAILABLE(macos(10.12), ios(10.0));

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h	2020-10-08 22:20:42 UTC (rev 268214)
@@ -73,6 +73,7 @@
 @property (nonatomic) BOOL suppressesConnectionTerminationOnSystemChange WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic) BOOL allowsServerPreconnect WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, nullable, copy, setter=setHSTSStorageDirectory:) NSURL *hstsStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic) BOOL enableInAppBrowserPrivacyForTesting WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @property (nonatomic, nullable, copy) NSURL *alternativeServicesStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm	2020-10-08 22:20:42 UTC (rev 268214)
@@ -466,6 +466,16 @@
     _configuration->setStandaloneApplicationURL(url);
 }
 
+- (BOOL)enableInAppBrowserPrivacyForTesting
+{
+    return _configuration->enableInAppBrowserPrivacyForTesting();
+}
+
+- (void)setEnableInAppBrowserPrivacyForTesting:(BOOL)enable
+{
+    _configuration->setEnableInAppBrowserPrivacyForTesting(enable);
+}
+
 - (BOOL)allLoadsBlockedByDeviceManagementRestrictionsForTesting
 {
     return _configuration->allLoadsBlockedByDeviceManagementRestrictionsForTesting();

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


--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-10-08 22:20:42 UTC (rev 268214)
@@ -116,7 +116,6 @@
         else
             firstPartyWebsiteDataRemovalMode = WebCore::FirstPartyWebsiteDataRemovalMode::AllButCookies;
     }
-    m_isInAppBrowserPrivacyTestModeEnabled = [defaults boolForKey:[NSString stringWithFormat:@"WebKitDebug%@", WebPreferencesKey::isInAppBrowserPrivacyEnabledKey().createCFString().get()]];
 
     auto* manualPrevalentResource = [defaults stringForKey:@"ITPManualPrevalentResource"];
     if (manualPrevalentResource) {
@@ -479,9 +478,8 @@
 void WebsiteDataStore::ensureAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&, const HashSet<String>&)>&& completionHandler) const
 {
     if (hasInitializedAppBoundDomains) {
-        if (m_isInAppBrowserPrivacyTestModeEnabled) {
+        if (m_configuration->enableInAppBrowserPrivacyForTesting())
             addTestDomains();
-        }
         completionHandler(appBoundDomains(), appBoundSchemes());
         return;
     }
@@ -491,9 +489,8 @@
     appBoundDomainQueue().dispatch([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable {
         RunLoop::main().dispatch([this, protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler)] () mutable {
             ASSERT(hasInitializedAppBoundDomains);
-            if (m_isInAppBrowserPrivacyTestModeEnabled) {
+            if (m_configuration->enableInAppBrowserPrivacyForTesting())
                 addTestDomains();
-            }
             completionHandler(appBoundDomains(), appBoundSchemes());
         });
     });

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-10-08 22:20:42 UTC (rev 268214)
@@ -426,7 +426,6 @@
     WeakHashSet<WebProcessProxy> m_processes;
 
     bool m_isItpStateExplicitlySet { false };
-    bool m_isInAppBrowserPrivacyTestModeEnabled { false };
 
 #if HAVE(SEC_KEY_PROXY)
     Vector<Ref<SecKeyProxyStore>> m_secKeyProxyStores;

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp	2020-10-08 22:20:42 UTC (rev 268214)
@@ -92,6 +92,7 @@
     copy->m_requiresSecureHTTPSProxyConnection = this->m_requiresSecureHTTPSProxyConnection;
     copy->m_preventsSystemHTTPProxyAuthentication = this->m_preventsSystemHTTPProxyAuthentication;
     copy->m_standaloneApplicationURL = this->m_standaloneApplicationURL;
+    copy->m_enableInAppBrowserPrivacyForTesting = this->m_enableInAppBrowserPrivacyForTesting;
 #if PLATFORM(COCOA)
     if (m_proxyConfiguration)
         copy->m_proxyConfiguration = adoptCF(CFDictionaryCreateCopy(nullptr, this->m_proxyConfiguration.get()));

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h (268213 => 268214)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h	2020-10-08 22:20:42 UTC (rev 268214)
@@ -163,6 +163,9 @@
     const URL& standaloneApplicationURL() const { return m_standaloneApplicationURL; }
     void setStandaloneApplicationURL(URL&& url) { m_standaloneApplicationURL = WTFMove(url); }
 
+    bool enableInAppBrowserPrivacyForTesting() const { return m_enableInAppBrowserPrivacyForTesting; }
+    void setEnableInAppBrowserPrivacyForTesting(bool value) { m_enableInAppBrowserPrivacyForTesting = value; }
+    
 private:
     IsPersistent m_isPersistent { IsPersistent::No };
 
@@ -208,6 +211,7 @@
     bool m_requiresSecureHTTPSProxyConnection { false };
     unsigned m_testSpeedMultiplier { 1 };
     URL m_standaloneApplicationURL;
+    bool m_enableInAppBrowserPrivacyForTesting { false };
 #if PLATFORM(COCOA)
     RetainPtr<CFDictionaryRef> m_proxyConfiguration;
 #endif

Modified: trunk/Tools/ChangeLog (268213 => 268214)


--- trunk/Tools/ChangeLog	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Tools/ChangeLog	2020-10-08 22:20:42 UTC (rev 268214)
@@ -1,3 +1,16 @@
+2020-10-08  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION (r267763): [ iOS wk2 ] http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html is a constant failure
+        https://bugs.webkit.org/show_bug.cgi?id=217386
+
+        Reviewed by Brent Fulgham.
+
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::platformAddTestOptions const):
+        (WTR::TestController::platformInitializeDataStore):
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformResetStateToConsistentValues):
+
 2020-10-08  Jonathan Bedard  <jbed...@apple.com>
 
         [webkitpy] Support custom version information

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (268213 => 268214)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-10-08 22:20:42 UTC (rev 268214)
@@ -120,21 +120,20 @@
         options.contextOptions.enableProcessSwapOnNavigation = true;
     if ([[NSUserDefaults standardUserDefaults] boolForKey:@"EnableProcessSwapOnWindowOpen"])
         options.contextOptions.enableProcessSwapOnWindowOpen = true;
-
-#if PLATFORM(IOS_FAMILY)
-    if (options.enableInAppBrowserPrivacy)
-        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
-#endif
 }
 
 void TestController::platformInitializeDataStore(WKPageConfigurationRef, const TestOptions& options)
 {
-    if (options.useEphemeralSession || options.standaloneWebApplicationURL.length()) {
+    if (options.useEphemeralSession || options.standaloneWebApplicationURL.length() || options.enableInAppBrowserPrivacy) {
         auto websiteDataStoreConfig = options.useEphemeralSession ? [[[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration] autorelease] : [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease];
         if (!options.useEphemeralSession)
             configureWebsiteDataStoreTemporaryDirectories((WKWebsiteDataStoreConfigurationRef)websiteDataStoreConfig);
         if (options.standaloneWebApplicationURL.length())
             [websiteDataStoreConfig setStandaloneApplicationURL:[NSURL URLWithString:[NSString stringWithUTF8String:options.standaloneWebApplicationURL.c_str()]]];
+#if PLATFORM(IOS_FAMILY)
+        if (options.enableInAppBrowserPrivacy)
+            [websiteDataStoreConfig setEnableInAppBrowserPrivacyForTesting:YES];
+#endif
         m_websiteDataStore = (__bridge WKWebsiteDataStoreRef)[[[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfig] autorelease];
     } else
         m_websiteDataStore = (__bridge WKWebsiteDataStoreRef)globalWebViewConfiguration.websiteDataStore;

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (268213 => 268214)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2020-10-08 21:41:44 UTC (rev 268213)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2020-10-08 22:20:42 UTC (rev 268214)
@@ -258,8 +258,6 @@
     if (shouldRestoreFirstResponder)
         [mainWebView()->platformView() becomeFirstResponder];
 
-    [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
-
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to