[webkit-changes] [WebKit/WebKit] 4ce7e4: TestWebKitAPI test utilities are not declared in c...

Kimmo Kinnunen noreply at github.com
Mon Nov 7 05:32:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4ce7e49408a7a9cd5da160938b606a10f7aebe7e
      https://github.com/WebKit/WebKit/commit/4ce7e49408a7a9cd5da160938b606a10f7aebe7e
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M Tools/TestWebKitAPI/CMakeLists.txt
    M Tools/TestWebKitAPI/DebugUtilities.h
    M Tools/TestWebKitAPI/Sources.txt
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    M Tools/TestWebKitAPI/Test.h
    M Tools/TestWebKitAPI/TestNotificationProvider.cpp
    R Tools/TestWebKitAPI/TestUtilities.cpp
    R Tools/TestWebKitAPI/TestUtilities.h
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
    M Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp
    M Tools/TestWebKitAPI/Tests/IPC/IPCTestUtilities.cpp
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp
    M Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp
    M Tools/TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm
    M Tools/TestWebKitAPI/Tests/Misc/TestRunnerTests.cpp
    M Tools/TestWebKitAPI/Tests/WTF/CompletionHandlerTests.cpp
    R Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp
    A Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopierTests.cpp
    M Tools/TestWebKitAPI/Tests/WTF/HexNumber.cpp
    M Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp
    M Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StackTraceTest.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
    M Tools/TestWebKitAPI/Tests/WTF/StringParsingBuffer.cpp
    R Tools/TestWebKitAPI/Tests/WTF/SuspendableWorkQueue.cpp
    A Tools/TestWebKitAPI/Tests/WTF/SuspendableWorkQueueTests.cpp
    M Tools/TestWebKitAPI/Tests/WTF/URL.cpp
    M Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp
    M Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
    M Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm
    M Tools/TestWebKitAPI/Tests/WebCore/ColorTests.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/DNS.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/PushMessageCrypto.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebKit/CookieStorageFile.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback_Bundle.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/UserMessage.cpp
    R Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm
    A Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKPageConfiguration.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WillLoad.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ModalContainerObservation.mm
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/SOAuthorizationTests.mm
    R Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/AccessingPastedImage.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/ClosingWebView.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/DeallocWebViewInEventListener.mm
    M Tools/TestWebKitAPI/Tests/WebKitObjC/PreventImageLoadWithAutoResizing.mm
    M Tools/TestWebKitAPI/Tests/WebKitObjC/PreventImageLoadWithAutoResizing_Bundle.cpp
    M Tools/TestWebKitAPI/Tests/WebKitObjC/WKBrowsingContextGroupTest.mm
    M Tools/TestWebKitAPI/Tests/WebKitObjC/WKBrowsingContextLoadDelegateTest.mm
    M Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm
    M Tools/TestWebKitAPI/Tests/ios/FocusPreservationTests.mm
    M Tools/TestWebKitAPI/Tests/ios/ShareSheetTests.mm
    M Tools/TestWebKitAPI/Tests/mac/AttributedString.mm
    M Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm
    M Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm
    M Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm
    M Tools/TestWebKitAPI/Tests/mac/ImmediateActionTests.mm
    M Tools/TestWebKitAPI/Tests/mac/NSResponderTests.mm
    M Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm
    M Tools/TestWebKitAPI/Tests/mac/ScrollingCoordinatorTests.mm
    M Tools/TestWebKitAPI/Tests/mac/WebViewCanPasteURL.mm
    M Tools/TestWebKitAPI/Tests/mac/WebViewCanPasteZeroPng.mm
    M Tools/TestWebKitAPI/Tests/mac/WillPerformClientRedirectToURLCrash.mm
    M Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm
    M Tools/TestWebKitAPI/Utilities.h
    R Tools/TestWebKitAPI/WTFStringUtilities.h
    A Tools/TestWebKitAPI/WTFTestUtilities.h
    A Tools/TestWebKitAPI/WebCoreTestUtilities.cpp
    A Tools/TestWebKitAPI/WebCoreTestUtilities.h
    R Tools/TestWebKitAPI/WebCoreUtilities.h

  Log Message:
  -----------
  TestWebKitAPI test utilities are not declared in consistent header files
https://bugs.webkit.org/show_bug.cgi?id=246947

Reviewed by Antti Koivisto.

Tests have following utility code needs:
 - Support for GTest to interact with custom types: printing types
   using them in expectations
 - Common code used in many different test files

Before, these were defined in inconsistent manner in many different
header files, sometimes with duplicate responsibilities.

After, the GTest support and utilities are in following files:

 - Test.h -- the main GTest support file. Includes GTest support for
   WTF types, as WTF is currently always used.

 - WTFTestUtilities.h -- Utilities for WTF tests.

 - WebCoreTestUtilities.h -- GTest support for WebCore types and
   utilities for tests testing WebCore code.

Move GTest utility macros to Test.h. This header is almost always needed
for tests anyway, it is the top-level test utility file.

Move WTF::String support for GTest into Test.h. This is almost always
needed for tests anyway, and all tests should include Test.h.

Move WTF related utilities to WTFTestUtilities.h

Move WebCore related utilities to WebCoreTestUtilities.h

