Title: [260900] trunk
Revision
260900
Author
[email protected]
Date
2020-04-29 09:17:06 -0700 (Wed, 29 Apr 2020)

Log Message

Refactor layout tests after updates to In-App Browser Privacy
https://bugs.webkit.org/show_bug.cgi?id=211146
<rdar://problem/62524127>

Reviewed by Brent Fulgham.

Source/WebKit:

Tests: http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html
       http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html

Removes setInAppBrowserPrivacyEnabled, which is no longer needed by
layout tests. Setting this in TestOptions is enough.
getWebViewCategory is not needed because this patch deletes the only test
which uses it. Lastly, adds a new function to clear app-bound sessions
now that multiple tests are checking for them.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::clearAppBoundSession):
(WebKit::NetworkProcess::setInAppBrowserPrivacyEnabled): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::clearAppBoundSession):
(WebKit::NetworkSession::setInAppBrowserPrivacyEnabled): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::appBoundSession):
(WebKit::NetworkSessionCocoa::clearAppBoundSession):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreClearAppBoundSession):
(WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled): Deleted.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getWebViewCategoryFor:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::clearAppBoundSession):
(WebKit::NetworkProcessProxy::setInAppBrowserPrivacyEnabled): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::clearAppBoundSession):
(WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

Removes two unused functions after updating the test cases.
setInAppBrowserPrivacyEnabled is no longer needed, setting this
in TestOptions is enough. getWebViewCategory is not needed because
this patch deletes the only test which uses it.

Adds a function to clear app-bound sessions between tests now that
multiple tests check for them.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::getWebViewCategory): Deleted.
(WTR::TestRunner::callDidReceiveWebViewCategoryCallback): Deleted.
(WTR::TestRunner::setInAppBrowserPrivacyEnabled): Deleted.
(WTR::TestRunner::callDidSetInAppBrowserPrivacyEnabledCallback): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetStateToConsistentValues):
Move the call to clear the bundle id to happen in
resetStateToConsistentValues to make sure the next test can set the
value if needed (otherwise results in a call to exit(1)).

(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::clearAppBoundSession):
(WTR::TestController::getWebViewCategory): Deleted.
(WTR::TestController::setInAppBrowserPrivacyEnabled): Deleted.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didSetInAppBrowserPrivacyEnabled): Deleted.
(WTR::TestInvocation::didReceiveWebViewCategory): Deleted.
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):
App-bound WebViews now require a special configuration argument. This
patch adds logic to enable that using a new TestOption.
(WTR::TestController::getWebViewCategory): Deleted.

LayoutTests:

Updates the test cases in 2 ways:
1. Deletes app-bound-domain.html, which is fully and properly tested
using API tests and is unnecessary here.
2. Splits switch-session-on-navigation-to-app-bound-domain.html into
two separate tests now that navigation between app-bound and
non-app-bound WebViews is not allowed.

* http/tests/in-app-browser-privacy/app-bound-domain-expected.txt: Removed.
* http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session-expected.txt: Added.
* http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html: Added.
* http/tests/in-app-browser-privacy/app-bound-domain.html: Removed.
* http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session-expected.txt: Added.
* http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html: Added.
* http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt: Removed.
* http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (260899 => 260900)


--- trunk/LayoutTests/ChangeLog	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/LayoutTests/ChangeLog	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,3 +1,27 @@
+2020-04-29  Kate Cheney  <[email protected]>
+
+        Refactor layout tests after updates to In-App Browser Privacy
+        https://bugs.webkit.org/show_bug.cgi?id=211146
+        <rdar://problem/62524127>
+
+        Reviewed by Brent Fulgham.
+
+        Updates the test cases in 2 ways:
+        1. Deletes app-bound-domain.html, which is fully and properly tested
+        using API tests and is unnecessary here.
+        2. Splits switch-session-on-navigation-to-app-bound-domain.html into
+        two separate tests now that navigation between app-bound and 
+        non-app-bound WebViews is not allowed.
+
+        * http/tests/in-app-browser-privacy/app-bound-domain-expected.txt: Removed.
+        * http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session-expected.txt: Added.
+        * http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html: Added.
+        * http/tests/in-app-browser-privacy/app-bound-domain.html: Removed.
+        * http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session-expected.txt: Added.
+        * http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html: Added.
+        * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt: Removed.
+        * http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html: Removed.
+
 2020-04-28  Diego Pino Garcia  <[email protected]>
 
         [GTK] Gardening, update expectations after r260815

Deleted: trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-expected.txt (260899 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-expected.txt	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-expected.txt	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,7 +0,0 @@
-Tests that an App-Bound Domain gets classified as so
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Success, domain classified as In-App Browser.
-

Added: trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session-expected.txt (0 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session-expected.txt	2020-04-29 16:17:06 UTC (rev 260900)
@@ -0,0 +1,10 @@
+Tests that an app-bound domain has an app-bound session.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Origin has app-bound session.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html (0 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html	2020-04-29 16:17:06 UTC (rev 260900)
@@ -0,0 +1,25 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableInAppBrowserPrivacy=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier isAppBoundWebView=true ] -->
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that an app-bound domain has an app-bound session.");
+    jsTestIsAsync = true;
+
+    function runTest() {
+        if (!testRunner.hasAppBoundSession()) {
+            testFailed("Origin did not start with app-bound session.");
+            finishJSTest();
+        } else {
+            testPassed("Origin has app-bound session.");
+            finishJSTest();
+        }
+    }
+
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html (260899 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain.html	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,49 +0,0 @@
-<!DOCTYPE html><!-- webkit-test-runner [ enableInAppBrowserPrivacy=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier ] -->
-<html>
-<head>
-    <script src=""
-    <script src=""
-    <script>
-    description('Tests that an App-Bound Domain gets classified as so');
-        jsTestIsAsync = true;
-        testRunner.waitUntilDone();
-
-        function askForWebViewCategory() {
-            testRunner.getWebViewCategory(function (category) {
-                if (category != "InAppBrowser") {
-                      askForWebViewCategory();
-                      return;
-                }
-                testPassed("Success, domain classified as In-App Browser.");
-                testRunner.notifyDone();
-            });
-        }
-
-        const destinationOrigin = "http://localhost:8000";
-        function navigateToNonAppBoundDomain() {
-            document.location.href = "" + "/in-app-browser-privacy/app-bound-domain.html#step2";
-        }
-        
-        if (document.location.hash != "#step2") {
-            testRunner.getWebViewCategory(function (category) {
-                if (category != "AppBoundDomain") {
-                    testFailed("Failure, starting category not AppBoundDomain");
-                    testRunner.notifyDone();
-                }
-                navigateToNonAppBoundDomain();
-            });
-        } else {
-            askForWebViewCategory();
-        }
-    
-        setTimeout(function() {
-            testPassed("Failure, domain not classified as In-App Browser.");
-            console.log("Test timed out after 20 seconds");
-            testRunner.notifyDone()
-        }, 20000);
-    
-    </script>
-</head>
-<body>
-</body>
-</html>

Added: trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session-expected.txt (0 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session-expected.txt	2020-04-29 16:17:06 UTC (rev 260900)
@@ -0,0 +1,10 @@
+Tests that a non-app-bound domain does not have an app-bound session.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Origin has non-app-bound session.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html (0 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html	2020-04-29 16:17:06 UTC (rev 260900)
@@ -0,0 +1,25 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableInAppBrowserPrivacy=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier ] -->
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that a non-app-bound domain does not have an app-bound session.");
+    jsTestIsAsync = true;
+
+    function runTest() {
+        if (testRunner.hasAppBoundSession()) {
+            testFailed("Origin started with app-bound session.");
+            finishJSTest();
+        } else {
+            testPassed("Origin has non-app-bound session.");
+            finishJSTest();
+        }
+    }
+
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt (260899 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,12 +0,0 @@
-Tests that the session is switched upon top frame navigation to an app-bound domain.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Should have and has the session cookie.
-PASS Should have and has the persistent cookie.
-PASS Origin has app-bound session after navigation.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html (260899 => 260900)


--- trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/LayoutTests/http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,118 +0,0 @@
-<!DOCTYPE html><!-- webkit-test-runner [ enableInAppBrowserPrivacy=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier ] -->
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is switched upon top frame navigation to an app-bound domain.");
-    jsTestIsAsync = true;
-
-    const appBoundOrigin = "http://127.0.0.1:8000";
-    const nonAppBoundOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function finishTest() {
-        testRunner.setInAppBrowserPrivacyEnabled(false, finishJSTest);
-    }
-    
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn't have the session cookie.");
-            setEnableFeature(false, finishTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn't have but has the session cookie.");
-            setEnableFeature(false, finishTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn't have the persistent cookie.");
-            setEnableFeature(false, finishTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn't have but has the persistent cookie.");
-            setEnableFeature(false, finishTest);
-        } else
-            testPassed("Shouldn't have and doesn't have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "":
-                testRunner.setInAppBrowserPrivacyEnabled(true, function () {
-                    if (document.location.origin !== appBoundOrigin)
-                        testFailed("Test is not starting out on " + appBoundOrigin + ".");
-                    setEnableFeature(true, function() {
-                        // Since the test manually sets the inAppBrowserPrivacy flag in the
-                        // Network process, we need to re-establish an app-bound session by
-                        // navigating away then back to the app-bound Domain before setting cookies.
-                        document.location.href = "" + "/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html#step1";
-                    });
-                });
-                break;
-            case "#step1":
-                document.location.href = "" + "/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html#step2";
-                break;
-            case "#step2":
-                if (document.location.origin !== appBoundOrigin)
-                    testFailed("Step 2 is not on " + appBoundOrigin + ".");
-                testRunner.setStatisticsHasHadUserInteraction(appBoundOrigin, true, function() {
-                    setSessionCookie();
-                    setPersistentCookie();
-                    checkCookies(true, true);
-                if (!testRunner.hasAppBoundSession()) {
-                        testFailed("Origin did not start with app-bound session.");
-                        setEnableFeature(false, finishTest);
-                    } else
-                        testPassed("Origin has app-bound session.");
-                    document.location.href = "" + "/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html#step3";
-                });
-                break;
-            case "#step3":
-                document.location.hash = "#step4"
-                checkCookies(false, false);
-                if (document.location.origin !== nonAppBoundOrigin)
-                    testFailed("Step 3 is not on " + nonAppBoundOrigin);
-                testRunner.statisticsUpdateCookieBlocking(runTest);
-                break;
-            case "#step4":
-                checkCookies(false, false);
-                document.location.href = "" + "/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html#step5";
-                break;
-            case "#step5":
-                checkCookies(true, true);
-                if (testRunner.hasAppBoundSession())
-                    testPassed("Origin has app-bound session after navigation.");
-                else
-                    testFailed("Origin has no app-bound session after navigation.");
-                setEnableFeature(false, finishTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishTest);
-        }
-    }
-
-</script>
-</body>
-</html>

Modified: trunk/Source/WebKit/ChangeLog (260899 => 260900)


--- trunk/Source/WebKit/ChangeLog	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/ChangeLog	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,3 +1,48 @@
+2020-04-29  Kate Cheney  <[email protected]>
+
+        Refactor layout tests after updates to In-App Browser Privacy
+        https://bugs.webkit.org/show_bug.cgi?id=211146
+        <rdar://problem/62524127>
+
+        Reviewed by Brent Fulgham.
+
+        Tests: http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html
+               http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html
+
+        Removes setInAppBrowserPrivacyEnabled, which is no longer needed by
+        layout tests. Setting this in TestOptions is enough.
+        getWebViewCategory is not needed because this patch deletes the only test
+        which uses it. Lastly, adds a new function to clear app-bound sessions
+        now that multiple tests are checking for them.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::clearAppBoundSession):
+        (WebKit::NetworkProcess::setInAppBrowserPrivacyEnabled): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkSession.h:
+        (WebKit::NetworkSession::clearAppBoundSession):
+        (WebKit::NetworkSession::setInAppBrowserPrivacyEnabled): Deleted.
+        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::appBoundSession):
+        (WebKit::NetworkSessionCocoa::clearAppBoundSession):
+        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
+        (WKWebsiteDataStoreClearAppBoundSession):
+        (WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled): Deleted.
+        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _getWebViewCategoryFor:completionHandler:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::clearAppBoundSession):
+        (WebKit::NetworkProcessProxy::setInAppBrowserPrivacyEnabled): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::clearAppBoundSession):
+        (WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled): Deleted.
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+
 2020-04-29  Víctor Manuel Jáquez Leal  <[email protected]>
 
         [GPUP][GTK] compile GPUProcess in GTK port

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -2698,10 +2698,10 @@
     completionHandler(result);
 }
 
-void NetworkProcess::setInAppBrowserPrivacyEnabled(PAL::SessionID sessionID, bool enable, CompletionHandler<void()>&& completionHandler)
+void NetworkProcess::clearAppBoundSession(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler)
 {
     if (auto* networkSession = this->networkSession(sessionID)) {
-        networkSession->setInAppBrowserPrivacyEnabled(enable);
+        networkSession->clearAppBoundSession();
         completionHandler();
     } else {
         ASSERT_NOT_REACHED();

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -347,7 +347,7 @@
 
     void cookieAcceptPolicyChanged(WebCore::HTTPCookieAcceptPolicy);
     void hasAppBoundSession(PAL::SessionID, CompletionHandler<void(bool)>&&) const;
-    void setInAppBrowserPrivacyEnabled(PAL::SessionID, bool enable, CompletionHandler<void()>&&);
+    void clearAppBoundSession(PAL::SessionID, CompletionHandler<void()>&&);
 
     void broadcastConsoleMessage(PAL::SessionID, JSC::MessageSource, JSC::MessageLevel, const String& message);
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2020-04-29 16:17:06 UTC (rev 260900)
@@ -173,7 +173,7 @@
     ResetQuota(PAL::SessionID sessionID) -> () Async
     
     HasAppBoundSession(PAL::SessionID sessionID) -> (bool hasAppBoundSession) Async
-    SetInAppBrowserPrivacyEnabled(PAL::SessionID sessionID, bool value) -> () Async
+    ClearAppBoundSession(PAL::SessionID sessionID) -> () Async
 
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     DisableServiceWorkerEntitlement()

Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -109,7 +109,7 @@
 #endif
     
     virtual bool hasAppBoundSession() const { return false; }
-    virtual void setInAppBrowserPrivacyEnabled(bool) { }
+    virtual void clearAppBoundSession() { }
     void storeAdClickAttribution(WebCore::AdClickAttribution&&);
     void handleAdClickAttributionConversion(WebCore::AdClickAttribution::Conversion&&, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest);
     void dumpAdClickAttribution(CompletionHandler<void(String)>&&);

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -97,7 +97,7 @@
     bool hasAppBoundSession() const override { return !!m_appBoundSession; }
 
     SessionWrapper& sessionWrapperForTask(const WebCore::ResourceRequest&, WebCore::StoredCredentialsPolicy, Optional<NavigatingToAppBoundDomain>);
-    void setInAppBrowserPrivacyEnabled(bool enabled) override { m_isInAppBrowserPrivacyEnabled = enabled; }
+    void clearAppBoundSession() override;
     bool isInAppBrowserPrivacyEnabled() const { return m_isInAppBrowserPrivacyEnabled; }
     bool preventsSystemHTTPProxyAuthentication() const { return m_preventsSystemHTTPProxyAuthentication; }
     

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (260899 => 260900)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1365,6 +1365,11 @@
     m_isolatedSessions.clear();
 }
 
+void NetworkSessionCocoa::clearAppBoundSession()
+{
+    m_appBoundSession = nullptr;
+}
+
 void NetworkSessionCocoa::invalidateAndCancel()
 {
     NetworkSession::invalidateAndCancel();

Modified: trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -755,9 +755,9 @@
     });
 }
 
