Bug 241342

Summary: REGRESSION: [iOS] TestWebKitAPI.HSTS.ThirdParty is consistently failing
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: New BugsAssignee: Karl Rackler <rackler>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, katherine_cheney, rackler, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=241233
Attachments:
Description Flags
Patch none

Description Ryan Haddad 2022-06-06 11:48:01 PDT
TestWebKitAPI.HSTS.ThirdParty
        
        /Volumes/Data/worker/Apple-iOS-15-Simulator-Release-Build/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/HSTS.mm:117
        Expected equality of these values:
          [webView _test_waitForAlert]
            Which is: " "
          "http://example.com/ hi"
        
        
        /Volumes/Data/worker/Apple-iOS-15-Simulator-Release-Build/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/HSTS.mm:118
        Expected equality of these values:
          httpServer.totalRequests()
            Which is: 1
          2u
            Which is: 2

https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.HSTS.ThirdParty
Comment 1 Radar WebKit Bug Importer 2022-06-06 11:48:10 PDT
<rdar://problem/94448628>
Comment 2 Ryan Haddad 2022-06-06 12:03:29 PDT
This test makes requests to example.com, maybe it is the same as https://bugs.webkit.org/show_bug.cgi?id=241233?
Comment 3 Karl Rackler 2022-06-08 14:15:05 PDT
I have disabled this test for iOS while this issue is investigated.
Comment 4 Karl Rackler 2022-06-08 14:20:15 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1392
Comment 5 EWS 2022-06-08 16:06:11 PDT
Test gardening commit r295398 (251404@main): <https://commits.webkit.org/251404@main>

Reviewed commits have been landed. Closing PR #1392 and removing active labels.
Comment 6 Alex Christensen 2022-06-08 21:24:49 PDT
Aha!  determineITPStateInternal is returning true on macOS and false on iOS, which causes ITP to be enabled by default on macOS but not iOS, which causes the HSTS mitigation to happen on macOS but not iOS.  The code is fine, the test needs to just enable ITP everywhere.
Comment 7 Alex Christensen 2022-06-09 10:23:36 PDT
Created attachment 460136 [details]
Patch
Comment 8 EWS 2022-06-09 14:41:53 PDT
Committed r295437 (251443@main): <https://commits.webkit.org/251443@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460136 [details].