Title: [271283] trunk/Source/WebKit
Revision
271283
Author
[email protected]
Date
2021-01-07 19:59:24 -0800 (Thu, 07 Jan 2021)

Log Message

Error in layout tests: "Passed ITP enabled state (0) does not match TCC setting (1)"
https://bugs.webkit.org/show_bug.cgi?id=220385
<rdar://problem/70730482>

Reviewed by Darin Adler.

No new tests, this has no behavior change. It will fix excessive
logging when running tests.

We do not need to log a discrepancy between these states
for WebKitTestRunner or TestWebKitAPI because they are sometimes treated
like web browsers but need to turn ITP on/off for specific tests, so
these states will not always match.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::activateSessionCleanup):
* Shared/Cocoa/DefaultWebBrowserChecks.h:
* Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::isRunningTest):
(WebKit::isParentProcessAFullWebBrowser):
(WebKit::isFullWebBrowser):
(WebKit::shouldBeTreatedAsFullBrowser): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (271282 => 271283)


--- trunk/Source/WebKit/ChangeLog	2021-01-08 03:58:06 UTC (rev 271282)
+++ trunk/Source/WebKit/ChangeLog	2021-01-08 03:59:24 UTC (rev 271283)
@@ -1,3 +1,28 @@
+2021-01-07  Kate Cheney  <[email protected]>
+
+        Error in layout tests: "Passed ITP enabled state (0) does not match TCC setting (1)"
+        https://bugs.webkit.org/show_bug.cgi?id=220385
+        <rdar://problem/70730482>
+
+        Reviewed by Darin Adler.
+
+        No new tests, this has no behavior change. It will fix excessive
+        logging when running tests.
+
+        We do not need to log a discrepancy between these states
+        for WebKitTestRunner or TestWebKitAPI because they are sometimes treated
+        like web browsers but need to turn ITP on/off for specific tests, so
+        these states will not always match.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::activateSessionCleanup):
+        * Shared/Cocoa/DefaultWebBrowserChecks.h:
+        * Shared/Cocoa/DefaultWebBrowserChecks.mm:
+        (WebKit::isRunningTest):
+        (WebKit::isParentProcessAFullWebBrowser):
+        (WebKit::isFullWebBrowser):
+        (WebKit::shouldBeTreatedAsFullBrowser): Deleted.
+
 2021-01-07  Alex Christensen  <[email protected]>
 
         Remove assertions in MESSAGE_CHECK definition

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (271282 => 271283)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-01-08 03:58:06 UTC (rev 271282)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-01-08 03:59:24 UTC (rev 271283)
@@ -1197,7 +1197,8 @@
     bool itpEnabled = doesParentProcessHaveITPEnabled(parentAuditToken, parameters.appHasRequestedCrossWebsiteTrackingPermission);
     bool passedEnabledState = session.isResourceLoadStatisticsEnabled();
 
-    if (itpEnabled != passedEnabledState)
+    // We do not need to log a discrepancy between states for WebKitTestRunner or TestWebKitAPI.
+    if (itpEnabled != passedEnabledState && !isRunningTest(WebCore::applicationBundleIdentifier()))
         WTFLogAlways("Passed ITP enabled state (%d) does not match TCC setting (%d)\n", passedEnabledState, itpEnabled);
     session.setResourceLoadStatisticsEnabled(passedEnabledState);
 #endif

Modified: trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h (271282 => 271283)


--- trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h	2021-01-08 03:58:06 UTC (rev 271282)
+++ trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h	2021-01-08 03:59:24 UTC (rev 271283)
@@ -37,7 +37,7 @@
 bool hasRequestedCrossWebsiteTrackingPermission();
 bool hasProhibitedUsageStrings();
 Optional<Vector<WebCore::RegistrableDomain>> getAppBoundDomainsTesting(const String&);
-bool shouldBeTreatedAsFullBrowser(const String& bundleID);
+bool isRunningTest(const String& bundleID);
 void determineITPState();
 bool doesAppHaveITPEnabled();
 bool doesParentProcessHaveITPEnabled(Optional<audit_token_t>, bool);

Modified: trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm (271282 => 271283)


--- trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm	2021-01-08 03:58:06 UTC (rev 271282)
+++ trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm	2021-01-08 03:59:24 UTC (rev 271283)
@@ -46,7 +46,7 @@
 
 static bool isFullWebBrowser(const String&);
 
-bool shouldBeTreatedAsFullBrowser(const String& bundleID)
+bool isRunningTest(const String& bundleID)
 {
     return bundleID == "com.apple.WebKit.TestWebKitAPI"_s || bundleID == "com.apple.WebKit.WebKitTestRunner"_s || bundleID == "org.webkit.WebKitTestRunnerApp"_s;
 }
@@ -223,7 +223,7 @@
         fullWebBrowser = WTF::hasEntitlement(auditToken.value(), "com.apple.developer.web-browser");
     });
 
-    return fullWebBrowser || shouldBeTreatedAsFullBrowser(WebCore::applicationBundleIdentifier());
+    return fullWebBrowser || isRunningTest(WebCore::applicationBundleIdentifier());
 }
 
 static bool isFullWebBrowser(const String& bundleIdentifier)
@@ -232,7 +232,7 @@
 
     static bool fullWebBrowser = WTF::processHasEntitlement("com.apple.developer.web-browser");
 
-    return fullWebBrowser || shouldBeTreatedAsFullBrowser(bundleIdentifier);
+    return fullWebBrowser || isRunningTest(bundleIdentifier);
 }
 
 bool isFullWebBrowser()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to