-void WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enabled, void* context, WKWebsiteDataStoreSetInAppBrowserPrivacyEnabledFunction completionHandler)
+void WKWebsiteDataStoreClearAppBoundSession(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreClearAppBoundSessionFunction completionHandler)
 {
-    WebKit::toImpl(dataStoreRef)->setInAppBrowserPrivacyEnabled(enabled, [context, completionHandler] {
+    WebKit::toImpl(dataStoreRef)->clearAppBoundSession([context, completionHandler] {
         completionHandler(context);
     });
 }

Modified: trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -168,8 +168,8 @@
 typedef void (*WKWebsiteDataStoreResetQuotaCallback)(void* functionContext);
 WK_EXPORT void WKWebsiteDataStoreResetQuota(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreResetQuotaCallback callback);
 
-typedef void (*WKWebsiteDataStoreSetInAppBrowserPrivacyEnabledFunction)(void* functionContext);
-WK_EXPORT void WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enabled, void* context, WKWebsiteDataStoreSetInAppBrowserPrivacyEnabledFunction completionHandler);
+typedef void (*WKWebsiteDataStoreClearAppBoundSessionFunction)(void* functionContext);
+WK_EXPORT void WKWebsiteDataStoreClearAppBoundSession(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreClearAppBoundSessionFunction completionHandler);
 
 WK_EXPORT void WKWebsiteDataStoreReinitializeAppBoundDomains(WKWebsiteDataStoreRef dataStoreRef);
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm	2020-04-29 16:17:06 UTC (rev 260900)
@@ -456,22 +456,6 @@
 #endif
 }
 
