Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ce5df19df1a0cd09a6aa8a5d46bcaf108aba692f
https://github.com/WebKit/WebKit/commit/ce5df19df1a0cd09a6aa8a5d46bcaf108aba692f
Author: Chris Dumez <[email protected]>
Date: 2026-09-30 (Wed, 30 Sep 2026)
Changed paths:
M Tools/TestWebKitAPI/Helpers/PlatformUtilities.h
M Tools/TestWebKitAPI/Helpers/Test.h
M Tools/TestWebKitAPI/Tests/WTF/AtomString.cpp
M Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp
M Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp
M Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
M Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm
M Tools/TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp
M Tools/TestWebKitAPI/Tests/WebCore/DocumentOrder.cpp
M Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp
M Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp
M Tools/TestWebKitAPI/Tests/WebCore/URLPatternTests.cpp
M Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp
M Tools/TestWebKitAPI/Tests/WebCore/win/WindowsKeyNames.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKPage/CookieStorageFile.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CustomUserAgent.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/IndexedDBFileName.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WebPushDaemon.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestBackForwardList.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestLoaderClient.cpp
M
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitFaviconDatabase.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitPolicyClient.cpp
M Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h
M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
M Tools/WebKitTestRunner/StringFunctions.h
M Tools/WebKitTestRunner/TestController.cpp
M Tools/WebKitTestRunner/TestInvocation.cpp
M Tools/WebKitTestRunner/WorkQueueManager.cpp
M Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
M Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp
M Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp
Log Message:
-----------
Reduce legacyCStringPointer() calls in test harness code
https://bugs.webkit.org/show_bug.cgi?id=325779
Reviewed by Mike Wyrzykowski.
Test code unwrapped UTF8CStrings with legacyCStringPointer() mostly to pass
them to fixture
helpers, gtest string assertions and the WK C API. Let those take typed strings
instead, removing
78 calls to legacyCStringPointer() from Tools/.
Fixture helpers that are only ever passed a UTF8CString now take a
UTF8CStringView or a
const UTF8CString&: BackForwardListTest::checkItem(),
getFaviconForPageURIAndWaitUntilReady(),
getPageIconsForPageURIAndWaitUntilReady(), loadAndGetServerUserAgent() and
setRedirectURI().
Add an operator<< for UTF8CString to Test.h so that gtest can print it, and a
Util::toSTD()
overload for it so that EXPECT_WK_STREQ() accepts it. Compare UTF8CStrings with
EXPECT_EQ() against
an ASCIILiteral, or against a UTF8CString built from a u8 literal when the
expected bytes are not
ASCII, instead of unwrapping them for EXPECT_STREQ(). The number formatting
helpers in
WTFString.cpp and AtomString.cpp now return the UTF8CString instead of copying
it into a static
buffer. EXPECT_WK_STREQ() and SCOPED_TRACE() already accept a String, so pass
it directly.
Add toWKURL() helpers to WebKitTestRunner's StringFunctions.h and use them, and
the existing toWK()
helpers, instead of calling WKStringCreateWithUTF8CString(),
WKURLCreateWithUTF8CString() and
WKURLCreateWithBaseURL() with unwrapped strings.
* Tools/TestWebKitAPI/Helpers/PlatformUtilities.h:
(TestWebKitAPI::Util::toSTD):
* Tools/TestWebKitAPI/Helpers/Test.h:
(WTF::operator<<):
* Tools/TestWebKitAPI/Tests/WTF/AtomString.cpp:
(TestWebKitAPI::testAtomStringNumber):
(TestWebKitAPI::TEST(WTF, AtomStringNumberDouble)):
* Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F(FileSystemTest, readEntireFile)):
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST(WTF, StringConcatenate_Tuple)):
* Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::testStringNumberFixedPrecision):
(TestWebKitAPI::TEST(WTF, StringNumberFixedPrecision)):
(TestWebKitAPI::testStringNumberFixedWidth):
(TestWebKitAPI::TEST(WTF, StringNumberFixedWidth)):
(TestWebKitAPI::testStringNumber):
(TestWebKitAPI::TEST(WTF, StringNumber)):
(TestWebKitAPI::TEST(WTF, StringReplaceWithLiteral)):
(TestWebKitAPI::TEST(WTF, StringUTF8ConversionInvalidUTF16LenientMode)):
(TestWebKitAPI::TEST(WTF, StringUTF8ConversionStrictReplacingMode)):
* Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST(URLExtras, URLExtras_Spoof)):
* Tools/TestWebKitAPI/Tests/WebCore/CtapPinTest.cpp:
(TestWebKitAPI::TEST(CtapPinTest, TestValidateAndConvertToUTF8)):
* Tools/TestWebKitAPI/Tests/WebCore/DocumentOrder.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:
(TestWebKitAPI::TEST(WebCoreHTMLParser,
FastPathEntityWithoutSemicolonInAttributeValue)):
* Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
(TestWebKitAPI::eq):
* Tools/TestWebKitAPI/Tests/WebCore/URLPatternTests.cpp:
(TestWebKitAPI::TEST_F(URLPatternTest,
WithoutRegExpIgnoreCaseUnicodeAgreesWithRegExpPath)):
* Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp:
(TestWebKitAPI::test):
* Tools/TestWebKitAPI/Tests/WebCore/win/WindowsKeyNames.cpp:
(TestWebKitAPI::TEST(WindowsKeyNames, DomKeyReflectsAltGraph)):
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/CookieStorageFile.cpp:
(TestWebKitAPI::TEST_F(CookieStorageFile, CustomPath)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/CustomUserAgent.mm:
(TestWebKitAPI::TEST(CustomUserAgent,
PageLevelCustomUserAgentUpdatedInsidePolicyAppliesToRedirectTarget)):
(TestWebKitAPI::TEST(CustomUserAgent,
WebpagePreferencesCustomUserAgentAppliesToRedirectTarget)):
(TestWebKitAPI::TEST(CustomUserAgent,
WebpagePreferencesCustomUserAgentAsSiteSpecificQuirksAppliesToRedirectTarget)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/IndexedDBFileName.mm:
(createDirectories):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WebPushDaemon.mm:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestBackForwardList.cpp:
(testBackForwardListNavigation):
(testWebKitWebViewSessionState):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestLoaderClient.cpp:
(testLoadingStatus):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitFaviconDatabase.cpp:
(testFaviconDatabaseInitialization):
(testFaviconDatabaseGetFavicon):
(testFaviconDatabaseGetPageIcons):
(testFaviconDatabaseClear):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestWebKitPolicyClient.cpp:
(testCustomUserAgentPolicy):
* Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.h:
(LoadTrackingTest::setRedirectURI):
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPrivateClickMeasurementTokenPublicKeyURLForTesting):
(WTR::TestRunner::setPrivateClickMeasurementTokenSignatureURLForTesting):
* Tools/WebKitTestRunner/StringFunctions.h:
(WTR::toWKURL):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::createTestURL):
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* Tools/WebKitTestRunner/WorkQueueManager.cpp:
(WTR::WorkQueueManager::queueLoad):
(WTR::WorkQueueManager::queueLoadHTMLString):
* Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::getBackgroundFetchIdentifier):
* Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::takeViewPortSnapshot):
* Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::TestController::takeViewPortSnapshot):
Canonical link: https://commits.webkit.org/322334@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications