Title: [259314] branches/safari-610.1.7-branch
Revision
259314
Author
[email protected]
Date
2020-03-31 15:07:32 -0700 (Tue, 31 Mar 2020)

Log Message

Cherry-pick r258436. rdar://problem/61125864

    [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
    https://bugs.webkit.org/show_bug.cgi?id=209016
    <rdar://problem/60329530>

    Reviewed by Chris Dumez.

    Source/WebKit:

    This patch adds a function to re-initialize app bound domains for
    in-app-browser-privacy tests, since they are only initialized once
    when the WebsiteDataStore is created. This causes issues if the tests
    are run in parallel with other tests with different app-bound domains.

    * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
    (WKWebsiteDataStoreReinitializeAppBoundDomains):
    * UIProcess/API/C/WKWebsiteDataStoreRef.h:
    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
    (WebKit::WebsiteDataStore::clearAppBoundDomains):
    (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
    * UIProcess/WebsiteData/WebsiteDataStore.h:

    Tools:

    Re-initialize the app-bound domains when the correct
    TestOptions parameter is set.

    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::createWebViewWithOptions):
    (WTR::TestController::reinitializeAppBoundDomains):
    * WebKitTestRunner/TestController.h:

    LayoutTests:

    Use TestOptions to trigger the re-initialization of app-bound domains.

    * http/tests/in-app-browser-privacy/app-bound-domain.html:
    * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html:

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

Modified Paths

Diff

Modified: branches/safari-610.1.7-branch/LayoutTests/ChangeLog (259313 => 259314)


--- branches/safari-610.1.7-branch/LayoutTests/ChangeLog	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/LayoutTests/ChangeLog	2020-03-31 22:07:32 UTC (rev 259314)
@@ -1,3 +1,61 @@
+2020-03-31  Alan Coon  <[email protected]>
+
+        Cherry-pick r258436. rdar://problem/61125864
+
+    [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+    https://bugs.webkit.org/show_bug.cgi?id=209016
+    <rdar://problem/60329530>
+    
+    Reviewed by Chris Dumez.
+    
+    Source/WebKit:
+    
+    This patch adds a function to re-initialize app bound domains for
+    in-app-browser-privacy tests, since they are only initialized once
+    when the WebsiteDataStore is created. This causes issues if the tests
+    are run in parallel with other tests with different app-bound domains.
+    
+    * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+    (WKWebsiteDataStoreReinitializeAppBoundDomains):
+    * UIProcess/API/C/WKWebsiteDataStoreRef.h:
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::clearAppBoundDomains):
+    (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
+    * UIProcess/WebsiteData/WebsiteDataStore.h:
+    
+    Tools:
+    
+    Re-initialize the app-bound domains when the correct
+    TestOptions parameter is set.
+    
+    * WebKitTestRunner/TestController.cpp:
+    (WTR::TestController::createWebViewWithOptions):
+    (WTR::TestController::reinitializeAppBoundDomains):
+    * WebKitTestRunner/TestController.h:
+    
+    LayoutTests:
+    
+    Use TestOptions to trigger the re-initialization of app-bound domains.
+    
+    * http/tests/in-app-browser-privacy/app-bound-domain.html:
+    * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-13  Kate Cheney  <[email protected]>
+
+            [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+            https://bugs.webkit.org/show_bug.cgi?id=209016
+            <rdar://problem/60329530>
+
+            Reviewed by Chris Dumez.
+
+            Use TestOptions to trigger the re-initialization of app-bound domains.
+
+            * http/tests/in-app-browser-privacy/app-bound-domain.html:
+            * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html:
+
 2020-03-30  Alan Coon  <[email protected]>
 
         Cherry-pick r258804. rdar://problem/61082982

Modified: branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html (259313 => 259314)


--- branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html	2020-03-31 22:07:32 UTC (rev 259314)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ internal:IsInAppBrowserPrivacyEnabled=true applicationBundleIdentifier=testidentifier ] -->
+<!DOCTYPE html><!-- webkit-test-runner [ internal:IsInAppBrowserPrivacyEnabled=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier ] -->
 <html>
 <head>
     <script src=""

Modified: branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html (259313 => 259314)


--- branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html	2020-03-31 22:07:32 UTC (rev 259314)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ internal:IsInAppBrowserPrivacyEnabled=true applicationBundleIdentifier=testidentifier ] -->
+<!DOCTYPE html><!-- webkit-test-runner [ internal:IsInAppBrowserPrivacyEnabled=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier ] -->
 <html lang="en">
 <head>
     <meta charset="UTF-8">

Modified: branches/safari-610.1.7-branch/Source/WebKit/ChangeLog (259313 => 259314)


--- branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-31 22:07:32 UTC (rev 259314)
@@ -1,5 +1,71 @@
 2020-03-31  Alan Coon  <[email protected]>
 
+        Cherry-pick r258436. rdar://problem/61125864
+
+    [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+    https://bugs.webkit.org/show_bug.cgi?id=209016
+    <rdar://problem/60329530>
+    
+    Reviewed by Chris Dumez.
+    
+    Source/WebKit:
+    
+    This patch adds a function to re-initialize app bound domains for
+    in-app-browser-privacy tests, since they are only initialized once
+    when the WebsiteDataStore is created. This causes issues if the tests
+    are run in parallel with other tests with different app-bound domains.
+    
+    * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+    (WKWebsiteDataStoreReinitializeAppBoundDomains):
+    * UIProcess/API/C/WKWebsiteDataStoreRef.h:
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::clearAppBoundDomains):
+    (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
+    * UIProcess/WebsiteData/WebsiteDataStore.h:
+    
+    Tools:
+    
+    Re-initialize the app-bound domains when the correct
+    TestOptions parameter is set.
+    
+    * WebKitTestRunner/TestController.cpp:
+    (WTR::TestController::createWebViewWithOptions):
+    (WTR::TestController::reinitializeAppBoundDomains):
+    * WebKitTestRunner/TestController.h:
+    
+    LayoutTests:
+    
+    Use TestOptions to trigger the re-initialization of app-bound domains.
+    
+    * http/tests/in-app-browser-privacy/app-bound-domain.html:
+    * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-13  Kate Cheney  <[email protected]>
+
+            [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+            https://bugs.webkit.org/show_bug.cgi?id=209016
+            <rdar://problem/60329530>
+
+            Reviewed by Chris Dumez.
+
+            This patch adds a function to re-initialize app bound domains for
+            in-app-browser-privacy tests, since they are only initialized once
+            when the WebsiteDataStore is created. This causes issues if the tests
+            are run in parallel with other tests with different app-bound domains.
+
+            * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+            (WKWebsiteDataStoreReinitializeAppBoundDomains):
+            * UIProcess/API/C/WKWebsiteDataStoreRef.h:
+            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+            (WebKit::WebsiteDataStore::clearAppBoundDomains):
+            (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
+            * UIProcess/WebsiteData/WebsiteDataStore.h:
+
+2020-03-31  Alan Coon  <[email protected]>
+
         Cherry-pick r258600. rdar://problem/61082995
 
     Add internal debugging when initializing an app-bound session

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (259313 => 259314)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2020-03-31 22:07:32 UTC (rev 259314)
@@ -725,3 +725,10 @@
         completionHandler(context);
     });
 }
+
+void WKWebsiteDataStoreReinitializeAppBoundDomains(WKWebsiteDataStoreRef dataStoreRef)
+{
+#if PLATFORM(COCOA)
+    WebKit::toImpl(dataStoreRef)->reinitializeAppBoundDomains();
+#endif
+}

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h (259313 => 259314)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h	2020-03-31 22:07:32 UTC (rev 259314)
@@ -164,6 +164,8 @@
 typedef void (*WKWebsiteDataStoreSetInAppBrowserPrivacyEnabledFunction)(void* functionContext);
 WK_EXPORT void WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enabled, void* context, WKWebsiteDataStoreSetInAppBrowserPrivacyEnabledFunction completionHandler);
 