-- (void)_getWebViewCategoryFor:(WKWebView *)webView completionHandler:(void (^)(_WKWebViewCategory category))completionHandler
-{
-    if (!webView) {
-        completionHandler(_WKWebViewCategoryWebBrowser);
-        return;
-    }
-
-    auto webPageProxy = [webView _page];
-    if (!webPageProxy) {
-        completionHandler(_WKWebViewCategoryWebBrowser);
-        return;
-    }
-
-    completionHandler(toWKWebViewCategory(webPageProxy->configuration().webViewCategory()));
-}
-
 - (void)_scheduleCookieBlockingUpdate:(void (^)(void))completionHandler
 {
 #if ENABLE(RESOURCE_LOAD_STATISTICS)

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -63,7 +63,6 @@
 - (void)_getAllStorageAccessEntriesFor:(WKWebView *)webView completionHandler:(void (^)(NSArray<NSString *> *domains))completionHandler WK_API_AVAILABLE(macos(10.14), ios(12.0));
 - (void)_loadedThirdPartyDomainsFor:(WKWebView *)webView completionHandler:(void (^)(NSArray<NSString *> *domains))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 - (void)_clearLoadedThirdPartyDomainsFor:(WKWebView *)webView WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
-- (void)_getWebViewCategoryFor:(WKWebView *)webView completionHandler:(void (^)(_WKWebViewCategory category))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 + (void)_allowWebsiteDataRecordsForAllOrigins WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
 - (bool)_hasRegisteredServiceWorker WK_API_AVAILABLE(macos(10.14), ios(12.0));
 

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1466,7 +1466,7 @@
     sendWithAsyncReply(Messages::NetworkProcess::HasAppBoundSession(sessionID), WTFMove(completionHandler));
 }
 
