Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2c5cd6d774da5b3127a166b0b218212ca1115d20
      
https://github.com/WebKit/WebKit/commit/2c5cd6d774da5b3127a166b0b218212ca1115d20
  Author: Chris Dumez <[email protected]>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M Source/WTF/wtf/text/CString.h
    M Tools/TestWebKitAPI/Tests/WTF/CString.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestAuthentication.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestAutomationSession.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestBackForwardList.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestCookieManager.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestDownloads.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestInputMethodContext.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestLoaderClient.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestResources.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestSSL.cpp
    M 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitFaviconDatabase.cpp
    M 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitNetworkSession.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitPolicyClient.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitSettings.cpp
    M 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitUserContentManager.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebContext.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebXR.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebsiteData.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/gtk/TestContextMenu.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/wpe/TestWebViewEditor.cpp
    M Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp
    M Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h
    M Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h
    M Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp
    M Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h

  Log Message:
  -----------
  Remove CStringBase::legacyCStringPointer() and stop unwrapping UTF8CStrings 
for the GLib test helpers
https://bugs.webkit.org/show_bug.cgi?id=325471

Reviewed by Philippe Normand.

CStringBase does not know its encoding, but it still offered 
legacyCStringPointer(), which
handed out a const char* for Latin-1 bytes as readily as for UTF-8. Its only 
remaining caller
was assertCmpCStringPointer() in the GLib test harness, so remove it. The 
escape hatch is now
only offered where it is meaningful, by UTF8CString.

assertCmpCStringPointer() takes UTF8CString and ASCIICString instead, so 
ASSERT_CMP_CSTRING
no longer accepts a Latin-1 or an untyped string.

The GLib API tests unwrapped a UTF8CString with legacyCStringPointer() at 
roughly 290 call
sites, mostly to pass the result of getURIForPath() to loadURI() or to compare 
it in
g_assert_cmpstr(). Add UTF8CString overloads of WebViewTest::loadURI() and the 
local
loadURIAndGetMainResourceData() helpers, and use ASSERT_CMP_CSTRING, which 
already accepts
typed strings, in place of g_assert_cmpstr(). The loadURI() overload is 
non-virtual and
forwards to the virtual const char* version, so subclasses that override the 
latter only need
a using-declaration to keep it visible.