+WK_EXPORT void WKWebsiteDataStoreReinitializeAppBoundDomains(WKWebsiteDataStoreRef dataStoreRef);
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (259313 => 259314)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-03-31 22:07:32 UTC (rev 259314)
@@ -443,22 +443,25 @@
     return appBoundDomains;
 }
 
-void WebsiteDataStore::initializeAppBoundDomains()
+void WebsiteDataStore::initializeAppBoundDomains(ForceReinitialization forceReinitialization)
 {
     ASSERT(RunLoop::isMain());
 
-    if (hasInitializedAppBoundDomains)
+    if (hasInitializedAppBoundDomains && forceReinitialization != ForceReinitialization::Yes)
         return;
     
     static const auto maxAppBoundDomainCount = 10;
     
-    appBoundDomainQueue().dispatch([] () mutable {
-        if (hasInitializedAppBoundDomains)
+    appBoundDomainQueue().dispatch([forceReinitialization] () mutable {
+        if (hasInitializedAppBoundDomains && forceReinitialization != ForceReinitialization::Yes)
             return;
         
         NSArray<NSString *> *domains = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"WKAppBoundDomains"];
         
-        RunLoop::main().dispatch([domains = retainPtr(domains)] {
+        RunLoop::main().dispatch([forceReinitialization , domains = retainPtr(domains)] {
+            if (forceReinitialization == ForceReinitialization::Yes)
+                appBoundDomains().clear();
+
             for (NSString *domain in domains.get()) {
                 URL url { URL(), domain };
                 if (!url.isValid())
@@ -507,4 +510,10 @@
     });
 }
 
+void WebsiteDataStore::reinitializeAppBoundDomains()
+{
+    hasInitializedAppBoundDomains = false;
+    initializeAppBoundDomains(ForceReinitialization::Yes);
 }
+
+}

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (259313 => 259314)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-03-31 22:07:32 UTC (rev 259314)
@@ -286,9 +286,12 @@
     void beginAppBoundDomainCheck(WebCore::RegistrableDomain&&, WebFramePolicyListenerProxy&);
     void appBoundDomainsForTesting(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&)>&&) const;
     void ensureAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&)>&&) const;
+    void reinitializeAppBoundDomains();
 
 private:
-    void initializeAppBoundDomains();
+    enum class ForceReinitialization : bool { No, Yes };
+    void initializeAppBoundDomains(ForceReinitialization = ForceReinitialization::No);
+
     void fetchDataAndApply(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, RefPtr<WorkQueue>&&, Function<void(Vector<WebsiteDataRecord>)>&& apply);
 
     void platformInitialize();

Modified: branches/safari-610.1.7-branch/Tools/ChangeLog (259313 => 259314)


--- branches/safari-610.1.7-branch/Tools/ChangeLog	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Tools/ChangeLog	2020-03-31 22:07:32 UTC (rev 259314)
@@ -1,3 +1,64 @@
+2020-03-31  Alan Coon  <[email protected]>
+
+        Cherry-pick r258436. rdar://problem/61125864
+
+    [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+    https://bugs.webkit.org/show_bug.cgi?id=209016
+    <rdar://problem/60329530>
+    
+    Reviewed by Chris Dumez.
+    
+    Source/WebKit:
+    
+    This patch adds a function to re-initialize app bound domains for
+    in-app-browser-privacy tests, since they are only initialized once
+    when the WebsiteDataStore is created. This causes issues if the tests
+    are run in parallel with other tests with different app-bound domains.
+    
+    * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+    (WKWebsiteDataStoreReinitializeAppBoundDomains):
+    * UIProcess/API/C/WKWebsiteDataStoreRef.h:
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::clearAppBoundDomains):
+    (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
+    * UIProcess/WebsiteData/WebsiteDataStore.h:
+    
+    Tools:
+    
+    Re-initialize the app-bound domains when the correct
+    TestOptions parameter is set.
+    
+    * WebKitTestRunner/TestController.cpp:
+    (WTR::TestController::createWebViewWithOptions):
+    (WTR::TestController::reinitializeAppBoundDomains):
+    * WebKitTestRunner/TestController.h:
+    
+    LayoutTests:
+    
+    Use TestOptions to trigger the re-initialization of app-bound domains.
+    
+    * http/tests/in-app-browser-privacy/app-bound-domain.html:
+    * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-13  Kate Cheney  <[email protected]>
+
+            [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
+            https://bugs.webkit.org/show_bug.cgi?id=209016
+            <rdar://problem/60329530>
+
+            Reviewed by Chris Dumez.
+
+            Re-initialize the app-bound domains when the correct
+            TestOptions parameter is set.
+
+            * WebKitTestRunner/TestController.cpp:
+            (WTR::TestController::createWebViewWithOptions):
+            (WTR::TestController::reinitializeAppBoundDomains):
+            * WebKitTestRunner/TestController.h:
+
 2020-03-30  Alan Coon  <[email protected]>
 
         Cherry-pick r258659. rdar://problem/61083009

Modified: branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.cpp (259313 => 259314)


--- branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.cpp	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.cpp	2020-03-31 22:07:32 UTC (rev 259314)
@@ -790,6 +790,9 @@
     // Generally, the tests should default to running at 1x. updateWindowScaleForTest() will adjust the scale to
     // something else for specific tests that need to run at a different window scale.
     m_mainWebView->changeWindowScaleIfNeeded(1);
+    
+    if (!options.applicationBundleIdentifier.isEmpty())
+        reinitializeAppBoundDomains();
 }
 
 void TestController::ensureViewSupportsOptionsForTest(const TestInvocation& test)
@@ -3784,6 +3787,11 @@
     m_currentInvocation->didSetInAppBrowserPrivacyEnabled();
 }
 
+void TestController::reinitializeAppBoundDomains()
+{
+    WKWebsiteDataStoreReinitializeAppBoundDomains(TestController::websiteDataStore());
+}
+
 #if !PLATFORM(COCOA)
 void TestController::platformAddTestOptions(TestOptions&) const
 {

Modified: branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.h (259313 => 259314)


--- branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.h	2020-03-31 21:29:12 UTC (rev 259313)
+++ branches/safari-610.1.7-branch/Tools/WebKitTestRunner/TestController.h	2020-03-31 22:07:32 UTC (rev 259314)
@@ -269,6 +269,7 @@
     void clearPrevalentDomains();
     void getWebViewCategory();
     void setInAppBrowserPrivacyEnabled(bool);
+    void reinitializeAppBoundDomains();
 
     WKArrayRef openPanelFileURLs() const { return m_openPanelFileURLs.get(); }
     void setOpenPanelFileURLs(WKArrayRef fileURLs) { m_openPanelFileURLs = fileURLs; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to