-void NetworkProcessProxy::setInAppBrowserPrivacyEnabled(PAL::SessionID sessionID, bool value, CompletionHandler<void()>&& completionHandler)
+void NetworkProcessProxy::clearAppBoundSession(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler)
 {
     if (!canSendMessage()) {
         completionHandler();
@@ -1473,7 +1473,7 @@
         return;
     }
     
-    sendWithAsyncReply(Messages::NetworkProcess::SetInAppBrowserPrivacyEnabled(sessionID, value), WTFMove(completionHandler));
+    sendWithAsyncReply(Messages::NetworkProcess::ClearAppBoundSession(sessionID), WTFMove(completionHandler));
 }
 
 void NetworkProcessProxy::getAppBoundDomains(PAL::SessionID sessionID, CompletionHandler<void(HashSet<WebCore::RegistrableDomain>&&)>&& completionHandler)

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -223,7 +223,7 @@
     void resourceLoadDidCompleteWithError(WebPageProxyIdentifier, ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceError&&);
 
     void hasAppBoundSession(PAL::SessionID, CompletionHandler<void(bool)>&&);
-    void setInAppBrowserPrivacyEnabled(PAL::SessionID, bool, CompletionHandler<void()>&&);
+    void clearAppBoundSession(PAL::SessionID, CompletionHandler<void()>&&);
     void getAppBoundDomains(PAL::SessionID, CompletionHandler<void(HashSet<WebCore::RegistrableDomain>&&)>&&);
 
 private:

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -2397,13 +2397,13 @@
     completionHandler(false);
 }
 
-void WebsiteDataStore::setInAppBrowserPrivacyEnabled(bool enabled, CompletionHandler<void()>&& completionHandler)
+void WebsiteDataStore::clearAppBoundSession(CompletionHandler<void()>&& completionHandler)
 {
     auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
 
     for (auto& processPool : processPools()) {
         if (auto* networkProcess = processPool->networkProcess())
-            networkProcess->setInAppBrowserPrivacyEnabled(m_sessionID, enabled, [processPool, callbackAggregator = callbackAggregator.copyRef()] { });
+            networkProcess->clearAppBoundSession(m_sessionID, [processPool, callbackAggregator = callbackAggregator.copyRef()] { });
     }
 }
 

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (260899 => 260900)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -286,7 +286,7 @@
 
     void resetQuota(CompletionHandler<void()>&&);
     void hasAppBoundSession(CompletionHandler<void(bool)>&&) const;
-    void setInAppBrowserPrivacyEnabled(bool enabled, CompletionHandler<void()>&&);
+    void clearAppBoundSession(CompletionHandler<void()>&&);
 
     void beginAppBoundDomainCheck(const URL&, WebFramePolicyListenerProxy&);
     void getAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&)>&&) const;

Modified: trunk/Tools/ChangeLog (260899 => 260900)


--- trunk/Tools/ChangeLog	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/ChangeLog	2020-04-29 16:17:06 UTC (rev 260900)
@@ -1,3 +1,53 @@
+2020-04-29  Kate Cheney  <[email protected]>
+
+        Refactor layout tests after updates to In-App Browser Privacy
+        https://bugs.webkit.org/show_bug.cgi?id=211146
+        <rdar://problem/62524127>
+
+        Reviewed by Brent Fulgham.
+
+        Removes two unused functions after updating the test cases.
+        setInAppBrowserPrivacyEnabled is no longer needed, setting this
+        in TestOptions is enough. getWebViewCategory is not needed because
+        this patch deletes the only test which uses it.
+
+        Adds a function to clear app-bound sessions between tests now that
+        multiple tests check for them.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::didReceiveMessageToPage):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::getWebViewCategory): Deleted.
+        (WTR::TestRunner::callDidReceiveWebViewCategoryCallback): Deleted.
+        (WTR::TestRunner::setInAppBrowserPrivacyEnabled): Deleted.
+        (WTR::TestRunner::callDidSetInAppBrowserPrivacyEnabledCallback): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createWebViewWithOptions):
+        (WTR::TestController::resetStateToConsistentValues):
+        Move the call to clear the bundle id to happen in
+        resetStateToConsistentValues to make sure the next test can set the
+        value if needed (otherwise results in a call to exit(1)).
+
+        (WTR::updateTestOptionsFromTestHeader):
+        (WTR::TestController::clearAppBoundSession):
+        (WTR::TestController::getWebViewCategory): Deleted.
+        (WTR::TestController::setInAppBrowserPrivacyEnabled): Deleted.
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+        (WTR::TestInvocation::didSetInAppBrowserPrivacyEnabled): Deleted.
+        (WTR::TestInvocation::didReceiveWebViewCategory): Deleted.
+        * WebKitTestRunner/TestInvocation.h:
+        * WebKitTestRunner/TestOptions.h:
+        (WTR::TestOptions::hasSameInitializationOptions const):
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::platformCreateWebView):
+        App-bound WebViews now require a special configuration argument. This
+        patch adds logic to enable that using a new TestOption.
+        (WTR::TestController::getWebViewCategory): Deleted.
+
 2020-04-29  Aakash Jain  <[email protected]>
 
         [ews] Display flaky test names in build summary when ReRunJavaScriptCoreTests passes

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2020-04-29 16:17:06 UTC (rev 260900)
@@ -358,9 +358,6 @@
     // Storage Access API
     void getAllStorageAccessEntries(object callback);
 
