[webkit-changes] [WebKit/WebKit] 3dc776: WKWebExtensionAPITabs.ActiveTab is flaky.

Timothy Hatcher noreply at github.com
Fri Mar 15 19:00:35 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3dc776898be47c68845d9931dde1bd94638acaf3
      https://github.com/WebKit/WebKit/commit/3dc776898be47c68845d9931dde1bd94638acaf3
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

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

  Log Message:
  -----------
  WKWebExtensionAPITabs.ActiveTab is flaky.
https://webkit.org/b/269932
rdar://problem/123457954

Reviewed by Alex Christensen and Brian Weinstein.

We need to mark the title as changed after the document has loaded,
not when the navigation is committed, since the <title> wont be parsed yet.
This was causing a race condition for accessing the web view's title.

To keep things simple in the tests, also fire the URL change with the title,
otherwise it will require rejiggering the tests to be more robust. In practice
these do fire together due to event coalescing, but that coalescing window
is small and we were sometimes firing them separate, and that was causing
flakiness. Fix the tests to expect both 'url' and 'title' in `changeInfo`.

* Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm:
(-[TestWebExtensionTab _webView:navigationDidFinishDocumentLoad:]): Added.
(-[TestWebExtensionTab webView:didCommitNavigation:]): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm:
(TEST(WKWebExtensionAPITabs, ActiveTab)): Expect both 'url' and 'title' in `changeInfo`.
(TEST(WKWebExtensionAPITabs, UserGestureWithoutActiveTab)): Ditto.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list