[webkit-changes] [WebKit/WebKit] 944ca6: Improve sidePanel API test coverage.

Ariel Young noreply at github.com
Wed Aug 21 22:18:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 944ca61fed7730e59a563e890753bc5ec8bf4e16
      https://github.com/WebKit/WebKit/commit/944ca61fed7730e59a563e890753bc5ec8bf4e16
  Author: Ari Young <ari_young at apple.com>
  Date:   2024-08-21 (Wed, 21 Aug 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionSidebarCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionSidebar.h
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidePanelCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPISidebar.mm

  Log Message:
  -----------
  Improve sidePanel API test coverage.
https://webkit.org/b/278485
rdar://134444173

Reviewed by Timothy Hatcher.

This patch adds tests which exercise the sidePanel API, especially as
pertaining to the url and enable "properties." Additionally, this patch
also contains several fixes for bugs which I found while writing these
tests.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionSidebarCocoa.mm:
(WebKit::WebExtensionSidebar::icon): Lazily evaluate retrieving the
extension's action icon when no sidebar icon is present
(WebKit::WebExtensionSidebar::title const): Lazily evaluate retrieving
the current sidebar's parent's title when the current sidebar has no
title override
(WebKit::WebExtensionSidebar::isEnabled const): Add code to defer to the
current sidebar's parent's enablement state rather than assuming every
sidebar will have an enablement state
(WebKit::WebExtensionSidebar::sidebarPath const): Lazily evaluate
retrieving the current sidebar's parent's path when the current sidebar
has no path override
* Source/WebKit/UIProcess/Extensions/WebExtensionSidebar.h: Change type
  of m_isEnabled from bool to std::optional<bool>
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPISidePanelCocoa.mm:
(WebKit::serializeSidebarParameters): Fix serialization of tab
identifier
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPISidebar.mm:
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPIGlobalPathPersists)):
Test which ensures that the globally configured sidebar path persists
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPITabPathPersists)):
Test which ensures that per-tab sidebar paths persist
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPIGlobalEnablePersists)):
Test which ensures that the global enablement state persists
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPITabEnablePersists)):
Test which ensure that the per-tab enablement state persists
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPIModifyGlobalPath)):
Test which ensures that the global sidebar path can be modified
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelAPIModifyTabPath)):
Test which ensures that tab-specific sidebar paths can be modified
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelModifyGlobalEnable)):
Test which ensures that the global enablement state can be modified
(TestWebKitAPI::TEST_F(WKWebExtensionAPISidebar, SidePanelModifyTabEnable)):
Test which ensures that the per-tab enablement state can be modified

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