[webkit-changes] [WebKit/WebKit] b74a5a: REGRESSION (275981 at main): [ macOS ] 7 tests in Tes...

Timothy Hatcher noreply at github.com
Tue Mar 12 16:06:48 PDT 2024


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

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIPermissionsCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMatchPatternCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
    M Source/WebKit/UIProcess/Extensions/WebExtensionMatchPattern.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm

  Log Message:
  -----------
  REGRESSION (275981 at main): [ macOS ] 7 tests in TestWebKitAPI.WKWebExtensionAPIPermissions are a constant failure/timeout.
https://webkit.org/b/270872
rdar://problem/124475393

Reviewed by Jeff Miller.

When requesting permissions via permissions.request(), we need to include optional permissions
in the check. That was actually happening by accident before, since !hasPermission() was returning
true for any unknown permission. With the change to needsPermission(), only RequestedExplicitly
or RequestedImplicitly results were counted. To fix this, a new option was added for use by
the permissions API to include optional permissions in the RequestedImplicitly category.

* Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIPermissionsCocoa.mm:
(WebKit::WebExtensionContext::permissionsRequest): Pass the IncludeOptionalPermissions option.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::requestPermissionMatchPatterns): Pass through options to needsPermission().
(WebKit::WebExtensionContext::requestPermissionToAccessURLs): Ditto.
(WebKit::WebExtensionContext::requestPermissions): Ditto.
(WebKit::WebExtensionContext::permissionState): Added support for IncludeOptionalPermissions to check
the optional permissions from the extension's manifest.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMatchPatternCocoa.mm:
(WebKit::WebExtensionMatchPattern::patternsMatchURL): Added const to URL to fix build issue.
(WebKit::WebExtensionMatchPattern::patternsMatchPattern): Added.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
(WebKit::WebExtensionContext::requestPermissionMatchPatterns): Added options parameter.
(WebKit::WebExtensionContext::requestPermissionToAccessURLs): Ditto.
(WebKit::WebExtensionContext::requestPermissions): Ditto.
* Source/WebKit/UIProcess/Extensions/WebExtensionMatchPattern.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm:
(TEST(WKWebExtensionAPITabs, QueryWithAccessPrompt)): Grant tabs permission so the tab URL counts as a
requested URL and the prompt delegate will be called.

Canonical link: https://commits.webkit.org/276003@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