Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flaky WKWebExtensionAPIWebRequest tests
https://bugs.webkit.org/show_bug.cgi?id=270824 rdar://124401551 Reviewed by Timothy Hatcher. There were a few cascading issues here. 1) For webRequest, we were trying to create a persistent background page with manifest v3. This is not a supported configuration, so it was being forced into being non-persistent. This meant that the background page could sometimes unload, leading to the flakiness described in the bug. 2) After making this change, I discovered that we were attempting to load the background page before it was safe (before moveLocalStorageIfNeeded was called). To fix this, add a new variable tracking if it's safe to load the background view. This is set to true in loadBackgroundWebViewDuringLoad, and checked in loadBackgroundWebViewIfNeeded before attempting to load the background web view. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm: (WebKit::WebExtensionContext::loadBackgroundWebViewDuringLoad): (WebKit::WebExtensionContext::loadBackgroundWebViewIfNeeded): (WebKit::WebExtensionContext::loadBackgroundWebView): * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: (WebKit::WebExtensionContext::safeToLoadBackgroundContent const): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIWebRequest.mm: Canonical link: https://commits.webkit.org/275955@main
- Loading branch information