-    void getWebViewCategory(object callback);
-    void setInAppBrowserPrivacyEnabled(boolean value, object callback);
-
     // Open panel
     void setOpenPanelFiles(object filesArray);
     void setOpenPanelFilesMediaIcon(object mediaIcon);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -346,11 +346,6 @@
         m_testRunner->statisticsCallDidSetShouldBlockThirdPartyCookiesCallback();
         return;
     }
-    
-    if (WKStringIsEqualToUTF8CString(messageName, "CallDidSetInAppBrowserPrivacyEnabled")) {
-        m_testRunner->callDidSetInAppBrowserPrivacyEnabledCallback();
-        return;
-    }
 
     if (WKStringIsEqualToUTF8CString(messageName, "CallDidSetFirstPartyWebsiteDataRemovalMode")) {
         m_testRunner->statisticsCallDidSetFirstPartyWebsiteDataRemovalModeCallback();
@@ -442,15 +437,7 @@
         m_testRunner->callDidReceiveLoadedThirdPartyDomainsCallback(WTFMove(domains));
         return;
     }
-    
-    if (WKStringIsEqualToUTF8CString(messageName, "CallDidReceiveWebViewCategory")) {
-        ASSERT(messageBody);
-        ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
 
-        m_testRunner->callDidReceiveWebViewCategoryCallback(toWTFString(static_cast<WKStringRef>(messageBody)));
-        return;
-    }
-
     if (WKStringIsEqualToUTF8CString(messageName, "CallDidRemoveAllSessionCredentialsCallback")) {
         m_testRunner->callDidRemoveAllSessionCredentialsCallback();
         return;

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -763,8 +763,6 @@
     TextFieldDidBeginEditingCallbackID,
     TextFieldDidEndEditingCallbackID,
     CustomMenuActionCallbackID,
-    GetWebViewCategoryCallbackID,
-    DidSetInAppBrowserPrivacyEnabledCallbackID,
     FirstUIScriptCallbackID = 100
 };
 
@@ -2967,26 +2965,6 @@
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
-void TestRunner::getWebViewCategory(JSValueRef callback)
-{
-    cacheTestRunnerCallback(GetWebViewCategoryCallbackID, callback);
-    
-    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("GetWebViewCategory"));
-    WKBundlePostMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr);
-}
-
-void TestRunner::callDidReceiveWebViewCategoryCallback(String category)
-{
-    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page());
-    JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
-
-    auto resultString = makeString("\"", category, "\"");
-    
-    JSValueRef result = JSValueMakeFromJSONString(context, adopt(JSStringCreateWithUTF8CString(resultString.utf8().data())).get());
-
-    callTestRunnerCallback(GetWebViewCategoryCallbackID, 1, &result);
-}
-
 bool TestRunner::hasAppBoundSession()
 {
     auto messageName = adoptWK(WKStringCreateWithUTF8CString("HasAppBoundSession"));
@@ -2997,17 +2975,4 @@
     return WKBooleanGetValue(adoptWK(static_cast<WKBooleanRef>(returnData)).get());
 }
 
-void TestRunner::setInAppBrowserPrivacyEnabled(bool value, JSValueRef completionHandler)
-{
-    cacheTestRunnerCallback(DidSetInAppBrowserPrivacyEnabledCallbackID, completionHandler);
-    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetInAppBrowserPrivacyEnabled"));
-    WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(value));
-    WKBundlePostMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get());
-}
-
-void TestRunner::callDidSetInAppBrowserPrivacyEnabledCallback()
-{
-    callTestRunnerCallback(DidSetInAppBrowserPrivacyEnabledCallbackID);
-}
-
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -469,10 +469,6 @@
     void getAllStorageAccessEntries(JSValueRef callback);
     void callDidReceiveAllStorageAccessEntriesCallback(Vector<String>& domains);
 