* Source/WTF/wtf/text/CString.h:
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringLegacyCStringPointer)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestAuthentication.cpp:
(testWebViewAuthenticationRequest):
(testWebViewAuthenticationCancel):
(testWebViewAuthenticationLoadCancelled):
(testWebViewAuthenticationFailure):
(testWebViewAuthenticationNoCredential):
(testWebViewAuthenticationEphemeral):
(testWebViewAuthenticationStorage):
(testWebViewAuthenticationSuccess):
(testWebViewAuthenticationPageProvidedAuthorizationHeader):
(testWebViewAuthenticationEmptyRealm):
(testWebViewAuthenticationProxy):
(testWebViewAuthenticationProxyHTTPS):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestAutomationSession.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestBackForwardList.cpp:
(testBackForwardListNavigation):
(testBackForwardListLimitAndCache):
(testWebKitWebViewSessionState):
(testWebKitWebViewNavigationAfterSessionRestore):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestCookieManager.cpp:
(testCookieManagerAcceptPolicy):
(testCookieManagerAddCookie):
(testCookieManagerGetCookies):
(testCookieManagerReplaceGetAllCookies):
(testCookieManagerDeleteCookie):
(testCookieManagerDeleteCookies):
(testCookieManagerCookiesChanged):
(testCookieManagerPersistentStorage):
(testCookieManagerPersistentStorageDeleteAll):
(testCookieSyncWithWebView):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestDownloads.cpp:
(testPolicyResponseDownload):
(testPolicyResponseDownloadCancel):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestInputMethodContext.cpp:
(testWebKitInputMethodContextSimple):
(testWebKitInputMethodContextSequence):
(testWebKitInputMethodContextInvalidSequence):
(testWebKitInputMethodContextCancelSequence):
(testWebKitInputMethodContextReset):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestLoaderClient.cpp:
(testLoadingStatus):
(testLoadCancelled):
(testWebViewReload):
(testLoadProgress):
(testWebViewHistoryLoad):
(testWebViewLoadTwiceAndReload):
(testUnfinishedSubresourceLoad):
(testWebViewActiveURI):
(testWebViewIsLoading):
(testWebPageURI):
(testURIRequestHTTPHeaders):
(testURIResponseHTTPHeaders):
(testUserAgent):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestResources.cpp:
(testWebViewResources):
(testWebResourceLoading):
(testWebResourceResponse):
(testWebResourceMimeType):
(testWebResourceSuggestedFilename):
(testWebResourceActiveURI):
(testWebResourceGetData):
(testWebViewResourcesHistoryCache):
(testWebResourceSendRequest):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestSSL.cpp:
(testSSL):
(testInsecureContent):
(testTLSErrorsPolicy):
(testTLSErrorsRedirect):
(testTLSErrorsHTTPAuth):
(testLoadFailedWithTLSErrors):
(testSubresourceLoadFailedWithTLSErrors):
(testWebSocketTLSErrors):
(testTLSErrorsEphemeral):
(testClientSideCertificate):
(testWebSocketClientSideCertificate):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitFaviconDatabase.cpp:
(testFaviconDatabaseGetFavicon):
(testFaviconDatabaseGetPageIcons):
(testFaviconDatabaseEphemeral):
(testFaviconDatabaseClear):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitNetworkSession.cpp:
(ProxyTest::loadURIAndGetMainResourceData):
(testNetworkSessionProxySettings):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitPolicyClient.cpp:
(testNavigationPolicy):
(testResponsePolicy):
(testCustomUserAgentPolicy):
(testUpgradeToHTTPSPolicy):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitSettings.cpp:
(testWebKitSettingsApplyFromConfigFile):
(assertThatUserAgentIsSentInHeaders):
(testWebKitSettingsUserAgent):
* 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitUserContentManager.cpp:
(isStyleSheetInjectedForURLAtPath):
(isScriptInjectedForURLAtPath):
(isCSSBlockedForURLAtPath):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebContext.cpp:
(testWebContextLanguages):
(testWebContextSecurityFileXHR):
(ProxyTest::loadURIAndGetMainResourceData):
(testWebContextProxySettings):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebView.cpp:
(testWebViewCustomCharset):
(testWebViewNotification):
(testWebViewNotificationInitialPermissionAllowed):
(testWebViewNotificationInitialPermissionDisallowed):
(testWebViewOffscreenWindow):
(testWebViewTitleChange):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitWebXR.cpp:
(testWebKitWebXRLeaveImmersiveModeAndWaitUntilImmersiveModeChanged):
(testWebKitXRPermissionRequest):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebsiteData.cpp:
(testWebsiteDataConfiguration):
(testWebsiteDataCache):
(loadCompressionDictionaryPage):
(testWebsiteDataCompressionDictionary):
(testWebsiteDataCompressionDictionaryForeignMatch):
(testWebsiteDataCompressionDictionaryOtherOrigin):
(testWebsiteDataStorage):
(testWebsiteDataDatabases):
(testWebsiteDataCookies):
(testWebsiteDataDeviceIdHashSalt):
(testWebsiteDataITP):
(testWebsiteDataServiceWorkerRegistrations):
(testWebsiteDataDOMCache):
(testWebsiteDataSizes):
(testWebsiteDataFileSystem):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/gtk/TestContextMenu.cpp:
(testContextMenuWebExtensionNode):
(testContextMenuLiveStream):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/wpe/TestWebViewEditor.cpp:
(testEditorCopyKeyBindingNonEditable):
(testEditorCopyKeyBindingEditable):
(testEditorSelectAllKeyBindingNonEditable):
* Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp:
(loadChangedCallback):
(loadFailedCallback):
(loadFailedWithTLSErrorsCallback):
* Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:
* Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(assertCmpCStringPointer):
* Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
(WebViewTest::loadURI):
(WebViewTest::loadHtml):
(WebViewTest::loadPlainText):
(WebViewTest::loadBytes):
(WebViewTest::loadRequest):
(WebViewTest::loadAlternateHTML):
(WebViewTest::goBack):
(WebViewTest::goForward):
(WebViewTest::goToBackForwardListItem):
* Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:

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



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

Reply via email to