⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 271283 in webkit


Ignore:
Timestamp:
Jan 7, 2021, 7:59:24 PM (6 years ago)
Author:
Kate Cheney
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.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r271282 r271283  
     12021-01-07  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        Error in layout tests: "Passed ITP enabled state (0) does not match TCC setting (1)"
     4        https://bugs.webkit.org/show_bug.cgi?id=220385
     5        <rdar://problem/70730482>
     6
     7        Reviewed by Darin Adler.
     8
     9        No new tests, this has no behavior change. It will fix excessive
     10        logging when running tests.
     11
     12        We do not need to log a discrepancy between these states
     13        for WebKitTestRunner or TestWebKitAPI because they are sometimes treated
     14        like web browsers but need to turn ITP on/off for specific tests, so
     15        these states will not always match.
     16
     17        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     18        (WebKit::activateSessionCleanup):
     19        * Shared/Cocoa/DefaultWebBrowserChecks.h:
     20        * Shared/Cocoa/DefaultWebBrowserChecks.mm:
     21        (WebKit::isRunningTest):
     22        (WebKit::isParentProcessAFullWebBrowser):
     23        (WebKit::isFullWebBrowser):
     24        (WebKit::shouldBeTreatedAsFullBrowser): Deleted.
     25
    1262021-01-07  Alex Christensen  <achristensen@webkit.org>
    227
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r271040 r271283  
    11981198    bool passedEnabledState = session.isResourceLoadStatisticsEnabled();
    11991199
    1200     if (itpEnabled != passedEnabledState)
     1200    // We do not need to log a discrepancy between states for WebKitTestRunner or TestWebKitAPI.
     1201    if (itpEnabled != passedEnabledState && !isRunningTest(WebCore::applicationBundleIdentifier()))
    12011202        WTFLogAlways("Passed ITP enabled state (%d) does not match TCC setting (%d)\n", passedEnabledState, itpEnabled);
    12021203    session.setResourceLoadStatisticsEnabled(passedEnabledState);
  • trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.h

    r265202 r271283  
    3838bool hasProhibitedUsageStrings();
    3939Optional<Vector<WebCore::RegistrableDomain>> getAppBoundDomainsTesting(const String&);
    40 bool shouldBeTreatedAsFullBrowser(const String& bundleID);
     40bool isRunningTest(const String& bundleID);
    4141void determineITPState();
    4242bool doesAppHaveITPEnabled();
  • trunk/Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm

    r271267 r271283  
    4747static bool isFullWebBrowser(const String&);
    4848
    49 bool shouldBeTreatedAsFullBrowser(const String& bundleID)
     49bool isRunningTest(const String& bundleID)
    5050{
    5151    return bundleID == "com.apple.WebKit.TestWebKitAPI"_s || bundleID == "com.apple.WebKit.WebKitTestRunner"_s || bundleID == "org.webkit.WebKitTestRunnerApp"_s;
     
    224224    });
    225225
    226     return fullWebBrowser || shouldBeTreatedAsFullBrowser(WebCore::applicationBundleIdentifier());
     226    return fullWebBrowser || isRunningTest(WebCore::applicationBundleIdentifier());
    227227}
    228228
     
    233233    static bool fullWebBrowser = WTF::processHasEntitlement("com.apple.developer.web-browser");
    234234
    235     return fullWebBrowser || shouldBeTreatedAsFullBrowser(bundleIdentifier);
     235    return fullWebBrowser || isRunningTest(bundleIdentifier);
    236236}
    237237
Note: See TracChangeset for help on using the changeset viewer.