-    
-    void getWebViewCategory(JSValueRef callback);
-    void callDidReceiveWebViewCategoryCallback(String);
-
     // Open panel
     void setOpenPanelFiles(JSValueRef);
     void setOpenPanelFilesMediaIcon(JSValueRef);
@@ -505,8 +501,6 @@
     void setMockCameraOrientation(unsigned);
     bool isMockRealtimeMediaSourceCenterEnabled();
     bool hasAppBoundSession();
-    void setInAppBrowserPrivacyEnabled(bool, JSValueRef);
-    void callDidSetInAppBrowserPrivacyEnabledCallback();
 
     size_t userScriptInjectedCount() const;
     void injectUserScript(JSStringRef);

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -645,7 +645,6 @@
         exit(1);
     }
     if (!options.applicationBundleIdentifier.isEmpty()) {
-        clearApplicationBundleIdentifierTestingOverride();
         setApplicationBundleIdentifier(options.applicationBundleIdentifier);
         m_hasSetApplicationBundleIdentifier = true;
     }
@@ -1136,7 +1135,7 @@
 
     statisticsResetToConsistentState();
     clearLoadedThirdPartyDomains();
-
+    clearAppBoundSession();
     clearAdClickAttribution();
 
     m_didReceiveServerRedirectForProvisionalNavigation = false;
@@ -1150,8 +1149,12 @@
     if (!m_doneResetting)
         return false;
     
-    if (resetStage == ResetStage::AfterTest)
+    if (resetStage == ResetStage::AfterTest) {
         updateLiveDocumentsAfterTest();
+#if PLATFORM(COCOA)
+        clearApplicationBundleIdentifierTestingOverride();
+#endif
+    }
 
     return m_doneResetting;
 }
@@ -1527,7 +1530,8 @@
             testOptions.enableInAppBrowserPrivacy = parseBooleanTestHeaderValue(value);
         else if (key == "standaloneWebApplicationURL")
             testOptions.standaloneWebApplicationURL = parseStringTestHeaderValueAsURL(value);
-
+        else if (key == "isAppBoundWebView")
+            testOptions.isAppBoundWebView = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }
@@ -3191,10 +3195,6 @@
     WKPageClearLoadedThirdPartyDomains(m_mainWebView->page());
 }
 
-void TestController::getWebViewCategory()
-{
-}
-
 #endif
 
 struct ClearServiceWorkerRegistrationsCallbackContext {
@@ -3850,13 +3850,11 @@
     return context.result;
 }
 
-
-void TestController::setInAppBrowserPrivacyEnabled(bool value)
+void TestController::clearAppBoundSession()
 {
     InAppBrowserPrivacyCallbackContext context(*this);
-    WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled(TestController::websiteDataStore(), value, &context, inAppBrowserPrivacyVoidResultCallback);
+    WKWebsiteDataStoreClearAppBoundSession(TestController::websiteDataStore(), &context, inAppBrowserPrivacyVoidResultCallback);
     runUntil(context.done, noTimeout);
-    m_currentInvocation->didSetInAppBrowserPrivacyEnabled();
 }
 
 void TestController::reinitializeAppBoundDomains()

Modified: trunk/Tools/WebKitTestRunner/TestController.h (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/TestController.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -271,8 +271,7 @@
     void getAllStorageAccessEntries();
     void loadedThirdPartyDomains();
     void clearLoadedThirdPartyDomains();
-    void getWebViewCategory();
-    void setInAppBrowserPrivacyEnabled(bool);
+    void clearAppBoundSession();
     void reinitializeAppBoundDomains();
 
     WKArrayRef openPanelFileURLs() const { return m_openPanelFileURLs.get(); }

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2020-04-29 16:17:06 UTC (rev 260900)
@@ -760,13 +760,6 @@
         TestController::singleton().setStatisticsShouldBlockThirdPartyCookies(WKBooleanGetValue(value), false);
         return;
     }
-    
-    if (WKStringIsEqualToUTF8CString(messageName, "SetInAppBrowserPrivacyEnabled")) {
-        ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
-        WKBooleanRef value = static_cast<WKBooleanRef>(messageBody);
-        TestController::singleton().setInAppBrowserPrivacyEnabled(WKBooleanGetValue(value));
-        return;
-    }
 
     if (WKStringIsEqualToUTF8CString(messageName, "RunUIProcessScript")) {
         WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
@@ -807,11 +800,6 @@
         TestController::singleton().setOpenPanelFileURLs(static_cast<WKArrayRef>(messageBody));
         return;
     }