Fix all tests that use Test.h as the primary header file to work
around the above bug. Instead, include Test.h as the include rules
mandate.

Rename couple of test files that do not contain Tests.cpp suffix.
Currently the suffix is used to trigger the style checker to know
that the file does not have a primary header file. This is a good
suffix anyway, as it removes linker errors on Cocoa, due to
object files having duplicate base name (CrossThreadCopier.cpp
in WTF and in TestWebKitAPI).

* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/DebugUtilities.h:
* Tools/TestWebKitAPI/Sources.txt:
* Tools/TestWebKitAPI/Test.h:
(WTF::operator<<):
* Tools/TestWebKitAPI/TestNotificationProvider.cpp:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
* Tools/TestWebKitAPI/Tests/IPC/ConnectionTests.cpp:
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionBufferTests.cpp:
* Tools/TestWebKitAPI/Tests/IPC/StreamConnectionTests.cpp:
* Tools/TestWebKitAPI/Tests/JavaScriptCore/JSRunLoopTimer.mm:
* Tools/TestWebKitAPI/Tests/Misc/TestRunnerTests.cpp:
* Tools/TestWebKitAPI/Tests/WTF/CompletionHandlerTests.cpp:
* Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopierTests.cpp: Renamed from Tools/TestWebKitAPI/Tests/WTF/CrossThreadCopier.cpp.
* Tools/TestWebKitAPI/Tests/WTF/HexNumber.cpp:
* Tools/TestWebKitAPI/Tests/WTF/JSONValue.cpp:
* Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StackTraceTest.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringCommon.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp:
* Tools/TestWebKitAPI/Tests/WTF/StringParsingBuffer.cpp:
* Tools/TestWebKitAPI/Tests/WTF/SuspendableWorkQueueTests.cpp: Renamed from Tools/TestWebKitAPI/Tests/WTF/SuspendableWorkQueue.cpp.
* Tools/TestWebKitAPI/Tests/WTF/URL.cpp:
* Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp:
* Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:
* Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
* Tools/TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/DNS.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/PushMessageCrypto.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm:
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm:
* Tools/TestWebKitAPI/Tests/WebKit/CookieStorageFile.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/DidRemoveFrameFromHiearchyInPageCache.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/LoadCanceledNoServerRedirectCallback_Bundle.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/UserMessage.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm: Renamed from Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm.
* Tools/TestWebKitAPI/Tests/WebKit/WKPageConfiguration.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/WillLoad.cpp:
* Tools/TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ModalContainerObservation.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SOAuthorizationTests.mm: Renamed from Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
* Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/AccessingPastedImage.mm:
* Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/ClosingWebView.mm:
* Tools/TestWebKitAPI/Tests/WebKitLegacy/mac/DeallocWebViewInEventListener.mm:
* Tools/TestWebKitAPI/Tests/WebKitObjC/PreventImageLoadWithAutoResizing.mm:
* Tools/TestWebKitAPI/Tests/WebKitObjC/PreventImageLoadWithAutoResizing_Bundle.cpp:
* Tools/TestWebKitAPI/Tests/WebKitObjC/WKBrowsingContextGroupTest.mm:
* Tools/TestWebKitAPI/Tests/WebKitObjC/WKBrowsingContextLoadDelegateTest.mm:
* Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
* Tools/TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:
* Tools/TestWebKitAPI/Tests/ios/ShareSheetTests.mm:
* Tools/TestWebKitAPI/Tests/mac/AttributedString.mm:
* Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
* Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm:
* Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm:
* Tools/TestWebKitAPI/Tests/mac/ImmediateActionTests.mm:
* Tools/TestWebKitAPI/Tests/mac/NSResponderTests.mm:
* Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
* Tools/TestWebKitAPI/Tests/mac/ScrollingCoordinatorTests.mm:
* Tools/TestWebKitAPI/Tests/mac/WebViewCanPasteURL.mm:
* Tools/TestWebKitAPI/Tests/mac/WebViewCanPasteZeroPng.mm:
* Tools/TestWebKitAPI/Tests/mac/WillPerformClientRedirectToURLCrash.mm:
* Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm:
* Tools/TestWebKitAPI/Utilities.h:
* Tools/TestWebKitAPI/WTFStringUtilities.cpp: Removed.
* Tools/TestWebKitAPI/WTFTestUtilities.h: Renamed from Tools/TestWebKitAPI/WTFStringUtilities.h.
(TestWebKitAPI::utf16String):
* Tools/TestWebKitAPI/WebCoreTestUtilities.cpp: Renamed from Tools/TestWebKitAPI/TestUtilities.cpp.
* Tools/TestWebKitAPI/WebCoreTestUtilities.h: Renamed from Tools/TestWebKitAPI/TestUtilities.h.
(TestWebKitAPI::ScopedSetAuxiliaryProcessTypeForTesting::ScopedSetAuxiliaryProcessTypeForTesting):
(TestWebKitAPI::ScopedSetAuxiliaryProcessTypeForTesting::~ScopedSetAuxiliaryProcessTypeForTesting):
* Tools/TestWebKitAPI/WebCoreUtilities.h: Removed.

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




More information about the webkit-changes mailing list