Skip to content
Browse files
[ macOS ][ iOS ] TestWebKitAPI.SOAuthorizationSubFrame.InterceptionEr…
…ror is a flaky timeout

Reviewed by Kate Cheney.

This test was timing out for the same reason as SOAuthorizationSubFrame.InterceptionErrorWithReferrer,
which Pascoe fixed in Bug 239311.

This change modifies all 'waitForMessage'-based tests to use the message listener delegate to
avoid the race conditions identified. I also changed the method swizzling code to remove
a bunch of copy/paste code that had to be kept in sync.

With these changes I can run the tests 1000 times on simulator without a timeout.

* Source/WebKit/UIProcess/Cocoa/SOAuthorization/
(-[WKSOAuthorizationDelegate authorization:didCompleteWithError:]): Only emit an error log message
when there is an actual error. We pass through this flow in normal cases where a site wants to
use the web fallback instead of AppSSO based on user input.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/
(-[TestSOAuthorizationScriptMessageHandler extendExpectations:]):
(-[TestSOAuthorizationScriptMessageHandler resetExpectations:]):

Canonical link:
git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
brentfulgham committed Jun 10, 2022
1 parent dc4feb5 commit c1c720c3947f41c215959011eb585850f3a1fb37
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 354 deletions.
@@ -129,7 +129,8 @@ - (void)authorization:(SOAuthorization *)authorization didCompleteWithError:(NSE
WKSOAUTHORIZATIONDELEGATE_RELEASE_LOG("authorization:didCompleteWithError: (authorization = %p, _session = %p)", authorization, _session.get());
LOG_ERROR("Could not complete AppSSO: %d", error.code);
if (error.code)
LOG_ERROR("Could not complete AppSSO operation. Error: %d", error.code);
if (!_session) {
WKSOAUTHORIZATIONDELEGATE_RELEASE_LOG("authorization:didCompleteWithError: No session, so returning early.");

0 comments on commit c1c720c

Please sign in to comment.