-    
-    if (WKStringIsEqualToUTF8CString(messageName, "GetWebViewCategory")) {
-        TestController::singleton().getWebViewCategory();
-        return;
-    }
 
 #if PLATFORM(IOS_FAMILY)
     if (WKStringIsEqualToUTF8CString(messageName, "SetOpenPanelFileURLsMediaIcon")) {
@@ -1929,12 +1917,6 @@
     WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), nullptr);
 }
 
-void TestInvocation::didSetInAppBrowserPrivacyEnabled()
-{
-    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidSetInAppBrowserPrivacyEnabled"));
-    WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), nullptr);
-}
-
 void TestInvocation::didSetFirstPartyWebsiteDataRemovalMode()
 {
     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidSetFirstPartyWebsiteDataRemovalMode"));
@@ -2023,14 +2005,6 @@
     WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), messageBody.get());
 }
 
-void TestInvocation::didReceiveWebViewCategory(String&& webViewCategory)
-{
-    WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidReceiveWebViewCategory"));
-    
-    WKRetainPtr<WKStringRef> messageBody = adoptWK(WKStringCreateWithUTF8CString(webViewCategory.utf8().data()));
-    WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), messageBody.get());
-}
-
 void TestInvocation::didRemoveAllSessionCredentials()
 {
     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidRemoveAllSessionCredentialsCallback"));

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/TestInvocation.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -88,8 +88,6 @@
     void didSetHasHadUserInteraction();
     void didReceiveAllStorageAccessEntries(Vector<String>&& domains);
     void didReceiveLoadedThirdPartyDomains(Vector<String>&& domains);
-    void didReceiveWebViewCategory(String&&);
-    void didSetInAppBrowserPrivacyEnabled();
 
     void didRemoveAllSessionCredentials();
     

Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/TestOptions.h	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h	2020-04-29 16:17:06 UTC (rev 260900)
@@ -104,6 +104,7 @@
     bool enableCaptureAudioInGPUProcess { false };
     bool allowTopNavigationToDataURLs { true };
     bool enableInAppBrowserPrivacy { false };
+    bool isAppBoundWebView { false };
 
     double contentInsetTop { 0 };
 
@@ -172,7 +173,8 @@
             || enableCaptureAudioInGPUProcess != options.enableCaptureAudioInGPUProcess
             || allowTopNavigationToDataURLs != options.allowTopNavigationToDataURLs
             || enableInAppBrowserPrivacy != options.enableInAppBrowserPrivacy
-            || standaloneWebApplicationURL != options.standaloneWebApplicationURL)
+            || standaloneWebApplicationURL != options.standaloneWebApplicationURL
+            || isAppBoundWebView != options.isAppBoundWebView)
             return false;
 
         if (!contextOptions.hasSameInitializationOptions(options.contextOptions))

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (260899 => 260900)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-04-29 16:09:02 UTC (rev 260899)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2020-04-29 16:17:06 UTC (rev 260900)
@@ -145,6 +145,8 @@
         [copiedConfiguration setIgnoresViewportScaleLimits:YES];
     if (options.useCharacterSelectionGranularity)
         [copiedConfiguration setSelectionGranularity:WKSelectionGranularityCharacter];
+    if (options.isAppBoundWebView)
+        [copiedConfiguration setLimitsNavigationsToAppBoundDomains:YES];
 #else
     [copiedConfiguration _setServiceControlsEnabled:options.enableServiceControls];
 #endif
@@ -372,32 +374,6 @@
     [globalWebViewConfiguration.websiteDataStore _clearLoadedThirdPartyDomainsFor:parentView->platformView()];
 }
 
-void TestController::getWebViewCategory()
-{
-    auto* parentView = mainWebView();
-    if (!parentView)
-        return;
-
-    [globalWebViewConfiguration.websiteDataStore _getWebViewCategoryFor:parentView->platformView() completionHandler:^(_WKWebViewCategory webViewCategory) {
-        String category;
-        switch (webViewCategory) {
-        case _WKWebViewCategoryAppBoundDomain:
-            category = "AppBoundDomain";
-            break;
-        case _WKWebViewCategoryHybridApp:
-            category = "HybridApp";
-            break;
-        case _WKWebViewCategoryInAppBrowser:
-            category = "InAppBrowser";
-            break;
-        case _WKWebViewCategoryWebBrowser:
-            category = "WebBrowser";
-            break;
-        }
-        m_currentInvocation->didReceiveWebViewCategory(WTFMove(category));
-    }];
-}
-
 void TestController::injectUserScript(WKStringRef script)
 {
     auto userScript = adoptNS([[WKUserScript alloc] initWithSource: toWTFString(script) injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to