Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 204a09687fe7b2ab4242dff1cf4c86577e198eb2
      
https://github.com/WebKit/WebKit/commit/204a09687fe7b2ab4242dff1cf4c86577e198eb2
  Author: Timothy Hatcher <[email protected]>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIScripting.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm
    M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm

  Log Message:
  -----------
  WKWebExtensionAPITabs.ExecuteScript test has a race condition and fails 
sometimes.
https://webkit.org/b/264754
rdar://problem/118344217

Reviewed by Brian Weinstein.

Use the onUpdated or onCompleted events to know when the tab navigates so we 
can execute script.
Also properly fire the onUpdated event by using web view navigation delegate 
methods.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm:
(-[TestWebExtensionTab initWithWindow:extensionController:]): Set 
navigationDelegate.
(-[TestWebExtensionTab changeWebViewIfNeededForURL:forExtensionContext:]): 
Ditto.
(-[TestWebExtensionTab webView:didStartProvisionalNavigation:]): Added.
(-[TestWebExtensionTab 
webView:didReceiveServerRedirectForProvisionalNavigation:]): Added.
(-[TestWebExtensionTab webView:didFailNavigation:withError:]): Added.
(-[TestWebExtensionTab webView:didCommitNavigation:]): Added.
(-[TestWebExtensionTab webView:didFinishNavigation:]): Added.
(-[TestWebExtensionTab 
setParentTab:forWebExtensionContext:completionHandler:]): Added cast to fix 
error.

Canonical link: https://commits.webkit.org/270658@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to