summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Tools/TestWebKitAPI
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Tools/TestWebKitAPI')
-rw-r--r--Tools/TestWebKitAPI/CMakeLists.txt99
-rw-r--r--Tools/TestWebKitAPI/Configurations/Base.xcconfig15
-rw-r--r--Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig9
-rw-r--r--Tools/TestWebKitAPI/DerivedSources.pri12
-rw-r--r--Tools/TestWebKitAPI/ForwardingHeaders/WebCore/LayoutUnit.h4
-rw-r--r--Tools/TestWebKitAPI/GNUmakefile.am170
-rw-r--r--Tools/TestWebKitAPI/InjectedBundle.pri56
-rw-r--r--Tools/TestWebKitAPI/PlatformEfl.cmake73
-rw-r--r--Tools/TestWebKitAPI/PlatformWebView.h13
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp165
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.gypi54
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.pri22
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.pro11
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.sln29
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj314
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters98
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props17
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommonWinCairo.props17
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebug.props13
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebugWinCairo.props15
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPostBuild.cmd (renamed from Tools/TestWebKitAPI/win/TestWebKitAPIPostBuild.cmd)0
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPreBuild.cmd (renamed from Tools/TestWebKitAPI/win/TestWebKitAPIPreBuild.cmd)0
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIProduction.props13
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIRelease.props13
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIReleaseWinCairo.props15
-rw-r--r--Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj360
-rw-r--r--Tools/TestWebKitAPI/Tests.pri3
-rw-r--r--Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm69
-rw-r--r--Tools/TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro8
-rw-r--r--Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm2
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/CString.cpp87
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp35
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/Deque.cpp106
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp173
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MD5.cpp47
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp124
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp850
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp57
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp62
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp444
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp3
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp62
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/WTF.pro32
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp12
-rw-r--r--Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp17
-rw-r--r--Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp254
-rw-r--r--Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp4
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp61
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp145
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp83
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp78
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/FindMatches.mm168
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp102
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp12
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm76
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp85
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp85
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp89
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp96
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp87
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp441
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp65
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp6
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/WebKit2.pro63
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp240
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp84
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/associate-form-controls.html31
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html6
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp125
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp56
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/execCopy.html15
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/findRanges.html11
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html3
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp72
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp2
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm58
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp59
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm56
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm57
-rw-r--r--Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp64
-rw-r--r--Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp23
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm2
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/AttributedString.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/BackForwardList.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/CloseNewWindowInNavigationPolicyDelegate.mm84
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm77
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellElementCellAbove.html30
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm61
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DOMRangeOfString.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm2
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm2
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/ElementAtPointInWebFrame.mm73
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache1.html10
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache2.html10
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm96
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm8
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/OpenNewWindow.html7
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm2
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm79
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/SetDocumentURI.mm16
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/SimplifyMarkup.mm6
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html1
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm73
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm4
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm287
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/WebViewDidRemoveFrameFromHierarchy.mm83
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm74
-rw-r--r--Tools/TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm4
-rw-r--r--Tools/TestWebKitAPI/config.h14
-rw-r--r--Tools/TestWebKitAPI/efl/PlatformWebView.cpp34
-rw-r--r--Tools/TestWebKitAPI/ios/mainIOS.mm (renamed from Tools/TestWebKitAPI/win/WindowMessageObserver.h)23
-rw-r--r--Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm2
-rw-r--r--Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm5
-rw-r--r--Tools/TestWebKitAPI/mac/TestProtocol.h34
-rw-r--r--Tools/TestWebKitAPI/mac/TestProtocol.mm69
-rw-r--r--Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm6
-rw-r--r--Tools/TestWebKitAPI/mac/mainMac.mm (renamed from Tools/TestWebKitAPI/mac/main.mm)0
-rw-r--r--Tools/TestWebKitAPI/qt/InjectedBundleControllerQt.cpp (renamed from Tools/TestWebKitAPI/win/InjectedBundleControllerWin.cpp)2
-rw-r--r--Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp73
-rw-r--r--Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp151
-rw-r--r--Tools/TestWebKitAPI/qt/main.cpp70
-rw-r--r--Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp123
-rw-r--r--Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp147
-rw-r--r--Tools/TestWebKitAPI/win/TestWebKitAPI.sln66
-rw-r--r--Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj751
-rw-r--r--Tools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj82
-rw-r--r--Tools/TestWebKitAPI/win/TestWebKitAPIGeneratedCommon.vsprops14
-rw-r--r--Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj471
-rwxr-xr-xTools/TestWebKitAPI/win/copy-resources.cmd31
-rw-r--r--Tools/TestWebKitAPI/win/main.cpp16
146 files changed, 6996 insertions, 3115 deletions
diff --git a/Tools/TestWebKitAPI/CMakeLists.txt b/Tools/TestWebKitAPI/CMakeLists.txt
index 16033ec15..23f2184ce 100644
--- a/Tools/TestWebKitAPI/CMakeLists.txt
+++ b/Tools/TestWebKitAPI/CMakeLists.txt
@@ -1,6 +1,6 @@
-SET(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
+set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}
+include_directories(${CMAKE_BINARY_DIR}
${TESTWEBKITAPI_DIR}
${CMAKE_SOURCE_DIR}/Source
${DERIVED_SOURCES_WEBCORE_DIR}
@@ -16,24 +16,29 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}
${WEBCORE_DIR}/platform/network
${WEBKIT2_DIR}/Shared
${WEBKIT2_DIR}/Shared/API/c
+ ${WEBKIT2_DIR}/Shared/Plugins
${WEBKIT2_DIR}/UIProcess
+ ${WEBKIT2_DIR}/WebProcess/InjectedBundle
+ ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c
${WTF_DIR}
)
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
-ADD_LIBRARY(TestWebKitAPIInjectedBundle SHARED
+add_library(TestWebKitAPIInjectedBundle SHARED
${bundle_harness_SOURCES}
${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
@@ -46,25 +51,31 @@ ADD_LIBRARY(TestWebKitAPIInjectedBundle SHARED
${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKConnection_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillLoad_Bundle.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
)
-TARGET_LINK_LIBRARIES(TestWebKitAPIInjectedBundle ${WTF_LIBRARY_NAME})
-ADD_DEPENDENCIES(TestWebKitAPIInjectedBundle ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+set(TestWebKitAPI_LIBRARIES
+ WTF
+ WebKit2
+)
+
+target_link_libraries(TestWebKitAPIInjectedBundle ${TestWebKitAPI_LIBRARIES})
+add_dependencies(TestWebKitAPIInjectedBundle ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-GET_PROPERTY(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+get_property(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
-ADD_DEFINITIONS(-DGTEST_LINKED_AS_SHARED_LIBRARY=1
+add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1
-DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
-DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
)
-SET(test_wtf_LIBRARIES
- ${WTF_LIBRARY_NAME}
+set(test_wtf_LIBRARIES
+ WTF
gtest
)
-ADD_EXECUTABLE(test_wtf
+add_executable(test_wtf
${test_main_SOURCES}
${TESTWEBKITAPI_DIR}/TestsController.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/AtomicString.cpp
@@ -73,12 +84,15 @@ ADD_EXECUTABLE(test_wtf
${TESTWEBKITAPI_DIR}/Tests/WTF/Functional.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/IntegerToStringConversion.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/ListHashSet.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/MD5.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/MathExtras.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp
- ${TESTWEBKITAPI_DIR}/Tests/WTF/MemoryInstrumentationTest.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/SHA1.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/SaturatedArithmeticOperations.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/StringBuilder.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/StringHasher.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/StringImpl.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/StringOperators.cpp
${TESTWEBKITAPI_DIR}/Tests/WTF/TemporaryChange.cpp
@@ -88,29 +102,25 @@ ADD_EXECUTABLE(test_wtf
${TESTWEBKITAPI_DIR}/Tests/WTF/WTFString.cpp
)
-TARGET_LINK_LIBRARIES(test_wtf ${test_wtf_LIBRARIES})
-ADD_DEPENDENCIES(test_wtf ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-ADD_TEST(test_wtf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_wtf)
-SET_TESTS_PROPERTIES(test_wtf PROPERTIES TIMEOUT 60)
+target_link_libraries(test_wtf ${test_wtf_LIBRARIES})
+add_dependencies(test_wtf ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+add_test(test_wtf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_wtf)
+set_tests_properties(test_wtf PROPERTIES TIMEOUT 60)
-SET(test_webcore_LIBRARIES
+set(test_webcore_LIBRARIES
gtest
- ${WTF_LIBRARY_NAME}
- ${WebCore_LIBRARY_NAME}
-)
-
-ADD_EXECUTABLE(test_webcore
- ${test_main_SOURCES}
- ${TESTWEBKITAPI_DIR}/TestsController.cpp
- ${TESTWEBKITAPI_DIR}/Tests/WebCore/KURL.cpp
+ WTF
+ WebCore
)
-TARGET_LINK_LIBRARIES(test_webcore ${test_webcore_LIBRARIES})
-ADD_DEPENDENCIES(test_webcore ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-ADD_TEST(test_webcore ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webcore)
-SET_TESTS_PROPERTIES(test_webcore PROPERTIES TIMEOUT 60)
+foreach (testName ${test_webcore_BINARIES})
+ add_executable(test_webcore_${testName} ${test_main_SOURCES} ${TESTWEBKITAPI_DIR}/TestsController.cpp ${TESTWEBKITAPI_DIR}/Tests/WebCore/${testName}.cpp)
+ add_test(test_webcore_${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webcore_${testName})
+ set_tests_properties(test_webcore_${testName} PROPERTIES TIMEOUT 60)
+ target_link_libraries(test_webcore_${testName} ${test_webcore_LIBRARIES})
+endforeach ()
-ADD_LIBRARY(TestWebKitAPIBase
+add_library(TestWebKitAPIBase
${test_main_SOURCES}
${webkit2_api_harness_SOURCES}
${TESTWEBKITAPI_DIR}/JavaScriptTest.cpp
@@ -118,28 +128,29 @@ ADD_LIBRARY(TestWebKitAPIBase
${TESTWEBKITAPI_DIR}/TestsController.cpp
)
-ADD_DEPENDENCIES(TestWebKitAPIBase ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+add_dependencies(TestWebKitAPIBase WebKit2 ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
-SET(test_webkit2_api_LIBRARIES
+set(test_webkit2_api_LIBRARIES
TestWebKitAPIBase
- ${WTF_LIBRARY_NAME}
- ${JavaScriptCore_LIBRARY_NAME}
- ${WebKit2_LIBRARY_NAME}
+ WTF
+ JavaScriptCore
+ WebKit2
gtest
)
-FOREACH(testName ${test_webkit2_api_BINARIES})
- ADD_EXECUTABLE(test_webkit2_api_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
- ADD_TEST(test_webkit2_api_${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webkit2_api_${testName})
- SET_TESTS_PROPERTIES(test_webkit2_api_${testName} PROPERTIES TIMEOUT 60)
- TARGET_LINK_LIBRARIES(test_webkit2_api_${testName} ${test_webkit2_api_LIBRARIES})
-ENDFOREACH()
+foreach (testName ${test_webkit2_api_BINARIES})
+ get_filename_component(testBaseName ${testName} NAME)
+ add_executable(test_webkit2_api_${testBaseName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+ add_test(test_webkit2_api_${testBaseName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webkit2_api_${testBaseName})
+ set_tests_properties(test_webkit2_api_${testBaseName} PROPERTIES TIMEOUT 60)
+ target_link_libraries(test_webkit2_api_${testBaseName} ${test_webkit2_api_LIBRARIES})
+endforeach ()
# We don't run tests that are expected to fail. We could use the WILL_FAIL
# property, but it reports failure when the test crashes or timeouts and would
# make the bot red.
-FOREACH(testName ${test_webkit2_api_fail_BINARIES})
- ADD_EXECUTABLE(test_webkit2_api_fail_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
- TARGET_LINK_LIBRARIES(test_webkit2_api_fail_${testName} ${test_webkit2_api_LIBRARIES})
-ENDFOREACH()
+foreach (testName ${test_webkit2_api_fail_BINARIES})
+ add_executable(test_webkit2_api_fail_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+ target_link_libraries(test_webkit2_api_fail_${testName} ${test_webkit2_api_LIBRARIES})
+endforeach ()
diff --git a/Tools/TestWebKitAPI/Configurations/Base.xcconfig b/Tools/TestWebKitAPI/Configurations/Base.xcconfig
index 1e029d4eb..834faa366 100644
--- a/Tools/TestWebKitAPI/Configurations/Base.xcconfig
+++ b/Tools/TestWebKitAPI/Configurations/Base.xcconfig
@@ -25,8 +25,11 @@ CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
CLANG_CXX_LIBRARY = libc++;
CLANG_WARN_CXX0X_EXTENSIONS = NO;
HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu;
-FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_RTTI=0;
+FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(PLATFORM_NAME));
+FRAMEWORK_SEARCH_PATHS_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
+
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_RTTI=0 $(GCC_PREPROCESSOR_DEFINITIONS_$(PLATFORM_NAME));
+GCC_PREPROCESSOR_DEFINITIONS_macosx = ENABLE_DASHBOARD_SUPPORT;
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
PREBINDING = NO
GCC_C_LANGUAGE_STANDARD = gnu99
@@ -40,7 +43,7 @@ GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES
WARNING_CFLAGS = -Wall -W -Wno-unused-parameter
LINKER_DISPLAYS_MANGLED_NAMES = YES;
-VALID_ARCHS = i386 x86_64;
+OTHER_CPLUSPLUSFLAGS = $(OTHER_CPLUSPLUSFLAGS) -ftemplate-depth=256;
// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
// We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -48,6 +51,7 @@ DEBUG_DEFINES_debug = ;
DEBUG_DEFINES_normal = NDEBUG;
DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT));
+SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx;
TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
@@ -63,3 +67,8 @@ SDKROOT_TARGETING_SAME_OS_X_VERSION_ = macosx;
WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
+
+EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
+EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm;
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *Mac.h *Mac.cpp *Mac.mm *InjectedBundle* *PlatformUtilities* Tests/WebKit2/* Tests/WebKit2ObjC/* *_Bundle* JavaScriptTest.*;
+EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
diff --git a/Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig b/Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
index c2ab7cd23..5fc6f7449 100644
--- a/Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
+++ b/Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
@@ -21,5 +21,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRODUCT_NAME = TestWebKitAPI
-GCC_ENABLE_OBJC_EXCEPTIONS = YES
+PRODUCT_NAME = TestWebKitAPI;
+GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+
+OTHER_LDFLAGS = -lgtest -framework JavaScriptCore -framework WebKit $(OTHER_LDFLAGS_$(PLATFORM_NAME));
+OTHER_LDFLAGS_iphoneos = -framework WebCore;
+OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos);
+OTHER_LDFLAGS_macosx = -framework Cocoa -framework Carbon -framework WebKit2;
diff --git a/Tools/TestWebKitAPI/DerivedSources.pri b/Tools/TestWebKitAPI/DerivedSources.pri
new file mode 100644
index 000000000..cb391ad59
--- /dev/null
+++ b/Tools/TestWebKitAPI/DerivedSources.pri
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------
+# Derived sources for TestWebKitAPI
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+TEMPLATE = derived
+
+# Make sure forwarded headers needed by this project are present
+fwheader_generator.commands = perl $${ROOT_WEBKIT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl $${ROOT_WEBKIT_DIR}/Tools/TestWebKitAPI $${ROOT_BUILD_DIR}/Source/include qt
+fwheader_generator.depends = $${ROOT_WEBKIT_DIR}/Source/WebKit2/Scripts/generate-forwarding-headers.pl
+GENERATORS += fwheader_generator
diff --git a/Tools/TestWebKitAPI/ForwardingHeaders/WebCore/LayoutUnit.h b/Tools/TestWebKitAPI/ForwardingHeaders/WebCore/LayoutUnit.h
new file mode 100644
index 000000000..de0a7454e
--- /dev/null
+++ b/Tools/TestWebKitAPI/ForwardingHeaders/WebCore/LayoutUnit.h
@@ -0,0 +1,4 @@
+#ifndef TestWebKitAPI_FWD_LayoutUnit_h
+#define TestWebKitAPI_FWD_LayoutUnit_h
+#include <LayoutUnit.h>
+#endif
diff --git a/Tools/TestWebKitAPI/GNUmakefile.am b/Tools/TestWebKitAPI/GNUmakefile.am
index 01b115878..a3b3f9857 100644
--- a/Tools/TestWebKitAPI/GNUmakefile.am
+++ b/Tools/TestWebKitAPI/GNUmakefile.am
@@ -1,10 +1,3 @@
-BUILT_SOURCES += \
- generate-testwebkitapi-forwarding-headers
-wk2_tests_sources = $(shell ls $(srcdir)/Tools/TestWebKitAPI/Tests/WebKit2/*.cpp)
-generate-testwebkitapi-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(wk2_tests_sources)
- $(AM_V_GEN)$(PERL) $< $(srcdir)/Tools/TestWebKitAPI $(GENSOURCES_WEBKIT2)/include gtk
- $(AM_V_GEN)$(PERL) $< $(srcdir)/Tools/TestWebKitAPI $(GENSOURCES_WEBKIT2)/include soup
-
noinst_LTLIBRARIES += \
Libraries/libTestWebKitAPIMain.la
@@ -21,19 +14,32 @@ Libraries_libTestWebKitAPIMain_la_CPPFLAGS = \
-isystem $(srcdir)/Source/ThirdParty/gtest/include \
-I$(srcdir)/Tools/TestWebKitAPI \
-I$(srcdir)/Source/ThirdParty/gtest/include \
+ -I$(top_builddir)/DerivedSources/WebCore/include \
-I$(top_builddir)/DerivedSources/WebKit2/include \
$(global_cppflags) \
$(javascriptcore_cppflags) \
$(GTK_CFLAGS)
noinst_PROGRAMS += \
- Programs/TestWebKitAPI/TestWTF
+ Programs/TestWebKitAPI/TestWTF \
+ Programs/TestWebKitAPI/TestJavaScriptCore \
+ Programs/TestWebKitAPI/TestWebCore \
+ Programs/TestWebKitAPI/TestGtk
+
+if ENABLE_WEBKIT2
+noinst_PROGRAMS += \
+ Programs/TestWebKitAPI/TestWebKit2
+endif # ENABLE_WEBKIT2
Programs_TestWebKitAPI_TestWTF_CPPFLAGS = \
$(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \
$(GLIB_LIBS) \
$(CAIRO_CFLAGS)
+Programs_TestWebKitAPI_TestWTF_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
+ $(global_cxxflags)
+
Programs_TestWebKitAPI_TestWTF_LDADD = \
Libraries/libTestWebKitAPIMain.la \
Libraries/libgtest.la \
@@ -51,36 +57,145 @@ Programs_TestWebKitAPI_TestWTF_SOURCES = \
Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp \
Tools/TestWebKitAPI/Tests/WTF/Functional.cpp \
Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp \
Tools/TestWebKitAPI/Tests/WTF/IntegerToStringConversion.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/MD5.cpp \
Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp \
Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/MetaAllocator.cpp \
Tools/TestWebKitAPI/Tests/WTF/RedBlackTree.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp \
Tools/TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp \
Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp \
Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp \
Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp \
Tools/TestWebKitAPI/Tests/WTF/TemporaryChange.cpp \
- Tools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp \
Tools/TestWebKitAPI/Tests/WTF/Vector.cpp \
+ Tools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp \
Tools/TestWebKitAPI/Tests/WTF/VectorReverse.cpp \
Tools/TestWebKitAPI/WTFStringUtilities.h
-noinst_PROGRAMS += \
- Programs/TestWebKitAPI/TestGtk
+Programs_TestWebKitAPI_TestJavaScriptCore_CPPFLAGS = \
+ $(Libraries_libTestWebKitAPIMain_la_CPPFLAGS)
+
+Programs_TestWebKitAPI_TestJavaScriptCore_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
+ $(global_cxxflags)
+
+Programs_TestWebKitAPI_TestJavaScriptCore_LDADD = \
+ Libraries/libTestWebKitAPIMain.la \
+ Libraries/libgtest.la \
+ libWTF.la \
+ $(GTK_LIBS)
+
+Programs_TestWebKitAPI_TestJavaScriptCore_LDFLAGS = \
+ -no-install \
+ -no-fast-install
+
+Programs_TestWebKitAPI_TestJavaScriptCore_SOURCES = \
+ Tools/TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp
+
+webcore_layer_deps = \
+ libPlatform.la \
+ libPlatformGtk.la \
+ libWebCorePlatform.la \
+ libWebCoreGtk.la \
+ libWebCore.la \
+ libWebCoreModules.la
+if ENABLE_SVG
+webcore_layer_deps += \
+ libWebCoreSVG.la
+endif
+if ENABLE_INDEXED_DATABASE
+webcore_layer_deps += \
+ libLevelDB.la
+endif
+if USE_OPENGL
+webcore_layer_deps += \
+ libANGLE.la
+endif
+
+webcore_layer_archives = $(foreach lib, $(webcore_layer_deps), $(shell echo $(lib) | sed "s/\(.*\)\.la/.libs\/\1.a/"))
+
+WebCoreLayer.a: $(webcore_layer_deps)
+ $(AM_V_GEN)
+ $(AM_V_at)$(shell rm -f $@)
+ $(AM_V_at)$(foreach archive, $(webcore_layer_archives), $(shell ar t $(archive) | xargs -n50 ar cruT $@))
+
+DISTCLEANFILES += \
+ $(top_builddir)/WebCoreLayer.a
+
+Programs_TestWebKitAPI_TestWebCore_CPPFLAGS = \
+ $(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \
+ -I$(top_builddir)/DerivedSources/WebCore/include
+
+Programs_TestWebKitAPI_TestWebCore_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
+ $(global_cxxflags)
+
+Programs_TestWebKitAPI_TestWebCore_LDADD = \
+ Libraries/libTestWebKitAPIMain.la \
+ Libraries/libgtest.la \
+ libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+ libWTF.la \
+ WebCoreLayer.a \
+ $(CAIRO_LIBS) \
+ $(CLUTTER_LIBS) \
+ $(FREETYPE_LIBS) \
+ $(GAMEPAD_LIBS) \
+ $(GEOCLUE_LIBS) \
+ $(GAIL_LIBS) \
+ $(GLIB_LIBS) \
+ $(GSTREAMER_LIBS) \
+ $(GTK_LIBS) \
+ $(JPEG_LIBS) \
+ $(LIBSECRET_LIBS) \
+ $(LIBSOUP_LIBS) \
+ $(LIBXML_LIBS) \
+ $(LIBXSLT_LIBS) \
+ $(OPENGL_LIBS) \
+ $(PANGO_LIBS) \
+ $(PNG_LIBS) \
+ $(SQLITE3_LIBS) \
+ $(UNICODE_LIBS) \
+ $(WEBP_LIBS) \
+ $(XRENDER_LIBS) \
+ $(XT_LIBS) \
+ $(ZLIB_LIBS)
+
+Programs_TestWebKitAPI_TestWebCore_LDFLAGS = \
+ -no-install \
+ -no-fast-install
+
+Programs_TestWebKitAPI_TestWebCore_SOURCES = \
+ Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp \
+ Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
Programs_TestWebKitAPI_TestGtk_CPPFLAGS = \
$(Programs_TestWebKitAPI_TestWTF_CPPFLAGS) \
+ $(platform_cppflags) \
+ $(platformgtk_cppflags) \
$(webcore_cppflags) \
$(webcoregtk_cppflags) \
+ $(FREETYPE_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(LIBSOUP_CFLAGS)
+Programs_TestWebKitAPI_TestGtk_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
+ $(global_cxxflags)
+
Programs_TestWebKitAPI_TestGtk_LDADD = \
Libraries/libTestWebKitAPIMain.la \
Libraries/libgtest.la \
libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
- libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+ libPlatformGtk.la \
+ libWebCore.la \
+ libWebCoreGtk.la \
+ $(FREETYPE_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(LIBSOUP_LIBS)
@@ -96,22 +211,24 @@ Programs_TestWebKitAPI_TestGtk_SOURCES = \
Tools/TestWebKitAPI/config.h \
Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
-if ENABLE_WEBKIT2
-noinst_PROGRAMS += \
- Programs/TestWebKitAPI/TestWebKit2
-
Programs_TestWebKitAPI_TestWebKit2_CPPFLAGS = \
$(Programs_TestWebKitAPI_TestWTF_CPPFLAGS) \
-I$(top_builddir)/DerivedSources/WebKit2/include \
+ $(FREETYPE_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(LIBSOUP_CFLAGS)
+Programs_TestWebKitAPI_TestWebKit2_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
+ $(global_cxxflags)
+
Programs_TestWebKitAPI_TestWebKit2_LDADD = \
Libraries/libTestWebKitAPIMain.la \
Libraries/libgtest.la \
libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+ $(FREETYPE_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(LIBSOUP_LIBS)
@@ -146,7 +263,10 @@ Programs_TestWebKitAPI_TestWebKit2_SOURCES = \
Tools/TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp \
+ Tools/TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp \
+ Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp \
+ Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp \
@@ -160,6 +280,7 @@ Programs_TestWebKitAPI_TestWebKit2_SOURCES = \
Tools/TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp \
+ Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/UserMessage.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/WKConnection.cpp \
@@ -168,8 +289,10 @@ Programs_TestWebKitAPI_TestWebKit2_SOURCES = \
Tools/TestWebKitAPI/Tests/WebKit2/WKString.cpp \
Tools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
+if ENABLE_WEBKIT2
noinst_LTLIBRARIES += \
Libraries/libTestWebKitAPIInjectedBundle.la
+endif # ENABLE_WEBKIT2
Libraries_libTestWebKitAPIInjectedBundle_la_SOURCES = \
Tools/TestWebKitAPI/InjectedBundleController.cpp \
@@ -213,12 +336,27 @@ Libraries_libTestWebKitAPIInjectedBundle_la_CPPFLAGS = \
$(GTK_CFLAGS)
Libraries_libTestWebKitAPIInjectedBundle_la_CXXFLAGS = \
+ -DGTEST_HAS_RTTI=0 \
$(global_cxxflags)
Libraries_libTestWebKitAPIInjectedBundle_la_CFLAGS = \
$(global_cflags)
+
+
+stamp-testwebkitapi-webcore-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(Programs_TestWebKitAPI_TestWebCore_SOURCES)
+ $(AM_V_GEN)$(PERL) $< $(srcdir)/Tools/TestWebKitAPI/Tests/WebCore $(GENSOURCES_WEBCORE)/include gtk \
+ && echo timestamp > $(@F)
+
+stamp-testwebkitapi-webkit2-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(Programs_TestWebKitAPI_TestWebKit2_SOURCES) $(Libraries_libTestWebKitAPIInjectedBundle_la_SOURCES)
+ $(AM_V_GEN)$(PERL) $< $(srcdir)/Tools/TestWebKitAPI $(GENSOURCES_WEBKIT2)/include gtk \
+ && echo timestamp > $(@F)
+
+BUILT_SOURCES += $(top_builddir)/stamp-testwebkitapi-webcore-forwarding-headers
+if ENABLE_WEBKIT2
+BUILT_SOURCES += $(top_builddir)/stamp-testwebkitapi-webkit2-forwarding-headers
endif # ENABLE_WEBKIT2
+
EXTRA_DIST += \
Tools/TestWebKitAPI/Tests/WebKit2/18-characters.html \
Tools/TestWebKitAPI/Tests/WebKit2/file-with-anchor.html \
diff --git a/Tools/TestWebKitAPI/InjectedBundle.pri b/Tools/TestWebKitAPI/InjectedBundle.pri
new file mode 100644
index 000000000..171a200f0
--- /dev/null
+++ b/Tools/TestWebKitAPI/InjectedBundle.pri
@@ -0,0 +1,56 @@
+# -------------------------------------------------------------------
+# Project file for TestWebKitAPI's InjectedBundle
+#
+# See 'Tools/qmake/README' for an overview of the build system
+# -------------------------------------------------------------------
+
+TEMPLATE = lib
+TARGET = TestWebKitAPIInjectedBundle
+
+INCLUDEPATH += $$PWD
+INCLUDEPATH += $${ROOT_WEBKIT_DIR}/Source/ThirdParty/gtest/include
+
+SOURCES += \
+ $$PWD/InjectedBundleController.cpp \
+ $$PWD/InjectedBundleController.h \
+ $$PWD/InjectedBundleMain.cpp \
+ $$PWD/InjectedBundleTest.h \
+ $$PWD/PlatformUtilities.cpp \
+ $$PWD/PlatformUtilities.h \
+ $$PWD/qt/InjectedBundleControllerQt.cpp \
+ $$PWD/qt/PlatformUtilitiesQt.cpp \
+ $$PWD/Tests/WebKit2/CanHandleRequest_Bundle.cpp \
+ $$PWD/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp \
+ $$PWD/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp \
+ $$PWD/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp \
+ $$PWD/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp \
+ $$PWD/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp \
+ $$PWD/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp \
+ $$PWD/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp \
+ $$PWD/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp \
+ $$PWD/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp \
+ $$PWD/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp \
+ $$PWD/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp \
+ $$PWD/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp \
+ $$PWD/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp \
+ $$PWD/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp \
+ $$PWD/Tests/WebKit2/ParentFrame_Bundle.cpp \
+ $$PWD/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp \
+ $$PWD/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp \
+ $$PWD/Tests/WebKit2/UserMessage_Bundle.cpp \
+ $$PWD/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp \
+ $$PWD/Tests/WebKit2/WKConnection_Bundle.cpp
+
+
+DESTDIR = $${ROOT_BUILD_DIR}/lib
+
+QT += core webkit
+
+WEBKIT += wtf javascriptcore webcore webkit2
+
+CONFIG += plugin rpath compiling_thirdparty_code
+
+LIBS += -L$${ROOT_BUILD_DIR}/Source/ThirdParty/gtest/$$targetSubDir() -lgtest
+
+DEFINES += APITEST_SOURCE_DIR=\\\"$$PWD\\\" \
+ ROOT_BUILD_DIR=\\\"$${ROOT_BUILD_DIR}\\\"
diff --git a/Tools/TestWebKitAPI/PlatformEfl.cmake b/Tools/TestWebKitAPI/PlatformEfl.cmake
index b1aa579de..28eaf77f5 100644
--- a/Tools/TestWebKitAPI/PlatformEfl.cmake
+++ b/Tools/TestWebKitAPI/PlatformEfl.cmake
@@ -1,51 +1,67 @@
-ADD_CUSTOM_TARGET(forwarding-headersEflForTestWebKitAPI
+add_custom_target(forwarding-headersEflForTestWebKitAPI
COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include efl
+ COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include CoordinatedGraphics
COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include efl
)
-SET(ForwardingHeadersForTestWebKitAPI_NAME forwarding-headersEflForTestWebKitAPI)
+set(ForwardingHeadersForTestWebKitAPI_NAME forwarding-headersEflForTestWebKitAPI)
-ADD_CUSTOM_TARGET(forwarding-headersSoupForTestWebKitAPI
+add_custom_target(forwarding-headersSoupForTestWebKitAPI
COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
)
-SET(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI)
+set(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI)
-INCLUDE_DIRECTORIES(
+include_directories(
+ ${WEBKIT2_DIR}/UIProcess/API/C/CoordinatedGraphics
${WEBKIT2_DIR}/UIProcess/API/C/soup
${WEBKIT2_DIR}/UIProcess/API/C/efl
${WEBKIT2_DIR}/UIProcess/API/efl
+ ${ECORE_EVAS_INCLUDE_DIRS}
${ECORE_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
+ ${EO_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${LIBSOUP_INCLUDE_DIRS}
)
-SET(test_main_SOURCES
+set(test_main_SOURCES
${TESTWEBKITAPI_DIR}/efl/main.cpp
)
-SET(bundle_harness_SOURCES
+set(bundle_harness_SOURCES
${TESTWEBKITAPI_DIR}/efl/InjectedBundleController.cpp
${TESTWEBKITAPI_DIR}/efl/PlatformUtilities.cpp
)
-SET(webkit2_api_harness_SOURCES
+set(webkit2_api_harness_SOURCES
${TESTWEBKITAPI_DIR}/efl/PlatformUtilities.cpp
${TESTWEBKITAPI_DIR}/efl/PlatformWebView.cpp
)
# The list below works like a test expectation. Tests in the
-# test_webkit2_api_BINARIES list are added to the test runner and
-# tried on the bots on every build. Tests in test_webkit2_api_fail_BINARIES
+# test_{webkit2_api|webcore}_BINARIES list are added to the test runner and
+# tried on the bots on every build. Tests in test_{webkit2_api|webcore}_BINARIES
# are compiled and suffixed with fail and skipped from the test runner.
#
# Make sure that the tests are passing on both Debug and
-# Release builds before adding it to test_webkit2_api_BINARIES.
+# Release builds before adding it to test_{webkit2_api|webcore}_BINARIES.
-SET(test_webkit2_api_BINARIES
+set(test_webcore_BINARIES
+ LayoutUnit
+ KURL
+)
+
+# In here we list the bundles that are used by our specific WK2 API Tests
+list(APPEND bundle_harness_SOURCES
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp
+)
+
+set(test_webkit2_api_BINARIES
AboutBlankLoad
+ CloseThenTerminate
CookieManager
+ DidAssociateFormControls
DOMWindowExtensionNoCache
DocumentStartUserScriptAlertCrash
EvaluateJavaScript
@@ -57,43 +73,58 @@ SET(test_webkit2_api_BINARIES
GetInjectedBundleInitializationUserDataCallback
HitTestResultNodeHandle
InjectedBundleBasic
+ InjectedBundleFrameHitTest
InjectedBundleInitializationUserDataCallbackWins
LoadAlternateHTMLStringWithNonDirectoryURL
LoadCanceledNoServerRedirectCallback
+ LoadPageOnCrash
MouseMoveAfterCrash
NewFirstVisuallyNonEmptyLayout
NewFirstVisuallyNonEmptyLayoutFails
+ NewFirstVisuallyNonEmptyLayoutForImages
PageLoadBasic
PageLoadDidChangeLocationWithinPageForFrame
+ PageVisibilityState
ParentFrame
PreventEmptyUserAgent
PrivateBrowsingPushStateNoHistoryCallback
+ ReloadPageAfterCrash
+ ResizeWindowAfterCrash
+ ResponsivenessTimerDoesntFireEarly
+ TerminateTwice
+ UserMessage
WKConnection
WKPreferences
WKString
WKStringJSString
WKURL
+ WillLoad
WillSendSubmitEvent
+ CoordinatedGraphics/WKViewUserViewportToContents
+ efl/WKViewClientWebProcessCallbacks
)
-SET(test_webkit2_api_fail_BINARIES
+# Seccomp filters is an internal API and its symbols
+# are not (and should not) be exposed by default. We
+# can only test it when building shared core.
+if (ENABLE_SECCOMP_FILTERS AND SHARED_CORE)
+ list(APPEND test_webkit2_api_BINARIES
+ SeccompFilters
+ )
+endif ()
+
+set(test_webkit2_api_fail_BINARIES
CanHandleRequest
DOMWindowExtensionBasic
DownloadDecideDestinationCrash
- NewFirstVisuallyNonEmptyLayoutForImages
NewFirstVisuallyNonEmptyLayoutFrames
+ ResizeReversePaginatedWebView
RestoreSessionStateContainingFormData
+ ScrollPinningBehaviors
ShouldGoToBackForwardListItem
WKPageGetScaleFactorNotZero
)
-ADD_DEFINITIONS(-DTHEME_DIR="${THEME_BINARY_DIR}")
-
# Tests disabled because of missing features on the test harness:
#
-# ResponsivenessTimerDoesntFireEarly
# SpacebarScrolling
-#
-# Flaky test, fails on Release but passes on Debug:
-#
-# UserMessage
diff --git a/Tools/TestWebKitAPI/PlatformWebView.h b/Tools/TestWebKitAPI/PlatformWebView.h
index 653a17cca..3eb791a19 100644
--- a/Tools/TestWebKitAPI/PlatformWebView.h
+++ b/Tools/TestWebKitAPI/PlatformWebView.h
@@ -47,10 +47,21 @@ typedef HWND PlatformWindow;
typedef WKViewRef PlatformWKView;
typedef GtkWidget *PlatformWindow;
#elif PLATFORM(EFL)
-typedef struct _Evas_Object Evas_Object;
typedef struct _Ecore_Evas Ecore_Evas;
+#if USE(EO)
+typedef struct _Eo Evas_Object;
+#else
+typedef struct _Evas_Object Evas_Object;
+#endif
typedef Evas_Object* PlatformWKView;
typedef Ecore_Evas* PlatformWindow;
+#elif PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QQuickView;
+QT_END_NAMESPACE
+class QQuickWebView;
+typedef QQuickWebView* PlatformWKView;
+typedef QQuickView* PlatformWindow;
#endif
namespace TestWebKitAPI {
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp b/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp
deleted file mode 100644
index 696f40c67..000000000
--- a/Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp
+++ /dev/null
@@ -1,165 +0,0 @@
-#
-# Copyright (C) 2012 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-{
- 'variables': {
- 'tools_dir': '../..',
- 'source_dir': '../../../Source',
- 'conditions': [
- # Location of the chromium src directory and target type is different
- # if webkit is built inside chromium or as standalone project.
- ['inside_chromium_build==0', {
- # Webkit is being built outside of the full chromium project.
- # e.g. via build-webkit --chromium
- 'chromium_src_dir': '<(source_dir)/WebKit/chromium',
- },{
- # WebKit is checked out in src/chromium/third_party/WebKit
- 'chromium_src_dir': '<(tools_dir)/../../..',
- }],
- ],
- },
- 'includes': [
- '../TestWebKitAPI.gypi',
- '../../../Source/WebKit/chromium/features.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'TestWebKitAPI',
- 'type': 'executable',
- 'dependencies': [
- '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
- '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
- '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
- '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
- '<(chromium_src_dir)/base/base.gyp:test_support_base',
- '<(chromium_src_dir)/testing/gtest.gyp:gtest',
- '<(chromium_src_dir)/testing/gmock.gyp:gmock',
- '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
- ],
- 'include_dirs': [
- '<(tools_dir)/TestWebKitAPI',
- # Needed by tests/RunAllTests.cpp, as well as ChromiumCurrentTime.cpp and
- # ChromiumThreading.cpp in chromium shared library configuration.
- '<(source_dir)/WebKit/chromium/public',
- ],
- 'sources': [
- # Reuse the same testing driver of Chromium's webkit_unit_tests.
- '<(source_dir)/WebKit/chromium/tests/RunAllTests.cpp',
- '<@(TestWebKitAPI_files)',
- ],
- 'conditions': [
- ['inside_chromium_build==1 and component=="shared_library"', {
- 'sources': [
- # To satisfy linking of WTF::currentTime() etc. in shared library configuration,
- # as the symbols are not exported from the DLLs.
- '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp',
- '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp',
- ],
- }],
- ['OS=="android" and gtest_target_type == "shared_library"', {
- 'type': 'shared_library',
- 'dependencies': [
- '<(chromium_src_dir)/testing/android/native_test.gyp:native_test_native_code',
- ],
- }],
- ],
- },
- ], # targets
- 'conditions': [
- ['OS=="android" and gtest_target_type == "shared_library"', {
- # Wrap libTestWebKitAPI.so into an android apk for execution.
- 'targets': [{
- 'target_name': 'TestWebKitAPI_apk',
- 'type': 'none',
- 'dependencies': [
- '<(chromium_src_dir)/base/base.gyp:base',
- 'TestWebKitAPI',
- ],
- 'variables': {
- 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)TestWebKitAPI<(SHARED_LIB_SUFFIX)',
- 'input_jars_paths': [
- '<(PRODUCT_DIR)/lib.java/chromium_base.jar',
- ],
- 'conditions': [
- ['inside_chromium_build==1', {
- 'ant_build_to_chromium_src': '<(ant_build_out)/../../',
- }, {
- 'ant_build_to_chromium_src': '<(chromium_src_dir)',
- }],
- ],
- },
- # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
- # Not including it because gyp include doesn't support variable in path or under
- # conditions. And we also have some different requirements.
- 'actions': [{
- 'action_name': 'apk_TestWebKitAPI',
- 'message': 'Building TestWebKitAPI test apk.',
- 'inputs': [
- '<(chromium_src_dir)/testing/android/AndroidManifest.xml',
- '<(chromium_src_dir)/testing/android/generate_native_test.py',
- '<(input_shlib_path)',
- '<@(input_jars_paths)',
- ],
- 'outputs': [
- '<(PRODUCT_DIR)/TestWebKitAPI_apk/TestWebKitAPI-debug.apk',
- ],
- 'action': [
- '<(chromium_src_dir)/testing/android/generate_native_test.py',
- '--native_library',
- '<(input_shlib_path)',
- '--jars',
- '"<@(input_jars_paths)"',
- '--output',
- '<(PRODUCT_DIR)/TestWebKitAPI_apk',
- '--strip-binary=<(android_strip)',
- '--ant-args',
- '-DANDROID_SDK=<(android_sdk)',
- '--ant-args',
- '-DANDROID_SDK_ROOT=<(android_sdk_root)',
- '--ant-args',
- '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
- '--ant-args',
- '-DANDROID_SDK_VERSION=<(android_sdk_version)',
- '--ant-args',
- '-DANDROID_TOOLCHAIN=<(android_toolchain)',
- '--ant-args',
- '-DANDROID_GDBSERVER=<(android_gdbserver)',
- '--ant-args',
- '-DPRODUCT_DIR=<(ant_build_out)',
- '--ant-args',
- '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)',
- '--app_abi',
- '<(android_app_abi)',
- ],
- }],
- }],
- }],
- ],
-}
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.gypi b/Tools/TestWebKitAPI/TestWebKitAPI.gypi
deleted file mode 100644
index 2c07940c8..000000000
--- a/Tools/TestWebKitAPI/TestWebKitAPI.gypi
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright (C) 2011 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-{
- 'variables': {
- 'TestWebKitAPI_files': [
- 'Tests/WTF/AtomicString.cpp',
- 'Tests/WTF/CheckedArithmeticOperations.cpp',
- 'Tests/WTF/CString.cpp',
- 'Tests/WTF/Functional.cpp',
- 'Tests/WTF/HashMap.cpp',
- 'Tests/WTF/MathExtras.cpp',
- 'Tests/WTF/MediaTime.cpp',
- 'Tests/WTF/MemoryInstrumentationTest.cpp',
- 'Tests/WTF/RedBlackTree.cpp',
- 'Tests/WTF/SaturatedArithmeticOperations.cpp',
- 'Tests/WTF/StringBuilder.cpp',
- 'Tests/WTF/StringImpl.cpp',
- 'Tests/WTF/StringOperators.cpp',
- 'Tests/WTF/TemporaryChange.cpp',
- 'Tests/WTF/Vector.cpp',
- 'Tests/WTF/VectorBasic.cpp',
- 'Tests/WTF/VectorReverse.cpp',
- 'Tests/WTF/WTFString.cpp',
- ],
- },
-}
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.pri b/Tools/TestWebKitAPI/TestWebKitAPI.pri
new file mode 100644
index 000000000..ddc9934f4
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.pri
@@ -0,0 +1,22 @@
+
+INCLUDEPATH += $$PWD $${ROOT_WEBKIT_DIR}/Source/ThirdParty/gtest/include
+WEBKIT += wtf javascriptcore webkit2
+
+DEFINES += QT_NO_CAST_FROM_ASCII
+
+QT += core core-private gui gui-private webkit quick quick-private
+
+CONFIG += compiling_thirdparty_code
+
+SOURCES += \
+ $$PWD/JavaScriptTest.cpp \
+ $$PWD/PlatformUtilities.cpp \
+ $$PWD/TestsController.cpp \
+ $$PWD/qt/main.cpp \
+ $$PWD/qt/PlatformUtilitiesQt.cpp \
+ $$PWD/qt/PlatformWebViewQt.cpp
+
+LIBS += -L$${ROOT_BUILD_DIR}/Source/ThirdParty/gtest/$$targetSubDir() -lgtest
+
+DEFINES += ROOT_BUILD_DIR=\\\"$${ROOT_BUILD_DIR}\\\"
+
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.pro b/Tools/TestWebKitAPI/TestWebKitAPI.pro
new file mode 100644
index 000000000..b9d0cd5b6
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.pro
@@ -0,0 +1,11 @@
+TEMPLATE = subdirs
+CONFIG += ordered
+
+derived_sources.file = DerivedSources.pri
+injected_bundle.file = InjectedBundle.pri
+tests.file = Tests.pri
+
+SUBDIRS += derived_sources injected_bundle tests
+
+addStrictSubdirOrderBetween(derived_sources, injected_bundle)
+addStrictSubdirOrderBetween(derived_sources, tests)
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.sln b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.sln
new file mode 100644
index 000000000..38b2fd6b3
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.sln
@@ -0,0 +1,29 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPI", "TestWebKitAPI.vcxproj", "{AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "..\..\..\Source\ThirdParty\gtest\msvc\gtest-md.vcxproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}.Debug|Win32.Build.0 = Debug|Win32
+ {AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}.Release|Win32.ActiveCfg = Release|Win32
+ {AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}.Release|Win32.Build.0 = Release|Win32
+ {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Debug|Win32.Build.0 = Debug|Win32
+ {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|Win32.ActiveCfg = Release|Win32
+ {C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj
new file mode 100644
index 000000000..d6db8309a
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="DebugSuffix|Win32">
+ <Configuration>DebugSuffix</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="DebugSuffix|x64">
+ <Configuration>DebugSuffix</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_WinCairo|Win32">
+ <Configuration>Debug_WinCairo</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug_WinCairo|x64">
+ <Configuration>Debug_WinCairo</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Production|Win32">
+ <Configuration>Production</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Production|x64">
+ <Configuration>Production</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_WinCairo|Win32">
+ <Configuration>Release_WinCairo</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release_WinCairo|x64">
+ <Configuration>Release_WinCairo</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AF94D13A-36C1-45FF-9B0B-EB5D3FF6F43D}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>TestWebKitAPI</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebug.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebug.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebugWinCairo.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebugWinCairo.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebug.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\debugsuffix.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIDebug.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\debugsuffix.props" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIRelease.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIRelease.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIReleaseWinCairo.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIReleaseWinCairo.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIProduction.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Production|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="TestWebKitAPIProduction.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Production|x64'" />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Production|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ </ClCompile>
+ <Link />
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\config.h" />
+ <ClInclude Include="..\Test.h" />
+ <ClInclude Include="..\TestsController.h" />
+ <ClInclude Include="..\win\HostWindow.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\TestsController.cpp" />
+ <ClCompile Include="..\Tests\WebCore\LayoutUnit.cpp" />
+ <ClCompile Include="..\Tests\WebCore\win\BitmapImage.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WebKit\win\WebViewDestruction.cpp" />
+ <ClCompile Include="..\Tests\WTF\cf\RetainPtr.cpp" />
+ <ClCompile Include="..\Tests\WTF\cf\RetainPtrHashing.cpp" />
+ <ClCompile Include="..\Tests\WTF\CheckedArithmeticOperations.cpp" />
+ <ClCompile Include="..\Tests\WTF\Functional.cpp" />
+ <ClCompile Include="..\Tests\WTF\HashMap.cpp" />
+ <ClCompile Include="..\Tests\WTF\MD5.cpp" />
+ <ClCompile Include="..\Tests\WTF\MathExtras.cpp" />
+ <ClCompile Include="..\Tests\WTF\MediaTime.cpp" />
+ <ClCompile Include="..\Tests\WTF\SHA1.cpp" />
+ <ClCompile Include="..\Tests\WTF\SaturatedArithmeticOperations.cpp" />
+ <ClCompile Include="..\Tests\WTF\StringHasher.cpp" />
+ <ClCompile Include="..\Tests\WTF\StringOperators.cpp" />
+ <ClCompile Include="..\Tests\WTF\Vector.cpp" />
+ <ClCompile Include="..\Tests\WTF\VectorBasic.cpp" />
+ <ClCompile Include="..\Tests\WTF\VectorReverse.cpp" />
+ <ClCompile Include="..\win\HostWindow.cpp" />
+ <ClCompile Include="..\win\main.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="TestWebKitAPIPostBuild.cmd" />
+ <None Include="TestWebKitAPIPreBuild.cmd" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters
new file mode 100644
index 000000000..27cf75cb4
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Tests">
+ <UniqueIdentifier>{80b7e5c5-5c50-4363-ae7b-a0956e6a688d}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="win">
+ <UniqueIdentifier>{e0b41579-994a-4d5e-9c2a-2ec14cd0c606}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Tests\WTF">
+ <UniqueIdentifier>{87f2c8f6-8710-4785-a918-2aec42c9f1d3}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Tests\WebCore">
+ <UniqueIdentifier>{77db1e64-3c2d-4de3-adc1-860d4ea1c3c2}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Tests\WebKit">
+ <UniqueIdentifier>{f8236406-78aa-4c83-b393-b060b09405a3}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Tests\WTF\cf">
+ <UniqueIdentifier>{909ce22a-2223-4afa-af44-2d0153f13cc6}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\config.h" />
+ <ClInclude Include="..\Test.h" />
+ <ClInclude Include="..\TestsController.h" />
+ <ClInclude Include="..\win\HostWindow.h">
+ <Filter>win</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\TestsController.cpp" />
+ <ClCompile Include="..\win\HostWindow.cpp">
+ <Filter>win</Filter>
+ </ClCompile>
+ <ClCompile Include="..\win\main.cpp">
+ <Filter>win</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WebCore\win\BitmapImage.cpp">
+ <Filter>Tests\WebCore</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WebCore\LayoutUnit.cpp">
+ <Filter>Tests\WebCore</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WebKit\win\WebViewDestruction.cpp">
+ <Filter>Tests\WebKit</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\CheckedArithmeticOperations.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\Functional.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\HashMap.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\MD5.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\MathExtras.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\MediaTime.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\SHA1.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\SaturatedArithmeticOperations.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\StringHasher.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\StringOperators.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\Vector.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\VectorBasic.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\VectorReverse.cpp">
+ <Filter>Tests\WTF</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\cf\RetainPtr.cpp">
+ <Filter>Tests\WTF\cf</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Tests\WTF\cf\RetainPtrHashing.cpp">
+ <Filter>Tests\WTF\cf</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="TestWebKitAPIPostBuild.cmd" />
+ <None Include="TestWebKitAPIPreBuild.cmd" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props
new file mode 100644
index 000000000..07bdf91db
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets" />
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>CFNetwork$(DebugSuffix).lib;CoreFoundation$(DebugSuffix).lib;WebKit$(DebugSuffix).lib;WTF$(DebugSuffix).lib;JavaScriptCore$(DebugSuffix).lib;gtest$(DebugSuffix).lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\win;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\private;..\..\..\Source\ThirdParty\gtest\include;$(WebKit_Libraries)\include;$(WebKit_Libraries)\Include\private;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup />
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommonWinCairo.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommonWinCairo.props
new file mode 100644
index 000000000..5b75cd8ba
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommonWinCairo.props
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets" />
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <AdditionalDependencies>CFLite.lib;WebKit.lib;JavaScriptCore.lib;gtest.lib;WTF.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\win;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\private;..\..\..\Source\ThirdParty\gtest\include;$(WebKit_Libraries)\include;$(WebKit_Libraries)\Include\private;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup />
+</Project>
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebug.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebug.props
new file mode 100644
index 000000000..76cef1409
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebug.props
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\FeatureDefines.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\common.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\debug.props" />
+ <Import Project="TestWebKitAPICommon.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebugWinCairo.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebugWinCairo.props
new file mode 100644
index 000000000..ce507e69c
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebugWinCairo.props
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\FeatureDefinesCairo.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\common.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\debug.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\WinCairo.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\cURL.props" />
+ <Import Project="TestWebKitAPICommonWinCairo.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project>
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIPostBuild.cmd b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPostBuild.cmd
index 26707cac6..26707cac6 100644
--- a/Tools/TestWebKitAPI/win/TestWebKitAPIPostBuild.cmd
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPostBuild.cmd
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIPreBuild.cmd b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPreBuild.cmd
index a77077674..a77077674 100644
--- a/Tools/TestWebKitAPI/win/TestWebKitAPIPreBuild.cmd
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPreBuild.cmd
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIProduction.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIProduction.props
new file mode 100644
index 000000000..bac3a5bf2
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIProduction.props
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\FeatureDefines.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\common.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\production.props" />
+ <Import Project="TestWebKitAPICommon.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIRelease.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIRelease.props
new file mode 100644
index 000000000..a25ac6c9b
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIRelease.props
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\FeatureDefines.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\common.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\release.props" />
+ <Import Project="TestWebKitAPICommon.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIReleaseWinCairo.props b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIReleaseWinCairo.props
new file mode 100644
index 000000000..759c7fc3c
--- /dev/null
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIReleaseWinCairo.props
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\FeatureDefinesCairo.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\common.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\release.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\WinCairo.props" />
+ <Import Project="$(WebKit_Libraries)\tools\vsprops\cURL.props" />
+ <Import Project="TestWebKitAPICommonWinCairo.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup />
+ <ItemGroup />
+</Project>
diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
index 4c0925f17..2d1688b9b 100644
--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -7,22 +7,28 @@
objects = {
/* Begin PBXBuildFile section */
+ 00BC16871680FE810065F1E5 /* PublicSuffix.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00BC16851680FE810065F1E5 /* PublicSuffix.mm */; };
00CD9F6315BE312C002DA2CE /* BackForwardList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00CD9F6215BE312C002DA2CE /* BackForwardList.mm */; };
0BCD833514857CE400EA2003 /* HashMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD833414857CE400EA2003 /* HashMap.cpp */; };
0BCD856A1485C98B00EA2003 /* TemporaryChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */; };
0F17BBD615AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */; };
0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */; };
0FC6C4CF141034AD005B7F0C /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */; };
+ 14464013167A8305000BD218 /* LayoutUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14464012167A8305000BD218 /* LayoutUnit.cpp */; };
14F3B11315E45EAB00210069 /* SaturatedArithmeticOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */; };
1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02C84E125D4A8400E3F4BD /* Find.cpp */; };
1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */; };
+ 1A7BFC0C171A0BDB00BC5F64 /* WillSendSubmitEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A7BFC0A171A0BDB00BC5F64 /* WillSendSubmitEvent.mm */; };
1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C045F9461385C2F800C0F3CD /* 18-characters.html */; };
1AA9E55914980A9900001A8A /* Functional.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA9E55714980A9900001A8A /* Functional.cpp */; };
1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */; };
1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */; };
+ 1AE72F48173EB214006362F0 /* TerminateTwice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */; };
1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */; };
+ 1AEF994917A09F5400998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AEF994817A09F5300998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp */; };
261516D615B0E60500A2C201 /* SetAndUpdateCacheModel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 261516D515B0E60500A2C201 /* SetAndUpdateCacheModel.mm */; };
+ 26300B1816755CD90066886D /* ListHashSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26300B1716755CD90066886D /* ListHashSet.cpp */; };
265AF55015D1E48A00B0CB4A /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265AF54F15D1E48A00B0CB4A /* WTFString.cpp */; };
266FAFD315E5775200F61D5B /* IntegerToStringConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */; };
26A2C72F15E2E73C005B1A14 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A2C72E15E2E73C005B1A14 /* CString.cpp */; };
@@ -31,9 +37,21 @@
26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */; };
26F1B44415CA434F00D1E4BF /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F1B44215CA434F00D1E4BF /* AtomicString.cpp */; };
26F1B44515CA434F00D1E4BF /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F1B44315CA434F00D1E4BF /* StringImpl.cpp */; };
+ 290A9BB71735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 290A9BB51735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm */; };
+ 290A9BB91735F63800D71BBC /* OpenNewWindow.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 290A9BB81735F42300D71BBC /* OpenNewWindow.html */; };
+ 290F4275172A221C00939FF0 /* custom-protocol-sync-xhr.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */; };
+ 290F4278172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 290F4276172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm */; };
+ 290F427B172A23A500939FF0 /* TestProtocol.mm in Sources */ = {isa = PBXBuildFile; fileRef = 290F4279172A23A500939FF0 /* TestProtocol.mm */; };
2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2943BE84161DFEB800999E3D /* UserContentTest.mm */; };
+ 297234B4173AD04800983601 /* CustomProtocolsInvalidScheme.mm in Sources */ = {isa = PBXBuildFile; fileRef = 297234B2173AD04800983601 /* CustomProtocolsInvalidScheme.mm */; };
+ 297234B7173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 297234B5173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp */; };
29AB8AA1164C735800D49BEC /* CustomProtocolsTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AB8A9F164C735800D49BEC /* CustomProtocolsTest.mm */; };
29AB8AA4164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */; };
+ 2D640B5517875DFF00BFAF99 /* ScrollPinningBehaviors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */; };
+ 2DD7D3AA178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DD7D3A9178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp */; };
+ 2DD7D3AF178227B30026E1E3 /* lots-of-text-vertical-lr.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */; };
+ 2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */; };
+ 2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CE16C4D81100BA2BB1 /* mainMac.mm */; };
333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */; };
33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
@@ -43,6 +61,7 @@
33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */; };
37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37200B9113A16230007A4FAD /* VectorReverse.cpp */; };
3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */; };
+ 3751AF7C169518F800764319 /* DOMNodeFromJSObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */; };
3776BC63150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */; };
378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */; };
378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; };
@@ -53,10 +72,14 @@
37A6895F148A9B50005100FA /* SubresourceErrorCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */; };
37DC678D140D7C5000ABCCDB /* DOMRangeOfString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */; };
37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
+ 37E1064C1697681800B78BD0 /* DOMHTMLTableCellElementCellAbove.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */; };
+ 37E1064D16976C8500B78BD0 /* DOMHTMLTableCellCellAbove.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */; };
+ 37E38C34169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */; };
440A1D3914A0103A008A66F2 /* KURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 440A1D3814A0103A008A66F2 /* KURL.cpp */; };
+ 4BB4160216815B2600824238 /* JSWrapperForNodeInWebFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4160116815B2600824238 /* JSWrapperForNodeInWebFrame.mm */; };
+ 4BB4160416815F9100824238 /* ElementAtPointInWebFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BB4160316815F9100824238 /* ElementAtPointInWebFrame.mm */; };
4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */; };
4BFDFFA9131477770061F24B /* HitTestResultNodeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFDFFA8131477770061F24B /* HitTestResultNodeHandle.cpp */; };
- 4F4D2C0E1626FE2700320FE1 /* MemoryInstrumentationTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4D2C0D1626FE2700320FE1 /* MemoryInstrumentationTest.cpp */; };
51393E201523944A005F39C5 /* DOMWindowExtensionBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51393E1E1523944A005F39C5 /* DOMWindowExtensionBasic.cpp */; };
51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */; };
5142B2711517C88B00C32B19 /* ContextMenuCanCopyURL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */; };
@@ -77,11 +100,18 @@
76E182DA1547550100F1FADD /* WillSendSubmitEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76E182D91547550100F1FADD /* WillSendSubmitEvent.cpp */; };
76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */; };
76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 76E182DE15475A8300F1FADD /* auto-submitting-form.html */; };
+ 7C8DDAAB1735DEEE00EA5AC0 /* CloseThenTerminate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */; };
+ 7CFBCADF1743234F00B2BFCF /* WillLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */; };
+ 7CFBCAE51743238F00B2BFCF /* WillLoad_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */; };
81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81B50192140F232300D9EB58 /* StringBuilder.cpp */; };
+ 8A2C750E16CED9550024F352 /* ResizeWindowAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A2C750D16CED9550024F352 /* ResizeWindowAfterCrash.cpp */; };
+ 8A3AF93B16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */; };
+ 8AA28C1A16D2FA7B002FF4DB /* LoadPageOnCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */; };
930AD402150698D00067970F /* lots-of-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 930AD401150698B30067970F /* lots-of-text.html */; };
9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECA1506F035007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages.cpp */; };
9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9361002814DC957B0061379D /* lots-of-iframes.html */; };
939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */ = {isa = PBXBuildFile; fileRef = 939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */; };
+ 93ABA80916DDAB91002DB2FA /* StringHasher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ABA80816DDAB91002DB2FA /* StringHasher.cpp */; };
93AF4ECE1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */; };
93AF4ED01506F123007FD57E /* lots-of-images.html in Resources */ = {isa = PBXBuildFile; fileRef = 93AF4ECF1506F123007FD57E /* lots-of-images.html */; };
93AF4ED11506F130007FD57E /* lots-of-images.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 93AF4ECF1506F123007FD57E /* lots-of-images.html */; };
@@ -102,13 +132,14 @@
A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; };
A7A966DB140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */; };
B4039F9D15E6D8B3007255D6 /* MathExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */; };
+ B55AD1D2179F336C00AC1494 /* PreventImageLoadWithAutoResizing.mm in Sources */ = {isa = PBXBuildFile; fileRef = B55AD1D1179F336600AC1494 /* PreventImageLoadWithAutoResizing.mm */; };
+ B55AD1D5179F3B3000AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55AD1D3179F3ABF00AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp */; };
B55F11A01516834F00915916 /* AttributedString.mm in Sources */ = {isa = PBXBuildFile; fileRef = B55F119F1516834F00915916 /* AttributedString.mm */; };
B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = B55F11B01517A2C400915916 /* attributedStringCustomFont.html */; };
B55F11BE15191A0600915916 /* Ahem.ttf in Copy Resources */ = {isa = PBXBuildFile; fileRef = B55F11B9151916E600915916 /* Ahem.ttf */; };
BC029B181486AD6400817DA9 /* RetainPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC029B161486AD6400817DA9 /* RetainPtr.cpp */; };
BC029B1C1486B25900817DA9 /* RetainPtr.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC029B1B1486B25900817DA9 /* RetainPtr.mm */; };
BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
- BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; };
BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC131AA8117131FC00B69727 /* TestsController.cpp */; };
BC22D31514DC689800FFB1DD /* UserMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22D31314DC689800FFB1DD /* UserMessage.cpp */; };
BC22D31914DC68B900FFB1DD /* UserMessage_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22D31714DC68B800FFB1DD /* UserMessage_Bundle.cpp */; };
@@ -135,17 +166,14 @@
BC901E331492AF390074A667 /* WKConnection_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC901E311492AF390074A667 /* WKConnection_Bundle.cpp */; };
BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90955C125548AA00083756 /* PlatformWebViewMac.mm */; };
BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90964B125561BF00083756 /* VectorBasic.cpp */; };
- BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC90964D1255620C00083756 /* JavaScriptCore.framework */; };
BC90977A125571AB00083756 /* PageLoadBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC909779125571AB00083756 /* PageLoadBasic.cpp */; };
BC909784125571CF00083756 /* simple.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = BC909778125571AB00083756 /* simple.html */; };
BC90995E12567BC100083756 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90995D12567BC100083756 /* WKString.cpp */; };
BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9099931256ACF100083756 /* WKStringJSString.cpp */; };
- BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA61DB411700EFD00460D1E /* WebKit2.framework */; };
BCAA485614A0444C0088FAC4 /* simple-tall.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCAA485514A021640088FAC4 /* simple-tall.html */; };
BCAA485814A044D40088FAC4 /* EditorCommands.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAA485714A044D40088FAC4 /* EditorCommands.mm */; };
BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */; };
BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */; };
- BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB9E9F011235BDE00A137E0 /* Cocoa.framework */; };
BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */; };
BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */; };
@@ -153,13 +181,11 @@
C01363C813C3997300EF3964 /* StringOperators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01363C713C3997300EF3964 /* StringOperators.cpp */; };
C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C02B7882126615410026BF0F /* spacebar-scrolling.html */; };
C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; };
- C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C02B7853126613AE0026BF0F /* Carbon.framework */; };
C045F9451385C2EA00C0F3CD /* DownloadDecideDestinationCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C045F9441385C2E900C0F3CD /* DownloadDecideDestinationCrash.cpp */; };
C07E6CAF13FD67650038B22B /* DynamicDeviceScaleFactor.mm in Sources */ = {isa = PBXBuildFile; fileRef = C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */; };
C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C07E6CB113FD738A0038B22B /* devicePixelRatio.html */; };
C081224213FC172400DC39AE /* JavaScriptTestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C081224013FC172400DC39AE /* JavaScriptTestMac.mm */; };
C081224513FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */; };
- C081224913FC1B0300DC39AE /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C081224813FC1B0300DC39AE /* WebKit.framework */; };
C08587BF13FE956C001EF4E5 /* WebKitAgnosticTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */; };
C08587FC13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FB13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm */; };
C085880013FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */; };
@@ -171,18 +197,33 @@
C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; };
C0C5D3BE14598B6F00A802A6 /* GetBackingScaleFactor.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */; };
C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */; };
+ C2CF975A16CEC7140054E99D /* JSContextBackForwardCache2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C2CF975916CEC69E0054E99D /* JSContextBackForwardCache2.html */; };
+ C2CF975B16CEC71B0054E99D /* JSContextBackForwardCache1.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C2CF975816CEC69E0054E99D /* JSContextBackForwardCache1.html */; };
+ C2EB2DD316CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2EB2DD116CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm */; };
C507E8A714C6545B005D6B3B /* InspectorBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = C507E8A614C6545B005D6B3B /* InspectorBar.mm */; };
+ C5101C4F176B8D9200EE9B15 /* findRanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5101C4E176B8BB900EE9B15 /* findRanges.html */; };
+ C51AFB99169F49FF009CCF66 /* FindMatches.mm in Sources */ = {isa = PBXBuildFile; fileRef = C51AFB98169F49FF009CCF66 /* FindMatches.mm */; };
C540F776152E4DA000A40C8C /* SimplifyMarkup.mm in Sources */ = {isa = PBXBuildFile; fileRef = C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */; };
C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C540F783152E5A7800A40C8C /* verboseMarkup.html */; };
+ C54237F016B8955800E638FC /* PasteboardNotifications.mm in Sources */ = {isa = PBXBuildFile; fileRef = C54237EE16B8955800E638FC /* PasteboardNotifications.mm */; };
+ C54237F116B8957D00E638FC /* PasteboardNotifications_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */; };
+ C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5E1AFFD16B22179006CC1F2 /* execCopy.html */; };
+ CD5393C81757BA9700C07123 /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393C71757BA9700C07123 /* MD5.cpp */; };
+ CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5393C91757BAC400C07123 /* SHA1.cpp */; };
CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497B315857F0C00B5BC30 /* MediaTime.cpp */; };
E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */; };
E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; };
+ E194E1BB177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */; };
+ E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */; };
E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; };
- F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; };
+ E4A757D4178AF1B100B5D7A4 /* Deque.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A757D3178AEA5B00B5D7A4 /* Deque.cpp */; };
F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */; };
F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0F15A5F624003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp */; };
F660AA1315A619C9003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA1215A619C8003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp */; };
F660AA1515A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA1415A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp */; };
+ F6B7BE9417469209008A3445 /* DidAssociateFormControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6B7BE93174691EF008A3445 /* DidAssociateFormControls.cpp */; };
+ F6B7BE9517469212008A3445 /* DidAssociateFormControls_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6B7BE92174691EF008A3445 /* DidAssociateFormControls_Bundle.cpp */; };
+ F6B7BE9717469B96008A3445 /* associate-form-controls.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F6B7BE9617469B7E008A3445 /* associate-form-controls.html */; };
F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */; };
F6F49C6915545C8E0007F39D /* DOMWindowExtensionNoCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */; };
F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */; };
@@ -217,38 +258,48 @@
dstPath = TestWebKitAPI.resources;
dstSubfolderSpec = 7;
files = (
- 52B8CF9815868D9100281053 /* SetDocumentURI.html in Copy Resources */,
+ 290A9BB91735F63800D71BBC /* OpenNewWindow.html in Copy Resources */,
+ 290F4275172A221C00939FF0 /* custom-protocol-sync-xhr.html in Copy Resources */,
+ C2CF975B16CEC71B0054E99D /* JSContextBackForwardCache1.html in Copy Resources */,
+ C2CF975A16CEC7140054E99D /* JSContextBackForwardCache2.html in Copy Resources */,
+ 1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
+ F6B7BE9717469B96008A3445 /* associate-form-controls.html in Copy Resources */,
+ 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */,
B55F11BE15191A0600915916 /* Ahem.ttf in Copy Resources */,
B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */,
76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */,
26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */,
5142B2731517C8C800C32B19 /* ContextMenuCanCopyURL.html in Copy Resources */,
+ C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */,
+ 37E1064C1697681800B78BD0 /* DOMHTMLTableCellElementCellAbove.html in Copy Resources */,
+ 37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */,
+ C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */,
+ BC2D006412AA04CE00E732A3 /* file-with-anchor.html in Copy Resources */,
+ C5101C4F176B8D9200EE9B15 /* findRanges.html in Copy Resources */,
+ 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */,
9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */,
9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */,
- E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */,
- 517E7E04151119C100D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html in Copy Resources */,
- A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */,
- 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */,
- 33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
- 1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
- C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */,
+ BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */,
378E64791632707400B6C676 /* link-with-title.html in Copy Resources */,
9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */,
93AF4ED11506F130007FD57E /* lots-of-images.html in Copy Resources */,
930AD402150698D00067970F /* lots-of-text.html in Copy Resources */,
+ 2DD7D3AF178227B30026E1E3 /* lots-of-text-vertical-lr.html in Copy Resources */,
+ E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */,
+ 517E7E04151119C100D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html in Copy Resources */,
33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */,
A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */,
F6FDDDD614241C6F004F1729 /* push-state.html in Copy Resources */,
- BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */,
- 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */,
- BC909784125571CF00083756 /* simple.html in Copy Resources */,
+ 52B8CF9815868D9100281053 /* SetDocumentURI.html in Copy Resources */,
+ 1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */,
C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */,
+ 33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
BCAA485614A0444C0088FAC4 /* simple-tall.html in Copy Resources */,
+ BC909784125571CF00083756 /* simple.html in Copy Resources */,
C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */,
- BC2D006412AA04CE00E732A3 /* file-with-anchor.html in Copy Resources */,
- 37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */,
- 1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */,
+ E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */,
C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */,
+ A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */,
);
name = "Copy Resources";
runOnlyForDeploymentPostprocessing = 0;
@@ -256,21 +307,27 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 00BC16851680FE810065F1E5 /* PublicSuffix.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PublicSuffix.mm; sourceTree = "<group>"; };
00CD9F6215BE312C002DA2CE /* BackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackForwardList.mm; sourceTree = "<group>"; };
0BCD833414857CE400EA2003 /* HashMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HashMap.cpp; path = WTF/HashMap.cpp; sourceTree = "<group>"; };
0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemporaryChange.cpp; path = WTF/TemporaryChange.cpp; sourceTree = "<group>"; };
0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreStatisticsWithNoWebProcess.cpp; sourceTree = "<group>"; };
0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RedBlackTree.cpp; path = WTF/RedBlackTree.cpp; sourceTree = "<group>"; };
0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MetaAllocator.cpp; path = WTF/MetaAllocator.cpp; sourceTree = "<group>"; };
+ 14464012167A8305000BD218 /* LayoutUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnit.cpp; sourceTree = "<group>"; };
14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SaturatedArithmeticOperations.cpp; path = WTF/SaturatedArithmeticOperations.cpp; sourceTree = "<group>"; };
1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; };
1A02C84E125D4A8400E3F4BD /* Find.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Find.cpp; sourceTree = "<group>"; };
1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJavaScript.cpp; sourceTree = "<group>"; };
+ 1A7BFC0A171A0BDB00BC5F64 /* WillSendSubmitEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WillSendSubmitEvent.mm; sourceTree = "<group>"; };
1AA9E55714980A9900001A8A /* Functional.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Functional.cpp; path = WTF/Functional.cpp; sourceTree = "<group>"; };
1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ForceRepaint.cpp; sourceTree = "<group>"; };
1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "simple-accelerated-compositing.html"; sourceTree = "<group>"; };
+ 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TerminateTwice.cpp; sourceTree = "<group>"; };
1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundleControllerMac.mm; sourceTree = "<group>"; };
+ 1AEF994817A09F5300998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetPIDAfterAbortedProcessLaunch.cpp; sourceTree = "<group>"; };
261516D515B0E60500A2C201 /* SetAndUpdateCacheModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SetAndUpdateCacheModel.mm; sourceTree = "<group>"; };
+ 26300B1716755CD90066886D /* ListHashSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ListHashSet.cpp; path = WTF/ListHashSet.cpp; sourceTree = "<group>"; };
265AF54F15D1E48A00B0CB4A /* WTFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WTFString.cpp; path = WTF/WTFString.cpp; sourceTree = "<group>"; };
266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IntegerToStringConversion.cpp; path = WTF/IntegerToStringConversion.cpp; sourceTree = "<group>"; };
26A2C72E15E2E73C005B1A14 /* CString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CString.cpp; path = WTF/CString.cpp; sourceTree = "<group>"; };
@@ -279,10 +336,23 @@
26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = CancelLoadFromResourceLoadDelegate.html; sourceTree = "<group>"; };
26F1B44215CA434F00D1E4BF /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = WTF/AtomicString.cpp; sourceTree = "<group>"; };
26F1B44315CA434F00D1E4BF /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImpl.cpp; path = WTF/StringImpl.cpp; sourceTree = "<group>"; };
+ 290A9BB51735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CloseNewWindowInNavigationPolicyDelegate.mm; sourceTree = "<group>"; };
+ 290A9BB81735F42300D71BBC /* OpenNewWindow.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = OpenNewWindow.html; sourceTree = "<group>"; };
+ 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "custom-protocol-sync-xhr.html"; sourceTree = "<group>"; };
+ 290F4276172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CustomProtocolsSyncXHRTest.mm; sourceTree = "<group>"; };
+ 290F4279172A23A500939FF0 /* TestProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestProtocol.mm; sourceTree = "<group>"; };
+ 290F427A172A23A500939FF0 /* TestProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestProtocol.h; sourceTree = "<group>"; };
2943BE84161DFEB800999E3D /* UserContentTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UserContentTest.mm; path = WebKit2ObjC/UserContentTest.mm; sourceTree = "<group>"; };
+ 297234B2173AD04800983601 /* CustomProtocolsInvalidScheme.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CustomProtocolsInvalidScheme.mm; path = WebKit2ObjC/CustomProtocolsInvalidScheme.mm; sourceTree = "<group>"; };
+ 297234B5173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomProtocolsInvalidScheme_Bundle.cpp; path = WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp; sourceTree = "<group>"; };
29AB8A9F164C735800D49BEC /* CustomProtocolsTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CustomProtocolsTest.mm; path = WebKit2ObjC/CustomProtocolsTest.mm; sourceTree = "<group>"; };
29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestBrowsingContextLoadDelegate.mm; sourceTree = "<group>"; };
29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestBrowsingContextLoadDelegate.h; sourceTree = "<group>"; };
+ 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollPinningBehaviors.cpp; sourceTree = "<group>"; };
+ 2DD7D3A9178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResizeReversePaginatedWebView.cpp; sourceTree = "<group>"; };
+ 2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "lots-of-text-vertical-lr.html"; sourceTree = "<group>"; };
+ 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mainIOS.mm; sourceTree = "<group>"; };
+ 2E7765CE16C4D81100BA2BB1 /* mainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mainMac.mm; sourceTree = "<group>"; };
333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = "<group>"; };
33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = "<group>"; };
@@ -292,6 +362,7 @@
33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "mouse-move-listener.html"; sourceTree = "<group>"; };
37200B9113A16230007A4FAD /* VectorReverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorReverse.cpp; path = WTF/VectorReverse.cpp; sourceTree = "<group>"; };
3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMRange.mm; sourceTree = "<group>"; };
+ 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMNodeFromJSObject.mm; sourceTree = "<group>"; };
3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorInDashboardRegions.mm; sourceTree = "<group>"; };
378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest.cpp; sourceTree = "<group>"; };
378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest_Bundle.cpp; sourceTree = "<group>"; };
@@ -302,11 +373,15 @@
37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = "<group>"; };
37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRangeOfString.mm; sourceTree = "<group>"; };
37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DOMRangeOfString.html; sourceTree = "<group>"; };
+ 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLTableCellCellAbove.mm; sourceTree = "<group>"; };
+ 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DOMHTMLTableCellElementCellAbove.html; sourceTree = "<group>"; };
+ 37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewDidRemoveFrameFromHierarchy.mm; sourceTree = "<group>"; };
440A1D3814A0103A008A66F2 /* KURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KURL.cpp; sourceTree = "<group>"; };
44A622C114A0E2B60048515B /* WTFStringUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFStringUtilities.h; sourceTree = "<group>"; };
+ 4BB4160116815B2600824238 /* JSWrapperForNodeInWebFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSWrapperForNodeInWebFrame.mm; sourceTree = "<group>"; };
+ 4BB4160316815F9100824238 /* ElementAtPointInWebFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ElementAtPointInWebFrame.mm; sourceTree = "<group>"; };
4BFDFFA61314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResultNodeHandle_Bundle.cpp; sourceTree = "<group>"; };
4BFDFFA8131477770061F24B /* HitTestResultNodeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResultNodeHandle.cpp; sourceTree = "<group>"; };
- 4F4D2C0D1626FE2700320FE1 /* MemoryInstrumentationTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryInstrumentationTest.cpp; path = WTF/MemoryInstrumentationTest.cpp; sourceTree = "<group>"; };
51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionBasic_Bundle.cpp; sourceTree = "<group>"; };
51393E1E1523944A005F39C5 /* DOMWindowExtensionBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionBasic.cpp; sourceTree = "<group>"; };
5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuCanCopyURL.mm; sourceTree = "<group>"; };
@@ -327,11 +402,18 @@
76E182D91547550100F1FADD /* WillSendSubmitEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillSendSubmitEvent.cpp; sourceTree = "<group>"; };
76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillSendSubmitEvent_Bundle.cpp; sourceTree = "<group>"; };
76E182DE15475A8300F1FADD /* auto-submitting-form.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "auto-submitting-form.html"; sourceTree = "<group>"; };
+ 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CloseThenTerminate.cpp; sourceTree = "<group>"; };
+ 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad.cpp; sourceTree = "<group>"; };
+ 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad_Bundle.cpp; sourceTree = "<group>"; };
81B50192140F232300D9EB58 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringBuilder.cpp; path = WTF/StringBuilder.cpp; sourceTree = "<group>"; };
+ 8A2C750D16CED9550024F352 /* ResizeWindowAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResizeWindowAfterCrash.cpp; sourceTree = "<group>"; };
+ 8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReloadPageAfterCrash.cpp; sourceTree = "<group>"; };
+ 8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadPageOnCrash.cpp; sourceTree = "<group>"; };
8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
930AD401150698B30067970F /* lots-of-text.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-text.html"; sourceTree = "<group>"; };
9361002814DC957B0061379D /* lots-of-iframes.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-iframes.html"; sourceTree = "<group>"; };
939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorOnBack.mm; sourceTree = "<group>"; };
+ 93ABA80816DDAB91002DB2FA /* StringHasher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringHasher.cpp; path = WTF/StringHasher.cpp; sourceTree = "<group>"; };
93AF4ECA1506F035007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutForImages.cpp; sourceTree = "<group>"; };
93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp; sourceTree = "<group>"; };
93AF4ECF1506F123007FD57E /* lots-of-images.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-images.html"; sourceTree = "<group>"; };
@@ -352,6 +434,8 @@
A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowlessWebViewWithMedia.mm; sourceTree = "<group>"; };
A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckedArithmeticOperations.cpp; path = WTF/CheckedArithmeticOperations.cpp; sourceTree = "<group>"; };
B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MathExtras.cpp; path = WTF/MathExtras.cpp; sourceTree = "<group>"; };
+ B55AD1D1179F336600AC1494 /* PreventImageLoadWithAutoResizing.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = PreventImageLoadWithAutoResizing.mm; path = WebKit2ObjC/PreventImageLoadWithAutoResizing.mm; sourceTree = "<group>"; };
+ B55AD1D3179F3ABF00AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PreventImageLoadWithAutoResizing_Bundle.cpp; path = WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp; sourceTree = "<group>"; };
B55F119F1516834F00915916 /* AttributedString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AttributedString.mm; sourceTree = "<group>"; };
B55F11B01517A2C400915916 /* attributedStringCustomFont.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = attributedStringCustomFont.html; sourceTree = "<group>"; };
B55F11B9151916E600915916 /* Ahem.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Ahem.ttf; sourceTree = "<group>"; };
@@ -359,7 +443,6 @@
BC029B1B1486B25900817DA9 /* RetainPtr.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RetainPtr.mm; path = WTF/ns/RetainPtr.mm; sourceTree = "<group>"; };
BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; };
BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUtilitiesMac.mm; sourceTree = "<group>"; };
- BC131A9A1171316900B69727 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
BC131A9E1171317C00B69727 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
BC131AA8117131FC00B69727 /* TestsController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = TestsController.cpp; sourceTree = "<group>"; };
BC22D31314DC689800FFB1DD /* UserMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessage.cpp; sourceTree = "<group>"; };
@@ -434,18 +517,34 @@
C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; };
C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor.mm; sourceTree = "<group>"; };
C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor_Bundle.mm; sourceTree = "<group>"; };
+ C2CF975816CEC69E0054E99D /* JSContextBackForwardCache1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JSContextBackForwardCache1.html; sourceTree = "<group>"; };
+ C2CF975916CEC69E0054E99D /* JSContextBackForwardCache2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JSContextBackForwardCache2.html; sourceTree = "<group>"; };
+ C2EB2DD116CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewDidCreateJavaScriptContext.mm; sourceTree = "<group>"; };
C507E8A614C6545B005D6B3B /* InspectorBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorBar.mm; sourceTree = "<group>"; };
+ C5101C4E176B8BB900EE9B15 /* findRanges.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = findRanges.html; sourceTree = "<group>"; };
+ C51AFB98169F49FF009CCF66 /* FindMatches.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindMatches.mm; sourceTree = "<group>"; };
C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimplifyMarkup.mm; sourceTree = "<group>"; };
C540F783152E5A7800A40C8C /* verboseMarkup.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = verboseMarkup.html; sourceTree = "<group>"; };
+ C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PasteboardNotifications_Bundle.cpp; sourceTree = "<group>"; };
+ C54237EE16B8955800E638FC /* PasteboardNotifications.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardNotifications.mm; sourceTree = "<group>"; };
+ C5E1AFFD16B22179006CC1F2 /* execCopy.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = execCopy.html; sourceTree = "<group>"; };
+ CD5393C71757BA9700C07123 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MD5.cpp; path = WTF/MD5.cpp; sourceTree = "<group>"; };
+ CD5393C91757BAC400C07123 /* SHA1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SHA1.cpp; path = WTF/SHA1.cpp; sourceTree = "<group>"; };
CD5497B315857F0C00B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTime.cpp; path = WTF/MediaTime.cpp; sourceTree = "<group>"; };
E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheDisableWithinResourceLoadDelegate.mm; sourceTree = "<group>"; };
E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCacheDisableWithinResourceLoadDelegate.html; sourceTree = "<group>"; };
+ E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StopLoadingFromDidReceiveResponse.mm; sourceTree = "<group>"; };
+ E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = StopLoadingFromDidReceiveResponse.html; sourceTree = "<group>"; };
E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TypingStyleCrash.mm; sourceTree = "<group>"; };
+ E4A757D3178AEA5B00B5D7A4 /* Deque.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Deque.cpp; path = WTF/Deque.cpp; sourceTree = "<group>"; };
F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetInjectedBundleInitializationUserDataCallback.cpp; sourceTree = "<group>"; };
F660AA0F15A5F624003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetInjectedBundleInitializationUserDataCallback_Bundle.cpp; sourceTree = "<group>"; };
F660AA1215A619C8003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleInitializationUserDataCallbackWins.cpp; sourceTree = "<group>"; };
F660AA1415A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp; sourceTree = "<group>"; };
+ F6B7BE92174691EF008A3445 /* DidAssociateFormControls_Bundle.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DidAssociateFormControls_Bundle.cpp; sourceTree = "<group>"; };
+ F6B7BE93174691EF008A3445 /* DidAssociateFormControls.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DidAssociateFormControls.cpp; sourceTree = "<group>"; };
+ F6B7BE9617469B7E008A3445 /* associate-form-controls.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "associate-form-controls.html"; sourceTree = "<group>"; };
F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieManager.cpp; sourceTree = "<group>"; };
F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionNoCache_Bundle.cpp; sourceTree = "<group>"; };
F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtensionNoCache.cpp; sourceTree = "<group>"; };
@@ -459,12 +558,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */,
- C081224913FC1B0300DC39AE /* WebKit.framework in Frameworks */,
- BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */,
- BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */,
- C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */,
- F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -473,8 +566,8 @@
buildActionMask = 2147483647;
files = (
BC575A90126E74D3006F0F12 /* Cocoa.framework in Frameworks */,
- BC575A91126E74D3006F0F12 /* WebKit2.framework in Frameworks */,
BC575A92126E74D3006F0F12 /* JavaScriptCore.framework in Frameworks */,
+ BC575A91126E74D3006F0F12 /* WebKit2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -496,11 +589,12 @@
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
- BCA61C3A11700B9400460D1E /* mac */,
BC575944126E733C006F0F12 /* InjectedBundle */,
+ 2E9660DC16C07D7B00371B42 /* ios */,
+ BCA61C3A11700B9400460D1E /* mac */,
+ BC131A9E1171317C00B69727 /* config.h */,
C0ADBE7A12FCA4D000D2C129 /* JavaScriptTest.cpp */,
C0ADBE7B12FCA4D000D2C129 /* JavaScriptTest.h */,
- BC131A9E1171317C00B69727 /* config.h */,
BC575BBF126F5752006F0F12 /* PlatformUtilities.cpp */,
BC131883117114A800B69727 /* PlatformUtilities.h */,
BC90951B125533D700083756 /* PlatformWebView.h */,
@@ -515,12 +609,12 @@
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
- F3FC3EE213678B7300126A65 /* libgtest.a */,
+ C02B7853126613AE0026BF0F /* Carbon.framework */,
BCB9E9F011235BDE00A137E0 /* Cocoa.framework */,
BC90964D1255620C00083756 /* JavaScriptCore.framework */,
+ F3FC3EE213678B7300126A65 /* libgtest.a */,
C081224813FC1B0300DC39AE /* WebKit.framework */,
BCA61DB411700EFD00460D1E /* WebKit2.framework */,
- C02B7853126613AE0026BF0F /* Carbon.framework */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
@@ -534,10 +628,19 @@
name = Products;
sourceTree = "<group>";
};
+ 2E9660DC16C07D7B00371B42 /* ios */ = {
+ isa = PBXGroup;
+ children = (
+ 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */,
+ );
+ path = ios;
+ sourceTree = "<group>";
+ };
440A1D3614A01000008A66F2 /* WebCore */ = {
isa = PBXGroup;
children = (
440A1D3814A0103A008A66F2 /* KURL.cpp */,
+ 14464012167A8305000BD218 /* LayoutUnit.cpp */,
);
path = WebCore;
sourceTree = "<group>";
@@ -553,7 +656,12 @@
BC3C4C6F14575B1D0025FB62 /* WebKit2 Objective-C */ = {
isa = PBXGroup;
children = (
+ B55AD1D3179F3ABF00AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp */,
+ B55AD1D1179F336600AC1494 /* PreventImageLoadWithAutoResizing.mm */,
+ 297234B2173AD04800983601 /* CustomProtocolsInvalidScheme.mm */,
+ 297234B5173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp */,
29AB8A9F164C735800D49BEC /* CustomProtocolsTest.mm */,
+ 290F4276172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm */,
2943BE84161DFEB800999E3D /* UserContentTest.mm */,
BC3C4C7D14587AA60025FB62 /* WKBrowsingContextGroupTest.mm */,
BC3C4C7014575B6A0025FB62 /* WKBrowsingContextLoadDelegateTest.mm */,
@@ -565,10 +673,10 @@
isa = PBXGroup;
children = (
BC575981126E74AF006F0F12 /* InjectedBundle-Info.plist */,
+ BC575AA0126E7657006F0F12 /* InjectedBundleController.cpp */,
+ BC575A9F126E7657006F0F12 /* InjectedBundleController.h */,
BC575946126E7351006F0F12 /* InjectedBundleMain.cpp */,
BC575A9E126E75FB006F0F12 /* InjectedBundleTest.h */,
- BC575A9F126E7657006F0F12 /* InjectedBundleController.h */,
- BC575AA0126E7657006F0F12 /* InjectedBundleController.cpp */,
);
name = InjectedBundle;
sourceTree = "<group>";
@@ -590,19 +698,23 @@
C0C5D3BB14598B6F00A802A6 /* mac */,
BC90977B125571AE00083756 /* Resources */,
BC246D8C132F115A00B56D7C /* AboutBlankLoad.cpp */,
+ 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */,
BC246D98132F1FE100B56D7C /* CanHandleRequest.cpp */,
BC246D97132F1FE100B56D7C /* CanHandleRequest_Bundle.cpp */,
F6F3F29013342FEB00A6BF19 /* CookieManager.cpp */,
+ F6B7BE93174691EF008A3445 /* DidAssociateFormControls.cpp */,
+ F6B7BE92174691EF008A3445 /* DidAssociateFormControls_Bundle.cpp */,
+ BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */,
+ BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */,
51393E1E1523944A005F39C5 /* DOMWindowExtensionBasic.cpp */,
51393E1D1523944A005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp */,
F6F49C6715545C8D0007F39D /* DOMWindowExtensionNoCache.cpp */,
F6F49C6615545C8D0007F39D /* DOMWindowExtensionNoCache_Bundle.cpp */,
- BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */,
- BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */,
C045F9441385C2E900C0F3CD /* DownloadDecideDestinationCrash.cpp */,
1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */,
BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
1A02C84E125D4A8400E3F4BD /* Find.cpp */,
+ C51AFB98169F49FF009CCF66 /* FindMatches.mm */,
1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */,
BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */,
BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */,
@@ -619,6 +731,7 @@
52CB47401448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp */,
33DC8910141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp */,
33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */,
+ 8AA28C1916D2FA7B002FF4DB /* LoadPageOnCrash.cpp */,
33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */,
33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */,
93F1DB3014DA20760024C362 /* NewFirstVisuallyNonEmptyLayout.cpp */,
@@ -634,18 +747,28 @@
A51B650816ADF9B1007AA5D9 /* PageVisibilityState.cpp */,
52E5CE4514D21E9D003B2BD8 /* ParentFrame.cpp */,
52E5CE4814D21EAB003B2BD8 /* ParentFrame_Bundle.cpp */,
+ C54237EE16B8955800E638FC /* PasteboardNotifications.mm */,
+ C54237ED16B8955800E638FC /* PasteboardNotifications_Bundle.cpp */,
333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */,
F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */,
+ 8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */,
+ 2DD7D3A9178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp */,
+ 8A2C750D16CED9550024F352 /* ResizeWindowAfterCrash.cpp */,
C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */,
C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */,
C0ADBE8212FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp */,
+ 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */,
51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */,
51FCF7971534AC6D00104491 /* ShouldGoToBackForwardListItem_Bundle.cpp */,
C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */,
+ 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */,
BC22D31314DC689800FFB1DD /* UserMessage.cpp */,
BC22D31714DC68B800FFB1DD /* UserMessage_Bundle.cpp */,
520BCF4B141EB09E00937EA8 /* WebArchive.cpp */,
520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */,
+ 0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */,
+ 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */,
+ 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */,
76E182D91547550100F1FADD /* WillSendSubmitEvent.cpp */,
76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */,
BC901E221492ADCE0074A667 /* WKConnection.cpp */,
@@ -654,7 +777,6 @@
BC7B619A1299FE9E00D174A4 /* WKPreferences.cpp */,
BC90995D12567BC100083756 /* WKString.cpp */,
BC9099931256ACF100083756 /* WKStringJSString.cpp */,
- 0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */,
);
path = WebKit2;
sourceTree = "<group>";
@@ -662,22 +784,26 @@
BC9096461255618900083756 /* WTF */ = {
isa = PBXGroup;
children = (
- BC029B1A1486B23800817DA9 /* ns */,
C0991C4F143C7D68007998F2 /* cf */,
+ BC029B1A1486B23800817DA9 /* ns */,
26F1B44215CA434F00D1E4BF /* AtomicString.cpp */,
- 26A2C72E15E2E73C005B1A14 /* CString.cpp */,
- CD5497B315857F0C00B5BC30 /* MediaTime.cpp */,
- 4F4D2C0D1626FE2700320FE1 /* MemoryInstrumentationTest.cpp */,
- 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */,
- 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */,
A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */,
+ 26A2C72E15E2E73C005B1A14 /* CString.cpp */,
+ E4A757D3178AEA5B00B5D7A4 /* Deque.cpp */,
1AA9E55714980A9900001A8A /* Functional.cpp */,
0BCD833414857CE400EA2003 /* HashMap.cpp */,
26B2DFF815BDE599004F691D /* HashSet.cpp */,
+ 266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */,
+ 26300B1716755CD90066886D /* ListHashSet.cpp */,
+ CD5393C71757BA9700C07123 /* MD5.cpp */,
B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */,
+ CD5497B315857F0C00B5BC30 /* MediaTime.cpp */,
+ 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */,
+ 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */,
+ CD5393C91757BAC400C07123 /* SHA1.cpp */,
14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */,
- 266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */,
81B50192140F232300D9EB58 /* StringBuilder.cpp */,
+ 93ABA80816DDAB91002DB2FA /* StringHasher.cpp */,
26F1B44315CA434F00D1E4BF /* StringImpl.cpp */,
C01363C713C3997300EF3964 /* StringOperators.cpp */,
0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */,
@@ -693,14 +819,19 @@
isa = PBXGroup;
children = (
C045F9461385C2F800C0F3CD /* 18-characters.html */,
+ F6B7BE9617469B7E008A3445 /* associate-form-controls.html */,
76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
+ 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */,
+ C5E1AFFD16B22179006CC1F2 /* execCopy.html */,
BC2D004A12A9FEB300E732A3 /* file-with-anchor.html */,
1A02C84B125D4A5E00E3F4BD /* find.html */,
+ C5101C4E176B8BB900EE9B15 /* findRanges.html */,
BCBD372E125ABBE600D2C29F /* icon.png */,
378E647816326FDF00B6C676 /* link-with-title.html */,
9361002814DC957B0061379D /* lots-of-iframes.html */,
93AF4ECF1506F123007FD57E /* lots-of-images.html */,
930AD401150698B30067970F /* lots-of-text.html */,
+ 2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */,
33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */,
F6FDDDD514241C48004F1729 /* push-state.html */,
1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */,
@@ -720,13 +851,15 @@
C08587FE13FEC3A6001EF4E5 /* InstanceMethodSwizzler.h */,
C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */,
C081224013FC172400DC39AE /* JavaScriptTestMac.mm */,
- BC131A9A1171316900B69727 /* main.mm */,
+ 2E7765CE16C4D81100BA2BB1 /* mainMac.mm */,
BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */,
BC90955C125548AA00083756 /* PlatformWebViewMac.mm */,
C081224313FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.h */,
C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */,
29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */,
29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */,
+ 290F427A172A23A500939FF0 /* TestProtocol.h */,
+ 290F4279172A23A500939FF0 /* TestProtocol.mm */,
C08587BE13FE956C001EF4E5 /* WebKitAgnosticTest.h */,
C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */,
);
@@ -737,8 +870,8 @@
isa = PBXGroup;
children = (
FE217ECB1640A54A0052988B /* JavaScriptCore */,
- C08587F913FEC39B001EF4E5 /* TestWebKitAPI */,
C07E6CAD13FD67650038B22B /* mac */,
+ C08587F913FEC39B001EF4E5 /* TestWebKitAPI */,
440A1D3614A01000008A66F2 /* WebCore */,
BC9096411255616000083756 /* WebKit2 */,
BC3C4C6F14575B1D0025FB62 /* WebKit2 Objective-C */,
@@ -753,18 +886,25 @@
C07E6CB013FD737C0038B22B /* Resources */,
379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */,
B55F119F1516834F00915916 /* AttributedString.mm */,
+ 00CD9F6215BE312C002DA2CE /* BackForwardList.mm */,
26DF5A5D15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm */,
+ 290A9BB51735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm */,
5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */,
- 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */,
- C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */,
3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */,
939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */,
+ 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */,
+ 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */,
+ 37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */,
+ C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */,
+ 4BB4160316815F9100824238 /* ElementAtPointInWebFrame.mm */,
9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */,
9B26FC6B159D061000CC3765 /* HTMLFormCollectionNamedItem.mm */,
C507E8A614C6545B005D6B3B /* InspectorBar.mm */,
+ 4BB4160116815B2600824238 /* JSWrapperForNodeInWebFrame.mm */,
E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */,
517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */,
A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */,
+ 00BC16851680FE810065F1E5 /* PublicSuffix.mm */,
3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */,
261516D515B0E60500A2C201 /* SetAndUpdateCacheModel.mm */,
52B8CF9515868CF000281053 /* SetDocumentURI.mm */,
@@ -773,8 +913,11 @@
37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */,
E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */,
51FBBB4C1513D4E900822738 /* WebViewCanPasteURL.mm */,
+ C2EB2DD116CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm */,
+ 37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */,
+ 1A7BFC0A171A0BDB00BC5F64 /* WillSendSubmitEvent.mm */,
A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */,
- 00CD9F6215BE312C002DA2CE /* BackForwardList.mm */,
+ E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */,
);
path = mac;
sourceTree = "<group>";
@@ -782,19 +925,24 @@
C07E6CB013FD737C0038B22B /* Resources */ = {
isa = PBXGroup;
children = (
- 52B8CF9415868CF000281053 /* SetDocumentURI.html */,
+ C2CF975816CEC69E0054E99D /* JSContextBackForwardCache1.html */,
+ C2CF975916CEC69E0054E99D /* JSContextBackForwardCache2.html */,
+ 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */,
B55F11B9151916E600915916 /* Ahem.ttf */,
B55F11B01517A2C400915916 /* attributedStringCustomFont.html */,
- 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */,
26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */,
5142B2721517C89100C32B19 /* ContextMenuCanCopyURL.html */,
+ C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
+ 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */,
37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */,
9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */,
9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */,
E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */,
517E7E031511187500D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.html */,
- C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
+ 290A9BB81735F42300D71BBC /* OpenNewWindow.html */,
A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */,
+ 52B8CF9415868CF000281053 /* SetDocumentURI.html */,
+ E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */,
C540F783152E5A7800A40C8C /* verboseMarkup.html */,
A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */,
);
@@ -820,8 +968,8 @@
C0991C4F143C7D68007998F2 /* cf */ = {
isa = PBXGroup;
children = (
- C0991C50143C7D68007998F2 /* RetainPtrHashing.cpp */,
BC029B161486AD6400817DA9 /* RetainPtr.cpp */,
+ C0991C50143C7D68007998F2 /* RetainPtrHashing.cpp */,
);
name = cf;
path = WTF/cf;
@@ -830,9 +978,10 @@
C0C5D3BB14598B6F00A802A6 /* mac */ = {
isa = PBXGroup;
children = (
+ BCAA485714A044D40088FAC4 /* EditorCommands.mm */,
C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */,
C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */,
- BCAA485714A044D40088FAC4 /* EditorCommands.mm */,
+ 1AEF994817A09F5300998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp */,
);
path = mac;
sourceTree = "<group>";
@@ -890,6 +1039,8 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ };
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "TestWebKitAPI" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -927,40 +1078,51 @@
buildActionMask = 2147483647;
files = (
BC246D8E132F115A00B56D7C /* AboutBlankLoad.cpp in Sources */,
+ 297234B4173AD04800983601 /* CustomProtocolsInvalidScheme.mm in Sources */,
379028B614FABD92007E6B43 /* AcceptsFirstMouse.mm in Sources */,
26F1B44415CA434F00D1E4BF /* AtomicString.cpp in Sources */,
B55F11A01516834F00915916 /* AttributedString.mm in Sources */,
00CD9F6315BE312C002DA2CE /* BackForwardList.mm in Sources */,
+ 1AE72F48173EB214006362F0 /* TerminateTwice.cpp in Sources */,
26DF5A5E15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm in Sources */,
BC246D9A132F1FE100B56D7C /* CanHandleRequest.cpp in Sources */,
A7A966DB140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp in Sources */,
5142B2711517C88B00C32B19 /* ContextMenuCanCopyURL.mm in Sources */,
F6F3F29113342FEB00A6BF19 /* CookieManager.cpp in Sources */,
26A2C72F15E2E73C005B1A14 /* CString.cpp in Sources */,
+ 29AB8AA1164C735800D49BEC /* CustomProtocolsTest.mm in Sources */,
3776BC63150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm in Sources */,
939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */,
BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */,
+ 37E1064D16976C8500B78BD0 /* DOMHTMLTableCellCellAbove.mm in Sources */,
+ 3751AF7C169518F800764319 /* DOMNodeFromJSObject.mm in Sources */,
37DC678D140D7C5000ABCCDB /* DOMRangeOfString.mm in Sources */,
51393E201523944A005F39C5 /* DOMWindowExtensionBasic.cpp in Sources */,
F6F49C6915545C8E0007F39D /* DOMWindowExtensionNoCache.cpp in Sources */,
C045F9451385C2EA00C0F3CD /* DownloadDecideDestinationCrash.cpp in Sources */,
C07E6CAF13FD67650038B22B /* DynamicDeviceScaleFactor.mm in Sources */,
BCAA485814A044D40088FAC4 /* EditorCommands.mm in Sources */,
+ 4BB4160416815F9100824238 /* ElementAtPointInWebFrame.mm in Sources */,
1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */,
BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */,
1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */,
+ C51AFB99169F49FF009CCF66 /* FindMatches.mm in Sources */,
1ADBEFAE130C689C00D61D19 /* ForceRepaint.cpp in Sources */,
BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */,
BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */,
+ 290F427B172A23A500939FF0 /* TestProtocol.mm in Sources */,
1AA9E55914980A9900001A8A /* Functional.cpp in Sources */,
C0C5D3BE14598B6F00A802A6 /* GetBackingScaleFactor.mm in Sources */,
F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */,
0BCD833514857CE400EA2003 /* HashMap.cpp in Sources */,
+ 2DD7D3AA178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp in Sources */,
26B2DFF915BDE599004F691D /* HashSet.cpp in Sources */,
4BFDFFA9131477770061F24B /* HitTestResultNodeHandle.cpp in Sources */,
9B4F8FA4159D52B1002D9F94 /* HTMLCollectionNamedItem.mm in Sources */,
9B26FC6C159D061000CC3765 /* HTMLFormCollectionNamedItem.mm in Sources */,
+ C2EB2DD316CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm in Sources */,
BC575AAD126E83B9006F0F12 /* InjectedBundleBasic.cpp in Sources */,
+ 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */,
F660AA1315A619C9003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */,
C507E8A714C6545B005D6B3B /* InspectorBar.mm in Sources */,
C08587FC13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm in Sources */,
@@ -968,10 +1130,15 @@
266FAFD315E5775200F61D5B /* IntegerToStringConversion.cpp in Sources */,
C0ADBE7C12FCA4D000D2C129 /* JavaScriptTest.cpp in Sources */,
C081224213FC172400DC39AE /* JavaScriptTestMac.mm in Sources */,
+ 4BB4160216815B2600824238 /* JSWrapperForNodeInWebFrame.mm in Sources */,
440A1D3914A0103A008A66F2 /* KURL.cpp in Sources */,
+ 14464013167A8305000BD218 /* LayoutUnit.cpp in Sources */,
+ 2D640B5517875DFF00BFAF99 /* ScrollPinningBehaviors.cpp in Sources */,
+ 26300B1816755CD90066886D /* ListHashSet.cpp in Sources */,
52CB47411448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */,
- BC131A9B1171316900B69727 /* main.mm in Sources */,
+ 8AA28C1A16D2FA7B002FF4DB /* LoadPageOnCrash.cpp in Sources */,
+ CD5393C81757BA9700C07123 /* MD5.cpp in Sources */,
B4039F9D15E6D8B3007255D6 /* MathExtras.cpp in Sources */,
CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */,
E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */,
@@ -980,49 +1147,70 @@
33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */,
93F1DB3114DA20760024C362 /* NewFirstVisuallyNonEmptyLayout.cpp in Sources */,
93F1DB5514DB1B730024C362 /* NewFirstVisuallyNonEmptyLayoutFails.cpp in Sources */,
+ 9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */,
+ 7CFBCADF1743234F00B2BFCF /* WillLoad.cpp in Sources */,
93F7E86C14DC8E4D00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames.cpp in Sources */,
BC90977A125571AB00083756 /* PageLoadBasic.cpp in Sources */,
BC2D004912A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */,
A51B650916ADF9B1007AA5D9 /* PageVisibilityState.cpp in Sources */,
A57A34F016AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm in Sources */,
52E5CE4614D21E9D003B2BD8 /* ParentFrame.cpp in Sources */,
+ C54237F016B8955800E638FC /* PasteboardNotifications.mm in Sources */,
BC575BC0126F5752006F0F12 /* PlatformUtilities.cpp in Sources */,
BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */,
BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */,
333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */,
+ B55AD1D2179F336C00AC1494 /* PreventImageLoadWithAutoResizing.mm in Sources */,
F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
+ 00BC16871680FE810065F1E5 /* PublicSuffix.mm in Sources */,
0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */,
+ 8A3AF93B16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp in Sources */,
+ 8A2C750E16CED9550024F352 /* ResizeWindowAfterCrash.cpp in Sources */,
3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */,
C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */,
C0ADBE8312FCA6AA00D2C129 /* RestoreSessionStateContainingFormData.cpp in Sources */,
+ 1AEF994917A09F5400998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp in Sources */,
BC029B181486AD6400817DA9 /* RetainPtr.cpp in Sources */,
- C0991C51143C7D68007998F2 /* RetainPtrHashing.cpp in Sources */,
BC029B1C1486B25900817DA9 /* RetainPtr.mm in Sources */,
+ C0991C51143C7D68007998F2 /* RetainPtrHashing.cpp in Sources */,
+ CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */,
14F3B11315E45EAB00210069 /* SaturatedArithmeticOperations.cpp in Sources */,
261516D615B0E60500A2C201 /* SetAndUpdateCacheModel.mm in Sources */,
52B8CF9615868CF000281053 /* SetDocumentURI.mm in Sources */,
+ 7C8DDAAB1735DEEE00EA5AC0 /* CloseThenTerminate.cpp in Sources */,
51FCF79A1534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp in Sources */,
C540F776152E4DA000A40C8C /* SimplifyMarkup.mm in Sources */,
C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */,
+ E194E1BB177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm in Sources */,
81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */,
3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
+ 93ABA80916DDAB91002DB2FA /* StringHasher.cpp in Sources */,
26F1B44515CA434F00D1E4BF /* StringImpl.cpp in Sources */,
C01363C813C3997300EF3964 /* StringOperators.cpp in Sources */,
37A6895F148A9B50005100FA /* SubresourceErrorCrash.mm in Sources */,
C081224513FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m in Sources */,
0BCD856A1485C98B00EA2003 /* TemporaryChange.cpp in Sources */,
+ E4A757D4178AF1B100B5D7A4 /* Deque.cpp in Sources */,
+ 29AB8AA4164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm in Sources */,
BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */,
E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */,
+ 2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */,
+ 1A7BFC0C171A0BDB00BC5F64 /* WillSendSubmitEvent.mm in Sources */,
BC22D31514DC689800FFB1DD /* UserMessage.cpp in Sources */,
- BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */,
BC55F5F914AD78EE00484BE1 /* Vector.cpp in Sources */,
+ BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */,
37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */,
+ 290A9BB71735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm in Sources */,
+ FE217ECD1640A54A0052988B /* VMInspector.cpp in Sources */,
520BCF4D141EB09E00937EA8 /* WebArchive.cpp in Sources */,
0F17BBD615AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */,
+ 290F4278172A232C00939FF0 /* CustomProtocolsSyncXHRTest.mm in Sources */,
C08587BF13FE956C001EF4E5 /* WebKitAgnosticTest.mm in Sources */,
51FBBB4D1513D4E900822738 /* WebViewCanPasteURL.mm in Sources */,
+ 37E38C34169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm in Sources */,
76E182DA1547550100F1FADD /* WillSendSubmitEvent.cpp in Sources */,
A5E2027315B2181900C13E14 /* WindowlessWebViewWithMedia.mm in Sources */,
+ F6B7BE9417469209008A3445 /* DidAssociateFormControls.cpp in Sources */,
BC3C4C7F14587AA60025FB62 /* WKBrowsingContextGroupTest.mm in Sources */,
BC3C4C7214575B6A0025FB62 /* WKBrowsingContextLoadDelegateTest.mm in Sources */,
BC901E241492ADCE0074A667 /* WKConnection.cpp in Sources */,
@@ -1031,13 +1219,8 @@
BC90995E12567BC100083756 /* WKString.cpp in Sources */,
BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */,
265AF55015D1E48A00B0CB4A /* WTFString.cpp in Sources */,
- 9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */,
- 2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */,
- 4F4D2C0E1626FE2700320FE1 /* MemoryInstrumentationTest.cpp in Sources */,
- 378E64731632646D00B6C676 /* InjectedBundleFrameHitTest.cpp in Sources */,
- FE217ECD1640A54A0052988B /* VMInspector.cpp in Sources */,
- 29AB8AA1164C735800D49BEC /* CustomProtocolsTest.mm in Sources */,
- 29AB8AA4164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm in Sources */,
+ 2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */,
+ 2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1045,34 +1228,39 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- BC575A97126E74F1006F0F12 /* InjectedBundleMain.cpp in Sources */,
- BC575AA2126E7660006F0F12 /* InjectedBundleController.cpp in Sources */,
- BC575AB0126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp in Sources */,
- BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */,
- BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */,
+ BC246D9C132F1FF000B56D7C /* CanHandleRequest_Bundle.cpp in Sources */,
BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */,
+ 51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */,
+ F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */,
+ C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */,
+ B55AD1D5179F3B3000AC1494 /* PreventImageLoadWithAutoResizing_Bundle.cpp in Sources */,
+ F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */,
4BFDFFA71314776C0061F24B /* HitTestResultNodeHandle_Bundle.cpp in Sources */,
- C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */,
- BC246D9C132F1FF000B56D7C /* CanHandleRequest_Bundle.cpp in Sources */,
- 33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */,
+ BC575AB0126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp in Sources */,
+ BC575AA2126E7660006F0F12 /* InjectedBundleController.cpp in Sources */,
1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */,
+ 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */,
+ 297234B7173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp in Sources */,
+ F660AA1515A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp in Sources */,
+ BC575A97126E74F1006F0F12 /* InjectedBundleMain.cpp in Sources */,
33DC89141419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp in Sources */,
- 520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */,
- C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */,
- BC901E331492AF390074A667 /* WKConnection_Bundle.cpp in Sources */,
- 52E5CE4914D21EAB003B2BD8 /* ParentFrame_Bundle.cpp in Sources */,
+ 33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */,
93F1DB3414DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp in Sources */,
93F1DB5714DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp in Sources */,
- 93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */,
- BC22D31914DC68B900FFB1DD /* UserMessage_Bundle.cpp in Sources */,
93AF4ECE1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp in Sources */,
+ 93F7E86F14DC8E5C00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp in Sources */,
+ 52E5CE4914D21EAB003B2BD8 /* ParentFrame_Bundle.cpp in Sources */,
+ C54237F116B8957D00E638FC /* PasteboardNotifications_Bundle.cpp in Sources */,
+ 7CFBCAE51743238F00B2BFCF /* WillLoad_Bundle.cpp in Sources */,
+ BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */,
+ BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */,
+ F6B7BE9517469212008A3445 /* DidAssociateFormControls_Bundle.cpp in Sources */,
+ C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */,
51FCF7A11534B2A000104491 /* ShouldGoToBackForwardListItem_Bundle.cpp in Sources */,
- 51393E221523952D005F39C5 /* DOMWindowExtensionBasic_Bundle.cpp in Sources */,
+ BC22D31914DC68B900FFB1DD /* UserMessage_Bundle.cpp in Sources */,
+ 520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */,
76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */,
- F6F49C6B15545CA70007F39D /* DOMWindowExtensionNoCache_Bundle.cpp in Sources */,
- F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */,
- F660AA1515A61ABF003A1243 /* InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp in Sources */,
- 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */,
+ BC901E331492AF390074A667 /* WKConnection_Bundle.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Tools/TestWebKitAPI/Tests.pri b/Tools/TestWebKitAPI/Tests.pri
new file mode 100644
index 000000000..15e81c094
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests.pri
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS += Tests/WTF Tests/JavaScriptCore Tests/WebKit2
diff --git a/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm b/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
new file mode 100644
index 000000000..461cd75bd
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "JavaScriptTest.h"
+#import "Test.h"
+
+#import "PlatformUtilities.h"
+#import "TestBrowsingContextLoadDelegate.h"
+#import "TestProtocol.h"
+#import <WebKit2/WKBrowsingContextGroupPrivate.h>
+#import <WebKit2/WKPreferencesPrivate.h>
+#import <WebKit2/WKRetainPtr.h>
+#import <WebKit2/WKString.h>
+#import <WebKit2/WKViewPrivate.h>
+#import <wtf/RetainPtr.h>
+
+static bool testFinished = false;
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2CustomProtocolsTest, SyncXHR)
+{
+ [NSURLProtocol registerClass:[TestProtocol class]];
+ [WKBrowsingContextController registerSchemeForCustomProtocol:[TestProtocol scheme]];
+
+ RetainPtr<WKProcessGroup> processGroup = adoptNS([[WKProcessGroup alloc] init]);
+ RetainPtr<WKBrowsingContextGroup> browsingContextGroup = adoptNS([[WKBrowsingContextGroup alloc] initWithIdentifier:@"TestIdentifier"]);
+
+ // Allow file URLs to load non-file resources
+ WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
+ WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences.get(), true);
+ WKPageGroupSetPreferences(browsingContextGroup.get()._pageGroupRef, preferences.get());
+
+ RetainPtr<WKView> wkView = adoptNS([[WKView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) processGroup:processGroup.get() browsingContextGroup:browsingContextGroup.get()]);
+ RetainPtr<TestBrowsingContextLoadDelegate> delegate = adoptNS([[TestBrowsingContextLoadDelegate alloc] initWithBlockToRunOnLoad:^(WKBrowsingContextController *sender) {
+ EXPECT_JS_EQ(wkView.get().pageRef, "window._testResult", "PASS");
+ testFinished = true;
+ }]);
+ wkView.get().browsingContextController.loadDelegate = delegate.get();
+
+ WKPageLoadURL(wkView.get().pageRef, Util::createURLForResource("custom-protocol-sync-xhr", "html"));
+
+ TestWebKitAPI::Util::run(&testFinished);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro b/Tools/TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro
new file mode 100644
index 000000000..9d44fad0e
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = tst_jsc
+
+SOURCES += *.cpp
+
+include(../../TestWebKitAPI.pri)
+
+DEFINES += APITEST_SOURCE_DIR=\\\"$$PWD\\\"
diff --git a/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm b/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm
index f869272ea..94bb7ef97 100644
--- a/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm
+++ b/Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm
@@ -53,7 +53,7 @@ static void setValue3(id self, SEL _cmd, int* value)
TEST(TestWebKitAPI, InstanceMethodSwizzler)
{
- RetainPtr<SimpleObject> object(AdoptNS, [[SimpleObject alloc] init]);
+ RetainPtr<SimpleObject> object = adoptNS([[SimpleObject alloc] init]);
int value = 0;
diff --git a/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp b/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp
index bddf22c23..9df71ce44 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp
@@ -35,14 +35,12 @@ TEST(WTF, AtomicStringCreationFromLiteral)
ASSERT_EQ(strlen("Template Literal"), stringWithTemplate.length());
ASSERT_TRUE(stringWithTemplate == "Template Literal");
ASSERT_TRUE(stringWithTemplate.string().is8Bit());
- ASSERT_TRUE(stringWithTemplate.impl()->hasTerminatingNullCharacter());
const char* programmaticStringData = "Explicit Size Literal";
AtomicString programmaticString(programmaticStringData, strlen(programmaticStringData), AtomicString::ConstructFromLiteral);
ASSERT_EQ(strlen(programmaticStringData), programmaticString.length());
ASSERT_TRUE(programmaticStringData == programmaticStringData);
ASSERT_TRUE(programmaticString.string().is8Bit());
- ASSERT_TRUE(programmaticString.impl()->hasTerminatingNullCharacter());
ASSERT_EQ(programmaticStringData, reinterpret_cast<const char*>(programmaticString.string().characters8()));
}
diff --git a/Tools/TestWebKitAPI/Tests/WTF/CString.cpp b/Tools/TestWebKitAPI/Tests/WTF/CString.cpp
index 1f47cb292..735d7dd8b 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/CString.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/CString.cpp
@@ -107,3 +107,90 @@ TEST(WTF, CStringCopyOnWrite)
ASSERT_STREQ(string.data(), "WebKit");
ASSERT_STREQ(copy.data(), initialString);
}
+
+TEST(WTF, CStringComparison)
+{
+ // Comparison with another CString.
+ CString a;
+ CString b;
+ ASSERT_TRUE(a == b);
+ ASSERT_FALSE(a != b);
+ a = "a";
+ b = CString();
+ ASSERT_FALSE(a == b);
+ ASSERT_TRUE(a != b);
+ a = "a";
+ b = "b";
+ ASSERT_FALSE(a == b);
+ ASSERT_TRUE(a != b);
+ a = "a";
+ b = "a";
+ ASSERT_TRUE(a == b);
+ ASSERT_FALSE(a != b);
+ a = "a";
+ b = "aa";
+ ASSERT_FALSE(a == b);
+ ASSERT_TRUE(a != b);
+ a = "";
+ b = "";
+ ASSERT_TRUE(a == b);
+ ASSERT_FALSE(a != b);
+ a = "";
+ b = CString();
+ ASSERT_FALSE(a == b);
+ ASSERT_TRUE(a != b);
+ a = "a";
+ b = "";
+ ASSERT_FALSE(a == b);
+ ASSERT_TRUE(a != b);
+
+ // Comparison with a const char*.
+ CString c;
+ const char* d = 0;
+ ASSERT_TRUE(c == d);
+ ASSERT_FALSE(c != d);
+ c = "c";
+ d = 0;
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = CString();
+ d = "d";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "c";
+ d = "d";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "c";
+ d = "c";
+ ASSERT_TRUE(c == d);
+ ASSERT_FALSE(c != d);
+ c = "c";
+ d = "cc";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "cc";
+ d = "c";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "";
+ d = "";
+ ASSERT_TRUE(c == d);
+ ASSERT_FALSE(c != d);
+ c = "";
+ d = 0;
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = CString();
+ d = "";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "a";
+ d = "";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+ c = "";
+ d = "b";
+ ASSERT_FALSE(c == d);
+ ASSERT_TRUE(c != d);
+}
diff --git a/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp b/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp
index 768c7d3af..77b8ff458 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp
@@ -70,6 +70,41 @@ namespace TestWebKitAPI {
EXPECT_EQ(true, (value += coerceLiteral(1)).hasOverflowed()); \
EXPECT_EQ(true, value.hasOverflowed()); \
value = 10; \
+ type _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(0)).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(0) * value).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * value).safeGet(_value)); \
+ value = 0; \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * value).safeGet(_value)); \
+ value = 1; \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * value).safeGet(_value)); \
+ _value = 0; \
+ value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * (type)0).safeGet(_value)); \
+ _value = 0; \
+ value = 1; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * (type)1).safeGet(_value)); \
+ _value = 0; \
+ value = 2; \
+ EXPECT_EQ(true, CheckedState::DidOverflow == (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidOverflow == (Checked<type, RecordOverflow>(std::numeric_limits<type>::max()) * (type)2).safeGet(_value)); \
+ value = 10; \
+ EXPECT_EQ(true, (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).hasOverflowed()); \
MixedSignednessTest(EXPECT_EQ(coerceLiteral(0), (value + -10).unsafeGet())); \
MixedSignednessTest(EXPECT_EQ(0U, (value - 10U).unsafeGet())); \
MixedSignednessTest(EXPECT_EQ(coerceLiteral(0), (-10 + value).unsafeGet())); \
diff --git a/Tools/TestWebKitAPI/Tests/WTF/Deque.cpp b/Tools/TestWebKitAPI/Tests/WTF/Deque.cpp
new file mode 100644
index 000000000..26a815aba
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/Deque.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include <wtf/Deque.h>
+
+namespace TestWebKitAPI {
+
+TEST(WTF, DequeIterator)
+{
+ Deque<int> deque;
+ deque.append(11);
+ deque.prepend(10);
+ deque.append(12);
+ deque.append(13);
+
+ Deque<int>::iterator it = deque.begin();
+ Deque<int>::iterator end = deque.end();
+ EXPECT_TRUE(end != it);
+
+ EXPECT_EQ(10, *it);
+ ++it;
+ EXPECT_EQ(11, *it);
+ ++it;
+ EXPECT_EQ(12, *it);
+ ++it;
+ EXPECT_EQ(13, *it);
+ ++it;
+
+ EXPECT_TRUE(end == it);
+}
+
+TEST(WTF, DequeReverseIterator)
+{
+ Deque<int> deque;
+ deque.append(11);
+ deque.prepend(10);
+ deque.append(12);
+ deque.append(13);
+
+ Deque<int>::reverse_iterator it = deque.rbegin();
+ Deque<int>::reverse_iterator end = deque.rend();
+ EXPECT_TRUE(end != it);
+
+ EXPECT_EQ(13, *it);
+ ++it;
+ EXPECT_EQ(12, *it);
+ ++it;
+ EXPECT_EQ(11, *it);
+ ++it;
+ EXPECT_EQ(10, *it);
+ ++it;
+
+ EXPECT_TRUE(end == it);
+}
+
+TEST(WTF, DequeRemove)
+{
+ Deque<int> deque;
+ deque.append(11);
+ deque.prepend(10);
+ deque.append(12);
+ deque.append(13);
+
+ EXPECT_EQ(10, deque.first());
+ EXPECT_EQ(13, deque.last());
+
+ deque.removeLast();
+ EXPECT_EQ(10, deque.first());
+ EXPECT_EQ(12, deque.last());
+
+ deque.removeFirst();
+ EXPECT_EQ(11, deque.first());
+ EXPECT_EQ(12, deque.last());
+
+ deque.removeFirst();
+ EXPECT_EQ(12, deque.first());
+ EXPECT_EQ(12, deque.last());
+
+ deque.removeLast();
+ EXPECT_TRUE(deque.isEmpty());
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp b/Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp
new file mode 100644
index 000000000..7579c4299
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <wtf/ListHashSet.h>
+
+namespace TestWebKitAPI {
+
+TEST(WTF, ListHashSetRemoveFirst)
+{
+ ListHashSet<int> list;
+ list.add(1);
+ list.add(2);
+ list.add(3);
+
+ ASSERT_EQ(1, list.first());
+
+ list.removeFirst();
+ ASSERT_EQ(2, list.first());
+
+ list.removeFirst();
+ ASSERT_EQ(3, list.first());
+
+ list.removeFirst();
+ ASSERT_TRUE(list.isEmpty());
+}
+
+TEST(WTF, ListHashSetAppendOrMoveToLastNewItems)
+{
+ ListHashSet<int> list;
+ ListHashSet<int>::AddResult result = list.appendOrMoveToLast(1);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.add(2);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.appendOrMoveToLast(3);
+ ASSERT_TRUE(result.isNewEntry);
+
+ ASSERT_EQ(list.size(), 3);
+
+ // The list should be in order 1, 2, 3.
+ ListHashSet<int>::iterator iterator = list.begin();
+ ASSERT_EQ(1, *iterator);
+ ++iterator;
+ ASSERT_EQ(2, *iterator);
+ ++iterator;
+ ASSERT_EQ(3, *iterator);
+ ++iterator;
+}
+
+TEST(WTF, ListHashSetAppendOrMoveToLastWithDuplicates)
+{
+ ListHashSet<int> list;
+
+ // Add a single element twice.
+ ListHashSet<int>::AddResult result = list.add(1);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.appendOrMoveToLast(1);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(1, list.size());
+
+ list.add(2);
+ list.add(3);
+ ASSERT_EQ(3, list.size());
+
+ // Appending 2 move it to the end.
+ ASSERT_EQ(3, list.last());
+ result = list.appendOrMoveToLast(2);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(2, list.last());
+
+ // Inverse the list by moving each element to end end.
+ result = list.appendOrMoveToLast(3);
+ ASSERT_FALSE(result.isNewEntry);
+ result = list.appendOrMoveToLast(2);
+ ASSERT_FALSE(result.isNewEntry);
+ result = list.appendOrMoveToLast(1);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(3, list.size());
+
+ ListHashSet<int>::iterator iterator = list.begin();
+ ASSERT_EQ(3, *iterator);
+ ++iterator;
+ ASSERT_EQ(2, *iterator);
+ ++iterator;
+ ASSERT_EQ(1, *iterator);
+ ++iterator;
+}
+
+TEST(WTF, ListHashSetPrependOrMoveToLastNewItems)
+{
+ ListHashSet<int> list;
+ ListHashSet<int>::AddResult result = list.prependOrMoveToFirst(1);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.add(2);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.prependOrMoveToFirst(3);
+ ASSERT_TRUE(result.isNewEntry);
+
+ ASSERT_EQ(list.size(), 3);
+
+ // The list should be in order 3, 1, 2.
+ ListHashSet<int>::iterator iterator = list.begin();
+ ASSERT_EQ(3, *iterator);
+ ++iterator;
+ ASSERT_EQ(1, *iterator);
+ ++iterator;
+ ASSERT_EQ(2, *iterator);
+ ++iterator;
+}
+
+TEST(WTF, ListHashSetPrependOrMoveToLastWithDuplicates)
+{
+ ListHashSet<int> list;
+
+ // Add a single element twice.
+ ListHashSet<int>::AddResult result = list.add(1);
+ ASSERT_TRUE(result.isNewEntry);
+ result = list.prependOrMoveToFirst(1);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(1, list.size());
+
+ list.add(2);
+ list.add(3);
+ ASSERT_EQ(3, list.size());
+
+ // Prepending 2 move it to the beginning.
+ ASSERT_EQ(1, list.first());
+ result = list.prependOrMoveToFirst(2);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(2, list.first());
+
+ // Inverse the list by moving each element to the first position.
+ result = list.prependOrMoveToFirst(1);
+ ASSERT_FALSE(result.isNewEntry);
+ result = list.prependOrMoveToFirst(2);
+ ASSERT_FALSE(result.isNewEntry);
+ result = list.prependOrMoveToFirst(3);
+ ASSERT_FALSE(result.isNewEntry);
+ ASSERT_EQ(3, list.size());
+
+ ListHashSet<int>::iterator iterator = list.begin();
+ ASSERT_EQ(3, *iterator);
+ ++iterator;
+ ASSERT_EQ(2, *iterator);
+ ++iterator;
+ ASSERT_EQ(1, *iterator);
+ ++iterator;
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MD5.cpp b/Tools/TestWebKitAPI/Tests/WTF/MD5.cpp
new file mode 100644
index 000000000..7f592aee4
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/MD5.cpp
@@ -0,0 +1,47 @@
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ */
+
+#include "config.h"
+#include <wtf/MD5.h>
+#include <wtf/StringExtras.h>
+#include <wtf/text/CString.h>
+
+namespace TestWebKitAPI {
+
+static void expectMD5(CString input, CString expected)
+{
+ MD5 md5;
+ md5.addBytes(reinterpret_cast<const uint8_t*>(input.data()), input.length());
+ Vector<uint8_t, 16> digest;
+ md5.checksum(digest);
+ char* buf = 0;
+ CString actual = CString::newUninitialized(32, buf);
+ for (size_t i = 0; i < 16; i++, buf += 2)
+ snprintf(buf, 3, "%02x", digest.at(i));
+
+ ASSERT_EQ(expected.length(), actual.length());
+ ASSERT_STREQ(expected.data(), actual.data());
+}
+
+TEST(WTF_MD5, Computation)
+{
+ // MD5 Test suite from http://www.ietf.org/rfc/rfc1321.txt.
+ expectMD5("", "d41d8cd98f00b204e9800998ecf8427e");
+ expectMD5("a", "0cc175b9c0f1b6a831c399e269772661");
+ expectMD5("abc", "900150983cd24fb0d6963f7d28e17f72");
+ expectMD5("message digest", "f96b697d7cb7938d525a2f31aaf161d0");
+ expectMD5("abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b");
+ expectMD5("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "d174ab98d277d9f5a5611c2c9f419d9f");
+ expectMD5("12345678901234567890123456789012345678901234567890123456789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a");
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp b/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp
index 06e442ce7..7cbb29766 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp
@@ -50,4 +50,128 @@ TEST(WTF, Lrint)
}
}
+TEST(WTF, clampToIntLong)
+{
+ if (sizeof(long) == sizeof(int))
+ return;
+
+ long maxInt = std::numeric_limits<int>::max();
+ long minInt = std::numeric_limits<int>::min();
+ long overflowInt = maxInt + 1;
+ long underflowInt = minInt - 1;
+
+ EXPECT_GT(overflowInt, maxInt);
+ EXPECT_LT(underflowInt, minInt);
+
+ EXPECT_EQ(clampTo<int>(maxInt), maxInt);
+ EXPECT_EQ(clampTo<int>(minInt), minInt);
+
+ EXPECT_EQ(clampTo<int>(overflowInt), maxInt);
+ EXPECT_EQ(clampTo<int>(underflowInt), minInt);
+}
+
+TEST(WTF, clampToIntLongLong)
+{
+ long long maxInt = std::numeric_limits<int>::max();
+ long long minInt = std::numeric_limits<int>::min();
+ long long overflowInt = maxInt + 1;
+ long long underflowInt = minInt - 1;
+
+ EXPECT_GT(overflowInt, maxInt);
+ EXPECT_LT(underflowInt, minInt);
+
+ EXPECT_EQ(clampTo<int>(maxInt), maxInt);
+ EXPECT_EQ(clampTo<int>(minInt), minInt);
+
+ EXPECT_EQ(clampTo<int>(overflowInt), maxInt);
+ EXPECT_EQ(clampTo<int>(underflowInt), minInt);
+}
+
+TEST(WTF, clampToIntegerFloat)
+{
+ // This test is inaccurate as floats will round the min / max integer
+ // due to the narrow mantissa. However it will properly checks within
+ // (close to the extreme) and outside the integer range.
+ float maxInt = std::numeric_limits<int>::max();
+ float minInt = std::numeric_limits<int>::min();
+ float overflowInt = maxInt * 1.1;
+ float underflowInt = minInt * 1.1;
+
+ EXPECT_GT(overflowInt, maxInt);
+ EXPECT_LT(underflowInt, minInt);
+
+ // If maxInt == 2^31 - 1 (ie on I32 architecture), the closest float used to represent it is 2^31.
+ EXPECT_NEAR(clampToInteger(maxInt), maxInt, 1);
+ EXPECT_EQ(clampToInteger(minInt), minInt);
+
+ EXPECT_NEAR(clampToInteger(overflowInt), maxInt, 1);
+ EXPECT_EQ(clampToInteger(underflowInt), minInt);
+}
+
+TEST(WTF, clampToIntegerDouble)
+{
+ double maxInt = std::numeric_limits<int>::max();
+ double minInt = std::numeric_limits<int>::min();
+ double overflowInt = maxInt + 1;
+ double underflowInt = minInt - 1;
+
+ EXPECT_GT(overflowInt, maxInt);
+ EXPECT_LT(underflowInt, minInt);
+
+ EXPECT_EQ(clampToInteger(maxInt), maxInt);
+ EXPECT_EQ(clampToInteger(minInt), minInt);
+
+ EXPECT_EQ(clampToInteger(overflowInt), maxInt);
+ EXPECT_EQ(clampToInteger(underflowInt), minInt);
+}
+
+TEST(WTF, clampToFloat)
+{
+ double maxFloat = std::numeric_limits<float>::max();
+ double minFloat = -maxFloat;
+ double overflowFloat = maxFloat * 1.1;
+ double underflowFloat = minFloat * 1.1;
+
+ EXPECT_GT(overflowFloat, maxFloat);
+ EXPECT_LT(underflowFloat, minFloat);
+
+ EXPECT_EQ(clampToFloat(maxFloat), maxFloat);
+ EXPECT_EQ(clampToFloat(minFloat), minFloat);
+
+ EXPECT_EQ(clampToFloat(overflowFloat), maxFloat);
+ EXPECT_EQ(clampToFloat(underflowFloat), minFloat);
+
+ EXPECT_EQ(clampToFloat(std::numeric_limits<float>::infinity()), maxFloat);
+ EXPECT_EQ(clampToFloat(-std::numeric_limits<float>::infinity()), minFloat);
+}
+
+TEST(WTF, clampToUnsignedLong)
+{
+ if (sizeof(unsigned long) == sizeof(unsigned))
+ return;
+
+ unsigned long maxUnsigned = std::numeric_limits<unsigned>::max();
+ unsigned long overflowUnsigned = maxUnsigned + 1;
+
+ EXPECT_GT(overflowUnsigned, maxUnsigned);
+
+ EXPECT_EQ(clampTo<unsigned>(maxUnsigned), maxUnsigned);
+
+ EXPECT_EQ(clampTo<unsigned>(overflowUnsigned), maxUnsigned);
+ EXPECT_EQ(clampTo<unsigned>(-1), 0u);
+}
+
+TEST(WTF, clampToUnsignedLongLong)
+{
+ unsigned long long maxUnsigned = std::numeric_limits<unsigned>::max();
+ unsigned long long overflowUnsigned = maxUnsigned + 1;
+
+ EXPECT_GT(overflowUnsigned, maxUnsigned);
+
+ EXPECT_EQ(clampTo<unsigned>(maxUnsigned), maxUnsigned);
+
+ EXPECT_EQ(clampTo<unsigned>(overflowUnsigned), maxUnsigned);
+ EXPECT_EQ(clampTo<unsigned>(-1), 0u);
+}
+
} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp b/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
deleted file mode 100644
index dad08dda4..000000000
--- a/Tools/TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <gtest/gtest.h>
-
-#include <wtf/ArrayBuffer.h>
-#include <wtf/HashCountedSet.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/MemoryInstrumentation.h>
-#include <wtf/MemoryInstrumentationArrayBufferView.h>
-#include <wtf/MemoryInstrumentationHashCountedSet.h>
-#include <wtf/MemoryInstrumentationHashMap.h>
-#include <wtf/MemoryInstrumentationHashSet.h>
-#include <wtf/MemoryInstrumentationListHashSet.h>
-#include <wtf/MemoryInstrumentationString.h>
-#include <wtf/MemoryInstrumentationVector.h>
-#include <wtf/MemoryObjectInfo.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringBuffer.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/text/StringImpl.h>
-#include <wtf/text/WTFString.h>
-
-namespace {
-enum TestEnum { ONE = 1, TWO, THREE, MY_ENUM_MAX };
-}
-
-namespace WTF {
-
-template<> struct DefaultHash<TestEnum> {
- typedef IntHash<unsigned> Hash;
-};
-
-template<> struct HashTraits<TestEnum> : GenericHashTraits<TestEnum> {
- static const bool emptyValueIsZero = true;
- static const bool needsDestruction = false;
- static void constructDeletedValue(TestEnum& slot) { slot = static_cast<TestEnum>(MY_ENUM_MAX + 1); }
- static bool isDeletedValue(TestEnum value) { return value == (MY_ENUM_MAX + 1); }
-};
-
-}
-
-namespace {
-
-using WTF::MemoryObjectInfo;
-using WTF::MemoryClassInfo;
-using WTF::MemoryObjectType;
-
-MemoryObjectType TestType = "TestType";
-
-class MemoryInstrumentationTestClient : public WTF::MemoryInstrumentationClient {
-public:
- virtual void countObjectSize(const void*, MemoryObjectType objectType, size_t size)
- {
- TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size);
- if (!result.isNewEntry)
- result.iterator->value += size;
- }
- virtual bool visited(const void* object) { return !m_visitedObjects.add(object).isNewEntry; }
- virtual bool checkCountedObject(const void*) { return true; }
-
- size_t visitedObjects() const { return m_visitedObjects.size(); }
- size_t totalSize(const MemoryObjectType objectType) const
- {
- TypeToSizeMap::const_iterator i = m_totalSizes.find(objectType);
- return i == m_totalSizes.end() ? 0 : i->value;
- }
-
- size_t reportedSizeForAllTypes() const
- {
- size_t size = 0;
- for (TypeToSizeMap::const_iterator i = m_totalSizes.begin(); i != m_totalSizes.end(); ++i)
- size += i->value;
- return size;
- }
-
-private:
- typedef HashMap<MemoryObjectType, size_t> TypeToSizeMap;
- TypeToSizeMap m_totalSizes;
- WTF::HashSet<const void*> m_visitedObjects;
-};
-
-class InstrumentationTestImpl : public WTF::MemoryInstrumentation {
-public:
- explicit InstrumentationTestImpl(MemoryInstrumentationTestClient* client)
- : MemoryInstrumentation(client)
- , m_client(client) { }
-
- virtual void processDeferredInstrumentedPointers();
- virtual void deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase>);
-
- size_t visitedObjects() const { return m_client->visitedObjects(); }
- size_t reportedSizeForAllTypes() const { return m_client->reportedSizeForAllTypes(); }
- size_t totalSize(const MemoryObjectType objectType) const { return m_client->totalSize(objectType); }
-
-private:
- MemoryInstrumentationTestClient* m_client;
- Vector<OwnPtr<InstrumentedPointerBase> > m_deferredInstrumentedPointers;
-};
-
-class InstrumentationTestHelper : public InstrumentationTestImpl {
-public:
- InstrumentationTestHelper() : InstrumentationTestImpl(&m_client) { }
-
-private:
- MemoryInstrumentationTestClient m_client;
-};
-
-void InstrumentationTestImpl::processDeferredInstrumentedPointers()
-{
- while (!m_deferredInstrumentedPointers.isEmpty()) {
- OwnPtr<InstrumentedPointerBase> pointer = m_deferredInstrumentedPointers.last().release();
- m_deferredInstrumentedPointers.removeLast();
- pointer->process(this);
- }
-}
-
-void InstrumentationTestImpl::deferInstrumentedPointer(PassOwnPtr<InstrumentedPointerBase> pointer)
-{
- m_deferredInstrumentedPointers.append(pointer);
-}
-
-class NotInstrumented {
-public:
- NotInstrumented(const char* = 0) { }
- char m_data[42];
-};
-
-class Instrumented {
-public:
- Instrumented() : m_notInstrumented(new NotInstrumented) { }
- virtual ~Instrumented() { delete m_notInstrumented; }
-
- virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_notInstrumented);
- }
- NotInstrumented* m_notInstrumented;
-};
-
-TEST(MemoryInstrumentationTest, sizeOf)
-{
- InstrumentationTestHelper helper;
- Instrumented instrumented;
- helper.addRootObject(instrumented);
- EXPECT_EQ(sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, nullCheck)
-{
- InstrumentationTestHelper helper;
- Instrumented* instrumented = 0;
- helper.addRootObject(instrumented);
- EXPECT_EQ(0u, helper.reportedSizeForAllTypes());
- EXPECT_EQ(0u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, ptrVsRef)
-{
- {
- InstrumentationTestHelper helper;
- Instrumented instrumented;
- helper.addRootObject(&instrumented);
- EXPECT_EQ(sizeof(Instrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
- }
- {
- InstrumentationTestHelper helper;
- Instrumented instrumented;
- helper.addRootObject(instrumented);
- EXPECT_EQ(sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-}
-
-TEST(MemoryInstrumentationTest, ownPtr)
-{
- InstrumentationTestHelper helper;
- OwnPtr<Instrumented> instrumented(adoptPtr(new Instrumented));
- helper.addRootObject(instrumented);
- EXPECT_EQ(sizeof(Instrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class InstrumentedRefPtr : public RefCounted<InstrumentedRefPtr> {
-public:
- InstrumentedRefPtr() : m_notInstrumented(new NotInstrumented) { }
- virtual ~InstrumentedRefPtr() { delete m_notInstrumented; }
- static PassRefPtr<InstrumentedRefPtr> create() { return adoptRef(new InstrumentedRefPtr()); }
-
- virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_notInstrumented);
- }
- NotInstrumented* m_notInstrumented;
-};
-
-TEST(MemoryInstrumentationTest, refPtr)
-{
- InstrumentationTestHelper helper;
- RefPtr<InstrumentedRefPtr> instrumentedRefPtr(adoptRef(new InstrumentedRefPtr));
- helper.addRootObject(instrumentedRefPtr);
- EXPECT_EQ(sizeof(InstrumentedRefPtr) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class InstrumentedWithOwnPtr : public Instrumented {
-public:
- InstrumentedWithOwnPtr() : m_notInstrumentedOwnPtr(adoptPtr(new NotInstrumented)) { }
-
- virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- Instrumented::reportMemoryUsage(memoryObjectInfo);
- info.addMember(m_notInstrumentedOwnPtr);
- }
- OwnPtr<NotInstrumented> m_notInstrumentedOwnPtr;
-};
-
-TEST(MemoryInstrumentationTest, ownPtrNotInstrumented)
-{
- InstrumentationTestHelper helper;
- InstrumentedWithOwnPtr instrumentedWithOwnPtr;
- helper.addRootObject(instrumentedWithOwnPtr);
- EXPECT_EQ(2u * sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class InstrumentedUndefined {
-public:
- InstrumentedUndefined() : m_data(0) { }
-
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this);
- }
- int m_data;
-};
-
-class InstrumentedDOM {
-public:
- InstrumentedDOM() : m_instrumentedUndefined(adoptPtr(new InstrumentedUndefined)) { }
-
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_instrumentedUndefined);
- }
- OwnPtr<InstrumentedUndefined> m_instrumentedUndefined;
-};
-
-TEST(MemoryInstrumentationTest, ownerTypePropagation)
-{
- InstrumentationTestHelper helper;
- OwnPtr<InstrumentedDOM> instrumentedDOM(adoptPtr(new InstrumentedDOM));
- helper.addRootObject(instrumentedDOM);
- EXPECT_EQ(sizeof(InstrumentedDOM) + sizeof(InstrumentedUndefined), helper.reportedSizeForAllTypes());
- EXPECT_EQ(sizeof(InstrumentedDOM) + sizeof(InstrumentedUndefined), helper.totalSize(TestType));
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class NonVirtualInstrumented {
-public:
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_instrumented);
- }
-
- Instrumented m_instrumented;
-};
-
-TEST(MemoryInstrumentationTest, visitFirstMemberInNonVirtualClass)
-{
- InstrumentationTestHelper helper;
- NonVirtualInstrumented nonVirtualInstrumented;
- helper.addRootObject(&nonVirtualInstrumented);
- EXPECT_EQ(sizeof(NonVirtualInstrumented) + sizeof(NotInstrumented), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-template<typename T>
-class InstrumentedOwner {
-public:
- template<typename V>
- InstrumentedOwner(const V& value) : m_value(value) { }
- InstrumentedOwner() { }
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_value);
- }
-
- T m_value;
-};
-
-TEST(MemoryInstrumentationTest, visitStrings)
-{
- { // 8-bit string.
- InstrumentationTestHelper helper;
- InstrumentedOwner<String> stringInstrumentedOwner("String");
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-
- { // 8-bit string with 16bit shadow.
- InstrumentationTestHelper helper;
- InstrumentedOwner<String> stringInstrumentedOwner("String");
- stringInstrumentedOwner.m_value.characters();
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
- }
-
- { // 16 bit string.
- InstrumentationTestHelper helper;
- String string("String");
- InstrumentedOwner<String> stringInstrumentedOwner(String(string.characters(), string.length()));
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length() * sizeof(UChar), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-
- { // ASCIILiteral
- InstrumentationTestHelper helper;
- ASCIILiteral literal("String");
- InstrumentedOwner<String> stringInstrumentedOwner(literal);
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-
- { // Zero terminated internal buffer.
- InstrumentationTestHelper helper;
- InstrumentedOwner<String> stringInstrumentedOwner("string");
- stringInstrumentedOwner.m_value.charactersWithNullTermination();
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + (stringInstrumentedOwner.m_value.length() + 1) * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
- }
-
- { // Substring
- InstrumentationTestHelper helper;
- String baseString("String");
- baseString.characters(); // Force 16 shadow creation.
- InstrumentedOwner<String> stringInstrumentedOwner(baseString.substringSharingImpl(1, 4));
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) * 2 + baseString.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes());
- EXPECT_EQ(3u, helper.visitedObjects());
- }
-
- { // Owned buffer.
- InstrumentationTestHelper helper;
- StringBuffer<LChar> buffer(6);
- InstrumentedOwner<String> stringInstrumentedOwner(String::adopt(buffer));
- helper.addRootObject(stringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + stringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
- }
-
- {
- InstrumentationTestHelper helper;
- InstrumentedOwner<AtomicString> atomicStringInstrumentedOwner("AtomicString");
- atomicStringInstrumentedOwner.m_value.string().characters(); // Force 16bit shadow creation.
- helper.addRootObject(atomicStringInstrumentedOwner);
- EXPECT_EQ(sizeof(StringImpl) + atomicStringInstrumentedOwner.m_value.length() * (sizeof(LChar) + sizeof(UChar)), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
- }
-
- {
- InstrumentationTestHelper helper;
- InstrumentedOwner<CString> cStringInstrumentedOwner("CString");
- helper.addRootObject(cStringInstrumentedOwner);
- EXPECT_EQ(sizeof(WTF::CStringBuffer) + cStringInstrumentedOwner.m_value.length(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-}
-
-class TwoPointersToRefPtr {
-public:
- TwoPointersToRefPtr(const RefPtr<StringImpl>& value) : m_ptr1(&value), m_ptr2(&value) { }
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_ptr1);
- info.addMember(m_ptr2);
- }
-
- const RefPtr<StringImpl>* m_ptr1;
- const RefPtr<StringImpl>* m_ptr2;
-};
-
-TEST(MemoryInstrumentationTest, refPtrPtr)
-{
- InstrumentationTestHelper helper;
- RefPtr<StringImpl> refPtr;
- TwoPointersToRefPtr root(refPtr);
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(RefPtr<StringImpl>), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-class TwoPointersToOwnPtr {
-public:
- TwoPointersToOwnPtr(const OwnPtr<NotInstrumented>& value) : m_ptr1(&value), m_ptr2(&value) { }
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_ptr1);
- info.addMember(m_ptr2);
- }
-
- const OwnPtr<NotInstrumented>* m_ptr1;
- const OwnPtr<NotInstrumented>* m_ptr2;
-};
-
-TEST(MemoryInstrumentationTest, ownPtrPtr)
-{
- InstrumentationTestHelper helper;
- OwnPtr<NotInstrumented> ownPtr;
- TwoPointersToOwnPtr root(ownPtr);
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(OwnPtr<NotInstrumented>), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-template<typename T>
-class InstrumentedTemplate {
-public:
- template<typename V>
- InstrumentedTemplate(const V& value) : m_value(value) { }
-
- template<typename MemoryObjectInfo>
- void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_value);
- }
-
- T m_value;
-};
-
-TEST(MemoryInstrumentationTest, detectReportMemoryUsageMethod)
-{
- {
- InstrumentationTestHelper helper;
-
- OwnPtr<InstrumentedTemplate<String> > value(adoptPtr(new InstrumentedTemplate<String>("")));
- InstrumentedOwner<InstrumentedTemplate<String>* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(InstrumentedTemplate<String>) + sizeof(StringImpl), helper.reportedSizeForAllTypes());
- // FIXME: it is failing on Chromium Canary bots but works fine locally.
- // EXPECT_EQ(2, helper.visitedObjects());
- }
- {
- InstrumentationTestHelper helper;
-
- OwnPtr<InstrumentedTemplate<NotInstrumented> > value(adoptPtr(new InstrumentedTemplate<NotInstrumented>("")));
- InstrumentedOwner<InstrumentedTemplate<NotInstrumented>* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(InstrumentedTemplate<NotInstrumented>), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
- }
-}
-
-TEST(MemoryInstrumentationTest, vectorZeroInlineCapacity)
-{
- InstrumentationTestHelper helper;
- InstrumentedOwner<Vector<int> > vectorOwner(16);
- helper.addRootObject(vectorOwner);
- EXPECT_EQ(16 * sizeof(int), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, vectorFieldWithInlineCapacity)
-{
- InstrumentationTestHelper helper;
- InstrumentedOwner<Vector<int, 4> > vectorOwner;
- helper.addRootObject(vectorOwner);
- EXPECT_EQ(static_cast<size_t>(0), helper.reportedSizeForAllTypes());
- EXPECT_EQ(0u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, vectorFieldWithInlineCapacityResized)
-{
- InstrumentationTestHelper helper;
- InstrumentedOwner<Vector<int, 4> > vectorOwner;
- vectorOwner.m_value.reserveCapacity(8);
- helper.addRootObject(vectorOwner);
- EXPECT_EQ(8u * sizeof(int), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, heapAllocatedVectorWithInlineCapacity)
-{
- InstrumentationTestHelper helper;
- InstrumentedOwner<OwnPtr<Vector<int, 4> > > vectorOwner;
- vectorOwner.m_value = adoptPtr(new Vector<int, 4>());
- helper.addRootObject(vectorOwner);
- EXPECT_EQ(sizeof(Vector<int, 4>), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, heapAllocatedVectorWithInlineCapacityResized)
-{
- InstrumentationTestHelper helper;
- InstrumentedOwner<OwnPtr<Vector<int, 4> > > vectorOwner;
- vectorOwner.m_value = adoptPtr(new Vector<int, 4>());
- vectorOwner.m_value->reserveCapacity(8);
- helper.addRootObject(vectorOwner);
- EXPECT_EQ(8u * sizeof(int) + sizeof(Vector<int, 4>), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, vectorWithInstrumentedType)
-{
- InstrumentationTestHelper helper;
-
- typedef Vector<String> StringVector;
- OwnPtr<StringVector> value = adoptPtr(new StringVector());
- size_t count = 10;
- for (size_t i = 0; i < count; ++i)
- value->append("string");
- InstrumentedOwner<StringVector* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(StringVector) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 6) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 2, (size_t)helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashSetWithInstrumentedType)
-{
- InstrumentationTestHelper helper;
-
- typedef HashSet<String> ValueType;
- OwnPtr<ValueType> value = adoptPtr(new ValueType());
- size_t count = 10;
- for (size_t i = 0; i < count; ++i)
- value->add(String::number(i));
- InstrumentedOwner<ValueType* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(ValueType) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 1, (size_t)helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithNotInstrumentedKeysAndValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<int, int> IntToIntMap;
- OwnPtr<IntToIntMap> value = adoptPtr(new IntToIntMap());
- size_t count = 10;
- for (size_t i = 1; i <= count; ++i)
- value->set(i, i);
- InstrumentedOwner<IntToIntMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(IntToIntMap) + sizeof(IntToIntMap::ValueType) * value->capacity(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(1u, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithInstrumentedKeys)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<String, int> StringToIntMap;
- OwnPtr<StringToIntMap> value = adoptPtr(new StringToIntMap());
- size_t count = 10;
- for (size_t i = 10; i < 10 + count; ++i)
- value->set(String::number(i), i);
- InstrumentedOwner<StringToIntMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(StringToIntMap) + sizeof(StringToIntMap::ValueType) * value->capacity() + (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithInstrumentedValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<int, String> IntToStringMap;
- OwnPtr<IntToStringMap> value = adoptPtr(new IntToStringMap());
- size_t count = 10;
- for (size_t i = 10; i < 10 + count; ++i)
- value->set(i, String::number(i));
- InstrumentedOwner<IntToStringMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(IntToStringMap) + sizeof(IntToStringMap::ValueType) * value->capacity() + (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithInstrumentedKeysAndValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<String, String> StringToStringMap;
- OwnPtr<StringToStringMap> value = adoptPtr(new StringToStringMap());
- size_t count = 10;
- for (size_t i = 10; i < 10 + count; ++i)
- value->set(String::number(count + i), String::number(i));
- InstrumentedOwner<StringToStringMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(StringToStringMap) + sizeof(StringToStringMap::ValueType) * value->capacity() + 2 * (sizeof(StringImpl) + 2) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u * count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithInstrumentedPointerKeysAndPointerValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<Instrumented*, Instrumented*> InstrumentedToInstrumentedMap;
- OwnPtr<InstrumentedToInstrumentedMap> value(adoptPtr(new InstrumentedToInstrumentedMap()));
- Vector<OwnPtr<Instrumented> > valuesVector;
- size_t count = 10;
- for (size_t i = 0; i < count; ++i) {
- valuesVector.append(adoptPtr(new Instrumented()));
- valuesVector.append(adoptPtr(new Instrumented()));
- value->set(valuesVector[2 * i].get(), valuesVector[2 * i + 1].get());
- }
- InstrumentedOwner<InstrumentedToInstrumentedMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(InstrumentedToInstrumentedMap) + sizeof(InstrumentedToInstrumentedMap::ValueType) * value->capacity() + 2 * (sizeof(Instrumented) + sizeof(NotInstrumented)) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u * 2u * count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedType)
-{
- InstrumentationTestHelper helper;
-
- typedef ListHashSet<String, 8> TestSet;
- OwnPtr<TestSet> value = adoptPtr(new TestSet());
- size_t count = 10;
- for (size_t i = 0; i < count; ++i)
- value->add(String::number(i));
- InstrumentedOwner<TestSet* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 1 * sizeof(LChar)) * count +
- sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 8),
- helper.reportedSizeForAllTypes());
- EXPECT_EQ(1 + count, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, listHashSetWithInstrumentedTypeAfterValuesRemoval)
-{
- InstrumentationTestHelper helper;
-
- typedef ListHashSet<String, 8> TestSet;
- OwnPtr<TestSet> value = adoptPtr(new TestSet());
- size_t count = 20;
- for (size_t i = 0; i < count; ++i)
- value->add(String::number(i));
- // Remove 10 values, 8 of which were allocated in the internal buffer.
- for (size_t i = 0; i < 10; ++i)
- value->remove(String::number(i));
- InstrumentedOwner<TestSet* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(TestSet) + sizeof(String) * value->capacity() + (sizeof(StringImpl) + 2 * sizeof(LChar)) * (count - 10) +
- sizeof(WTF::ListHashSetNodeAllocator<String, 8>) + sizeof(WTF::ListHashSetNode<String, 8>) * (count - 10),
- helper.reportedSizeForAllTypes());
- EXPECT_EQ(1 + (count - 10), helper.visitedObjects());
-}
-
-class InstrumentedConvertibleToInt {
-public:
- InstrumentedConvertibleToInt() : m_notInstrumented(0) { }
- virtual ~InstrumentedConvertibleToInt() { }
-
- virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- info.addMember(m_notInstrumented);
- }
-
- operator int() const { return 2012; }
-
- NotInstrumented* m_notInstrumented;
-};
-
-// This test checks if reportMemoryUsage method will be called on a class
-// that can be implicitly cast to int. Currently objects of such classes are
-// treated as integers when they are stored in a HashMap by value and
-// reportMemoryUsage will not be called on them. We may fix that later.
-TEST(MemoryInstrumentationTest, hashMapWithValuesConvertibleToInt)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<InstrumentedConvertibleToInt*, InstrumentedConvertibleToInt> TestMap;
- OwnPtr<TestMap> value(adoptPtr(new TestMap()));
- Vector<OwnPtr<InstrumentedConvertibleToInt> > keysVector;
- Vector<OwnPtr<NotInstrumented> > valuesVector;
- size_t count = 10;
- for (size_t i = 0; i < count; ++i) {
- keysVector.append(adoptPtr(new InstrumentedConvertibleToInt()));
- valuesVector.append(adoptPtr(new NotInstrumented()));
- value->set(keysVector[i].get(), InstrumentedConvertibleToInt()).iterator->value.m_notInstrumented = valuesVector[i].get();
- }
- InstrumentedOwner<TestMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(TestMap) + sizeof(TestMap::ValueType) * value->capacity() +
- sizeof(InstrumentedConvertibleToInt) * count /* + sizeof(NotInstrumented) * count */, helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashMapWithEnumKeysAndInstrumentedValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashMap<TestEnum, String> EnumToStringMap;
- OwnPtr<EnumToStringMap> value(adoptPtr(new EnumToStringMap()));
- size_t count = MY_ENUM_MAX;
- for (size_t i = ONE; i <= count; ++i)
- value->set(static_cast<TestEnum>(i), String::number(i));
- InstrumentedOwner<EnumToStringMap* > root(value.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(EnumToStringMap) + sizeof(EnumToStringMap::ValueType) * value->capacity() + (sizeof(StringImpl) + 1) * value->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, hashCountedSetWithInstrumentedValues)
-{
- InstrumentationTestHelper helper;
-
- typedef HashCountedSet<Instrumented*> TestSet;
- OwnPtr<TestSet> set(adoptPtr(new TestSet()));
- Vector<OwnPtr<Instrumented> > keysVector;
- size_t count = 10;
- for (size_t i = 0; i < count; ++i) {
- keysVector.append(adoptPtr(new Instrumented()));
- for (size_t j = 0; j <= i; j++)
- set->add(keysVector.last().get());
- }
- InstrumentedOwner<TestSet* > root(set.get());
- helper.addRootObject(root);
- EXPECT_EQ(sizeof(TestSet) + sizeof(HashMap<Instrumented*, unsigned>::ValueType) * set->capacity() + (sizeof(Instrumented) + sizeof(NotInstrumented)) * set->size(), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u * count + 1, helper.visitedObjects());
-}
-
-TEST(MemoryInstrumentationTest, arrayBuffer)
-{
- InstrumentationTestHelper helper;
-
- typedef InstrumentedTemplate<RefPtr<ArrayBuffer> > ValueType;
- ValueType value(ArrayBuffer::create(1000, sizeof(int)));
- helper.addRootObject(value);
- EXPECT_EQ(sizeof(int) * 1000 + sizeof(ArrayBuffer), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class AncestorWithVirtualMethod {
-public:
- virtual char* data() { return m_data; }
-
-private:
- char m_data[10];
-};
-
-class ClassWithTwoAncestors : public AncestorWithVirtualMethod, public Instrumented {
-public:
- virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
- {
- MemoryClassInfo info(memoryObjectInfo, this, TestType);
- }
-};
-
-TEST(MemoryInstrumentationTest, instrumentedWithMultipleAncestors)
-{
- InstrumentationTestHelper helper;
- OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors());
- ClassWithTwoAncestors* descendantPointer = instance.get();
- InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer);
- Instrumented* ancestorPointer = descendantPointer;
- InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer);
- EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer));
-
- helper.addRootObject(descendantPointerOwner);
- helper.addRootObject(ancestorPointerOwner);
- EXPECT_EQ(sizeof(ClassWithTwoAncestors), helper.reportedSizeForAllTypes());
- EXPECT_EQ(2u, helper.visitedObjects());
-}
-
-class CheckCountedObjectsClient : public MemoryInstrumentationTestClient {
-public:
- CheckCountedObjectsClient(const void* expectedPointer) : m_expectedPointer(expectedPointer), m_expectedPointerFound(false) { }
- virtual bool checkCountedObject(const void* pointer)
- {
- EXPECT_EQ(pointer, m_expectedPointer);
- m_expectedPointerFound = true;
- return true;
- }
- bool expectedPointerFound() { return m_expectedPointerFound; }
-
-private:
- const void* m_expectedPointer;
- bool m_expectedPointerFound;
-};
-
-TEST(MemoryInstrumentationTest, checkCountedObjectWithMultipleAncestors)
-{
- OwnPtr<ClassWithTwoAncestors> instance = adoptPtr(new ClassWithTwoAncestors());
- ClassWithTwoAncestors* descendantPointer = instance.get();
- InstrumentedOwner<ClassWithTwoAncestors*> descendantPointerOwner(descendantPointer);
- Instrumented* ancestorPointer = descendantPointer;
- InstrumentedOwner<Instrumented*> ancestorPointerOwner(ancestorPointer);
- EXPECT_NE(static_cast<void*>(ancestorPointer), static_cast<void*>(descendantPointer));
-
- CheckCountedObjectsClient client(instance.get());
- InstrumentationTestImpl instrumentation(&client);
- instrumentation.addRootObject(descendantPointerOwner);
- instrumentation.addRootObject(ancestorPointerOwner);
- EXPECT_TRUE(client.expectedPointerFound());
-}
-
-} // namespace
-
diff --git a/Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp b/Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp
new file mode 100644
index 000000000..dcf9d27b3
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include <wtf/SHA1.h>
+#include <wtf/text/CString.h>
+
+namespace TestWebKitAPI {
+
+static void expectSHA1(CString input, int repeat, CString expected)
+{
+ SHA1 sha1;
+ for (int i = 0; i < repeat; ++i)
+ sha1.addBytes(input);
+ CString actual = sha1.computeHexDigest();
+
+ ASSERT_EQ(expected.length(), actual.length());
+ ASSERT_STREQ(expected.data(), actual.data());
+}
+
+TEST(WTF_SHA1, Computation)
+{
+ // Examples taken from sample code in RFC 3174.
+ expectSHA1("abc", 1, "A9993E364706816ABA3E25717850C26C9CD0D89D");
+ expectSHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 1, "84983E441C3BD26EBAAE4AA1F95129E5E54670F1");
+ expectSHA1("a", 1000000, "34AA973CD4C4DAA4F61EEB2BDBAD27316534016F");
+ expectSHA1("0123456701234567012345670123456701234567012345670123456701234567", 10, "DEA356A2CDDD90C7A7ECEDC5EBB563934F460452");
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
index 8ee5c6e04..d1b5b43bd 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,11 +34,11 @@
namespace TestWebKitAPI {
-void expectBuilderContent(const char* expected, const StringBuilder& builder)
+static void expectBuilderContent(const String& expected, const StringBuilder& builder)
{
// Not using builder.toString() or builder.toStringPreserveCapacity() because they all
// change internal state of builder.
- EXPECT_EQ(String(expected), String(builder.characters(), builder.length()));
+ EXPECT_EQ(expected, String(builder.characters(), builder.length()));
}
void expectEmpty(const StringBuilder& builder)
@@ -85,6 +86,16 @@ TEST(StringBuilderTest, Append)
builder2.toStringPreserveCapacity(); // Test after reifyString with buffer preserved.
builder2.append("abcd");
ASSERT_EQ(characters, builder2.characters());
+
+ // Test appending UChar32 characters to StringBuilder.
+ StringBuilder builderForUChar32Append;
+ UChar32 frakturAChar = 0x1D504;
+ builderForUChar32Append.append(frakturAChar); // The fraktur A is not in the BMP, so it's two UTF-16 code units long.
+ ASSERT_EQ(2U, builderForUChar32Append.length());
+ builderForUChar32Append.append(static_cast<UChar32>('A'));
+ ASSERT_EQ(3U, builderForUChar32Append.length());
+ const UChar resultArray[] = { U16_LEAD(frakturAChar), U16_TRAIL(frakturAChar), 'A' };
+ expectBuilderContent(String(resultArray, WTF_ARRAY_LENGTH(resultArray)), builderForUChar32Append);
}
TEST(StringBuilderTest, ToString)
@@ -274,4 +285,51 @@ TEST(StringBuilderTest, ToAtomicString)
ASSERT_EQ(atomicString2.impl(), string.impl());
}
+TEST(StringBuilderTest, ToAtomicStringOnEmpty)
+{
+ { // Default constructed.
+ StringBuilder builder;
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // With capacity.
+ StringBuilder builder;
+ builder.reserveCapacity(64);
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // AtomicString constructed from a null string.
+ StringBuilder builder;
+ builder.append(String());
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // AtomicString constructed from an empty string.
+ StringBuilder builder;
+ builder.append(emptyString());
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // AtomicString constructed from an empty StringBuilder.
+ StringBuilder builder;
+ StringBuilder emptyBuilder;
+ builder.append(emptyBuilder);
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // AtomicString constructed from an empty char* string.
+ StringBuilder builder;
+ builder.append("", 0);
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+ { // Cleared StringBuilder.
+ StringBuilder builder;
+ builder.appendLiteral("WebKit");
+ builder.clear();
+ AtomicString atomicString = builder.toAtomicString();
+ ASSERT_EQ(emptyAtom, atomicString);
+ }
+}
+
} // namespace
diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp
new file mode 100644
index 000000000..a4d223c99
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/StringHasher.cpp
@@ -0,0 +1,444 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <wtf/StringHasher.h>
+
+namespace TestWebKitAPI {
+
+static const LChar nullLChars[2] = { 0, 0 };
+static const UChar nullUChars[2] = { 0, 0 };
+
+static const unsigned emptyStringHash = 0x4EC889EU;
+static const unsigned singleNullCharacterHash = 0x3D3ABF44U;
+
+static const LChar testALChars[6] = { 0x41, 0x95, 0xFF, 0x50, 0x01, 0 };
+static const UChar testAUChars[6] = { 0x41, 0x95, 0xFF, 0x50, 0x01, 0 };
+static const UChar testBUChars[6] = { 0x41, 0x95, 0xFFFF, 0x1080, 0x01, 0 };
+
+static const unsigned testAHash1 = 0xEA32B004;
+static const unsigned testAHash2 = 0x93F0F71E;
+static const unsigned testAHash3 = 0xCB609EB1;
+static const unsigned testAHash4 = 0x7984A706;
+static const unsigned testAHash5 = 0x0427561F;
+
+static const unsigned testBHash1 = 0xEA32B004;
+static const unsigned testBHash2 = 0x93F0F71E;
+static const unsigned testBHash3 = 0x59EB1B2C;
+static const unsigned testBHash4 = 0xA7BCCC0A;
+static const unsigned testBHash5 = 0x79201649;
+
+TEST(WTF, StringHasher)
+{
+ StringHasher hasher;
+
+ // The initial state of the hasher.
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+}
+
+TEST(WTF, StringHasher_addCharacter)
+{
+ StringHasher hasher;
+
+ // Hashing a single character.
+ hasher = StringHasher();
+ hasher.addCharacter(0);
+ ASSERT_EQ(singleNullCharacterHash, hasher.hash());
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, checking the intermediate state after each is added.
+ hasher = StringHasher();
+ hasher.addCharacter(testAUChars[0]);
+ ASSERT_EQ(testAHash1, hasher.hash());
+ ASSERT_EQ(testAHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testAUChars[1]);
+ ASSERT_EQ(testAHash2, hasher.hash());
+ ASSERT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testAUChars[2]);
+ ASSERT_EQ(testAHash3, hasher.hash());
+ ASSERT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testAUChars[3]);
+ ASSERT_EQ(testAHash4, hasher.hash());
+ ASSERT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testAUChars[4]);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing a second set of five characters, including non-Latin-1 characters.
+ hasher = StringHasher();
+ hasher.addCharacter(testBUChars[0]);
+ ASSERT_EQ(testBHash1, hasher.hash());
+ ASSERT_EQ(testBHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testBUChars[1]);
+ ASSERT_EQ(testBHash2, hasher.hash());
+ ASSERT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testBUChars[2]);
+ ASSERT_EQ(testBHash3, hasher.hash());
+ ASSERT_EQ(testBHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testBUChars[3]);
+ ASSERT_EQ(testBHash4, hasher.hash());
+ ASSERT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testBUChars[4]);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+}
+
+TEST(WTF, StringHasher_addCharacters)
+{
+ StringHasher hasher;
+
+ // Hashing zero characters.
+ hasher = StringHasher();
+ hasher.addCharacters(static_cast<LChar*>(0), 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(nullLChars, 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(nullLChars);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(static_cast<UChar*>(0), 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(nullUChars, 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(nullUChars);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing one character.
+ hasher = StringHasher();
+ hasher.addCharacters(nullLChars, 1);
+ ASSERT_EQ(singleNullCharacterHash, hasher.hash());
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(nullUChars, 1);
+ ASSERT_EQ(singleNullCharacterHash, hasher.hash());
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, all at once.
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars, 5);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars, 5);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars, 5);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, in groups of two, then the last one.
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars, 2);
+ ASSERT_EQ(testAHash2, hasher.hash());
+ ASSERT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testALChars + 2, 2);
+ ASSERT_EQ(testAHash4, hasher.hash());
+ ASSERT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testALChars + 4, 1);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars, 2);
+ hasher.addCharacters(testALChars + 2, 2);
+ hasher.addCharacters(testALChars + 4);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars, 2);
+ ASSERT_EQ(testAHash2, hasher.hash());
+ ASSERT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testAUChars + 2, 2);
+ ASSERT_EQ(testAHash4, hasher.hash());
+ ASSERT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testAUChars + 4, 1);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars, 2);
+ hasher.addCharacters(testAUChars + 2, 2);
+ hasher.addCharacters(testAUChars + 4);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars, 2);
+ ASSERT_EQ(testBHash2, hasher.hash());
+ ASSERT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testBUChars + 2, 2);
+ ASSERT_EQ(testBHash4, hasher.hash());
+ ASSERT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testBUChars + 4, 1);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars, 2);
+ hasher.addCharacters(testBUChars + 2, 2);
+ hasher.addCharacters(testBUChars + 4);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, the first three, then the last two.
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars, 3);
+ ASSERT_EQ(testAHash3, hasher.hash());
+ ASSERT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testALChars + 3, 2);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testALChars, 3);
+ ASSERT_EQ(testAHash3, hasher.hash());
+ ASSERT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testALChars + 3);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars, 3);
+ ASSERT_EQ(testAHash3, hasher.hash());
+ ASSERT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testAUChars + 3, 2);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testAUChars, 3);
+ ASSERT_EQ(testAHash3, hasher.hash());
+ ASSERT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testAUChars + 3, 2);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars, 3);
+ ASSERT_EQ(testBHash3, hasher.hash());
+ ASSERT_EQ(testBHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacters(testBUChars + 3, 2);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharacters(testBUChars, 3);
+ hasher.addCharacters(testBUChars + 3);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+}
+
+TEST(WTF, StringHasher_addCharactersAssumingAligned)
+{
+ StringHasher hasher;
+
+ // Hashing zero characters.
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(static_cast<LChar*>(0), 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(nullLChars, 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(static_cast<UChar*>(0), 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(nullUChars, 0);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(nullUChars);
+ ASSERT_EQ(emptyStringHash, hasher.hash());
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing one character.
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(nullLChars, 1);
+ ASSERT_EQ(singleNullCharacterHash, hasher.hash());
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(nullUChars, 1);
+ ASSERT_EQ(singleNullCharacterHash, hasher.hash());
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, all at once.
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testALChars, 5);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testALChars);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testAUChars, 5);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testAUChars);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testBUChars, 5);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testBUChars);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, in groups of two, then the last one.
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testALChars, 2);
+ ASSERT_EQ(testAHash2, hasher.hash());
+ ASSERT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testALChars + 2, 2);
+ ASSERT_EQ(testAHash4, hasher.hash());
+ ASSERT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testALChars + 4, 1);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testALChars, 2);
+ hasher.addCharactersAssumingAligned(testALChars + 2, 2);
+ hasher.addCharactersAssumingAligned(testALChars + 4);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testAUChars, 2);
+ ASSERT_EQ(testAHash2, hasher.hash());
+ ASSERT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testAUChars + 2, 2);
+ ASSERT_EQ(testAHash4, hasher.hash());
+ ASSERT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testAUChars + 4, 1);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testAUChars, 2);
+ hasher.addCharactersAssumingAligned(testAUChars + 2, 2);
+ hasher.addCharactersAssumingAligned(testAUChars + 4);
+ ASSERT_EQ(testAHash5, hasher.hash());
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testBUChars, 2);
+ ASSERT_EQ(testBHash2, hasher.hash());
+ ASSERT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testBUChars + 2, 2);
+ ASSERT_EQ(testBHash4, hasher.hash());
+ ASSERT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testBUChars + 4, 1);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher = StringHasher();
+ hasher.addCharactersAssumingAligned(testBUChars, 2);
+ hasher.addCharactersAssumingAligned(testBUChars + 2, 2);
+ hasher.addCharactersAssumingAligned(testBUChars + 4);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+
+ // Hashing five characters, first two characters one at a time,
+ // then two more, then the last one.
+ hasher = StringHasher();
+ hasher.addCharacter(testBUChars[0]);
+ ASSERT_EQ(testBHash1, hasher.hash());
+ ASSERT_EQ(testBHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharacter(testBUChars[1]);
+ ASSERT_EQ(testBHash2, hasher.hash());
+ ASSERT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testBUChars[2], testBUChars[3]);
+ ASSERT_EQ(testBHash4, hasher.hash());
+ ASSERT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+ hasher.addCharactersAssumingAligned(testBUChars + 4);
+ ASSERT_EQ(testBHash5, hasher.hash());
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked());
+}
+
+TEST(WTF, StringHasher_computeHash)
+{
+ ASSERT_EQ(emptyStringHash, StringHasher::computeHash(static_cast<LChar*>(0), 0));
+ ASSERT_EQ(emptyStringHash, StringHasher::computeHash(nullLChars, 0));
+ ASSERT_EQ(emptyStringHash, StringHasher::computeHash(static_cast<UChar*>(0), 0));
+ ASSERT_EQ(emptyStringHash, StringHasher::computeHash(nullUChars, 0));
+
+ ASSERT_EQ(singleNullCharacterHash, StringHasher::computeHash(nullLChars, 1));
+ ASSERT_EQ(singleNullCharacterHash, StringHasher::computeHash(nullUChars, 1));
+
+ ASSERT_EQ(testAHash5, StringHasher::computeHash(testALChars, 5));
+ ASSERT_EQ(testAHash5, StringHasher::computeHash(testAUChars, 5));
+ ASSERT_EQ(testBHash5, StringHasher::computeHash(testBUChars, 5));
+}
+
+TEST(WTF, StringHasher_computeHashAndMaskTop8Bits)
+{
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(static_cast<LChar*>(0), 0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(nullLChars, 0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(static_cast<UChar*>(0), 0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(nullUChars, 0));
+
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(nullLChars, 1));
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(nullUChars, 1));
+
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(testALChars, 5));
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(testAUChars, 5));
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, StringHasher::computeHashAndMaskTop8Bits(testBUChars, 5));
+}
+
+TEST(WTF, StringHasher_hashMemory)
+{
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory(0, 0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory(nullUChars, 0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory<0>(0));
+ ASSERT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory<0>(nullUChars));
+
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, StringHasher::hashMemory(nullUChars, 2));
+ ASSERT_EQ(singleNullCharacterHash & 0xFFFFFF, StringHasher::hashMemory<2>(nullUChars));
+
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, StringHasher::hashMemory(testAUChars, 10));
+ ASSERT_EQ(testAHash5 & 0xFFFFFF, StringHasher::hashMemory<10>(testAUChars));
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, StringHasher::hashMemory(testBUChars, 10));
+ ASSERT_EQ(testBHash5 & 0xFFFFFF, StringHasher::hashMemory<10>(testBUChars));
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
index 35d64844c..10ab9e2cb 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
@@ -37,7 +37,6 @@ TEST(WTF, StringImplCreationFromLiteral)
ASSERT_EQ(strlen("Template Literal"), stringWithTemplate->length());
ASSERT_TRUE(equal(stringWithTemplate.get(), "Template Literal"));
ASSERT_TRUE(stringWithTemplate->is8Bit());
- ASSERT_TRUE(stringWithTemplate->hasTerminatingNullCharacter());
// Constructor taking the size explicitely.
const char* programmaticStringData = "Explicit Size Literal";
@@ -46,7 +45,6 @@ TEST(WTF, StringImplCreationFromLiteral)
ASSERT_TRUE(equal(programmaticString.get(), programmaticStringData));
ASSERT_EQ(programmaticStringData, reinterpret_cast<const char*>(programmaticString->characters8()));
ASSERT_TRUE(programmaticString->is8Bit());
- ASSERT_TRUE(programmaticString->hasTerminatingNullCharacter());
// Constructor without explicit size.
const char* stringWithoutLengthLiteral = "No Size Literal";
@@ -55,7 +53,6 @@ TEST(WTF, StringImplCreationFromLiteral)
ASSERT_TRUE(equal(programmaticStringNoLength.get(), stringWithoutLengthLiteral));
ASSERT_EQ(stringWithoutLengthLiteral, reinterpret_cast<const char*>(programmaticStringNoLength->characters8()));
ASSERT_TRUE(programmaticStringNoLength->is8Bit());
- ASSERT_TRUE(programmaticStringNoLength->hasTerminatingNullCharacter());
}
TEST(WTF, StringImplFromLiteralLoop16BitConversion)
diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
index 819013fdb..149b85b21 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
@@ -45,6 +45,7 @@ TEST(WTF, StringOperators)
{
String string("String");
AtomicString atomicString("AtomicString");
+ ASCIILiteral literal("ASCIILiteral");
EXPECT_EQ(0, wtfStringCopyCount);
@@ -58,6 +59,11 @@ TEST(WTF, StringOperators)
EXPECT_N_WTF_STRING_COPIES(1, "C string" + atomicString);
EXPECT_N_WTF_STRING_COPIES(1, atomicString + "C string");
+ EXPECT_N_WTF_STRING_COPIES(1, literal + string);
+ EXPECT_N_WTF_STRING_COPIES(1, string + literal);
+ EXPECT_N_WTF_STRING_COPIES(1, literal + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(1, atomicString + literal);
+
EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + "C string" + string);
EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + "C string" + string));
EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + ("C string" + string));
@@ -65,6 +71,41 @@ TEST(WTF, StringOperators)
EXPECT_N_WTF_STRING_COPIES(2, string + ("C string" + string + "C string"));
EXPECT_N_WTF_STRING_COPIES(2, (string + "C string") + (string + "C string"));
+ EXPECT_N_WTF_STRING_COPIES(2, literal + string + literal + string);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (string + literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + (literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, string + literal + string + literal);
+ EXPECT_N_WTF_STRING_COPIES(2, string + (literal + string + literal));
+ EXPECT_N_WTF_STRING_COPIES(2, (string + literal) + (string + literal));
+
+ EXPECT_N_WTF_STRING_COPIES(2, literal + string + "C string" + string);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (string + "C string" + string));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + ("C string" + string));
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + literal + string);
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + (literal + string));
+
+ EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + "C string" + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + "C string" + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + atomicString) + ("C string" + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + atomicString + literal + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + (atomicString + literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, ("C string" + atomicString) + (literal + atomicString));
+
+ EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + "C string" + string);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + "C string" + string));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + atomicString) + ("C string" + string));
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + atomicString + literal + string);
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + (atomicString + literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, ("C string" + atomicString) + (literal + string));
+
+ EXPECT_N_WTF_STRING_COPIES(2, literal + string + "C string" + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (string + "C string" + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + ("C string" + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + literal + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + (literal + atomicString));
+
EXPECT_N_WTF_STRING_COPIES(2, "C string" + atomicString + "C string" + atomicString);
EXPECT_N_WTF_STRING_COPIES(2, "C string" + (atomicString + "C string" + atomicString));
EXPECT_N_WTF_STRING_COPIES(2, ("C string" + atomicString) + ("C string" + atomicString));
@@ -72,6 +113,13 @@ TEST(WTF, StringOperators)
EXPECT_N_WTF_STRING_COPIES(2, atomicString + ("C string" + atomicString + "C string"));
EXPECT_N_WTF_STRING_COPIES(2, (atomicString + "C string") + (atomicString + "C string"));
+ EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + literal + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + atomicString) + (literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, atomicString + literal + atomicString + literal);
+ EXPECT_N_WTF_STRING_COPIES(2, atomicString + (literal + atomicString + literal));
+ EXPECT_N_WTF_STRING_COPIES(2, (atomicString + literal) + (atomicString + literal));
+
EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + "C string" + atomicString);
EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + "C string" + atomicString));
EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + ("C string" + atomicString));
@@ -79,6 +127,13 @@ TEST(WTF, StringOperators)
EXPECT_N_WTF_STRING_COPIES(2, string + ("C string" + atomicString + "C string"));
EXPECT_N_WTF_STRING_COPIES(2, (string + "C string") + (atomicString + "C string"));
+ EXPECT_N_WTF_STRING_COPIES(2, literal + string + literal + atomicString);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (string + literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + (literal + atomicString));
+ EXPECT_N_WTF_STRING_COPIES(2, string + literal + atomicString + literal);
+ EXPECT_N_WTF_STRING_COPIES(2, string + (literal + atomicString + literal));
+ EXPECT_N_WTF_STRING_COPIES(2, (string + literal) + (atomicString + literal));
+
EXPECT_N_WTF_STRING_COPIES(2, "C string" + atomicString + "C string" + string);
EXPECT_N_WTF_STRING_COPIES(2, "C string" + (atomicString + "C string" + string));
EXPECT_N_WTF_STRING_COPIES(2, ("C string" + atomicString) + ("C string" + string));
@@ -86,6 +141,13 @@ TEST(WTF, StringOperators)
EXPECT_N_WTF_STRING_COPIES(2, atomicString + ("C string" + string + "C string"));
EXPECT_N_WTF_STRING_COPIES(2, (atomicString + "C string") + (string + "C string"));
+ EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + literal + string);
+ EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, (literal + atomicString) + (literal + string));
+ EXPECT_N_WTF_STRING_COPIES(2, atomicString + literal + string + literal);
+ EXPECT_N_WTF_STRING_COPIES(2, atomicString + (literal + string + literal));
+ EXPECT_N_WTF_STRING_COPIES(2, (atomicString + literal) + (string + literal));
+
#if COMPILER(MSVC)
EXPECT_N_WTF_STRING_COPIES(1, L"wide string" + string);
EXPECT_N_WTF_STRING_COPIES(1, string + L"wide string");
diff --git a/Tools/TestWebKitAPI/Tests/WTF/WTF.pro b/Tools/TestWebKitAPI/Tests/WTF/WTF.pro
new file mode 100644
index 000000000..8b3658ffd
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WTF/WTF.pro
@@ -0,0 +1,32 @@
+TEMPLATE = app
+TARGET = tst_wtf
+
+SOURCES += \
+ AtomicString.cpp \
+ CheckedArithmeticOperations.cpp \
+ CString.cpp \
+ Functional.cpp \
+ HashMap.cpp \
+ HashSet.cpp \
+ IntegerToStringConversion.cpp \
+ ListHashSet.cpp \
+ MD5.cpp \
+ MathExtras.cpp \
+ MediaTime.cpp \
+ RedBlackTree.cpp \
+ SHA1.cpp \
+ SaturatedArithmeticOperations.cpp \
+ StringBuilder.cpp \
+ StringHasher.cpp \
+ StringImpl.cpp \
+ StringOperators.cpp \
+ TemporaryChange.cpp \
+ Vector.cpp \
+ VectorBasic.cpp \
+ VectorReverse.cpp \
+ WTFString.cpp
+
+include(../../TestWebKitAPI.pri)
+
+DEFINES += APITEST_SOURCE_DIR=\\\"$$PWD\\\"
+
diff --git a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
index 4a92cd4e8..3da40ff83 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
@@ -38,14 +38,12 @@ TEST(WTF, StringCreationFromLiteral)
ASSERT_EQ(strlen("Explicit construction syntax"), stringFromLiteral.length());
ASSERT_TRUE(stringFromLiteral == "Explicit construction syntax");
ASSERT_TRUE(stringFromLiteral.is8Bit());
- ASSERT_TRUE(stringFromLiteral.impl()->hasTerminatingNullCharacter());
ASSERT_TRUE(String("Explicit construction syntax") == stringFromLiteral);
String stringWithTemplate("Template Literal", String::ConstructFromLiteral);
ASSERT_EQ(strlen("Template Literal"), stringWithTemplate.length());
ASSERT_TRUE(stringWithTemplate == "Template Literal");
ASSERT_TRUE(stringWithTemplate.is8Bit());
- ASSERT_TRUE(stringWithTemplate.impl()->hasTerminatingNullCharacter());
ASSERT_TRUE(String("Template Literal") == stringWithTemplate);
}
diff --git a/Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp b/Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp
index 0cd28c9bb..6dd7b6a56 100644
--- a/Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp
+++ b/Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp
@@ -38,13 +38,13 @@ TEST(RetainPtrHashing, HashSet)
{
HashSet<RetainPtr<CFStringRef> > set;
- RetainPtr<CFStringRef> foo(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(set.contains(foo));
set.add(foo);
EXPECT_TRUE(set.contains(foo));
- RetainPtr<CFStringRef> foo2(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(set.contains(foo2));
set.add(foo2);
EXPECT_TRUE(set.contains(foo2));
@@ -57,13 +57,13 @@ TEST(RetainPtrHashing, HashMapKey)
{
HashMap<RetainPtr<CFStringRef>, int> map;
- RetainPtr<CFStringRef> foo(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(map.contains(foo));
map.add(foo, 1);
EXPECT_EQ(1, map.get(foo));
- RetainPtr<CFStringRef> foo2(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(map.contains(foo2));
map.add(foo2, 2);
EXPECT_EQ(2, map.get(foo2));
@@ -76,13 +76,13 @@ TEST(RetainPtrHashing, HashMapValue)
{
HashMap<int, RetainPtr<CFStringRef> > map;
- RetainPtr<CFStringRef> foo(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(map.contains(1));
map.add(1, foo);
EXPECT_EQ(foo, map.get(1));
- RetainPtr<CFStringRef> foo2(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
EXPECT_FALSE(map.contains(2));
map.add(2, foo2);
EXPECT_EQ(foo2, map.get(2));
diff --git a/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp b/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp
index 66f580805..6eade5586 100644
--- a/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebCore/KURL.cpp
@@ -32,7 +32,7 @@ using namespace WebCore;
namespace TestWebKitAPI {
-class WebCore: public testing::Test {
+class KURLTest : public testing::Test {
public:
virtual void SetUp()
{
@@ -40,21 +40,19 @@ public:
}
};
-TEST_F(WebCore, KURLConstructorDefault)
+TEST_F(KURLTest, KURLConstructorDefault)
{
KURL kurl;
- EXPECT_FALSE(kurl.hasPath());
EXPECT_TRUE(kurl.isEmpty());
EXPECT_TRUE(kurl.isNull());
EXPECT_FALSE(kurl.isValid());
}
-TEST_F(WebCore, KURLConstructorConstChar)
+TEST_F(KURLTest, KURLConstructorConstChar)
{
KURL kurl(ParsedURLString, "http://username:password@www.example.com:8080/index.html?var=val#fragment");
- EXPECT_TRUE(kurl.hasPath());
EXPECT_FALSE(kurl.isEmpty());
EXPECT_FALSE(kurl.isNull());
EXPECT_TRUE(kurl.isValid());
@@ -72,4 +70,13 @@ TEST_F(WebCore, KURLConstructorConstChar)
EXPECT_EQ(String("fragment"), kurl.fragmentIdentifier());
}
+TEST_F(KURLTest, KURLDataURIStringSharing)
+{
+ KURL baseURL(ParsedURLString, "http://www.webkit.org/");
+ String threeApples = "data:text/plain;charset=utf-8;base64,76O/76O/76O/";
+
+ KURL url(baseURL, threeApples);
+ EXPECT_EQ(threeApples.impl(), url.string().impl());
+}
+
} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp b/Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
new file mode 100644
index 000000000..ceafb039c
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define ENABLE_SUBPIXEL_LAYOUT 1
+#define ENABLE_SATURATED_LAYOUT_ARITHMETIC 1
+#include "config.h"
+
+#include <WebCore/LayoutUnit.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+TEST(WebCoreLayoutUnit, LayoutUnitInt)
+{
+ ASSERT_EQ(LayoutUnit(INT_MIN).toInt(), intMinForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(INT_MIN / 2).toInt(), intMinForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit - 1).toInt(), intMinForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).toInt(), intMinForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit + 1).toInt(), intMinForLayoutUnit + 1);
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit / 2).toInt(), intMinForLayoutUnit / 2);
+ ASSERT_EQ(LayoutUnit(-10000).toInt(), -10000);
+ ASSERT_EQ(LayoutUnit(-1000).toInt(), -1000);
+ ASSERT_EQ(LayoutUnit(-100).toInt(), -100);
+ ASSERT_EQ(LayoutUnit(-10).toInt(), -10);
+ ASSERT_EQ(LayoutUnit(-1).toInt(), -1);
+ ASSERT_EQ(LayoutUnit(0).toInt(), 0);
+ ASSERT_EQ(LayoutUnit(1).toInt(), 1);
+ ASSERT_EQ(LayoutUnit(100).toInt(), 100);
+ ASSERT_EQ(LayoutUnit(1000).toInt(), 1000);
+ ASSERT_EQ(LayoutUnit(10000).toInt(), 10000);
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit / 2).toInt(), intMaxForLayoutUnit / 2);
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit - 1).toInt(), intMaxForLayoutUnit - 1);
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).toInt(), intMaxForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit + 1).toInt(), intMaxForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(INT_MAX / 2).toInt(), intMaxForLayoutUnit);
+ ASSERT_EQ(LayoutUnit(INT_MAX).toInt(), intMaxForLayoutUnit);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitFloat)
+{
+ const float tolerance = 1.0f / kFixedPointDenominator;
+ ASSERT_FLOAT_EQ(LayoutUnit(1.0f).toFloat(), 1.0f);
+ ASSERT_FLOAT_EQ(LayoutUnit(1.25f).toFloat(), 1.25f);
+ ASSERT_NEAR(LayoutUnit(1.1f).toFloat(), 1.1f, tolerance);
+ ASSERT_NEAR(LayoutUnit(1.33f).toFloat(), 1.33f, tolerance);
+ ASSERT_NEAR(LayoutUnit(1.3333f).toFloat(), 1.3333f, tolerance);
+ ASSERT_NEAR(LayoutUnit(1.53434f).toFloat(), 1.53434f, tolerance);
+ ASSERT_NEAR(LayoutUnit(345634).toFloat(), 345634.0f, tolerance);
+ ASSERT_NEAR(LayoutUnit(345634.12335f).toFloat(), 345634.12335f, tolerance);
+ ASSERT_NEAR(LayoutUnit(-345634.12335f).toFloat(), -345634.12335f, tolerance);
+ ASSERT_NEAR(LayoutUnit(-345634).toFloat(), -345634.0f, tolerance);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitRounding)
+{
+ ASSERT_EQ(LayoutUnit(-1.9f).round(), -2);
+ ASSERT_EQ(LayoutUnit(-1.6f).round(), -2);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-1.51f).round(), -2);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-1.5f).round(), -1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-1.49f).round(), -1);
+ ASSERT_EQ(LayoutUnit(-1.0f).round(), -1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-0.99f).round(), -1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-0.51f).round(), -1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-0.50f).round(), 0);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(-0.49f).round(), 0);
+ ASSERT_EQ(LayoutUnit(-0.1f).round(), 0);
+ ASSERT_EQ(LayoutUnit(0.0f).round(), 0);
+ ASSERT_EQ(LayoutUnit(0.1f).round(), 0);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(0.49f).round(), 0);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(0.50f).round(), 1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(0.51f).round(), 1);
+ ASSERT_EQ(LayoutUnit(0.99f).round(), 1);
+ ASSERT_EQ(LayoutUnit(1.0f).round(), 1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(1.49f).round(), 1);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(1.5f).round(), 2);
+ ASSERT_EQ(LayoutUnit::fromFloatRound(1.51f).round(), 2);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitSnapSizeToPixel)
+{
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1), LayoutUnit(0)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1), LayoutUnit(0.5)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0)), 2);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.49)), 2);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.5)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.75)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.99)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(1)), 2);
+
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(0.5), LayoutUnit(1.5)), 0);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(0.99), LayoutUnit(1.5)), 0);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.0), LayoutUnit(1.5)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.49), LayoutUnit(1.5)), 1);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(1.5)), 1);
+
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(100.5), LayoutUnit(100)), 101);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(intMaxForLayoutUnit), LayoutUnit(0.3)), intMaxForLayoutUnit);
+ ASSERT_EQ(snapSizeToPixel(LayoutUnit(intMinForLayoutUnit), LayoutUnit(-0.3)), intMinForLayoutUnit);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitMultiplication)
+{
+ ASSERT_EQ((LayoutUnit(1) * LayoutUnit(1)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(1) * LayoutUnit(2)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(2) * LayoutUnit(1)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(2) * LayoutUnit(0.5)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(0.5) * LayoutUnit(2)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(100) * LayoutUnit(1)).toInt(), 100);
+
+ ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(1)).toInt(), -1);
+ ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(2)).toInt(), -2);
+ ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(1)).toInt(), -2);
+ ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(0.5)).toInt(), -1);
+ ASSERT_EQ((LayoutUnit(-0.5) * LayoutUnit(2)).toInt(), -1);
+ ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(1)).toInt(), -100);
+
+ ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(-1)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(-2)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(-1)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(-0.5)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(-0.5) * LayoutUnit(-2)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(-1)).toInt(), 100);
+
+ ASSERT_EQ((LayoutUnit(100) * LayoutUnit(3.33)).round(), 333);
+ ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(3.33)).round(), -333);
+ ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(-3.33)).round(), 333);
+
+ size_t aHundredSizeT = 100;
+ ASSERT_EQ((LayoutUnit(aHundredSizeT) * LayoutUnit(1)).toInt(), 100);
+ ASSERT_EQ((aHundredSizeT * LayoutUnit(4)).toInt(), 400);
+ ASSERT_EQ((LayoutUnit(4) * aHundredSizeT).toInt(), 400);
+
+ int quarterMax = intMaxForLayoutUnit / 4;
+ ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(2)).toInt(), quarterMax * 2);
+ ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(3)).toInt(), quarterMax * 3);
+ ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(4)).toInt(), quarterMax * 4);
+ ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(5)).toInt(), intMaxForLayoutUnit);
+
+ size_t overflowIntSizeT = intMaxForLayoutUnit * 4;
+ ASSERT_EQ((LayoutUnit(overflowIntSizeT) * LayoutUnit(2)).toInt(), intMaxForLayoutUnit);
+ ASSERT_EQ((overflowIntSizeT * LayoutUnit(4)).toInt(), intMaxForLayoutUnit);
+ ASSERT_EQ((LayoutUnit(4) * overflowIntSizeT).toInt(), intMaxForLayoutUnit);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitDivision)
+{
+ ASSERT_EQ((LayoutUnit(1) / LayoutUnit(1)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(1) / LayoutUnit(2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(2) / LayoutUnit(1)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(2) / LayoutUnit(0.5)).toInt(), 4);
+ ASSERT_EQ((LayoutUnit(0.5) / LayoutUnit(2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(100) / LayoutUnit(10)).toInt(), 10);
+ ASSERT_FLOAT_EQ((LayoutUnit(1) / LayoutUnit(2)).toFloat(), 0.5f);
+ ASSERT_FLOAT_EQ((LayoutUnit(0.5) / LayoutUnit(2)).toFloat(), 0.25f);
+
+ ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(1)).toInt(), -1);
+ ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(1)).toInt(), -2);
+ ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(0.5)).toInt(), -4);
+ ASSERT_EQ((LayoutUnit(-0.5) / LayoutUnit(2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(-100) / LayoutUnit(10)).toInt(), -10);
+ ASSERT_FLOAT_EQ((LayoutUnit(-1) / LayoutUnit(2)).toFloat(), -0.5f);
+ ASSERT_FLOAT_EQ((LayoutUnit(-0.5) / LayoutUnit(2)).toFloat(), -0.25f);
+
+ ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(-1)).toInt(), 1);
+ ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(-2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(-1)).toInt(), 2);
+ ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(-0.5)).toInt(), 4);
+ ASSERT_EQ((LayoutUnit(-0.5) / LayoutUnit(-2)).toInt(), 0);
+ ASSERT_EQ((LayoutUnit(-100) / LayoutUnit(-10)).toInt(), 10);
+ ASSERT_FLOAT_EQ((LayoutUnit(-1) / LayoutUnit(-2)).toFloat(), 0.5f);
+ ASSERT_FLOAT_EQ((LayoutUnit(-0.5) / LayoutUnit(-2)).toFloat(), 0.25f);
+
+ size_t aHundredSizeT = 100;
+ ASSERT_EQ((LayoutUnit(aHundredSizeT) / LayoutUnit(2)).toInt(), 50);
+ ASSERT_EQ((aHundredSizeT / LayoutUnit(4)).toInt(), 25);
+ ASSERT_EQ((LayoutUnit(400) / aHundredSizeT).toInt(), 4);
+
+ ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) / LayoutUnit(2)).toInt(), intMaxForLayoutUnit / 2);
+ ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) / LayoutUnit(0.5)).toInt(), intMaxForLayoutUnit);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitCeil)
+{
+ ASSERT_EQ(LayoutUnit(0).ceil(), 0);
+ ASSERT_EQ(LayoutUnit(0.1).ceil(), 1);
+ ASSERT_EQ(LayoutUnit(0.5).ceil(), 1);
+ ASSERT_EQ(LayoutUnit(0.9).ceil(), 1);
+ ASSERT_EQ(LayoutUnit(1.0).ceil(), 1);
+ ASSERT_EQ(LayoutUnit(1.1).ceil(), 2);
+
+ ASSERT_EQ(LayoutUnit(-0.1).ceil(), 0);
+ ASSERT_EQ(LayoutUnit(-0.5).ceil(), 0);
+ ASSERT_EQ(LayoutUnit(-0.9).ceil(), 0);
+ ASSERT_EQ(LayoutUnit(-1.0).ceil(), -1);
+
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).ceil(), intMaxForLayoutUnit);
+ ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) - LayoutUnit(0.5)).ceil(), intMaxForLayoutUnit);
+ ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) - LayoutUnit(1)).ceil(), intMaxForLayoutUnit - 1);
+
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).ceil(), intMinForLayoutUnit);
+}
+
+TEST(WebCoreLayoutUnit, LayoutUnitFloor)
+{
+ ASSERT_EQ(LayoutUnit(0).floor(), 0);
+ ASSERT_EQ(LayoutUnit(0.1).floor(), 0);
+ ASSERT_EQ(LayoutUnit(0.5).floor(), 0);
+ ASSERT_EQ(LayoutUnit(0.9).floor(), 0);
+ ASSERT_EQ(LayoutUnit(1.0).floor(), 1);
+ ASSERT_EQ(LayoutUnit(1.1).floor(), 1);
+
+ ASSERT_EQ(LayoutUnit(-0.1).floor(), -1);
+ ASSERT_EQ(LayoutUnit(-0.5).floor(), -1);
+ ASSERT_EQ(LayoutUnit(-0.9).floor(), -1);
+ ASSERT_EQ(LayoutUnit(-1.0).floor(), -1);
+
+ ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).floor(), intMaxForLayoutUnit);
+
+ ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).floor(), intMinForLayoutUnit);
+ ASSERT_EQ((LayoutUnit(intMinForLayoutUnit) + LayoutUnit(0.5)).floor(), intMinForLayoutUnit);
+ ASSERT_EQ((LayoutUnit(intMinForLayoutUnit) + LayoutUnit(1)).floor(), intMinForLayoutUnit + 1);
+}
+
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp b/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp
index d0d1bf29e..61b87cdad 100644
--- a/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp
@@ -50,10 +50,10 @@ public:
TEST(WebCore, BitmapImageEmptyFrameTest)
{
SIZE sz = {16, 16};
- BitmapImageTest bitmapImageTest;
+ RefPtr<BitmapImageTest> bitmapImageTest = adoptRef(new BitmapImageTest);
int bits[256];
HBITMAP hBitmap = CreateBitmap(16, 16, 1, 32, bits);
- bitmapImageTest.getHBITMAPOfSize(hBitmap, &sz);
+ bitmapImageTest->getHBITMAPOfSize(hBitmap, &sz);
}
} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp
new file mode 100644
index 000000000..09230bb57
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+
+namespace TestWebKitAPI {
+
+static bool loaded;
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ loaded = true;
+}
+
+// Test for https://webkit.org/b/115607
+// This tests that we don't crash when calling WKPageClose and WKPageTerminate.
+
+TEST(WebKit2, CloseThenTerminate)
+{
+ WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0 , sizeof(loaderClient));
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&loaded);
+
+ WKPageClose(webView.page());
+ WKPageTerminate(webView.page());
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp
new file mode 100644
index 000000000..de80f4437
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "WebKit2/WKView.h"
+#include "WebKit2/WKRetainPtr.h"
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2, WKViewUserViewportToContents)
+{
+ // This test creates a WKView and uses the WKViewUserViewportToContents
+ // function to convert viewport coordinates to contents (page) coordinates.
+ // It scrolls and scales around the contents and check if the coordinates
+ // conversion math is right.
+
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKViewRef> webView(AdoptWK, WKViewCreate(context.get(), 0));
+
+ WKViewInitialize(webView.get());
+ WKPageSetUseFixedLayout(WKViewGetPage(webView.get()), false);
+
+ WKPoint out;
+
+ // At scale 1.0 the viewport and contents coordinates should match.
+
+ WKViewSetContentScaleFactor(webView.get(), 1.0);
+ WKViewSetContentPosition(webView.get(), WKPointMake(0, 0));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 0);
+ EXPECT_EQ(out.y, 0);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 10);
+ EXPECT_EQ(out.y, 10);
+
+ WKViewSetContentPosition(webView.get(), WKPointMake(20, 20));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 20);
+ EXPECT_EQ(out.y, 20);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 30);
+ EXPECT_EQ(out.y, 30);
+
+ // At scale 2.0 the viewport distance values will be half
+ // the ones seem in the contents.
+
+ WKViewSetContentScaleFactor(webView.get(), 2.0);
+ WKViewSetContentPosition(webView.get(), WKPointMake(0, 0));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 0);
+ EXPECT_EQ(out.y, 0);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 5);
+ EXPECT_EQ(out.y, 5);
+
+ WKViewSetContentPosition(webView.get(), WKPointMake(20, 20));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 20);
+ EXPECT_EQ(out.y, 20);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 25);
+ EXPECT_EQ(out.y, 25);
+
+ // At scale 0.5 the viewport distance values will be twice
+ // the ones seem in the contents.
+
+ WKViewSetContentScaleFactor(webView.get(), 0.5);
+ WKViewSetContentPosition(webView.get(), WKPointMake(0, 0));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 0);
+ EXPECT_EQ(out.y, 0);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 20);
+ EXPECT_EQ(out.y, 20);
+
+ WKViewSetContentPosition(webView.get(), WKPointMake(20, 20));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 20);
+ EXPECT_EQ(out.y, 20);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 40);
+ EXPECT_EQ(out.y, 40);
+
+ // Let's add translation to the viewport.
+
+ const int delta = 10;
+ WKViewSetUserViewportTranslation(webView.get(), delta, delta);
+
+ WKViewSetContentPosition(webView.get(), WKPointMake(0, 0));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 0 - delta / 0.5);
+ EXPECT_EQ(out.y, 0 - delta / 0.5);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 20 - delta / 0.5);
+ EXPECT_EQ(out.y, 20 - delta / 0.5);
+
+ WKViewSetContentPosition(webView.get(), WKPointMake(20, 20));
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(0, 0));
+ EXPECT_EQ(out.x, 20 - delta / 0.5);
+ EXPECT_EQ(out.y, 20 - delta / 0.5);
+
+ out = WKViewUserViewportToContents(webView.get(), WKPointMake(10, 10));
+ EXPECT_EQ(out.x, 40 - delta / 0.5);
+ EXPECT_EQ(out.y, 40 - delta / 0.5);
+}
+
+}
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
index 8be4440c2..7ccddaea2 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp
@@ -77,7 +77,7 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
finished = true;
}
-TEST(WebKit2, DOMWindowExtensionBasic)
+TEST(WebKit2, DISABLED_DOMWindowExtensionBasic)
{
WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionBasicPageGroup")));
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
index c19104eb8..ac04012ca 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
@@ -78,7 +78,7 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
finished = true;
}
-TEST(WebKit2, DOMWindowExtensionNoCache)
+TEST(WebKit2, DISABLED_DOMWindowExtensionNoCache)
{
WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(WKStringCreateWithUTF8CString("DOMWindowExtensionNoCachePageGroup")));
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
index 411e115ea..f563b67c6 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
@@ -204,7 +204,7 @@ void DOMWindowExtensionNoCache::globalObjectIsAvailableForFrame(WKBundleFrameRef
{
WKBundleDOMWindowExtensionRef extension = WKBundleDOMWindowExtensionCreate(frame, world);
- int index;
+ int index = 0;
bool standard;
standard = world == WKBundleScriptWorldNormalWorld();
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp
new file mode 100644
index 000000000..4e6b4fe1d
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+
+namespace TestWebKitAPI {
+
+static bool didReceiveAllMessages = false;
+static bool receivedMessageForAddingForm = false;
+static const uint64_t expectedNumberOfElements = 1;
+
+static void nullJavaScriptCallback(WKSerializedScriptValueRef, WKErrorRef, void*)
+{
+}
+
+static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*)
+{
+ EXPECT_WK_STREQ("DidReceiveDidAssociateFormControls", messageName);
+ ASSERT_NOT_NULL(messageBody);
+ EXPECT_EQ(WKDictionaryGetTypeID(), WKGetTypeID(messageBody));
+
+ WKDictionaryRef dictionary = static_cast<WKDictionaryRef>(messageBody);
+ uint64_t numberOfElements = WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(dictionary, Util::toWK("NumberOfControls").get())));
+
+ EXPECT_EQ(expectedNumberOfElements, numberOfElements);
+
+ if (!receivedMessageForAddingForm) {
+ receivedMessageForAddingForm = true;
+
+ WKPageRef page = static_cast<WKPageRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("Page").get()));
+ WKPageRunJavaScriptInMainFrame(page, Util::toWK("addPasswordFieldToForm()").get(), 0, nullJavaScriptCallback);
+
+ return;
+ }
+
+ didReceiveAllMessages = true;
+}
+
+static void setInjectedBundleClient(WKContextRef context)
+{
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+
+ WKContextSetInjectedBundleClient(context, &injectedBundleClient);
+}
+
+TEST(WebKit2, DidAssociateFormControls)
+{
+ WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DidAssociateFormControlsTest"));
+ setInjectedBundleClient(context.get());
+
+ PlatformWebView webView(context.get());
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("associate-form-controls", "html")).get());
+ Util::run(&didReceiveAllMessages);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
new file mode 100644
index 000000000..b742650af
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+
+#include "PlatformUtilities.h"
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundlePage.h>
+
+namespace TestWebKitAPI {
+
+class DidAssociateFormControlsTest : public InjectedBundleTest {
+public:
+ DidAssociateFormControlsTest(const std::string& identifier);
+
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef) OVERRIDE;
+};
+
+static InjectedBundleTest::Register<DidAssociateFormControlsTest> registrar("DidAssociateFormControlsTest");
+
+static bool shouldNotifyOnFormChanges(WKBundlePageRef, const void*)
+{
+ return true;
+}
+
+static void didAssociateFormControls(WKBundlePageRef page, WKArrayRef elementHandles, const void*)
+{
+ WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
+
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("Page").get(), page);
+ WKRetainPtr<WKUInt64Ref> numberOfElements = adoptWK(WKUInt64Create(WKArrayGetSize(elementHandles)));
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("NumberOfControls").get(), numberOfElements.get());
+
+ WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("DidReceiveDidAssociateFormControls").get(), messageBody.get());
+}
+
+DidAssociateFormControlsTest::DidAssociateFormControlsTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+{
+}
+
+void DidAssociateFormControlsTest::didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+{
+ WKBundlePageFormClient formClient;
+ memset(&formClient, 0, sizeof(formClient));
+
+ formClient.version = 2;
+ formClient.clientInfo = this;
+ formClient.shouldNotifyOnFormChanges = shouldNotifyOnFormChanges;
+ formClient.didAssociateFormControls = didAssociateFormControls;
+
+ WKBundlePageSetFormClient(page, &formClient);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/FindMatches.mm b/Tools/TestWebKitAPI/Tests/WebKit2/FindMatches.mm
new file mode 100644
index 000000000..4a5734f58
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/FindMatches.mm
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#import <WebKit/WebDocumentPrivate.h>
+#import <WebKit/DOMPrivate.h>
+#include <WebKit2/WKImage.h>
+#import <wtf/RetainPtr.h>
+
+@interface FindMatchesWK1FrameLoadDelegate : NSObject {
+}
+@end
+
+static bool didFinishLoadWK1;
+
+@implementation FindMatchesWK1FrameLoadDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoadWK1 = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+static bool didFinishLoad = false;
+static bool didCallFindStringMatches = false;
+static bool didCallGetImage = false;
+static WKFindOptions findOptions = kWKFindOptionsAtWordStarts;
+
+RetainPtr<WebView> webkit1View;
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ didFinishLoad = true;
+}
+
+static void didFindStringMatches(WKPageRef page, WKStringRef string, WKArrayRef matches, int firstIndex, const void* clientInfo)
+{
+ if (WKStringIsEqualToUTF8CString(string, "Hello")) {
+ size_t numMatches = WKArrayGetSize(matches);
+ EXPECT_EQ(3u, numMatches);
+
+ if (findOptions & kWKFindOptionsBackwards)
+ EXPECT_EQ(1, firstIndex);
+ else
+ EXPECT_EQ(2, firstIndex);
+
+ for (size_t i = 0; i < numMatches; ++i) {
+ WKTypeRef items = WKArrayGetItemAtIndex(matches, i);
+ WKTypeID type = WKGetTypeID(items);
+ EXPECT_EQ(type, WKArrayGetTypeID());
+ WKArrayRef rects = reinterpret_cast<WKArrayRef>(items);
+ size_t numRects = WKArrayGetSize(rects);
+ EXPECT_EQ(1u, numRects);
+ items = WKArrayGetItemAtIndex(rects, 0);
+ type = WKGetTypeID(items);
+ EXPECT_EQ(type, WKRectGetTypeID());
+ WKRect rect = WKRectGetValue(reinterpret_cast<WKRectRef>(items));
+ rect = rect;
+ }
+ } else if (WKStringIsEqualToUTF8CString(string, "crazy")) {
+ size_t numMatches = WKArrayGetSize(matches);
+ EXPECT_EQ(1u, numMatches);
+ EXPECT_EQ(kWKFindResultNoMatchAfterUserSelection, firstIndex);
+ }
+ didCallFindStringMatches = true;
+}
+
+static void didGetImageForMatchResult(WKPageRef page, WKImageRef image, uint32_t index, const void* clientInfo)
+{
+ WKSize size = WKImageGetSize(image);
+
+ DOMDocument *document = webkit1View.get().mainFrameDocument;
+ DOMRange *range = [document createRange];
+ DOMNode *target = [document getElementById:@"target"];
+ [range selectNode:target];
+ NSImage *expectedImage = [range renderedImageForcingBlackText:YES];
+ NSSize expectedSize = [expectedImage size];
+ EXPECT_EQ(size.width, expectedSize.width);
+ EXPECT_EQ(size.height, expectedSize.height);
+ didCallGetImage = true;
+}
+
+TEST(WebKit2, FindMatches)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPageFindMatchesClient findMatchesClient;
+ memset(&findMatchesClient, 0, sizeof(findMatchesClient));
+
+ findMatchesClient.version = 0;
+ findMatchesClient.didFindStringMatches = didFindStringMatches;
+ findMatchesClient.didGetImageForMatchResult = didGetImageForMatchResult;
+
+ WKPageSetPageFindMatchesClient(webView.page(), &findMatchesClient);
+
+ // This HTML file contains 3 occurrences of the word Hello and has the second occurence of the word 'world' selected.
+ // It contains 1 occurrence of the word 'crazy' that is before the selected word.
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("findRanges", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&didFinishLoad);
+
+ WKRetainPtr<WKStringRef> findString(AdoptWK, WKStringCreateWithUTF8CString("Hello"));
+
+ WKPageFindStringMatches(webView.page(), findString.get(), findOptions, 100);
+ Util::run(&didCallFindStringMatches);
+
+ didCallFindStringMatches = false;
+ findOptions |= kWKFindOptionsBackwards;
+ WKPageFindStringMatches(webView.page(), findString.get(), findOptions, 100);
+ Util::run(&didCallFindStringMatches);
+
+ webkit1View = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<FindMatchesWK1FrameLoadDelegate> frameLoadDelegate = adoptNS([FindMatchesWK1FrameLoadDelegate new]);
+
+ webkit1View.get().frameLoadDelegate = frameLoadDelegate.get();
+ [webkit1View.get().mainFrame loadHTMLString:@"Test search. Hello <span id=\"target\">Hello</span> Hello!" baseURL:[NSURL URLWithString:@"about:blank"]];
+
+ Util::run(&didFinishLoadWK1);
+
+ WKPageGetImageForFindMatch(webView.page(), 0);
+ Util::run(&didCallGetImage);
+
+ didCallFindStringMatches = false;
+ findOptions &= ~kWKFindOptionsBackwards;
+ WKRetainPtr<WKStringRef> findOtherString(AdoptWK, WKStringCreateWithUTF8CString("crazy"));
+ WKPageFindStringMatches(webView.page(), findOtherString.get(), findOptions, 100);
+ Util::run(&didCallFindStringMatches);
+
+ WKPageHideFindUI(webView.page());
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp
new file mode 100644
index 000000000..f3d1830d6
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2013 Adenilson Cavalcanti <cavalcantii@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static void didFinishLoad(WKPageRef, WKFrameRef, WKTypeRef, const void*);
+
+class WebKit2CrashLoader {
+public:
+ WebKit2CrashLoader()
+ : context(AdoptWK, WKContextCreate())
+ , webView(context.get())
+ , url(adoptWK(WKURLCreateWithUTF8CString("about:blank")))
+ , firstSuccessfulLoad(false)
+ , secondSuccessfulLoad(false)
+ {
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.clientInfo = this;
+ loaderClient.didFinishLoadForFrame = didFinishLoad;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+ }
+
+ void loadUrl()
+ {
+ WKPageLoadURL(webView.page(), url.get());
+ }
+
+ void terminateWebProcess()
+ {
+ WKPageTerminate(webView.page());
+ }
+
+ WKRetainPtr<WKContextRef> context;
+ WKPageLoaderClient loaderClient;
+ PlatformWebView webView;
+ WKRetainPtr<WKURLRef> url;
+
+ bool firstSuccessfulLoad;
+ bool secondSuccessfulLoad;
+};
+
+// We are going to have 2 load events intertwined by a simulated crash
+// (i.e. Load -> Crash -> Load).
+void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WebKit2CrashLoader* testHelper = const_cast<WebKit2CrashLoader*>(static_cast<const WebKit2CrashLoader*>(clientInfo));
+
+ // First load worked, let's crash WebProcess.
+ if (!testHelper->firstSuccessfulLoad) {
+ testHelper->firstSuccessfulLoad = true;
+ return;
+ }
+
+ // Second load worked, we are done.
+ EXPECT_TRUE(testHelper->firstSuccessfulLoad);
+ if (!testHelper->secondSuccessfulLoad) {
+ testHelper->secondSuccessfulLoad = true;
+ return;
+ }
+}
+
+// This test will load a blank page and next kill WebProcess, the expected
+// result is that a call to page load should spawn a new WebProcess.
+TEST(WebKit2, LoadPageAfterCrash)
+{
+ WebKit2CrashLoader helper;
+ helper.loadUrl();
+ Util::run(&helper.firstSuccessfulLoad);
+ helper.terminateWebProcess();
+ helper.loadUrl();
+ Util::run(&helper.secondSuccessfulLoad);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp
index 9b4705151..4bf5527f9 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp
@@ -37,11 +37,6 @@ static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
didFinishLoad = true;
}
-static void processDidCrash(WKPageRef page, const void*)
-{
- WKPageReload(page);
-}
-
static void setPageLoaderClient(WKPageRef page)
{
WKPageLoaderClient loaderClient;
@@ -49,7 +44,6 @@ static void setPageLoaderClient(WKPageRef page)
loaderClient.version = 0;
loaderClient.clientInfo = 0;
loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
- loaderClient.processDidCrash = processDidCrash;
WKPageSetPageLoaderClient(page, &loaderClient);
}
@@ -79,11 +73,11 @@ TEST(WebKit2, MouseMoveAfterCrash)
webView.simulateMouseMove(10, 10);
webView.simulateMouseMove(20, 20);
- // After moving the mouse (while the web process was hung on the Pause message), kill the web process. It is restarted in
- // processDidCrash by reloading the page.
+ // After moving the mouse (while the web process was hung on the Pause message), kill the web process. It is restarted by reloading the page.
WKPageTerminate(webView.page());
+ WKPageReload(webView.page());
- // Wait until we load the page a second time (via reloading the page in processDidCrash).
+ // Wait until we load the page a second time.
Util::run(&didFinishLoad);
EXPECT_JS_FALSE(webView.page(), "didMoveMouse()");
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm b/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm
new file mode 100644
index 000000000..6635fae9e
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+
+#include <WebKit2/WKString.h>
+
+namespace TestWebKitAPI {
+
+static bool finished = false;
+
+static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+{
+ if (WKStringIsEqualToUTF8CString(messageName, "PasteboardNotificationTestDoneMessageName")
+ && WKStringIsEqualToUTF8CString(static_cast<WKStringRef>(messageBody), "didWriteToPasteboard")) {
+ NSData* data = [[NSPasteboard generalPasteboard] dataForType:@"AnotherArchivePasteboardType"];
+ EXPECT_NE(data, (NSData*)nil);
+ finished = true;
+ }
+}
+
+static void setInjectedBundleClient(WKContextRef context)
+{
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.version = 0;
+ injectedBundleClient.clientInfo = 0;
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+ WKContextSetInjectedBundleClient(context, &injectedBundleClient);
+}
+
+TEST(WebKit2, PasteboardNotifications)
+{
+ [[NSPasteboard generalPasteboard] clearContents];
+
+ WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("PasteboardNotificationsTest"));
+ setInjectedBundleClient(context.get());
+
+ PlatformWebView webView(context.get());
+
+ WKRetainPtr<WKPreferencesRef> preferences(AdoptWK, WKPreferencesCreate());
+ WKPreferencesSetJavaScriptCanAccessClipboard(preferences.get(), true);
+
+ WKPageGroupRef pageGroup = WKPageGetPageGroup(webView.page());
+ WKPageGroupSetPreferences(pageGroup, preferences.get());
+
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("execCopy", "html")).get());
+ Util::run(&finished);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp
new file mode 100644
index 000000000..d33b77b55
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+
+#include "PlatformUtilities.h"
+#include <WebKit2/WKArray.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundleBackForwardListItem.h>
+#include <WebKit2/WKWebArchive.h>
+
+namespace TestWebKitAPI {
+
+class PasteboardNotificationsTest : public InjectedBundleTest {
+public:
+ PasteboardNotificationsTest(const std::string& identifier);
+
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef);
+};
+
+static InjectedBundleTest::Register<PasteboardNotificationsTest> registrar("PasteboardNotificationsTest");
+
+static void willWriteToPasteboard(WKBundlePageRef page, WKBundleRangeHandleRef range, const void*)
+{
+ if (!range)
+ WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("PasteboardNotificationTestDoneMessageName").get(), Util::toWK("willWritetoPasteboardFail").get());
+}
+
+static void getPasteboardDataForRange(WKBundlePageRef, WKBundleRangeHandleRef range, WKArrayRef* pasteboardTypes, WKArrayRef* pasteboardData, const void*)
+{
+ WKTypeRef typeName = WKStringCreateWithUTF8CString("AnotherArchivePasteboardType");
+ *pasteboardTypes = WKArrayCreateAdoptingValues(&typeName, 1);
+ WKTypeRef typeData = WKWebArchiveCopyData(WKWebArchiveCreateFromRange(range));
+ *pasteboardData = WKArrayCreateAdoptingValues(&typeData, 1);
+}
+
+static void didWriteToPasteboard(WKBundlePageRef, const void*)
+{
+ WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("PasteboardNotificationTestDoneMessageName").get(), Util::toWK("didWriteToPasteboard").get());
+}
+
+PasteboardNotificationsTest::PasteboardNotificationsTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+{
+}
+
+void PasteboardNotificationsTest::didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+{
+ WKBundlePageEditorClient pageEditorClient;
+
+ memset(&pageEditorClient, 0, sizeof(pageEditorClient));
+
+ pageEditorClient.version = 1;
+ pageEditorClient.clientInfo = this;
+ pageEditorClient.willWriteToPasteboard = willWriteToPasteboard;
+ pageEditorClient.getPasteboardDataForRange = getPasteboardDataForRange;
+ pageEditorClient.didWriteToPasteboard = didWriteToPasteboard;
+
+ WKBundlePageSetEditorClient(page, &pageEditorClient);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp
new file mode 100644
index 000000000..7960dcbf1
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2013 Adenilson Cavalcanti <cavalcantii@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool loadBeforeCrash = false;
+static bool loadAfterCrash = false;
+
+static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ // First load before WebProcess was terminated.
+ if (!loadBeforeCrash) {
+ loadBeforeCrash = true;
+ return;
+ }
+
+ // Next load after WebProcess was terminated (hopefully
+ // it will be correctly re-spawned).
+ EXPECT_EQ(static_cast<uint32_t>(kWKFrameLoadStateFinished), WKFrameGetFrameLoadState(frame));
+ EXPECT_FALSE(loadAfterCrash);
+
+ // Set it, otherwise the loop will not end.
+ loadAfterCrash = true;
+}
+
+static void didCrash(WKPageRef page, const void*)
+{
+ // Test if first load actually worked.
+ EXPECT_TRUE(loadBeforeCrash);
+
+ // Reload should re-spawn webprocess.
+ WKPageReload(page);
+}
+
+TEST(WebKit2, ReloadPageAfterCrash)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.didFinishLoadForFrame = didFinishLoad;
+ loaderClient.processDidCrash = didCrash;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ // Load a blank page and next kills WebProcess.
+ WKPageLoadURL(webView.page(), url.get());
+ Util::run(&loadBeforeCrash);
+ WKPageTerminate(webView.page());
+
+ // Let's try load a page and see what happens.
+ WKPageLoadURL(webView.page(), url.get());
+ Util::run(&loadAfterCrash);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp
new file mode 100644
index 000000000..f032849ba
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JavaScriptTest.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <JavaScriptCore/JSContextRef.h>
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPagePrivate.h>
+#include <WebKit2/WKSerializedScriptValue.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static const unsigned pageLength = 100;
+static const unsigned pageGap = 100;
+static const unsigned expectedPageCount = 20;
+
+static void didLayout(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef, const void* clientInfo)
+{
+ if (milestones & kWKDidFirstLayoutAfterSuppressedIncrementalRendering) {
+ PlatformWebView* webView = (PlatformWebView*)clientInfo;
+
+ unsigned pageCount = WKPageGetPageCount(page);
+ EXPECT_EQ(expectedPageCount, pageCount);
+
+ webView->resizeTo((pageLength * pageCount) + (pageGap * (pageCount - 1)), 500);
+ EXPECT_JS_EQ(page, "window.scrollX", "0");
+
+ testDone = true;
+ }
+}
+
+TEST(WebKit2, ResizeReversePaginatedWebView)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.version = kWKPageLoaderClientCurrentVersion;
+ loaderClient.didLayout = didLayout;
+ loaderClient.clientInfo = &webView;
+
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPageListenForLayoutMilestones(webView.page(), kWKDidFirstLayoutAfterSuppressedIncrementalRendering);
+
+ WKPageGroupRef pageGroup = WKPageGetPageGroup(webView.page());
+ WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup);
+ WKPreferencesSetSuppressesIncrementalRendering(preferences, true);
+
+ WKPageSetPaginationMode(webView.page(), kWKPaginationModeRightToLeft);
+ WKPageSetPageLength(webView.page(), pageLength);
+ WKPageSetGapBetweenPages(webView.page(), pageGap);
+ WKPageSetPaginationBehavesLikeColumns(webView.page(), true);
+
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("lots-of-text-vertical-lr", "html")).get());
+
+ Util::run(&testDone);
+ EXPECT_TRUE(testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
new file mode 100644
index 000000000..1af639de7
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2013 Adenilson Cavalcanti <cavalcantii@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+struct TestStatesData {
+ TestStatesData(WKContextRef context)
+ : webView(context)
+ , firstLoad(false)
+ , resizeAfterCrash(false)
+ {
+ }
+
+ PlatformWebView webView;
+ bool firstLoad;
+ bool resizeAfterCrash;
+};
+
+static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ TestStatesData* states = const_cast<TestStatesData*>(static_cast<const TestStatesData*>(clientInfo));
+ if (!states->firstLoad) {
+ // Loading a blank page worked, next we will kill WebProcess.
+ states->firstLoad = true;
+ return;
+ }
+
+ EXPECT_FALSE(states->resizeAfterCrash);
+ states->resizeAfterCrash = true;
+}
+
+static void didCrash(WKPageRef page, const void* clientInfo)
+{
+ TestStatesData* states = const_cast<TestStatesData*>(static_cast<const TestStatesData*>(clientInfo));
+ EXPECT_TRUE(states->firstLoad);
+ // Resize should work after WebProcess was terminated, unless
+ // the port's View is accessing nulled WebProcess related data,
+ // which would cause a crash.
+ states->webView.resizeTo(100, 200);
+ states->webView.resizeTo(300, 400);
+
+ WKPageReload(page);
+}
+
+TEST(WebKit2, ResizeWindowAfterCrash)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ TestStatesData states(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.clientInfo = &states;
+ loaderClient.didFinishLoadForFrame = didFinishLoad;
+ loaderClient.processDidCrash = didCrash;
+ WKPageSetPageLoaderClient(states.webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ // Load a blank page and next kills WebProcess.
+ WKPageLoadURL(states.webView.page(), url.get());
+ Util::run(&states.firstLoad);
+ WKPageTerminate(states.webView.page());
+
+ // Let's try load a page and see what happens.
+ WKPageLoadURL(states.webView.page(), url.get());
+ Util::run(&states.resizeAfterCrash);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp
new file mode 100644
index 000000000..695e912df
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JavaScriptTest.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include <JavaScriptCore/JSContextRef.h>
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPagePrivate.h>
+#include <WebKit2/WKSerializedScriptValue.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didFinishDocumentLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ WKPageSetScrollPinningBehavior(page, kWKScrollPinningBehaviorPinToBottom);
+
+ EXPECT_JS_EQ(page, "window.scrollY", "2434");
+
+ PlatformWebView* webView = (PlatformWebView*)clientInfo;
+ webView->resizeTo(800, 200);
+
+ EXPECT_JS_EQ(page, "window.scrollY", "2834");
+ EXPECT_JS_EQ(page, "window.scrollTo(0,0)", "undefined");
+ EXPECT_JS_EQ(page, "window.scrollY", "2834");
+
+ WKPageSetScrollPinningBehavior(page, kWKScrollPinningBehaviorPinToTop);
+
+ EXPECT_JS_EQ(page, "window.scrollY", "0");
+ EXPECT_JS_EQ(page, "window.scrollTo(0,200)", "undefined");
+ EXPECT_JS_EQ(page, "window.scrollY", "0");
+
+ WKPageSetScrollPinningBehavior(page, kWKScrollPinningBehaviorDoNotPin);
+
+ EXPECT_JS_EQ(page, "window.scrollY", "0");
+ EXPECT_JS_EQ(page, "window.scrollTo(0,200)", "undefined");
+ EXPECT_JS_EQ(page, "window.scrollY", "200");
+
+ testDone = true;
+}
+
+TEST(WebKit2, ScrollPinningBehaviors)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.version = kWKPageLoaderClientCurrentVersion;
+ loaderClient.didFinishDocumentLoadForFrame = didFinishDocumentLoadForFrame;
+ loaderClient.clientInfo = &webView;
+
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("simple-tall", "html")).get());
+
+ Util::run(&testDone);
+ EXPECT_TRUE(testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp
new file mode 100644
index 000000000..c666bf687
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp
@@ -0,0 +1,441 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <WebKit2/SeccompBroker.h>
+#include <WebKit2/SeccompFilters.h>
+#include <WebKit2/SyscallPolicy.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebKit;
+
+namespace TestWebKitAPI {
+
+DEFINE_STATIC_LOCAL(String, rootDir, (ASCIILiteral("/")));
+DEFINE_STATIC_LOCAL(String, homeDir, (String(getenv("HOME"))));
+DEFINE_STATIC_LOCAL(String, usrDir, (ASCIILiteral("/usr")));
+DEFINE_STATIC_LOCAL(String, usrSbinDir, (ASCIILiteral("/usr/sbin")));
+DEFINE_STATIC_LOCAL(String, testDirRead, (ASCIILiteral("/tmp/WebKitSeccompFilters/testRead")));
+DEFINE_STATIC_LOCAL(String, testDirWrite, (ASCIILiteral("/tmp/WebKitSeccompFilters/testWrite")));
+DEFINE_STATIC_LOCAL(String, testDirReadAndWrite, (ASCIILiteral("/tmp/WebKitSeccompFilters/testReadAndWrite")));
+DEFINE_STATIC_LOCAL(String, testDirNotAllowed, (ASCIILiteral("/tmp/WebKitSeccompFilters/testNotAllowed")));
+DEFINE_STATIC_LOCAL(String, testFileNotAllowed, (testDirReadAndWrite + "/testFilePolicy"));
+DEFINE_STATIC_LOCAL(String, testFileReadAndWrite, (testDirNotAllowed + "/testFilePolicy"));
+
+static const mode_t defaultMode = S_IRUSR | S_IWUSR | S_IXUSR;
+
+class SeccompEnvironment : public testing::Environment {
+public:
+ virtual void SetUp()
+ {
+ ASSERT_TRUE(!homeDir.isEmpty());
+
+ mkdir("/tmp/WebKitSeccompFilters", defaultMode);
+ mkdir(testDirRead.utf8().data(), defaultMode);
+ mkdir(testDirWrite.utf8().data(), defaultMode);
+ mkdir(testDirReadAndWrite.utf8().data(), defaultMode);
+ mkdir(testDirNotAllowed.utf8().data(), defaultMode);
+
+ // Create a file for the Read only and NotAllowed directory before
+ // loading the filters.
+ String file = testDirRead + "/testFile";
+ int fd = open(file.utf8().data(), O_RDWR | O_CREAT, defaultMode);
+ ASSERT_NE(close(fd), -1);
+ file = testDirNotAllowed + "/testFile";
+ fd = open(file.utf8().data(), O_RDWR | O_CREAT, defaultMode);
+ ASSERT_NE(close(fd), -1);
+
+ // Create files for the file policy tests. File policies precedes the
+ // directory policy. In this case, we create a file with read and write
+ // policies inside a directory that is not allowed, and vice versa.
+ fd = open(testFileNotAllowed.utf8().data(), O_RDWR | O_CREAT, defaultMode);
+ ASSERT_NE(close(fd), -1);
+ fd = open(testFileReadAndWrite.utf8().data(), O_RDWR | O_CREAT, defaultMode);
+ ASSERT_NE(close(fd), -1);
+
+ SyscallPolicy policy;
+ policy.addDirectoryPermission(rootDir, SyscallPolicy::NotAllowed);
+ policy.addDirectoryPermission(usrDir, SyscallPolicy::Read);
+ policy.addDirectoryPermission(usrSbinDir, SyscallPolicy::NotAllowed);
+ policy.addDirectoryPermission(testDirRead, SyscallPolicy::Read);
+ policy.addDirectoryPermission(testDirWrite, SyscallPolicy::Write);
+ policy.addDirectoryPermission(testDirReadAndWrite, SyscallPolicy::ReadAndWrite);
+ policy.addDirectoryPermission(testDirNotAllowed, SyscallPolicy::NotAllowed);
+ policy.addFilePermission(testFileNotAllowed, SyscallPolicy::NotAllowed);
+ policy.addFilePermission(testFileReadAndWrite, SyscallPolicy::ReadAndWrite);
+
+ SeccompFilters seccompFilters(SeccompFilters::Allow);
+ seccompFilters.addRule("open", SeccompFilters::Trap);
+ seccompFilters.addRule("openat", SeccompFilters::Trap);
+ seccompFilters.addRule("creat", SeccompFilters::Trap);
+
+ SeccompBroker::launchProcess(&seccompFilters, policy);
+ seccompFilters.initialize();
+ }
+
+ virtual void TearDown()
+ {
+ // This will have to move to a separated process created before loading
+ // the filters when we put the rmdir/unlink policies in place.
+ unlink("/tmp/WebKitSeccompFilters/testNotAllowed/testFile");
+ unlink("/tmp/WebKitSeccompFilters/testNotAllowed/testFilePolicy");
+ unlink("/tmp/WebKitSeccompFilters/testReadAndWrite/testFile");
+ unlink("/tmp/WebKitSeccompFilters/testReadAndWrite/testFile2");
+ unlink("/tmp/WebKitSeccompFilters/testReadAndWrite/testFile3");
+ unlink("/tmp/WebKitSeccompFilters/testReadAndWrite/testFilePolicy");
+ unlink("/tmp/WebKitSeccompFilters/testWrite/testFile");
+ unlink("/tmp/WebKitSeccompFilters/testWrite/testFile2");
+ unlink("/tmp/WebKitSeccompFilters/testRead/testFile");
+ rmdir("/tmp/WebKitSeccompFilters/testNotAllowed");
+ rmdir("/tmp/WebKitSeccompFilters/testReadAndWrite");
+ rmdir("/tmp/WebKitSeccompFilters/testWrite");
+ rmdir("/tmp/WebKitSeccompFilters/testRead");
+ rmdir("/tmp/WebKitSeccompFilters");
+ }
+};
+
+::testing::Environment* const env = ::testing::AddGlobalTestEnvironment(new SeccompEnvironment);
+
+static void dummyHandler(int, siginfo_t*, void*)
+{
+}
+
+TEST(WebKit2, sigaction)
+{
+ // Setting a handler should be enough to break any subsequent test if
+ // not silently ignored by the sandbox.
+ struct sigaction action;
+ memset(&action, 0, sizeof(action));
+ action.sa_sigaction = &dummyHandler;
+ action.sa_flags = SA_SIGINFO;
+
+ ASSERT_NE(sigaction(SIGSYS, &action, 0), -1);
+}
+
+TEST(WebKit2, sigprocmask)
+{
+ // We test here the mechanism installed to prevent SIGSYS to be blocked. Any
+ // attemp to add SIGSYS to the set of blocked signals will be silently
+ // ignored (but other signals will be blocked just fine).
+ sigset_t set, oldSet;
+ sigemptyset(&set);
+ sigaddset(&set, SIGSYS);
+ sigaddset(&set, SIGUSR1);
+
+ ASSERT_NE(sigprocmask(SIG_BLOCK, &set, 0), -1);
+ ASSERT_NE(sigprocmask(SIG_BLOCK, 0, &oldSet), -1);
+ ASSERT_FALSE(sigismember(&oldSet, SIGSYS)) << "SIGSYS should not be blocked.";
+ ASSERT_TRUE(sigismember(&oldSet, SIGUSR1)) << "Other signals should be blocked normally.";
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGSYS);
+ sigaddset(&set, SIGUSR2);
+
+ ASSERT_NE(sigprocmask(SIG_SETMASK, &set, &oldSet), -1);
+ ASSERT_NE(sigprocmask(SIG_SETMASK, 0, &set), -1);
+ ASSERT_FALSE(sigismember(&set, SIGSYS)) << "SIGSYS should not be blocked.";
+ ASSERT_TRUE(sigismember(&set, SIGUSR2)) << "Other signals should be blocked normally.";
+ ASSERT_FALSE(sigismember(&oldSet, SIGUSR2));
+
+ ASSERT_NE(sigprocmask(SIG_SETMASK, &oldSet, 0), -1) << "Should restore the old signal set just fine.";
+ ASSERT_NE(sigprocmask(SIG_SETMASK, 0, &set), -1);
+ ASSERT_FALSE(sigismember(&set, SIGUSR2)) << "The restored set doesn't have SIGUSR2.";
+}
+
+TEST(WebKit2, open)
+{
+ // Read only directory.
+ String file = testDirRead + "/testFile";
+ int fd = open(file.utf8().data(), O_RDWR);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_RDONLY | O_CREAT, defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ file = testDirRead + "/ThisFileDoesNotExist";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == ENOENT) << "Should return ENOENT when trying " \
+ "to open a file that does not exit and the permissions are OK.";
+
+ fd = open(file.utf8().data(), O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES) << "Should return EACCES when trying " \
+ "to open a file that does not exit and the permissions are not OK.";
+
+ // Write only directory.
+ file = testDirWrite + "/testFile";
+ fd = open(file.utf8().data(), O_WRONLY | O_CREAT, defaultMode);
+ ASSERT_NE(fd, -1);
+ close(fd);
+
+ fd = open(file.utf8().data(), O_RDWR);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_WRONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ // Read an write directory.
+ file = testDirReadAndWrite + "/testFile";
+ fd = open(file.utf8().data(), O_WRONLY | O_CREAT, defaultMode);
+ ASSERT_NE(fd, -1);
+ close(fd);
+
+ fd = open(file.utf8().data(), O_RDWR);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = open(file.utf8().data(), O_WRONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ // NotAllowed directory.
+ file = testDirNotAllowed + "/testFile";
+ fd = open(file.utf8().data(), O_WRONLY | O_CREAT, defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_RDWR);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(file.utf8().data(), O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+
+ // The /usr directory here has read permissions, so it's subdirectories
+ // should resolve to the /usr permissions unless explicitly specified.
+ file = usrDir + "/bin/basename";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_NE(fd, -1) << "Subdirectories should with no policy should " \
+ "inherit the parent's policies.";
+ close(fd);
+
+ file = usrSbinDir + "/adduser";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES) << "This directory should have " \
+ "its own policy instead of the parent's.";
+
+ // Access to the rest of the files system is blocked and should
+ // never return anything else other than EACCES regardless if the
+ // file exists or not. The reason is because it will fallback to the
+ // policy of the Root directory, marked as NotAllowed.
+ file = homeDir + "/testFile";
+ fd = open(file.utf8().data(), O_RDWR | O_CREAT, defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open("/etc/passwd", O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ file = testDirReadAndWrite + "/../../../etc/passwd";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ file = testDirReadAndWrite + "/../../.." + testDirReadAndWrite + "/../../../etc/passwd";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ // Here we test file policies. The have precedence over directory policies.
+ // The file bellow lives inside a directory with ReadAndWrite policy.
+ fd = open(testFileNotAllowed.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(testFileNotAllowed.utf8().data(), O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open(testFileNotAllowed.utf8().data(), O_RDWR);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ file = testDirReadAndWrite + "/../../.." + testDirReadAndWrite + "/testFilePolicy";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ // The next file is located inside a directory marked as NotAllowed, but
+ // it has its own file policy that precedes the directory policy.
+ fd = open(testFileReadAndWrite.utf8().data(), O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = open(testFileReadAndWrite.utf8().data(), O_WRONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = open(testFileReadAndWrite.utf8().data(), O_RDWR);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ file = testDirReadAndWrite + "/../../.." + testDirNotAllowed + "/testFilePolicy";
+ fd = open(file.utf8().data(), O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+}
+
+TEST(WebKit2, creat)
+{
+ // Read only directory.
+ String file = testDirRead + "/testFile2";
+ int fd = creat(file.utf8().data(), defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ // Write only directory.
+ file = testDirWrite + "/testFile2";
+ fd = creat(file.utf8().data(), defaultMode);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ // Read an write directory.
+ file = testDirReadAndWrite + "/testFile2";
+ fd = creat(file.utf8().data(), defaultMode);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ // NotAllowed directory.
+ file = testDirNotAllowed + "/testFile2";
+ fd = creat(file.utf8().data(), defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+}
+
+TEST(WebKit2, openat)
+{
+ int dirFd = open(testDirReadAndWrite.utf8().data(), O_RDONLY);
+ ASSERT_NE(dirFd, -1);
+
+ int fd = openat(dirFd, "testFile3", O_RDWR | O_CREAT, defaultMode);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = openat(dirFd, "testFile3", O_RDWR);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = openat(dirFd, "testFile3", O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = openat(dirFd, "testFile3", O_WRONLY);
+ EXPECT_NE(fd, -1);
+
+ fd = openat(fd, "testFile3", O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == ENOTDIR) << "Should return ENOTDIR when the fd is a file.";
+ close(fd);
+
+ String file = "../../.." + testDirReadAndWrite + "/testFile3";
+ fd = openat(dirFd, file.utf8().data(), O_WRONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ file = "../../.." + testDirRead + "/testFile3";
+ fd = openat(dirFd, file.utf8().data(), O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ file = testDirReadAndWrite + "/testFile3";
+ fd = openat(-1, file.utf8().data(), O_WRONLY);
+ EXPECT_NE(fd, -1) << "Directory fd should be ignored when the path is absolute.";
+ close(fd);
+
+ fd = openat(-1, "testFile3", O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EBADF) << "Should return EBADF when the fd is invalid.";
+ close(dirFd);
+
+ dirFd = open(testDirNotAllowed.utf8().data(), O_RDONLY);
+ EXPECT_TRUE(dirFd == -1 && errno == EACCES);
+
+ dirFd = open(testDirRead.utf8().data(), O_RDONLY);
+ ASSERT_NE(dirFd, -1);
+
+ fd = openat(dirFd, "testFile2", O_RDONLY | O_CREAT, defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = openat(dirFd, "testFile", O_WRONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+ close(dirFd);
+}
+
+static void* stressTest(void*)
+{
+ for (int i = 0; i < 500; ++i) {
+ int fd = open("/tmp/WebKitSeccompFilters/testRead/testFile", O_RDWR);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = open("/tmp/WebKitSeccompFilters/testRead/testFile", O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+
+ fd = open("/tmp/WebKitSeccompFilters/testNotAllowed/testFile", O_RDONLY);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ fd = creat("/tmp/WebKitSeccompFilters/testNotAllowed/SholdNotBeAllowed", defaultMode);
+ EXPECT_TRUE(fd == -1 && errno == EACCES);
+
+ int dirFd = open("/tmp/WebKitSeccompFilters/testRead", O_RDONLY);
+ EXPECT_NE(dirFd, -1);
+
+ fd = openat(dirFd, "testFile", O_RDONLY);
+ EXPECT_NE(fd, -1);
+ close(fd);
+ close(dirFd);
+ }
+
+ return 0;
+}
+
+TEST(WebKit2, threading)
+{
+ // Tests if concurrent syscall execution works fine. It can be
+ // also used for performance testing and leak detection. The test
+ // is disabled on Debug mode because it can be way too verbose.
+ pthread_t threads[5];
+
+ for (int i = 0; i < sizeof(threads) / sizeof(pthread_t); ++i)
+ pthread_create(&threads[i], 0, stressTest, 0);
+
+ for (int i = 0; i < sizeof(threads) / sizeof(pthread_t); ++i)
+ pthread_join(threads[i], 0);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
index c13a5eb49..c6f3b1bac 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
@@ -38,7 +38,7 @@ static bool receivedProperBackForwardCallbacks = false;
static void didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef, const void*)
{
// Only mark finished when the main frame loads
- if (WKFrameGetParentFrame(frame))
+ if (!WKFrameIsMainFrame(frame))
return;
finished = true;
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp
new file mode 100644
index 000000000..780ce522f
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+
+namespace TestWebKitAPI {
+
+static bool loaded;
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ loaded = true;
+}
+
+TEST(WebKit2, TerminateTwice)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&loaded);
+ WKPageTerminate(webView.page());
+
+ // Reloading will start relaunching the process.
+ WKPageReload(webView.page());
+
+ // And now we terminate the page before the process launch is complete.
+ WKPageTerminate(webView.page());
+}
+
+} // namespace TestWebKitAPI
+
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp
index 7dea31554..0e6b985fb 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/WebArchive.cpp
@@ -48,8 +48,8 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
// Do basic sanity checks on the returned webarchive. We have more thorough checks in LayoutTests.
size_t size = WKDataGetSize(receivedData);
const unsigned char* bytes = WKDataGetBytes(receivedData);
- RetainPtr<CFDataRef> data(AdoptCF, CFDataCreate(0, bytes, size));
- RetainPtr<CFPropertyListRef> propertyList(AdoptCF, CFPropertyListCreateWithData(0, data.get(), kCFPropertyListImmutable, 0, 0));
+ RetainPtr<CFDataRef> data = adoptCF(CFDataCreate(0, bytes, size));
+ RetainPtr<CFPropertyListRef> propertyList = adoptCF(CFPropertyListCreateWithData(0, data.get(), kCFPropertyListImmutable, 0, 0));
EXPECT_TRUE(propertyList);
// It should be a dictionary.
@@ -78,7 +78,7 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag
EXPECT_TRUE(resourceData);
EXPECT_EQ(CFDataGetTypeID(), CFGetTypeID(resourceData));
- RetainPtr<CFStringRef> stringData(AdoptCF, CFStringCreateFromExternalRepresentation(0, (CFDataRef)resourceData, kCFStringEncodingUTF8));
+ RetainPtr<CFStringRef> stringData = adoptCF(CFStringCreateFromExternalRepresentation(0, (CFDataRef)resourceData, kCFStringEncodingUTF8));
EXPECT_TRUE(stringData);
// It should contain the string "Simple HTML file." in it.
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WebKit2.pro b/Tools/TestWebKitAPI/Tests/WebKit2/WebKit2.pro
new file mode 100644
index 000000000..4a93643fc
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/WebKit2.pro
@@ -0,0 +1,63 @@
+TEMPLATE = app
+TARGET = tst_webkit2
+
+SOURCES += \
+ AboutBlankLoad.cpp \
+ DocumentStartUserScriptAlertCrash.cpp \
+ DOMWindowExtensionBasic.cpp \
+ DOMWindowExtensionNoCache.cpp \
+ DocumentStartUserScriptAlertCrash.cpp \
+ EvaluateJavaScript.cpp \
+ FailedLoad.cpp \
+ Find.cpp \
+ FrameMIMETypeHTML.cpp \
+ FrameMIMETypePNG.cpp \
+ GetInjectedBundleInitializationUserDataCallback.cpp \
+ HitTestResultNodeHandle.cpp \
+ InjectedBundleBasic.cpp \
+ InjectedBundleFrameHitTest.cpp \
+ InjectedBundleInitializationUserDataCallbackWins.cpp \
+ LoadAlternateHTMLStringWithNonDirectoryURL.cpp \
+ LoadCanceledNoServerRedirectCallback.cpp \
+ LoadPageOnCrash.cpp \
+ MouseMoveAfterCrash.cpp \
+ PageLoadBasic.cpp \
+ PageLoadDidChangeLocationWithinPageForFrame.cpp \
+ PageVisibilityState.cpp \
+ ParentFrame.cpp \
+ PreventEmptyUserAgent.cpp \
+ PrivateBrowsingPushStateNoHistoryCallback.cpp \
+ ReloadPageAfterCrash.cpp \
+ ResizeWindowAfterCrash.cpp \
+ ResponsivenessTimerDoesntFireEarly.cpp \
+ TerminateTwice.cpp \
+ UserMessage.cpp \
+ WillSendSubmitEvent.cpp \
+ WKConnection.cpp \
+ WKString.cpp \
+ WKStringJSString.cpp \
+ WKURL.cpp
+
+FAILING_SOURCES = \
+ CanHandleRequest.cpp \
+
+FAILING_SOURCES += ShouldGoToBackForwardListItem.cpp # Only stalls in flickable mode.
+FAILING_SOURCES += SpacebarScrolling.cpp # Only fails in flickable mode.
+
+SOURCES += $$FAILING_SOURCES
+
+# Tests skipped because they crash, stall or do not compile.
+SKIPPED_SOURCES = \
+ CookieManager.cpp \
+ DownloadDecideDestinationCrash.cpp \
+ ForceRepaint.cpp \
+ NewFirstVisuallyNonEmptyLayout.cpp \
+ NewFirstVisuallyNonEmptyLayoutFails.cpp \
+ NewFirstVisuallyNonEmptyLayoutForImages.cpp \
+ NewFirstVisuallyNonEmptyLayoutFrames.cpp \
+ RestoreSessionStateContainingFormData.cpp \
+ WebCoreStatisticsWithNoWebProcess.cpp
+
+include(../../TestWebKitAPI.pri)
+
+DEFINES += APITEST_SOURCE_DIR=\\\"$$PWD\\\"
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp
new file mode 100644
index 000000000..beeb8007f
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace TestWebKitAPI {
+
+class WebKit2WillLoadTest : public ::testing::Test {
+public:
+ WebKit2WillLoadTest()
+ : didReceiveMessage(false)
+ {
+ }
+
+ WKRetainPtr<WKContextRef> context;
+ OwnPtr<PlatformWebView> webView;
+
+ WKRetainPtr<WKStringRef> messageName;
+ WKRetainPtr<WKTypeRef> messageBody;
+ bool didReceiveMessage;
+
+ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+ {
+ ((WebKit2WillLoadTest*)clientInfo)->messageName = messageName;
+ ((WebKit2WillLoadTest*)clientInfo)->messageBody = messageBody;
+ ((WebKit2WillLoadTest*)clientInfo)->didReceiveMessage = true;
+ }
+
+ static void setInjectedBundleClient(WKContextRef context, const void* clientInfo)
+ {
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.version = kWKContextInjectedBundleClientCurrentVersion;
+ injectedBundleClient.clientInfo = clientInfo;
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+
+ WKContextSetInjectedBundleClient(context, &injectedBundleClient);
+ }
+
+ virtual void SetUp()
+ {
+ context = adoptWK(Util::createContextForInjectedBundleTest("WillLoadTest"));
+ setInjectedBundleClient(context.get(), this);
+
+ webView = adoptPtr(new PlatformWebView(context.get()));
+
+ didReceiveMessage = false;
+ }
+
+ void testWillLoadURLRequestReturnValues(WKURLRef expectedURL, WKStringRef expectedUserDataString)
+ {
+ didReceiveMessage = false;
+ Util::run(&didReceiveMessage);
+
+ EXPECT_WK_STREQ("WillLoadURLRequestReturn", messageName.get());
+
+ EXPECT_EQ(WKDictionaryGetTypeID(), WKGetTypeID(messageBody.get()));
+ WKDictionaryRef dictionary = static_cast<WKDictionaryRef>(messageBody.get());
+
+ if (expectedUserDataString) {
+ WKStringRef userDataReturnValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("UserDataReturn").get()));
+ EXPECT_WK_STREQ(expectedUserDataString, userDataReturnValue);
+ } else
+ EXPECT_NULL(WKDictionaryGetItemForKey(dictionary, Util::toWK("UserDataReturn").get()));
+
+ WKURLRequestRef urlRequestReturnValue = static_cast<WKURLRequestRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("URLRequestReturn").get()));
+ WKRetainPtr<WKURLRef> urlReturnValue = adoptWK(WKURLRequestCopyURL(urlRequestReturnValue));
+ EXPECT_TRUE(WKURLIsEqual(expectedURL, urlReturnValue.get()));
+ }
+
+ void testWillLoadDataRequestReturnValues(WKURLRef expectedURL, WKStringRef expectedMIMEType, WKStringRef expectedEncodingName, WKURLRef expectedUnreachableURL, WKStringRef expectedUserDataString)
+ {
+ didReceiveMessage = false;
+ Util::run(&didReceiveMessage);
+
+ EXPECT_WK_STREQ("WillLoadDataRequestReturn", messageName.get());
+
+ EXPECT_EQ(WKDictionaryGetTypeID(), WKGetTypeID(messageBody.get()));
+ WKDictionaryRef dictionary = static_cast<WKDictionaryRef>(messageBody.get());
+
+ if (expectedUserDataString) {
+ WKStringRef userDataReturnValue = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("UserDataReturn").get()));
+ EXPECT_WK_STREQ(expectedUserDataString, userDataReturnValue);
+ } else
+ EXPECT_NULL(WKDictionaryGetItemForKey(dictionary, Util::toWK("UserDataReturn").get()));
+
+ WKURLRequestRef urlRequestReturnValue = static_cast<WKURLRequestRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("URLRequestReturn").get()));
+ WKRetainPtr<WKURLRef> urlReturnValue = adoptWK(WKURLRequestCopyURL(urlRequestReturnValue));
+ EXPECT_TRUE(WKURLIsEqual(expectedURL, urlReturnValue.get()));
+
+ WKStringRef MIMEType = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("MIMETypeReturn").get()));
+ EXPECT_WK_STREQ(expectedMIMEType, MIMEType);
+
+ WKStringRef encodingName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("EncodingNameReturn").get()));
+ EXPECT_WK_STREQ(expectedEncodingName, encodingName);
+
+ if (expectedUnreachableURL) {
+ WKURLRef unreachableURL = static_cast<WKURLRef>(WKDictionaryGetItemForKey(dictionary, Util::toWK("UnreachableURLReturn").get()));
+ EXPECT_TRUE(WKURLIsEqual(expectedUnreachableURL, unreachableURL));
+ } else
+ EXPECT_NULL(WKDictionaryGetItemForKey(dictionary, Util::toWK("UnreachableURLReturn").get()));
+ }
+};
+
+// URL Request tests
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadURLWithUserData)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKStringRef> userData = Util::toWK("WKPageLoadURLWithUserData UserData");
+ WKPageLoadURLWithUserData(webView->page(), url.get(), userData.get());
+
+ testWillLoadURLRequestReturnValues(url.get(), userData.get());
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadURL)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKPageLoadURL(webView->page(), url.get());
+
+ testWillLoadURLRequestReturnValues(url.get(), 0);
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadURLRequestWithUserData)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKURLRequestRef> urlRequest = adoptWK(WKURLRequestCreateWithWKURL(url.get()));
+ WKRetainPtr<WKStringRef> userData = Util::toWK("WKPageLoadURLRequestWithUserData UserData");
+ WKPageLoadURLRequestWithUserData(webView->page(), urlRequest.get(), userData.get());
+
+ testWillLoadURLRequestReturnValues(url.get(), userData.get());
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadURLRequest)
+{
+ WKRetainPtr<WKURLRef> url = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKURLRequestRef> urlRequest = adoptWK(WKURLRequestCreateWithWKURL(url.get()));
+ WKPageLoadURLRequest(webView->page(), urlRequest.get());
+
+ testWillLoadURLRequestReturnValues(url.get(), 0);
+}
+
+// Data Request tests
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadHTMLStringWithUserData)
+{
+ WKRetainPtr<WKURLRef> baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKStringRef> userData = Util::toWK("WKPageLoadHTMLStringWithUserData UserData");
+ WKRetainPtr<WKStringRef> htmlString = Util::toWK("<body>Hello, World</body>");
+
+ WKPageLoadHTMLStringWithUserData(webView->page(), htmlString.get(), baseURL.get(), userData.get());
+
+ testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("utf-16").get(), 0, userData.get());
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadHTMLString)
+{
+ WKRetainPtr<WKURLRef> baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKStringRef> htmlString = Util::toWK("<body>Hello, World</body>");
+
+ WKPageLoadHTMLString(webView->page(), htmlString.get(), baseURL.get());
+
+ testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("utf-16").get(), 0, 0);
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadAlternateHTMLStringWithUserData)
+{
+ WKRetainPtr<WKStringRef> htmlString = Util::toWK("<body>Hello, World</body>");
+
+ WKRetainPtr<WKURLRef> baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKURLRef> unreachableURL = adoptWK(WKURLCreateWithUTF8CString("about:other"));
+ WKRetainPtr<WKStringRef> userData = Util::toWK("WKPageLoadAlternateHTMLStringWithUserData UserData");
+
+ WKPageLoadAlternateHTMLStringWithUserData(webView->page(), htmlString.get(), baseURL.get(), unreachableURL.get(), userData.get());
+
+ testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("utf-16").get(), unreachableURL.get(), userData.get());
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadAlternateHTMLString)
+{
+ WKRetainPtr<WKStringRef> htmlString = Util::toWK("<body>Hello, World</body>");
+
+ WKRetainPtr<WKURLRef> baseURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ WKRetainPtr<WKURLRef> unreachableURL = adoptWK(WKURLCreateWithUTF8CString("about:other"));
+
+ WKPageLoadAlternateHTMLString(webView->page(), htmlString.get(), baseURL.get(), unreachableURL.get());
+
+ testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("utf-16").get(), unreachableURL.get(), 0);
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadPlainTextStringWithUserData)
+{
+ WKRetainPtr<WKStringRef> plaintTextString = Util::toWK("Hello, World");
+ WKRetainPtr<WKStringRef> userData = Util::toWK("WKPageLoadPlainTextStringWithUserData UserData");
+
+ WKPageLoadPlainTextStringWithUserData(webView->page(), plaintTextString.get(), userData.get());
+
+ WKRetainPtr<WKURLRef> blankURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK("utf-16").get(), 0, userData.get());
+}
+
+TEST_F(WebKit2WillLoadTest, WKPageLoadPlainTextString)
+{
+ WKRetainPtr<WKStringRef> plaintTextString = Util::toWK("Hello, World");
+
+ WKPageLoadPlainTextString(webView->page(), plaintTextString.get());
+
+ WKRetainPtr<WKURLRef> blankURL = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
+ testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK("utf-16").get(), 0, 0);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp
new file mode 100644
index 000000000..039349bd5
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+
+#include "PlatformUtilities.h"
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class WillLoadTest : public InjectedBundleTest {
+public:
+ WillLoadTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+private:
+ static void willLoadURLRequest(WKBundlePageRef page, WKURLRequestRef request, WKTypeRef userData, const void *clientInfo)
+ {
+ WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
+
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("URLRequestReturn").get(), request);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("UserDataReturn").get(), userData);
+
+ WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("WillLoadURLRequestReturn").get(), messageBody.get());
+ }
+
+ static void willLoadDataRequest(WKBundlePageRef page, WKURLRequestRef request, WKDataRef data, WKStringRef MIMEType, WKStringRef encodingName, WKURLRef unreachableURL, WKTypeRef userData, const void *clientInfo)
+ {
+ WKRetainPtr<WKMutableDictionaryRef> messageBody = adoptWK(WKMutableDictionaryCreate());
+
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("URLRequestReturn").get(), request);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("DataReturn").get(), data);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("MIMETypeReturn").get(), MIMEType);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("EncodingNameReturn").get(), encodingName);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("UnreachableURLReturn").get(), unreachableURL);
+ WKDictionaryAddItem(messageBody.get(), Util::toWK("UserDataReturn").get(), userData);
+
+ WKBundlePostMessage(InjectedBundleController::shared().bundle(), Util::toWK("WillLoadDataRequestReturn").get(), messageBody.get());
+
+ }
+
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef bundlePage) OVERRIDE
+ {
+ WKBundlePageLoaderClient pageLoaderClient;
+ memset(&pageLoaderClient, 0, sizeof(pageLoaderClient));
+
+ pageLoaderClient.version = 6;
+ pageLoaderClient.clientInfo = this;
+ pageLoaderClient.willLoadURLRequest = willLoadURLRequest;
+ pageLoaderClient.willLoadDataRequest = willLoadDataRequest;
+
+ WKBundlePageSetPageLoaderClient(bundlePage, &pageLoaderClient);
+ }
+};
+
+static InjectedBundleTest::Register<WillLoadTest> registrar("WillLoadTest");
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/associate-form-controls.html b/Tools/TestWebKitAPI/Tests/WebKit2/associate-form-controls.html
new file mode 100644
index 000000000..906246a54
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/associate-form-controls.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+ <script>
+ function addForm()
+ {
+ var form = document.createElement("form");
+ form.id = "login_form";
+
+ var usernameField = document.createElement("input");
+ usernameField.id = "username";
+ usernameField.type = "text";
+ form.appendChild(usernameField);
+
+ document.body.appendChild(form);
+ }
+
+ function addPasswordFieldToForm()
+ {
+ var passwordField = document.createElement("input");
+ passwordField.id = "password";
+ passwordField.type = "password";
+
+ var form = document.getElementById("login_form");
+ form.appendChild(passwordField);
+ }
+ </script>
+</head>
+<body onload="addForm()">
+<button onclick="addPasswordFieldToForm()">Manual Testing: Add the password field</button>
+</body>
+</html>
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html b/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html
new file mode 100644
index 000000000..8a98f33e9
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html
@@ -0,0 +1,6 @@
+<script>
+ var request = new XMLHttpRequest();
+ request.open('GET', 'test://test', false);
+ request.send(null);
+ window._testResult = request.responseText;
+</script> \ No newline at end of file
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp
new file mode 100644
index 000000000..552b38c4d
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ewk_view_private.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "Test.h"
+#include "WKView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+struct TestStatesData {
+ TestStatesData(WKViewRef view, WKURLRef url)
+ : view(view)
+ , url(url)
+ , didFinishLoad(false)
+ , didCrash(false)
+ , didRelaunch(false)
+ {
+ }
+
+ WKViewRef view;
+ WKURLRef url;
+ bool didFinishLoad;
+ bool didCrash;
+ bool didRelaunch;
+};
+
+static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void* clientInfo)
+{
+ TestStatesData* states = const_cast<TestStatesData*>(static_cast<const TestStatesData*>(clientInfo));
+ states->didFinishLoad = true;
+}
+
+static void setPageLoaderClient(WKPageRef page, const void* clientInfo)
+{
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ loaderClient.clientInfo = clientInfo;
+
+ WKPageSetPageLoaderClient(page, &loaderClient);
+}
+
+void webProcessCrashed(WKViewRef view, WKURLRef url, const void* clientInfo)
+{
+ TestStatesData* states = const_cast<TestStatesData*>(static_cast<const TestStatesData*>(clientInfo));
+
+ EXPECT_EQ(states->view, view);
+ EXPECT_TRUE(WKURLIsEqual(url, states->url));
+
+ states->didCrash = true;
+}
+
+void webProcessDidRelaunch(WKViewRef view, const void* clientInfo)
+{
+ TestStatesData* states = const_cast<TestStatesData*>(static_cast<const TestStatesData*>(clientInfo));
+
+ EXPECT_EQ(states->view, view);
+
+ states->didRelaunch = true;
+}
+
+static void setViewClient(WKViewRef view, const void* clientInfo)
+{
+ WKViewClient viewClient;
+ memset(&viewClient, 0, sizeof(WKViewClient));
+
+ viewClient.version = kWKViewClientCurrentVersion;
+ viewClient.clientInfo = clientInfo;
+ viewClient.webProcessCrashed = webProcessCrashed;
+ viewClient.webProcessDidRelaunch = webProcessDidRelaunch;
+
+ WKViewSetViewClient(view, &viewClient);
+}
+
+TEST(WebKit2, WKViewClientWebProcessCallbacks)
+{
+ WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("WKViewClientWebProcessCallbacksTest"));
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+
+ PlatformWebView view(context.get());
+ WKViewRef wkView = EWKViewGetWKView(view.platformView());
+
+ TestStatesData states = TestStatesData(wkView, url.get());
+
+ setPageLoaderClient(view.page(), &states);
+ setViewClient(wkView, &states);
+
+ WKPageLoadURL(view.page(), url.get());
+ Util::run(&states.didFinishLoad);
+
+ WKContextPostMessageToInjectedBundle(context.get(), Util::toWK("Crash").get(), 0);
+ Util::run(&states.didCrash);
+
+ WKPageReload(view.page());
+ Util::run(&states.didRelaunch);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp
new file mode 100644
index 000000000..83a95c069
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class WKViewClientWebProcessCallbacksTest : public InjectedBundleTest {
+public:
+ WKViewClientWebProcessCallbacksTest(const std::string& identifier);
+
+private:
+ virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody);
+};
+
+static InjectedBundleTest::Register<WKViewClientWebProcessCallbacksTest> registrar("WKViewClientWebProcessCallbacksTest");
+
+WKViewClientWebProcessCallbacksTest::WKViewClientWebProcessCallbacksTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+{
+}
+
+void WKViewClientWebProcessCallbacksTest::didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef)
+{
+ if (!WKStringIsEqualToUTF8CString(messageName, "Crash"))
+ return;
+
+ // Simulating a crash
+ abort();
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/execCopy.html b/Tools/TestWebKitAPI/Tests/WebKit2/execCopy.html
new file mode 100644
index 000000000..cf4608ebd
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/execCopy.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<script type="text/javascript">
+ function doCopy() {
+ document.execCommand("selectAll", true);
+ document.execCommand("copy");
+ }
+</script>
+</head>
+<body onLoad="doCopy()">
+ <div>Hello world.</div>
+ <div><b>Hello</b><i> world</i></div>
+ <div style="border: solid red 1px">Hello world</div>
+</body>
+</html>
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/findRanges.html b/Tools/TestWebKitAPI/Tests/WebKit2/findRanges.html
new file mode 100644
index 000000000..e10bbeb47
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/findRanges.html
@@ -0,0 +1,11 @@
+<html>
+<body>Test search. Hello world, Hello crazy world, Hello!</body>
+<script>
+ var s = window.getSelection();
+ var r = document.createRange();
+
+ r.setStart(document.body.firstChild, 38);
+ r.setEnd(document.body.firstChild, 43);
+ s.addRange(r);
+</script>
+</html>
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html b/Tools/TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html
new file mode 100644
index 000000000..9598a3efa
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html
@@ -0,0 +1,3 @@
+<body style="-webkit-writing-mode: vertical-lr;">
+You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too! You say it's your Birthday. It's my Birthday too!
+</body>
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm b/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm
index 4afd72fa2..ea770519a 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm
@@ -55,7 +55,7 @@ static void setInjectedBundleClient(WKContextRef context)
static RetainPtr<SyntheticBackingScaleFactorWindow> createWindow()
{
- RetainPtr<SyntheticBackingScaleFactorWindow> window(AdoptNS, [[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<SyntheticBackingScaleFactorWindow> window = adoptNS([[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[window.get() setReleasedWhenClosed:NO];
return window;
}
@@ -64,7 +64,7 @@ TEST(WebKit2, GetBackingScaleFactor)
{
WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("GetBackingScaleFactorTest"));
setInjectedBundleClient(context.get());
- RetainPtr<WKView> view(AdoptNS, [[WKView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) contextRef:context.get() pageGroupRef:0]);
+ RetainPtr<WKView> view = adoptNS([[WKView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) contextRef:context.get() pageGroupRef:0]);
RetainPtr<SyntheticBackingScaleFactorWindow> window1 = createWindow();
[window1.get() setBackingScaleFactor:1];
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp
new file mode 100644
index 000000000..5b37b0845
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+
+#include <WebKit2/WKPagePrivateMac.h>
+#include <WebKit2/WKContextPrivate.h>
+
+namespace TestWebKitAPI {
+
+static bool loaded;
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ loaded = true;
+}
+
+TEST(WebKit2, GetPIDAfterAbortedProcessLaunch)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKContextSetUsesNetworkProcess(context.get(), true);
+
+ PlatformWebView webView(context.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&loaded);
+ WKPageTerminate(webView.page());
+
+ // Reloading will start relaunching the process.
+ WKPageReload(webView.page());
+
+ WKPageClose(webView.page());
+
+ // And now we try to get the PID page when the page has been closed before the process launch was complete.
+ EXPECT_EQ(0, WKPageGetProcessIdentifier(webView.page()));
+}
+
+} // namespace TestWebKitAPI
+
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp
index 8bd0c5678..44a5b30d0 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp
@@ -34,7 +34,7 @@ TEST(WebKit2, DoNotCopyANullCFURLResponse)
{
// Neither of these calls should cause a crash.
WKRetainPtr<WKURLResponseRef> nullWKResponse(AdoptWK, WKURLResponseCreateWithCFURLResponse(0));
- RetainPtr<CFURLResponseRef> nullCFResponse(AdoptCF, WKURLResponseCopyCFURLResponse(kCFAllocatorDefault, nullWKResponse.get()));
+ RetainPtr<CFURLResponseRef> nullCFResponse = adoptCF(WKURLResponseCopyCFURLResponse(kCFAllocatorDefault, nullWKResponse.get()));
}
} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm
new file mode 100644
index 000000000..bf932cd43
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#import "PlatformUtilities.h"
+#import "PlatformWebView.h"
+#import "TestBrowsingContextLoadDelegate.h"
+#import <WebKit2/WebKit2.h>
+#import <wtf/RetainPtr.h>
+
+static bool testFinished = false;
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2CustomProtocolsTest, RegisterNilScheme)
+{
+ [WKBrowsingContextController registerSchemeForCustomProtocol:nil];
+ [WKBrowsingContextController unregisterSchemeForCustomProtocol:nil];
+}
+
+TEST(WebKit2CustomProtocolsTest, LoadInvalidScheme)
+{
+ [WKBrowsingContextController registerSchemeForCustomProtocol:@"custom"];
+ WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("CustomProtocolInvalidSchemeTest"));
+ PlatformWebView webView(context.get());
+
+ webView.platformView().browsingContextController.loadDelegate = [[TestBrowsingContextLoadDelegate alloc] initWithBlockToRunOnLoad:^(WKBrowsingContextController *sender) {
+ testFinished = true;
+ }];
+ [webView.platformView().browsingContextController loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"ht'tp://www.webkit.org"]]];
+
+ Util::run(&testFinished);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp
new file mode 100644
index 000000000..ee72f87e7
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "InjectedBundleTest.h"
+#include <WebKit2/WKBundlePage.h>
+
+namespace TestWebKitAPI {
+
+static WKBundlePagePolicyAction decidePolicyForNavigationAction(WKBundlePageRef, WKBundleFrameRef, WKBundleNavigationActionRef, WKURLRequestRef request, WKTypeRef*, const void*)
+{
+ if (WKBundlePageCanHandleRequest(request))
+ return WKBundlePagePolicyActionUse;
+ return WKBundlePagePolicyActionPassThrough;
+}
+
+class CustomProtocolInvalidSchemeTest : public InjectedBundleTest {
+public:
+ CustomProtocolInvalidSchemeTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+private:
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef bundlePage) OVERRIDE
+ {
+ WKBundlePagePolicyClient policyClient;
+ memset(&policyClient, 0, sizeof(policyClient));
+ policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction;
+ WKBundlePageSetPolicyClient(bundlePage, &policyClient);
+ }
+};
+
+static InjectedBundleTest::Register<CustomProtocolInvalidSchemeTest> registrar("CustomProtocolInvalidSchemeTest");
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
index 0454f3f38..7eb2d364e 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
+++ b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
@@ -28,57 +28,17 @@
#import "PlatformUtilities.h"
#import "TestBrowsingContextLoadDelegate.h"
-#import <Foundation/Foundation.h>
+#import "TestProtocol.h"
#import <WebKit2/WebKit2.h>
-static NSString *testScheme = @"test";
-static NSString *testHost = @"test";
static bool testFinished = false;
-@interface TestProtocol : NSURLProtocol {
-}
-@end
-
-@implementation TestProtocol
-
-+ (BOOL)canInitWithRequest:(NSURLRequest *)request
-{
- return [[[request URL] scheme] caseInsensitiveCompare:testScheme] == NSOrderedSame;
-}
-
-+ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
-{
- return request;
-}
-
-+ (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b
-{
- return NO;
-}
-
-- (void)startLoading
-{
- EXPECT_TRUE([[[[self request] URL] scheme] isEqualToString:testScheme]);
- EXPECT_TRUE([[[[self request] URL] host] isEqualToString:testHost]);
-
- NSData *data = [@"<body>PASS</body>" dataUsingEncoding:NSASCIIStringEncoding];
- NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[[self request] URL] MIMEType:@"text/html" expectedContentLength:[data length] textEncodingName:nil];
- [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
- [[self client] URLProtocol:self didLoadData:data];
- [[self client] URLProtocolDidFinishLoading:self];
- [response release];
-}
-
-- (void)stopLoading
-{
-}
-
-@end
+namespace TestWebKitAPI {
-TEST(WebKit2CustomProtocolsTest, CustomProtocolUsed)
+TEST(WebKit2CustomProtocolsTest, MainResource)
{
[NSURLProtocol registerClass:[TestProtocol class]];
- [WKBrowsingContextController registerSchemeForCustomProtocol:testScheme];
+ [WKBrowsingContextController registerSchemeForCustomProtocol:[TestProtocol scheme]];
WKProcessGroup *processGroup = [[WKProcessGroup alloc] init];
WKBrowsingContextGroup *browsingContextGroup = [[WKBrowsingContextGroup alloc] initWithIdentifier:@"TestIdentifier"];
@@ -86,7 +46,9 @@ TEST(WebKit2CustomProtocolsTest, CustomProtocolUsed)
wkView.browsingContextController.loadDelegate = [[TestBrowsingContextLoadDelegate alloc] initWithBlockToRunOnLoad:^(WKBrowsingContextController *sender) {
testFinished = true;
}];
- [wkView.browsingContextController loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", testScheme, testHost]]]];
+ [wkView.browsingContextController loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://test", [TestProtocol scheme]]]]];
+
+ Util::run(&testFinished);
+}
- TestWebKitAPI::Util::run(&testFinished);
-} \ No newline at end of file
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm
new file mode 100644
index 000000000..0e86aaa27
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "Test.h"
+
+#import "PlatformUtilities.h"
+#import "PlatformWebView.h"
+#import "TestBrowsingContextLoadDelegate.h"
+#import "TestProtocol.h"
+#import <WebKit2/WebKit2.h>
+#import <WebKit2/WKViewPrivate.h>
+
+static bool testFinished = false;
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2, PreventImageLoadWithAutoResizingTest)
+{
+ [NSURLProtocol registerClass:[TestProtocol class]];
+ [WKBrowsingContextController registerSchemeForCustomProtocol:[TestProtocol scheme]];
+
+ WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("DenyWillSendRequestTest"));
+ PlatformWebView webView(context.get());
+
+ webView.platformView().minimumSizeForAutoLayout = NSMakeSize(400, 300);
+ webView.platformView().browsingContextController.loadDelegate = [[TestBrowsingContextLoadDelegate alloc] initWithBlockToRunOnLoad:^(WKBrowsingContextController *sender) {
+ testFinished = true;
+ }];
+ [webView.platformView().browsingContextController loadHTMLString:@"<html><body style='background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC);'></body></html>" baseURL:[NSURL URLWithString:@"about:blank"]];
+
+ Util::run(&testFinished);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp
new file mode 100644
index 000000000..9f73d7541
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleTest.h"
+#include "PlatformUtilities.h"
+#include "Test.h"
+
+#include <WebKit2/WKBundlePage.h>
+
+#include <wtf/Assertions.h>
+
+namespace TestWebKitAPI {
+
+class DenyWillSendRequestTest : public InjectedBundleTest {
+public:
+ DenyWillSendRequestTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+ static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void *clientInfo)
+ {
+ return 0;
+ }
+
+ virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+ {
+ WKBundlePageResourceLoadClient resourceLoadClient;
+ memset(&resourceLoadClient, 0, sizeof(resourceLoadClient));
+
+ resourceLoadClient.version = 0;
+ resourceLoadClient.willSendRequestForFrame = willSendRequestForFrame;
+
+ WKBundlePageSetResourceLoadClient(page, &resourceLoadClient);
+
+ }
+};
+
+static InjectedBundleTest::Register<DenyWillSendRequestTest> registrar("DenyWillSendRequestTest");
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp b/Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
index de408831f..bfcc17dcc 100644
--- a/Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
+++ b/Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
@@ -80,21 +80,23 @@ public:
}
protected:
- virtual bool sendSimpleKeyEvent(GdkEventKey* event, WTF::String eventString)
+ virtual bool sendSimpleKeyEvent(GdkEventKey* event, WTF::String eventString, EventFakedForComposition faked)
{
const char* eventType = event->type == GDK_KEY_RELEASE ? "release" : "press";
+ const char* fakedString = faked == EventFaked ? " (faked)" : "";
if (!eventString.isNull())
- m_events.append(String::format("sendSimpleKeyEvent type=%s keycode=%x text='%s'", eventType, event->keyval, eventString.utf8().data()));
+ m_events.append(String::format("sendSimpleKeyEvent type=%s keycode=%x text='%s'%s", eventType, event->keyval, eventString.utf8().data(), fakedString));
else
- m_events.append(String::format("sendSimpleKeyEvent type=%s keycode=%x", eventType, event->keyval));
+ m_events.append(String::format("sendSimpleKeyEvent type=%s keycode=%x%s", eventType, event->keyval, fakedString));
return true;
}
- virtual bool sendKeyEventWithCompositionResults(GdkEventKey* event, ResultsToSend resultsToSend)
+ virtual bool sendKeyEventWithCompositionResults(GdkEventKey* event, ResultsToSend resultsToSend, EventFakedForComposition faked)
{
const char* eventType = event->type == GDK_KEY_RELEASE ? "release" : "press";
- m_events.append(String::format("sendKeyEventWithCompositionResults type=%s keycode=%u", eventType, event->keyval));
+ const char* fakedString = faked == EventFaked ? " (faked)" : "";
+ m_events.append(String::format("sendKeyEventWithCompositionResults type=%s keycode=%u%s", eventType, event->keyval, fakedString));
if (resultsToSend & Composition && !m_confirmedComposition.isNull())
confirmCompositionText(m_confirmedComposition);
@@ -241,12 +243,12 @@ TEST(GTK, GtkInputMethodFilterContextEventsWithoutKeyEvents)
const Vector<String>& events = inputMethodFilter.events();
ASSERT_EQ(6, events.size());
- ASSERT_EQ(String("sendKeyEventWithCompositionResults type=press keycode=16777215"), events[0]);
+ ASSERT_EQ(String("sendKeyEventWithCompositionResults type=press keycode=16777215 (faked)"), events[0]);
ASSERT_EQ(String("setPreedit text='preedit of doom, bringer of cheese' cursorOffset=3"), events[1]);
- ASSERT_EQ(String("sendSimpleKeyEvent type=release keycode=ffffff"), events[2]);
- ASSERT_EQ(String("sendKeyEventWithCompositionResults type=press keycode=16777215"), events[3]);
+ ASSERT_EQ(String("sendSimpleKeyEvent type=release keycode=ffffff (faked)"), events[2]);
+ ASSERT_EQ(String("sendKeyEventWithCompositionResults type=press keycode=16777215 (faked)"), events[3]);
ASSERT_EQ(String("confirmComposition 'commit text'"), events[4]);
- ASSERT_EQ(String("sendSimpleKeyEvent type=release keycode=ffffff"), events[5]);
+ ASSERT_EQ(String("sendSimpleKeyEvent type=release keycode=ffffff (faked)"), events[5]);
}
static bool gSawContextReset = false;
@@ -258,11 +260,10 @@ static void temporaryResetOverride(GtkIMContext*)
static void verifyCanceledComposition(const Vector<String>& events)
{
- ASSERT_EQ(4, events.size());
+ ASSERT_EQ(3, events.size());
ASSERT_EQ(String("sendKeyEventWithCompositionResults type=press keycode=39"), events[0]);
ASSERT_EQ(String("setPreedit text='' cursorOffset=0"), events[1]);
ASSERT_EQ(String("sendSimpleKeyEvent type=release keycode=27"), events[2]);
- ASSERT_EQ(String("confirmCurrentcomposition"), events[3]);
ASSERT(gSawContextReset);
}
diff --git a/Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm b/Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm
index bc2f786f8..dec788804 100644
--- a/Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm
@@ -47,7 +47,7 @@ public:
template <typename View>
void AcceptsFirstMouse::runTest(View view)
{
- RetainPtr<NSWindow> window(AdoptNS, [[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[[window.get() contentView] addSubview:view];
CGFloat viewHeight = view.bounds.size.height;
diff --git a/Tools/TestWebKitAPI/Tests/mac/AttributedString.mm b/Tools/TestWebKitAPI/Tests/mac/AttributedString.mm
index 18cce9c2d..6386cad5f 100644
--- a/Tools/TestWebKitAPI/Tests/mac/AttributedString.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/AttributedString.mm
@@ -52,8 +52,8 @@ static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
TEST(WebKit1, AttributedStringTest)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<AttributedStringTest> testController(AdoptNS, [AttributedStringTest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<AttributedStringTest> testController = adoptNS([AttributedStringTest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"attributedStringCustomFont" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/BackForwardList.mm b/Tools/TestWebKitAPI/Tests/mac/BackForwardList.mm
index 098453d18..82ddb3830 100644
--- a/Tools/TestWebKitAPI/Tests/mac/BackForwardList.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/BackForwardList.mm
@@ -54,8 +54,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, ReloadBackForward)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<BackForwardListTest> testController(AdoptNS, [BackForwardListTest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<BackForwardListTest> testController = adoptNS([BackForwardListTest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://does-not-exist.example"]]];
Util::run(&didFinishLoad);
diff --git a/Tools/TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm b/Tools/TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm
index 3729eb53c..9a19f936c 100644
--- a/Tools/TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm
@@ -64,11 +64,11 @@ TEST(WebKit1, CancelLoadFromResourceLoadDelegate)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<CancelLoadFromResourceLoadDelegate> resourceLoadDelegate(AdoptNS, [[CancelLoadFromResourceLoadDelegate alloc] init]);
+ RetainPtr<CancelLoadFromResourceLoadDelegate> resourceLoadDelegate = adoptNS([[CancelLoadFromResourceLoadDelegate alloc] init]);
webView.get().resourceLoadDelegate = resourceLoadDelegate.get();
- RetainPtr<CancelLoadFromResourceLoadDelegateFrameLoadDelegate> frameLoadDelegate(AdoptNS, [[CancelLoadFromResourceLoadDelegateFrameLoadDelegate alloc] init]);
+ RetainPtr<CancelLoadFromResourceLoadDelegateFrameLoadDelegate> frameLoadDelegate = adoptNS([[CancelLoadFromResourceLoadDelegateFrameLoadDelegate alloc] init]);
webView.get().frameLoadDelegate = frameLoadDelegate.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"CancelLoadFromResourceLoadDelegate" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/CloseNewWindowInNavigationPolicyDelegate.mm b/Tools/TestWebKitAPI/Tests/mac/CloseNewWindowInNavigationPolicyDelegate.mm
new file mode 100644
index 000000000..367378609
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/CloseNewWindowInNavigationPolicyDelegate.mm
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <wtf/RetainPtr.h>
+
+static bool testFinished = false;
+
+@interface TestDelegate : NSObject
+
++ (TestDelegate *)shared;
+
+@end
+
+@implementation TestDelegate
+
++ (TestDelegate *)shared
+{
+ static TestDelegate *sharedTestDelegate = [[TestDelegate alloc] init];
+ return sharedTestDelegate;
+}
+
+- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
+{
+ if (!request) {
+ [listener use];
+ return;
+ }
+
+ [webView close];
+ [listener ignore];
+ testFinished = true;
+}
+
+- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request
+{
+ WebView *webView = [[WebView alloc] init];
+ webView.policyDelegate = [TestDelegate shared];
+ [[webView mainFrame] loadRequest:request];
+ return webView;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, CloseNewWindowInNavigationPolicyDelegate)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] init]);
+ webView.get().preferences.javaScriptCanOpenWindowsAutomatically = YES;
+ webView.get().UIDelegate = [TestDelegate shared];
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"OpenNewWindow" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&testFinished);
+
+ [pool drain];
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm b/Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm
index 40ac377e1..f79535f64 100644
--- a/Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm
@@ -88,9 +88,9 @@ static void contextMenuCopyLink(WebView* webView, int itemIndex)
TEST(WebKit1, ContextMenuCanCopyURL)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0,0,800,600) frameName:nil groupName:nil]);
- RetainPtr<NSWindow> window(AdoptNS, [[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
- RetainPtr<ContextMenuCanCopyURLDelegate> delegate(AdoptNS, [[ContextMenuCanCopyURLDelegate alloc] init]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0,0,800,600) frameName:nil groupName:nil]);
+ RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<ContextMenuCanCopyURLDelegate> delegate = adoptNS([[ContextMenuCanCopyURLDelegate alloc] init]);
[window.get().contentView addSubview:webView.get()];
webView.get().frameLoadDelegate = delegate.get();
diff --git a/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm b/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm
new file mode 100644
index 000000000..2c8ca3986
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <wtf/RetainPtr.h>
+
+#import <WebKit/DOMPrivate.h>
+#import <WebKit/WebViewPrivate.h>
+
+@interface HTMLTableCellElementCellAboveTest : NSObject
+@end
+
+static bool didFinishLoad;
+
+@implementation HTMLTableCellElementCellAboveTest
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoad = true;
+}
+@end
+
+namespace TestWebKitAPI {
+
+static void expectCellAboveCell(DOMDocument *document, NSString *cellID, NSString *cellAboveID)
+{
+ DOMHTMLTableCellElement *cell = (DOMHTMLTableCellElement *)[document getElementById:cellID];
+ DOMHTMLTableCellElement *cellAbove = [cell _cellAbove];
+
+ EXPECT_WK_STREQ(cellAboveID, [cellAbove getAttribute:@"id"]);
+}
+
+TEST(WebKit1, HTMLTableCellElementCellAbove)
+{
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<HTMLTableCellElementCellAboveTest> testController = adoptNS([HTMLTableCellElementCellAboveTest new]);
+
+ webView.get().frameLoadDelegate = testController.get();
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle]
+ URLForResource:@"DOMHTMLTableCellElementCellAbove" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&didFinishLoad);
+ didFinishLoad = false;
+
+ DOMDocument *document = webView.get().mainFrameDocument;
+
+ expectCellAboveCell(document, @"cell-4-2", @"cell-3-2");
+ expectCellAboveCell(document, @"cell-3-1", @"cell-2-1");
+ expectCellAboveCell(document, @"cell-2-1", @"cell-1-1");
+ expectCellAboveCell(document, @"cell-1-2", @"cell-h-2");
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellElementCellAbove.html b/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellElementCellAbove.html
new file mode 100644
index 000000000..79135fd27
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/DOMHTMLTableCellElementCellAbove.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<body>
+ <table>
+ <tbody>
+ <tr>
+ <td id="cell-1-1">1-1</td>
+ <td id="cell-1-2">1-2</td>
+ </tr>
+ <tr>
+ <td id="cell-2-1">2-1</td>
+ <td id="cell-2-2">2-2</td>
+ </tr>
+ </tbody>
+ <thead>
+ <tr>
+ <th id="cell-h-1">h-1</th>
+ <th id="cell-h-2">h-2</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td id="cell-3-1">3-1</td>
+ <td id="cell-3-2">3-2</td>
+ </tr>
+ <tr>
+ <td id="cell-4-1">4-1</td>
+ <td id="cell-4-2">4-2</td>
+ </tr>
+ </tbody>
+</body>
diff --git a/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm b/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm
new file mode 100644
index 000000000..7bd23ea98
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#import <JavaScriptCore/JSRetainPtr.h>
+#import <WebKit/DOMPrivate.h>
+#import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebScriptWorld.h>
+#import <objc/runtime.h>
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, DOMNodeFromJSObject)
+{
+ WebView *webView = [[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil];
+
+ [webView stringByEvaluatingJavaScriptFromString:@"document.body.mainWorldProperty = true"];
+
+ WebScriptWorld *isolatedWorld = [WebScriptWorld world];
+ JSGlobalContextRef context = [[webView mainFrame] _globalContextForScriptWorld:isolatedWorld];
+
+ JSRetainPtr<JSStringRef> script(Adopt, JSStringCreateWithUTF8CString("document.body"));
+
+ JSValueRef value = JSEvaluateScript(context, script.get(), 0, 0, 0, 0);
+ JSObjectRef jsBody = JSValueToObject(context, value, 0);
+
+ id objcBody = [DOMNode _nodeFromJSWrapper:jsBody];
+
+ EXPECT_STREQ("DOMHTMLBodyElement", class_getName([objcBody class]));
+ EXPECT_EQ([[[webView mainFrame] DOMDocument] body], objcBody);
+
+ // Verify that the Objective-C wrapper is for the main world JS wrapper.
+ EXPECT_TRUE([[objcBody valueForKey:@"mainWorldProperty"] boolValue]);
+
+ [webView release];
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/DOMRangeOfString.mm b/Tools/TestWebKitAPI/Tests/mac/DOMRangeOfString.mm
index 1e8080539..a4485178d 100644
--- a/Tools/TestWebKitAPI/Tests/mac/DOMRangeOfString.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/DOMRangeOfString.mm
@@ -48,8 +48,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, DOMRangeOfString)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil]);
- RetainPtr<DOMRangeOfStringFrameLoadDelegate> frameLoadDelegate(AdoptNS, [DOMRangeOfStringFrameLoadDelegate new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil]);
+ RetainPtr<DOMRangeOfStringFrameLoadDelegate> frameLoadDelegate = adoptNS([DOMRangeOfStringFrameLoadDelegate new]);
webView.get().frameLoadDelegate = frameLoadDelegate.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"DOMRangeOfString" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
@@ -74,7 +74,7 @@ TEST(WebKit1, DOMRangeOfString)
resultRange = [webView.get() DOMRangeOfString:@"n" relativeTo:needleRange options:WebFindOptionsStartInSelection];
EXPECT_EQ(28, resultRange.startOffset);
- RetainPtr<WebView> otherWebView(AdoptNS, [[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil]);
+ RetainPtr<WebView> otherWebView = adoptNS([[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil]);
DOMRange *foreignRange = [[[otherWebView.get() mainFrame] DOMDocument] createRange];
resultRange = [webView.get() DOMRangeOfString:@"needle" relativeTo:foreignRange options:0];
EXPECT_EQ(nil, resultRange);
diff --git a/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm b/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm
index f20356429..68ecbf819 100644
--- a/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm
@@ -53,12 +53,12 @@ namespace TestWebKitAPI {
TEST(WebKit1, DeviceScaleFactorInDashboardRegions)
{
NSRect viewFrame = NSMakeRect(0, 0, 800, 600);
- RetainPtr<SyntheticBackingScaleFactorWindow> window(AdoptNS, [[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<SyntheticBackingScaleFactorWindow> window = adoptNS([[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[window.get() setReleasedWhenClosed:NO];
[window.get() setBackingScaleFactor:2];
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:viewFrame frameName:nil groupName:nil]);
- RetainPtr<DeviceScaleFactorInDashboardRegionsUIDelegate> uiDelegate(AdoptNS, [DeviceScaleFactorInDashboardRegionsUIDelegate new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:viewFrame frameName:nil groupName:nil]);
+ RetainPtr<DeviceScaleFactorInDashboardRegionsUIDelegate> uiDelegate = adoptNS([DeviceScaleFactorInDashboardRegionsUIDelegate new]);
webView.get().UIDelegate = uiDelegate.get();
[window.get().contentView addSubview:webView.get()];
diff --git a/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm b/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm
index 154b8c32c..8c454282a 100644
--- a/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm
@@ -50,7 +50,7 @@ public:
RetainPtr<SyntheticBackingScaleFactorWindow> DeviceScaleFactorOnBack::createWindow()
{
- RetainPtr<SyntheticBackingScaleFactorWindow> window(AdoptNS, [[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<SyntheticBackingScaleFactorWindow> window = adoptNS([[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[window.get() setReleasedWhenClosed:NO];
return window;
}
diff --git a/Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm b/Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm
index d0ebd5177..61a1efed7 100644
--- a/Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm
@@ -47,7 +47,7 @@ public:
RetainPtr<SyntheticBackingScaleFactorWindow> DynamicDeviceScaleFactor::createWindow()
{
- RetainPtr<SyntheticBackingScaleFactorWindow> window(AdoptNS, [[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+ RetainPtr<SyntheticBackingScaleFactorWindow> window = adoptNS([[SyntheticBackingScaleFactorWindow alloc] initWithContentRect:viewFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
[window.get() setReleasedWhenClosed:NO];
return window;
}
diff --git a/Tools/TestWebKitAPI/Tests/mac/ElementAtPointInWebFrame.mm b/Tools/TestWebKitAPI/Tests/mac/ElementAtPointInWebFrame.mm
new file mode 100644
index 000000000..10fc581f4
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/ElementAtPointInWebFrame.mm
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebFramePrivate.h>
+#import <wtf/RetainPtr.h>
+
+@interface ElementAtPointFrameLoadDelegate : NSObject
+@end
+
+static bool didFinishLoad;
+
+@implementation ElementAtPointFrameLoadDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoad = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, ElementAtPoint)
+{
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<ElementAtPointFrameLoadDelegate> frameLoadDelegate = adoptNS([[ElementAtPointFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ [mainFrame loadHTMLString:@"<style> div { position:absolute; width:60px; height:100px; } </style> <div name='first'></div> <div name='second' style='left:60px; top:100px;'></div>"
+ baseURL:[NSURL URLWithString:@"about:blank"]];
+
+ Util::run(&didFinishLoad);
+
+ NSDictionary *elementDictionary = [mainFrame elementAtPoint:NSMakePoint(30, 50)];
+ DOMElement *domElement = [elementDictionary objectForKey:WebElementDOMNodeKey];
+ EXPECT_WK_STREQ(@"first", [domElement getAttribute:@"name"]);
+
+ elementDictionary = [mainFrame elementAtPoint:NSMakePoint(90, 150)];
+ domElement = [elementDictionary objectForKey:WebElementDOMNodeKey];
+ EXPECT_WK_STREQ(@"second", [domElement getAttribute:@"name"]);
+
+ elementDictionary = [mainFrame elementAtPoint:NSMakePoint(30, 150)];
+ domElement = [elementDictionary objectForKey:WebElementDOMNodeKey];
+ EXPECT_WK_STREQ(@"BODY", [domElement tagName]);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm b/Tools/TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm
index 50aafeeba..62cb79751 100644
--- a/Tools/TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm
@@ -50,8 +50,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, HTMLCollectionNamedItemTest)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<HTMLCollectionNamedItemTest> testController(AdoptNS, [HTMLCollectionNamedItemTest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<HTMLCollectionNamedItemTest> testController = adoptNS([HTMLCollectionNamedItemTest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle]
diff --git a/Tools/TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm b/Tools/TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm
index cf2da2dfb..a716ab92f 100644
--- a/Tools/TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm
@@ -50,8 +50,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, HTMLFormCollectionNamedItemTest)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<HTMLFormCollectionNamedItemTest> testController(AdoptNS, [HTMLFormCollectionNamedItemTest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<HTMLFormCollectionNamedItemTest> testController = adoptNS([HTMLFormCollectionNamedItemTest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle]
diff --git a/Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm b/Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm
index 0a51e2fb4..5f2205be8 100644
--- a/Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/InspectorBar.mm
@@ -52,8 +52,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, InspectorBarTest)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<InspectorBarController> inspectorBarController(AdoptNS, [InspectorBarController new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<InspectorBarController> inspectorBarController = adoptNS([InspectorBarController new]);
webView.get().frameLoadDelegate = inspectorBarController.get();
[webView.get().mainFrame loadHTMLString:@"<body contenteditable style=\"color: green\"><u>Lorem ipsum sit amet</u></body>" baseURL:[NSURL URLWithString:@"about:blank"]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache1.html b/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache1.html
new file mode 100644
index 000000000..f736a7890
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache1.html
@@ -0,0 +1,10 @@
+<body>
+ <div id="test-div"></div>
+ <script>
+ var testDiv = document.getElementById("test-div");
+ if (!testDiv.myCustomProperty)
+ insertMyCustomProperty(testDiv);
+ else
+ checkForMyCustomProperty(testDiv);
+ </script>
+</body>
diff --git a/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache2.html b/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache2.html
new file mode 100644
index 000000000..1d26d21b4
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/JSContextBackForwardCache2.html
@@ -0,0 +1,10 @@
+<body>
+ <div id="test-div"></div>
+ <script>
+ var testDiv = document.getElementById("test-div");
+ if (testDiv.myCustomProperty)
+ myConsole.log("ERROR: found myCustomProperty.");
+ else
+ didCompleteTestSuccessfully();
+ </script>
+</body>
diff --git a/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm b/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm
new file mode 100644
index 000000000..5c41aaab5
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebScriptWorld.h>
+#import <JavaScriptCore/JSContextRef.h>
+#import <JavaScriptCore/JSRetainPtr.h>
+#import <JavaScriptCore/JSStringRef.h>
+#import <JavaScriptCore/JSValueRef.h>
+#import <wtf/RetainPtr.h>
+
+@interface JSWrapperForNodeFrameLoadDelegate : NSObject {
+}
+@end
+
+static bool didFinishLoad;
+
+@implementation JSWrapperForNodeFrameLoadDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoad = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, JSWrapperForNode)
+{
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<JSWrapperForNodeFrameLoadDelegate> frameLoadDelegate = adoptNS([[JSWrapperForNodeFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+ [mainFrame loadHTMLString:@"<div id=\"target\"</div>" baseURL:[NSURL URLWithString:@"about:blank"]];
+ Util::run(&didFinishLoad);
+ DOMDocument *document = webView.get().mainFrameDocument;
+ DOMNode *target = [document getElementById:@"target"]; // This script object is in standard world.
+
+ // In an isolated script world, add a new property to the target node.
+ NSString *isolatedScriptString = @"var target = document.getElementById(\"target\"); target.isolatedProperty = true;";
+ WebScriptWorld *isolatedWorld = [WebScriptWorld world];
+ JSGlobalContextRef isolatedCtx = [mainFrame _globalContextForScriptWorld:isolatedWorld];
+ [mainFrame _stringByEvaluatingJavaScriptFromString:isolatedScriptString withGlobalObject:JSContextGetGlobalObject(isolatedCtx) inScriptWorld:isolatedWorld];
+ JSValueRef isolatedNodeJSValue = [mainFrame jsWrapperForNode:target inScriptWorld:isolatedWorld];
+ ASSERT_TRUE(JSValueIsObject(isolatedCtx, isolatedNodeJSValue));
+ JSObjectRef isolatedNodeJSObject = JSValueToObject(isolatedCtx, isolatedNodeJSValue, 0);
+
+ // In the standard script world, add a different property to the target node
+ NSString *normalScriptString = @"var target = document.getElementById(\"target\"); target.normalProperty = true;";
+ WebScriptWorld *normalWorld = [WebScriptWorld standardWorld];
+ JSGlobalContextRef normalCtx = [mainFrame _globalContextForScriptWorld:normalWorld];
+ [mainFrame _stringByEvaluatingJavaScriptFromString:normalScriptString withGlobalObject:JSContextGetGlobalObject(normalCtx) inScriptWorld:normalWorld];
+ JSValueRef normalNodeJSValue = [mainFrame jsWrapperForNode:target inScriptWorld:normalWorld];
+ ASSERT_TRUE(JSValueIsObject(normalCtx, normalNodeJSValue));
+ JSObjectRef normalNodeJSObject = JSValueToObject(normalCtx, normalNodeJSValue, 0);
+
+ JSRetainPtr<JSStringRef> isolatedPropertyJSString = JSStringCreateWithUTF8CString("isolatedProperty");
+ // Test for successful retrieval of the first property in the isolated script world
+ EXPECT_TRUE(JSValueIsBoolean(isolatedCtx, JSObjectGetProperty(isolatedCtx, isolatedNodeJSObject, isolatedPropertyJSString.get(), 0)));
+ // Test for failed retrieval of the first property in the standard script world
+ EXPECT_TRUE(JSValueIsUndefined(normalCtx, JSObjectGetProperty(normalCtx, normalNodeJSObject, isolatedPropertyJSString.get(), 0)));
+
+ JSRetainPtr<JSStringRef> normalPropertyJSString = JSStringCreateWithUTF8CString("normalProperty");
+ // Test for successful retrieval of the second property in the standard script world
+ EXPECT_TRUE(JSValueIsBoolean(normalCtx, JSObjectGetProperty(normalCtx, normalNodeJSObject, normalPropertyJSString.get(), 0)));
+ // Test for failed retrieval of the second property in the isolated script world
+ EXPECT_TRUE(JSValueIsUndefined(isolatedCtx, JSObjectGetProperty(isolatedCtx, isolatedNodeJSObject, normalPropertyJSString.get(), 0)));
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm
index aeb955508..e2ecdeac4 100644
--- a/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm
@@ -74,9 +74,9 @@ TEST(WebKit1, MemoryCacheDisableWithinResourceLoadDelegate)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<MemoryCacheDisableTestResourceLoadDelegate> resourceLoadDelegate(AdoptNS, [[MemoryCacheDisableTestResourceLoadDelegate alloc] init]);
+ RetainPtr<MemoryCacheDisableTestResourceLoadDelegate> resourceLoadDelegate = adoptNS([[MemoryCacheDisableTestResourceLoadDelegate alloc] init]);
webView.get().resourceLoadDelegate = resourceLoadDelegate.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"MemoryCacheDisableWithinResourceLoadDelegate" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm b/Tools/TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm
index b178abd63..212820e0a 100644
--- a/Tools/TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm
@@ -75,17 +75,17 @@ static bool didFinishLoad;
namespace TestWebKitAPI {
-TEST(WebKit1, MemoryCachePruneWithinResourceLoadDelegate)
+TEST(WebKit1, DISABLED_MemoryCachePruneWithinResourceLoadDelegate)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- RetainPtr<WebView> webView1(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<WebView> webView2(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView1 = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView2 = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
NSWindow* window = [[NSWindow alloc] initWithContentRect:webView2.get().frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
[window.contentView addSubview:webView2.get()];
- RetainPtr<MemoryCachePruneTestResourceLoadDelegate> resourceLoadDelegate(AdoptNS, [[MemoryCachePruneTestResourceLoadDelegate alloc] init]);
+ RetainPtr<MemoryCachePruneTestResourceLoadDelegate> resourceLoadDelegate = adoptNS([[MemoryCachePruneTestResourceLoadDelegate alloc] init]);
resourceLoadDelegate.get()->_window = window;
webView1.get().resourceLoadDelegate = resourceLoadDelegate.get();
diff --git a/Tools/TestWebKitAPI/Tests/mac/OpenNewWindow.html b/Tools/TestWebKitAPI/Tests/mac/OpenNewWindow.html
new file mode 100644
index 000000000..975f6d98d
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/OpenNewWindow.html
@@ -0,0 +1,7 @@
+<a href="#" onclick="openWindow()"></a>
+<script>
+ function openWindow() {
+ window.open("window-to-ignore.html", "newWindow");
+ }
+ document.getElementsByTagName("a")[0].click();
+</script>
diff --git a/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm b/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm
index 9254ffb60..9a614ab7a 100644
--- a/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm
@@ -111,7 +111,7 @@ void PageVisibilityStateWithWindowChanges::runTest(View view)
EXPECT_JS_EQ(view, "document.visibilityState", "hidden");
// Add it to a non-visible window. PageVisibility should still be "hidden".
- RetainPtr<NSWindow> window(AdoptNS, [[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+ RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
[window.get().contentView addSubview:view];
EXPECT_NOT_NULL([view window]);
EXPECT_NOT_NULL([view superview]);
diff --git a/Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm b/Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm
new file mode 100644
index 000000000..cb72414f3
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(PUBLIC_SUFFIX_LIST)
+
+#include "WTFStringUtilities.h"
+#include <WebCore/PublicSuffix.h>
+#include <wtf/MainThread.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+class PublicSuffix: public testing::Test {
+public:
+ virtual void SetUp()
+ {
+ WTF::initializeMainThread();
+ [WebView initialize];
+ }
+};
+
+TEST_F(PublicSuffix, IsPublicSuffix)
+{
+ EXPECT_TRUE(isPublicSuffix("com"));
+ EXPECT_FALSE(isPublicSuffix("test.com"));
+ EXPECT_FALSE(isPublicSuffix("com.com"));
+ EXPECT_TRUE(isPublicSuffix("net"));
+ EXPECT_TRUE(isPublicSuffix("org"));
+ EXPECT_TRUE(isPublicSuffix("co.uk"));
+ EXPECT_FALSE(isPublicSuffix("bl.uk"));
+ EXPECT_FALSE(isPublicSuffix("test.co.uk"));
+ EXPECT_TRUE(isPublicSuffix("xn--zf0ao64a.tw"));
+}
+
+TEST_F(PublicSuffix, TopPrivatelyControlledDomain)
+{
+ EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("test.com"));
+ EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("com.test.com"));
+ EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("subdomain.test.com"));
+ EXPECT_EQ(String("com.com"), topPrivatelyControlledDomain("www.com.com"));
+ EXPECT_EQ(String("test.co.uk"), topPrivatelyControlledDomain("test.co.uk"));
+ EXPECT_EQ(String("test.co.uk"), topPrivatelyControlledDomain("subdomain.test.co.uk"));
+ EXPECT_EQ(String("bl.uk"), topPrivatelyControlledDomain("bl.uk"));
+ EXPECT_EQ(String("bl.uk"), topPrivatelyControlledDomain("subdomain.bl.uk"));
+ EXPECT_EQ(String("test.xn--zf0ao64a.tw"), topPrivatelyControlledDomain("test.xn--zf0ao64a.tw"));
+ EXPECT_EQ(String("test.xn--zf0ao64a.tw"), topPrivatelyControlledDomain("www.test.xn--zf0ao64a.tw"));
+ EXPECT_EQ(String("127.0.0.1"), topPrivatelyControlledDomain("127.0.0.1"));
+ EXPECT_EQ(String(), topPrivatelyControlledDomain("1"));
+ EXPECT_EQ(String(), topPrivatelyControlledDomain("com"));
+}
+
+}
+
+#endif
diff --git a/Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm b/Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm
index 5ad43bd25..bc3a11db3 100644
--- a/Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm
@@ -48,8 +48,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, RenderedImageFromDOMRange)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<RenderedImageFromDOMRangeFrameLoadDelegate> frameLoadDelegate(AdoptNS, [RenderedImageFromDOMRangeFrameLoadDelegate new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<RenderedImageFromDOMRangeFrameLoadDelegate> frameLoadDelegate = adoptNS([RenderedImageFromDOMRangeFrameLoadDelegate new]);
webView.get().frameLoadDelegate = frameLoadDelegate.get();
[webView.get().mainFrame loadHTMLString:@"<div style=\"width: 100px;\">Lorem <span id=\"target\">ipsum dolor</span> sit amet</div>" baseURL:[NSURL URLWithString:@"about:blank"]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm b/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm
index eed1f8180..003755235 100644
--- a/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm
@@ -39,7 +39,7 @@ TEST(WebKit1, SetAndUpdateCacheModelInitialModel)
{
EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
}
@@ -64,7 +64,7 @@ TEST(WebKit1, SetAndUpdateCacheModelPreferencesChangeMix)
EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]);
WebPreferences *standardPreferences = [WebPreferences standardPreferences];
- RetainPtr<WebPreferences> customPreferences(AdoptNS, [[WebPreferences alloc] initWithIdentifier:@"SetAndUpdateCacheModelPreferencesChangeMix"]);
+ RetainPtr<WebPreferences> customPreferences = adoptNS([[WebPreferences alloc] initWithIdentifier:@"SetAndUpdateCacheModelPreferencesChangeMix"]);
// 1) The customPreferences is not set on a view.
EXPECT_EQ((int)WebCacheModelDocumentBrowser, (int)[WebView _cacheModel]);
@@ -79,7 +79,7 @@ TEST(WebKit1, SetAndUpdateCacheModelPreferencesChangeMix)
// 2) The cache model should follow the highest value of cache model between the two preferences.
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
[webView.get() setPreferences:customPreferences.get()];
EXPECT_EQ((int)WebCacheModelPrimaryWebBrowser, (int)[WebView _cacheModel]);
diff --git a/Tools/TestWebKitAPI/Tests/mac/SetDocumentURI.mm b/Tools/TestWebKitAPI/Tests/mac/SetDocumentURI.mm
index f077ed95b..44ecc3e9b 100644
--- a/Tools/TestWebKitAPI/Tests/mac/SetDocumentURI.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/SetDocumentURI.mm
@@ -49,8 +49,8 @@ namespace TestWebKitAPI {
TEST(WebKit1, SetDocumentURITestFile)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<SetDocumentURITest> testController(AdoptNS, [SetDocumentURITest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<SetDocumentURITest> testController = adoptNS([SetDocumentURITest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetDocumentURI" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
Util::run(&didFinishLoad);
@@ -66,8 +66,8 @@ TEST(WebKit1, SetDocumentURITestFile)
TEST(WebKit1, SetDocumentURITestURL)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<SetDocumentURITest> testController(AdoptNS, [SetDocumentURITest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<SetDocumentURITest> testController = adoptNS([SetDocumentURITest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetDocumentURI" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
Util::run(&didFinishLoad);
@@ -86,8 +86,8 @@ TEST(WebKit1, SetDocumentURITestURL)
TEST(WebKit1, SetDocumentURITestString)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<SetDocumentURITest> testController(AdoptNS, [SetDocumentURITest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<SetDocumentURITest> testController = adoptNS([SetDocumentURITest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetDocumentURI" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
Util::run(&didFinishLoad);
@@ -103,8 +103,8 @@ TEST(WebKit1, SetDocumentURITestString)
TEST(WebKit1, SetDocumentURITestNull)
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<SetDocumentURITest> testController(AdoptNS, [SetDocumentURITest new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<SetDocumentURITest> testController = adoptNS([SetDocumentURITest new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"SetDocumentURI" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
Util::run(&didFinishLoad);
diff --git a/Tools/TestWebKitAPI/Tests/mac/SimplifyMarkup.mm b/Tools/TestWebKitAPI/Tests/mac/SimplifyMarkup.mm
index 70ec47d57..9d443ad04 100644
--- a/Tools/TestWebKitAPI/Tests/mac/SimplifyMarkup.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/SimplifyMarkup.mm
@@ -49,9 +49,9 @@ namespace TestWebKitAPI {
TEST(WebKit1, SimplifyMarkupTest)
{
- RetainPtr<WebView> webView1(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<WebView> webView2(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<SimplifyMarkupTest> testController(AdoptNS, [SimplifyMarkupTest new]);
+ RetainPtr<WebView> webView1 = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WebView> webView2 = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<SimplifyMarkupTest> testController = adoptNS([SimplifyMarkupTest new]);
webView1.get().frameLoadDelegate = testController.get();
[[webView1.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"verboseMarkup" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
diff --git a/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html b/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html
new file mode 100644
index 000000000..92af0012c
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.html
@@ -0,0 +1 @@
+<script src="data:text/javascript,document.write('SUCCESS')"></script>
diff --git a/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm b/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm
new file mode 100644
index 000000000..8eb269df0
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebCache.h>
+#import <wtf/RetainPtr.h>
+
+@interface StopLoadingFromDidReceiveResponse : NSObject {
+}
+@end
+
+static bool didFinishLoad;
+
+@implementation StopLoadingFromDidReceiveResponse
+
+- (void)webView:(WebView *)sender resource:(id)identifier didReceiveResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource
+{
+ static BOOL mainResourceReceived;
+ if (!mainResourceReceived) {
+ mainResourceReceived = YES;
+ return;
+ }
+
+ [sender stopLoading:identifier];
+
+ didFinishLoad = YES;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, StopLoadingFromDidReceiveResponse)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+
+ RetainPtr<StopLoadingFromDidReceiveResponse> resourceLoadDelegate = adoptNS([[StopLoadingFromDidReceiveResponse alloc] init]);
+ webView.get().resourceLoadDelegate = resourceLoadDelegate.get();
+
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"StopLoadingFromDidReceiveResponse" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&didFinishLoad);
+
+ [pool drain];
+ // If we finished without crashing, the test passed.
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm b/Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm
index 4e3e3ec75..260a5a53e 100644
--- a/Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm
@@ -32,7 +32,7 @@ namespace TestWebKitAPI {
TEST(WebKit1, StringByEvaluatingJavaScriptFromString)
{
// maps expected result <= JavaScript expression
- RetainPtr<NSDictionary> expressions(AdoptNS, [[NSDictionary alloc] initWithObjectsAndKeys:
+ RetainPtr<NSDictionary> expressions = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:
@"0", @"0",
@"0", @"'0'",
@"", @"",
@@ -53,7 +53,7 @@ TEST(WebKit1, StringByEvaluatingJavaScriptFromString)
nil
]);
- RetainPtr<WebView> webView (AdoptNS, [[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""]);
// Test a nil string
NSString *result = [webView.get() stringByEvaluatingJavaScriptFromString:nil];
diff --git a/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm b/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm
new file mode 100644
index 000000000..39504dda8
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm
@@ -0,0 +1,287 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <JavaScriptCore/JSExport.h>
+#import <JavaScriptCore/JSContext.h>
+#import <WebKit/WebFrameLoadDelegatePrivate.h>
+#import <wtf/RetainPtr.h>
+
+#if JSC_OBJC_API_ENABLED
+
+@class MyConsole;
+
+static bool didFinishLoad = false;
+static bool didCompleteTestSuccessfully = false;
+static bool didCallWindowCallback = false;
+static bool didFindMyCustomProperty = false;
+static bool didInsertMyCustomProperty = true;
+
+@protocol MyConsole<JSExport>
+- (void)log:(NSString *)s;
+- (void)printHelloWorld;
+- (int)add:(int)a to:(int)b;
+@end
+
+@interface MyConsole : NSObject<MyConsole>
+@end
+
+@implementation MyConsole
+- (void)log:(NSString *)s
+{
+ NSLog(@"%@", s);
+}
+
+- (void)printHelloWorld
+{
+ NSLog(@"Hello, World!");
+}
+
+- (int)add:(int)a to:(int)b
+{
+ return a + b;
+}
+@end
+
+@interface DidCreateJavaScriptContextFrameLoadDelegate : NSObject
+@end
+
+@implementation DidCreateJavaScriptContextFrameLoadDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoad = true;
+}
+
+- (void)webView:(WebView *)webView didCreateJavaScriptContext:(JSContext *)context forFrame:(WebFrame *)frame
+{
+ MyConsole *myConsole = [[MyConsole alloc] init];
+ context[@"myConsole"] = myConsole;
+ context.exceptionHandler = nil;
+ [myConsole release];
+
+ context[@"windowCallback"] = ^(JSValue *thisObject){
+ didCallWindowCallback = true;
+ };
+
+ context[@"didCompleteTestSuccessfully"] = ^{
+ didCompleteTestSuccessfully = true;
+ };
+
+ context[@"callMeBack"] = ^(JSValue *functionValue) {
+ [functionValue callWithArguments:[NSArray array]];
+ };
+
+ context[@"checkForMyCustomProperty"] = ^(JSValue *element) {
+ if ([element hasProperty:@"myCustomProperty"] && [[element valueForProperty:@"myCustomProperty"] toInt32] == 42)
+ didFindMyCustomProperty = true;
+ else
+ NSLog(@"ERROR: Did not find myCustomProperty.");
+ };
+
+ context[@"insertMyCustomProperty"] = ^(JSValue *element) {
+ JSValue *fortyTwo = [JSValue valueWithInt32:42 inContext:[JSContext currentContext]];
+ [element setValue:fortyTwo forProperty:@"myCustomProperty"];
+ didInsertMyCustomProperty = true;
+ };
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, DidCreateJavaScriptContextSanity1)
+{
+ didFinishLoad = false;
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyString =
+ @"<body> \
+ <script> \
+ myConsole.printHelloWorld(); \
+ myConsole.log(\"Loaded custom stuff.\"); \
+ myConsole.log(myConsole.addTo(40, 2)); \
+ didCompleteTestSuccessfully(); \
+ </script> \
+ </body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyString baseURL:aboutBlankURL];
+ Util::run(&didCompleteTestSuccessfully);
+ }
+}
+
+TEST(WebKit1, DidCreateJavaScriptContextSanity2)
+{
+ didCallWindowCallback = false;
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyString =
+ @"<body> \
+ <script> \
+ setTimeout(windowCallback, 100); \
+ </script> \
+ </body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyString baseURL:aboutBlankURL];
+ Util::run(&didCallWindowCallback);
+ }
+}
+
+TEST(WebKit1, DidCreateJavaScriptContextCallJSFunctionFromObjCCallbackTest)
+{
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyString =
+ @"<body> \
+ <script> \
+ callMeBack(function() { \
+ didCompleteTestSuccessfully(); \
+ }); \
+ </script> \
+ </body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyString baseURL:aboutBlankURL];
+ Util::run(&didCompleteTestSuccessfully);
+ }
+}
+
+TEST(WebKit1, DidCreateJavaScriptContextAddCustomPropertiesFromJSTest)
+{
+ didFindMyCustomProperty = false;
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyString =
+ @"<body> \
+ <div id=\"test-div\"></div> \
+ <script> \
+ var testDiv = document.getElementById(\"test-div\"); \
+ testDiv.myCustomProperty = 42; \
+ checkForMyCustomProperty(testDiv); \
+ </script> \
+ </body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyString baseURL:aboutBlankURL];
+ Util::run(&didFindMyCustomProperty);
+ }
+}
+
+TEST(WebKit1, DidCreateJavaScriptContextAddCustomPropertiesFromObjCTest)
+{
+ didFindMyCustomProperty = false;
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyString =
+ @"<body> \
+ <div id=\"test-div\"></div> \
+ <script> \
+ var testDiv = document.getElementById(\"test-div\"); \
+ insertMyCustomProperty(testDiv); \
+ if (testDiv.myCustomProperty === 42) { \
+ checkForMyCustomProperty(testDiv); \
+ } \
+ </script> \
+ </body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyString baseURL:aboutBlankURL];
+ Util::run(&didFindMyCustomProperty);
+ }
+}
+
+TEST(WebKit1, DidCreateJavaScriptContextBackForwardCacheTest)
+{
+ didInsertMyCustomProperty = false;
+ didFindMyCustomProperty = false;
+ didCompleteTestSuccessfully = false;
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidCreateJavaScriptContextFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidCreateJavaScriptContextFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSURL *url1 = [[NSBundle mainBundle] URLForResource:@"JSContextBackForwardCache1"
+ withExtension:@"html"
+ subdirectory:@"TestWebKitAPI.resources"];
+ [mainFrame loadRequest:[NSURLRequest requestWithURL:url1]];
+ Util::run(&didInsertMyCustomProperty);
+
+ NSURL *url2 = [[NSBundle mainBundle] URLForResource:@"JSContextBackForwardCache2"
+ withExtension:@"html"
+ subdirectory:@"TestWebKitAPI.resources"];
+ [mainFrame loadRequest:[NSURLRequest requestWithURL:url2]];
+ Util::run(&didCompleteTestSuccessfully);
+
+ didCompleteTestSuccessfully = false;
+ [[mainFrame javaScriptContext] evaluateScript:
+ @"var testDiv = document.getElementById(\"test-div\"); \
+ if (!testDiv.myCustomProperty) { \
+ didCompleteTestSuccessfully(); \
+ }"];
+ EXPECT_TRUE(didCompleteTestSuccessfully);
+
+ if ([webView.get() goBack]) {
+ [[mainFrame javaScriptContext] evaluateScript:
+ @"var testDiv = document.getElementById(\"test-div\"); \
+ checkForMyCustomProperty(testDiv);"];
+ EXPECT_TRUE(didFindMyCustomProperty);
+ } else
+ EXPECT_TRUE(false);
+ }
+}
+
+} // namespace TestWebKitAPI
+
+#endif // ENABLE(JSC_OBJC_API)
diff --git a/Tools/TestWebKitAPI/Tests/mac/WebViewDidRemoveFrameFromHierarchy.mm b/Tools/TestWebKitAPI/Tests/mac/WebViewDidRemoveFrameFromHierarchy.mm
new file mode 100644
index 000000000..fbe8af52a
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/WebViewDidRemoveFrameFromHierarchy.mm
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import <WebKit/WebFrameLoadDelegatePrivate.h>
+#import <wtf/RetainPtr.h>
+
+@interface DidRemoveFrameFromHierarchyFrameLoadDelegate : NSObject
+@end
+
+static bool didFinishLoad;
+static bool didRemoveFrame;
+
+@implementation DidRemoveFrameFromHierarchyFrameLoadDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ didFinishLoad = true;
+}
+
+- (void)webView:(WebView *)sender didRemoveFrameFromHierarchy:(WebFrame *)frame
+{
+ didRemoveFrame = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, DidRemoveFrameFromHierarchy)
+{
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<DidRemoveFrameFromHierarchyFrameLoadDelegate> frameLoadDelegate = adoptNS([[DidRemoveFrameFromHierarchyFrameLoadDelegate alloc] init]);
+
+ webView.get().frameLoadDelegate = frameLoadDelegate.get();
+ WebFrame *mainFrame = webView.get().mainFrame;
+
+ NSString *bodyWithIFrameString = @"<body><iframe id='iframe'></iframe></body>";
+ NSURL *aboutBlankURL = [NSURL URLWithString:@"about:blank"];
+
+ [mainFrame loadHTMLString:bodyWithIFrameString baseURL:aboutBlankURL];
+ Util::run(&didFinishLoad);
+
+ EXPECT_FALSE(didRemoveFrame);
+ [webView.get() stringByEvaluatingJavaScriptFromString:@"document.body.removeChild(document.getElementById('iframe'))"];
+ EXPECT_TRUE(didRemoveFrame);
+
+ didFinishLoad = false;
+ didRemoveFrame = false;
+
+ [mainFrame loadHTMLString:bodyWithIFrameString baseURL:aboutBlankURL];
+ Util::run(&didFinishLoad);
+
+ // The delegate method is not called when the frame is removed due to navigation in an ancestor frame.
+ EXPECT_FALSE(didRemoveFrame);
+ [mainFrame loadHTMLString:@"<body></body>" baseURL:aboutBlankURL];
+ EXPECT_FALSE(didRemoveFrame);
+}
+
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm b/Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm
new file mode 100644
index 000000000..1654f9ca8
--- /dev/null
+++ b/Tools/TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "PlatformUtilities.h"
+#import "PlatformWebView.h"
+#import "Test.h"
+
+#import <WebKit/WebFormDelegate.h>
+#import <WebKit/WebViewPrivate.h>
+#import <wtf/RetainPtr.h>
+
+static bool didFinishLoad;
+
+@interface FormDelegate : WebFormDelegate
+@end
+
+@implementation FormDelegate
+
+- (void)willSendSubmitEventToForm:(DOMHTMLFormElement *)element inFrame:(WebFrame *)sourceFrame withValues:(NSDictionary *)values
+{
+ EXPECT_NOT_NULL(element);
+ EXPECT_NOT_NULL(sourceFrame);
+
+ EXPECT_WK_STREQ([values objectForKey:@"textField"], @"text field");
+ EXPECT_WK_STREQ([values objectForKey:@"passwordField"], @"password field");
+
+ // <input type="hidden"> fields are not sent.
+ EXPECT_NULL([values objectForKey:@"hiddenField"]);
+
+ didFinishLoad = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, WillSendSubmitEvent)
+{
+ @autoreleasepool {
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+
+ RetainPtr<FormDelegate> formDelegate = [[FormDelegate alloc] init];
+ [webView _setFormDelegate:formDelegate.get()];
+
+ [[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"auto-submitting-form" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ Util::run(&didFinishLoad);
+ }
+}
+
+}
diff --git a/Tools/TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm b/Tools/TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm
index bf593e6ef..9225783ab 100644
--- a/Tools/TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm
+++ b/Tools/TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm
@@ -65,8 +65,8 @@ TEST(WebKit1, WindowlessWebViewWithMedia)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
- RetainPtr<WindowlessWebViewWithMediaFrameLoadDelegate> testController(AdoptNS, [WindowlessWebViewWithMediaFrameLoadDelegate new]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 120, 200) frameName:nil groupName:nil]);
+ RetainPtr<WindowlessWebViewWithMediaFrameLoadDelegate> testController = adoptNS([WindowlessWebViewWithMediaFrameLoadDelegate new]);
webView.get().frameLoadDelegate = testController.get();
[[webView.get() mainFrame] loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"WindowlessWebViewWithMedia" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
diff --git a/Tools/TestWebKitAPI/config.h b/Tools/TestWebKitAPI/config.h
index dd240a585..0fb19e1c3 100644
--- a/Tools/TestWebKitAPI/config.h
+++ b/Tools/TestWebKitAPI/config.h
@@ -26,22 +26,26 @@
#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
#ifdef BUILDING_WITH_CMAKE
#include "cmakeconfig.h"
+#else
+#include "autotoolsconfig.h"
#endif
#endif
#include <wtf/Platform.h>
#include <wtf/ExportMacros.h>
-#if USE(JSC)
#include <runtime/JSExportMacros.h>
-#endif
#if defined(__APPLE__) && __APPLE__
#ifdef __OBJC__
+#if PLATFORM(IOS)
+#import <Foundation/Foundation.h>
+#else
#import <Cocoa/Cocoa.h>
#endif
+#endif
-#elif defined(WIN32) || defined(_WIN32)
+#elif PLATFORM(WIN)
#ifndef NOMINMAX
#define NOMINMAX
@@ -60,11 +64,11 @@
#undef WTF_USE_CURL
#endif
-#endif
+#endif // PLATFORM(WIN)
#include <stdint.h>
-#if !PLATFORM(CHROMIUM) || (PLATFORM(GTK) && defined(BUILDING_WEBKIT2__))
+#if !PLATFORM(IOS) && !PLATFORM(WIN) && !(PLATFORM(GTK) && !defined(BUILDING_WEBKIT2__))
#include <WebKit2/WebKit2_C.h>
#endif
diff --git a/Tools/TestWebKitAPI/efl/PlatformWebView.cpp b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp
index 08407c6a3..5a3aa6b1e 100644
--- a/Tools/TestWebKitAPI/efl/PlatformWebView.cpp
+++ b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp
@@ -25,10 +25,13 @@
*/
#include "config.h"
+#include "ewk_view_private.h"
#include "PlatformWebView.h"
#include "EWebKit2.h"
-#include "WebKit2/WKAPICast.h"
+#include <WebKit2/WKAPICast.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKViewEfl.h>
#include <Ecore_Evas.h>
extern bool useX11Window;
@@ -39,13 +42,16 @@ namespace TestWebKitAPI {
static Ecore_Evas* initEcoreEvas()
{
- ASSERT(ecore_evas_init());
+ if (!ecore_evas_init())
+ return 0;
- const char* engine = 0;
+ Ecore_Evas* ecoreEvas;
#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X)
- engine = "opengl_x11";
+ ecoreEvas = ecore_evas_new("opengl_x11", 0, 0, 800, 600, 0);
+ // Graceful fallback to software rendering if evas_gl engine is not available.
+ if (!ecoreEvas)
#endif
- Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0);
+ ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
ASSERT(ecoreEvas);
@@ -63,9 +69,12 @@ static void onWebProcessCrashed(void*, Evas_Object*, void* eventInfo)
PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
{
m_window = initEcoreEvas();
- Evas* evas = ecore_evas_get(m_window);
- m_view = toImpl(WKViewCreate(evas, contextRef, pageGroupRef));
- ewk_view_theme_set(m_view, THEME_DIR"/default.edj");
+
+ m_view = EWKViewCreate(contextRef, pageGroupRef, ecore_evas_get(m_window), /* smart */ 0);
+
+ WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(TEST_THEME_DIR "/default.edj"));
+ WKViewSetThemePath(EWKViewGetWKView(m_view), wkTheme.get());
+
evas_object_smart_callback_add(m_view, "webprocess,crashed", onWebProcessCrashed, 0);
resizeTo(600, 800);
}
@@ -73,6 +82,7 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
PlatformWebView::~PlatformWebView()
{
evas_object_del(m_view);
+
ecore_evas_free(m_window);
ecore_evas_shutdown();
}
@@ -84,12 +94,12 @@ void PlatformWebView::resizeTo(unsigned width, unsigned height)
WKPageRef PlatformWebView::page() const
{
- return WKViewGetPage(toAPI(m_view));
+ return WKViewGetPage(EWKViewGetWKView(m_view));
}
void PlatformWebView::simulateSpacebarKeyPress()
{
- Evas* evas = ecore_evas_get(m_window);
+ Evas* evas = evas_object_evas_get(m_view);
evas_object_focus_set(m_view, true);
evas_event_feed_key_down(evas, "space", "space", " ", 0, 0, 0);
evas_event_feed_key_up(evas, "space", "space", " ", 0, 1, 0);
@@ -97,14 +107,14 @@ void PlatformWebView::simulateSpacebarKeyPress()
void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
{
- Evas* evas = ecore_evas_get(m_window);
+ Evas* evas = evas_object_evas_get(m_view);
evas_object_show(m_view);
evas_event_feed_mouse_move(evas, x, y, 0, 0);
}
void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
{
- Evas* evas = ecore_evas_get(m_window);
+ Evas* evas = evas_object_evas_get(m_view);
evas_object_show(m_view);
evas_event_feed_mouse_move(evas, x, y, 0, 0);
evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, 0);
diff --git a/Tools/TestWebKitAPI/win/WindowMessageObserver.h b/Tools/TestWebKitAPI/ios/mainIOS.mm
index 338881664..3eec9b005 100644
--- a/Tools/TestWebKitAPI/win/WindowMessageObserver.h
+++ b/Tools/TestWebKitAPI/ios/mainIOS.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,19 +23,16 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WindowMessageObserver_h
-#define WindowMessageObserver_h
+#import "config.h"
+#import "TestsController.h"
-namespace TestWebKitAPI {
+int main(int argc, char** argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-class WindowMessageObserver {
-public:
- virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM) = 0;
+ bool passed = TestWebKitAPI::TestsController::shared().run(argc, argv);
-protected:
- virtual ~WindowMessageObserver() { }
-};
+ [pool drain];
-} // namespace TestWebKitAPI
-
-#endif // WindowMessageObserver_h
+ return passed ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm b/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm
index 965beb4ae..5d6712a57 100644
--- a/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm
+++ b/Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm
@@ -40,7 +40,7 @@ void InjectedBundleController::platformInitialize()
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:4], @"AppleAntiAliasingThreshold",
[NSNumber numberWithInteger:0], @"AppleFontSmoothing",
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !PLATFORM(CHROMIUM)
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
[NSNumber numberWithBool:NO], @"NSScrollAnimationEnabled",
#else
[NSNumber numberWithBool:NO], @"AppleScrollAnimationEnabled",
diff --git a/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm b/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
index afa28a76a..1e73adbb3 100644
--- a/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
+++ b/Tools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
@@ -67,7 +67,7 @@ WKURLRef URLForNonExistentResource()
WKRetainPtr<WKStringRef> MIMETypeForWKURLResponse(WKURLResponseRef wkResponse)
{
- RetainPtr<NSURLResponse> response(AdoptNS, WKURLResponseCopyNSURLResponse(wkResponse));
+ RetainPtr<NSURLResponse> response = adoptNS(WKURLResponseCopyNSURLResponse(wkResponse));
return adoptWK(WKStringCreateWithCFString((CFStringRef)[response.get() MIMEType]));
}
@@ -78,6 +78,9 @@ bool isKeyDown(WKNativeEventPtr event)
std::string toSTD(NSString *string)
{
+ if (!string)
+ return std::string();
+
size_t bufferSize = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
OwnArrayPtr<char> buffer = adoptArrayPtr(new char[bufferSize]);
NSUInteger stringLength;
diff --git a/Tools/TestWebKitAPI/mac/TestProtocol.h b/Tools/TestWebKitAPI/mac/TestProtocol.h
new file mode 100644
index 000000000..cf6734b88
--- /dev/null
+++ b/Tools/TestWebKitAPI/mac/TestProtocol.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestProtocol_h
+#define TestProtocol_h
+
+@interface TestProtocol : NSURLProtocol {
+}
++ (NSString *)scheme;
+@end
+
+#endif // TestProtocol_h
diff --git a/Tools/TestWebKitAPI/mac/TestProtocol.mm b/Tools/TestWebKitAPI/mac/TestProtocol.mm
new file mode 100644
index 000000000..367ea0489
--- /dev/null
+++ b/Tools/TestWebKitAPI/mac/TestProtocol.mm
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "TestProtocol.h"
+
+static NSString *testScheme = @"test";
+
+@implementation TestProtocol
+
++ (BOOL)canInitWithRequest:(NSURLRequest *)request
+{
+ return [[[request URL] scheme] caseInsensitiveCompare:testScheme] == NSOrderedSame;
+}
+
++ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
+{
+ return request;
+}
+
++ (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b
+{
+ return NO;
+}
+
++ (NSString *)scheme
+{
+ return testScheme;
+}
+
+- (void)startLoading
+{
+ EXPECT_TRUE([[[[self request] URL] scheme] isEqualToString:testScheme]);
+
+ NSData *data = [@"PASS" dataUsingEncoding:NSASCIIStringEncoding];
+ NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[[self request] URL] MIMEType:@"text/html" expectedContentLength:[data length] textEncodingName:nil];
+ [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed];
+ [[self client] URLProtocol:self didLoadData:data];
+ [[self client] URLProtocolDidFinishLoading:self];
+ [response release];
+}
+
+- (void)stopLoading
+{
+}
+
+@end
diff --git a/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm b/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm
index ce25a84da..03552b3a8 100644
--- a/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm
+++ b/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm
@@ -83,8 +83,8 @@ WebKitAgnosticTest::WebKitAgnosticTest()
void WebKitAgnosticTest::runWebKit1Test()
{
- RetainPtr<WebView> webView(AdoptNS, [[WebView alloc] initWithFrame:viewFrame]);
- RetainPtr<FrameLoadDelegate> delegate(AdoptNS, [[FrameLoadDelegate alloc] initWithDidFinishLoadBoolean:&didFinishLoad]);
+ RetainPtr<WebView> webView = adoptNS([[WebView alloc] initWithFrame:viewFrame]);
+ RetainPtr<FrameLoadDelegate> delegate = adoptNS([[FrameLoadDelegate alloc] initWithDidFinishLoadBoolean:&didFinishLoad]);
[webView.get() setFrameLoadDelegate:delegate.get()];
initializeView(webView.get());
@@ -98,7 +98,7 @@ void WebKitAgnosticTest::runWebKit2Test()
{
WKRetainPtr<WKContextRef> context = adoptWK(WKContextCreate());
WKRetainPtr<WKPageGroupRef> pageGroup = adoptWK(WKPageGroupCreateWithIdentifier(Util::toWK("WebKitAgnosticTest").get()));
- RetainPtr<WKView> view(AdoptNS, [[WKView alloc] initWithFrame:viewFrame contextRef:context.get() pageGroupRef:pageGroup.get()]);
+ RetainPtr<WKView> view = adoptNS([[WKView alloc] initWithFrame:viewFrame contextRef:context.get() pageGroupRef:pageGroup.get()]);
setPageLoaderClient([view.get() pageRef], &didFinishLoad);
initializeView(view.get());
diff --git a/Tools/TestWebKitAPI/mac/main.mm b/Tools/TestWebKitAPI/mac/mainMac.mm
index 498eb480e..498eb480e 100644
--- a/Tools/TestWebKitAPI/mac/main.mm
+++ b/Tools/TestWebKitAPI/mac/mainMac.mm
diff --git a/Tools/TestWebKitAPI/win/InjectedBundleControllerWin.cpp b/Tools/TestWebKitAPI/qt/InjectedBundleControllerQt.cpp
index 5c4f42d9b..5d55002cc 100644
--- a/Tools/TestWebKitAPI/win/InjectedBundleControllerWin.cpp
+++ b/Tools/TestWebKitAPI/qt/InjectedBundleControllerQt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp b/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp
new file mode 100644
index 000000000..5a3c13a66
--- /dev/null
+++ b/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+
+#include <WebKit2/WKStringQt.h>
+#include <WebKit2/WKNativeEvent.h>
+#include <WebKit2/WKURLQt.h>
+
+#include <QCoreApplication>
+#include <QDir>
+#include <QUrl>
+#include <QThread>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+void run(bool* done)
+{
+ while (!*done)
+ QCoreApplication::processEvents();
+}
+
+void sleep(double seconds)
+{
+ QThread::sleep(seconds);
+}
+
+WKStringRef createInjectedBundlePath()
+{
+ QString path = QFileInfo(QStringLiteral(ROOT_BUILD_DIR "/lib/libTestWebKitAPIInjectedBundle")).absoluteFilePath();
+
+ return WKStringCreateWithQString(path);
+}
+
+WKURLRef createURLForResource(const char* resource, const char* extension)
+{
+ QDir path(QStringLiteral(APITEST_SOURCE_DIR));
+ QString filename = QString::fromLocal8Bit(resource) + QStringLiteral(".") + QString::fromLocal8Bit(extension);
+
+ return WKURLCreateWithQUrl(QUrl::fromLocalFile(path.absoluteFilePath(filename)));
+}
+
+WKURLRef URLForNonExistentResource()
+{
+ return WKURLCreateWithUTF8CString("file:///does-not-exist.html");
+}
+
+bool isKeyDown(WKNativeEventPtr event)
+{
+ return event->type() == QEvent::KeyPress;
+}
+
+} // namespace Util
+} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp b/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp
new file mode 100644
index 000000000..8f571c544
--- /dev/null
+++ b/Tools/TestWebKitAPI/qt/PlatformWebViewQt.cpp
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. All rights reserved.
+ * Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "PlatformWebView.h"
+#include "qquickwebpage_p.h"
+#include "qquickwebview_p.h"
+
+#include <WebKit2/WKRetainPtr.h>
+
+#include <QCoreApplication>
+#include <QEventLoop>
+#include <QQmlProperty>
+#include <QtQuick/QQuickView>
+#include <qpa/qwindowsysteminterface.h>
+
+namespace TestWebKitAPI {
+
+class WrapperWindow : public QQuickView {
+ Q_OBJECT
+public:
+ WrapperWindow(QQuickWebView* view)
+ : QQuickView(QUrl(QStringLiteral("data:text/plain,import QtQuick 2.0\nItem { objectName: 'root' }")))
+ , m_view(view)
+ {
+ if (status() == QQuickView::Ready)
+ handleStatusChanged(QQuickView::Ready);
+ else
+ connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status)));
+ }
+
+private Q_SLOTS:
+ void handleStatusChanged(QQuickView::Status status)
+ {
+ if (status != QQuickView::Ready)
+ return;
+
+ setGeometry(0, 0, 800, 600);
+
+ setResizeMode(QQuickView::SizeRootObjectToView);
+ m_view->setParentItem(rootObject());
+ QQmlProperty::write(m_view, QStringLiteral("anchors.fill"), qVariantFromValue(rootObject()));
+
+ m_view->experimental()->setRenderToOffscreenBuffer(true);
+
+ QWindowSystemInterface::handleWindowActivated(this);
+ m_view->page()->setFocus(true);
+ }
+
+private:
+ QQuickWebView* m_view;
+};
+
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+{
+ m_view = new QQuickWebView(contextRef, pageGroupRef);
+ m_view->setAllowAnyHTTPSCertificateForLocalHost(true);
+ m_view->componentComplete();
+
+ m_window = new WrapperWindow(m_view);
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ delete m_window;
+}
+
+void PlatformWebView::resizeTo(unsigned width, unsigned height)
+{
+ // If we do not have a platform window we will never get the necessary
+ // resize event, so simulate it in that case to make sure the quickview is
+ // resized to what the api tests expects.
+ if (!m_window->handle()) {
+ QRect newGeometry(m_window->x(), m_window->y(), width, height);
+ QWindowSystemInterface::handleGeometryChange(m_window, newGeometry);
+ QWindowSystemInterface::flushWindowSystemEvents();
+ }
+
+ m_window->resize(width, height);
+}
+
+WKPageRef PlatformWebView::page() const
+{
+ return m_view->pageRef();
+}
+
+void PlatformWebView::focus()
+{
+ m_view->setFocus(true);
+}
+
+void PlatformWebView::simulateSpacebarKeyPress()
+{
+ QKeyEvent event(QEvent::KeyPress, Qt::Key_Space, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event);
+ QKeyEvent event2(QEvent::KeyRelease, Qt::Key_Space, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event2);
+}
+
+void PlatformWebView::simulateAltKeyPress()
+{
+ QKeyEvent event(QEvent::KeyPress, Qt::Key_Alt, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event);
+ QKeyEvent event2(QEvent::KeyRelease, Qt::Key_Alt, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event2);
+}
+
+void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
+{
+ QPointF mousePos(x, y);
+ QMouseEvent event(QEvent::MouseMove, mousePos, Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event);
+}
+
+void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
+{
+ QPointF mousePos(x, y);
+ QMouseEvent event2(QEvent::MouseButtonPress, mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event2);
+ QMouseEvent event3(QEvent::MouseButtonRelease, mousePos, Qt::RightButton, Qt::NoButton, Qt::NoModifier);
+ QCoreApplication::sendEvent(m_window, &event3);
+}
+
+} // namespace TestWebKitAPI
+
+#include "PlatformWebViewQt.moc"
diff --git a/Tools/TestWebKitAPI/qt/main.cpp b/Tools/TestWebKitAPI/qt/main.cpp
new file mode 100644
index 000000000..efad5bbb3
--- /dev/null
+++ b/Tools/TestWebKitAPI/qt/main.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "TestsController.h"
+
+#include "qquickwebview_p.h"
+#include <QGuiApplication>
+
+void addQtWebProcessToPath()
+{
+ // Since tests won't find ./QtWebProcess, add it to PATH (at the end to prevent surprises).
+ // ROOT_BUILD_DIR should be defined by qmake.
+ qputenv("PATH", qgetenv("PATH") + QByteArray(":" ROOT_BUILD_DIR "/bin"));
+}
+
+void messageHandler(QtMsgType type, const QMessageLogContext&, const QString& message)
+{
+ if (type == QtCriticalMsg) {
+ fprintf(stderr, "%s\n", qPrintable(message));
+ return;
+ }
+
+ // Do nothing
+}
+
+int main(int argc, char** argv)
+{
+ bool suppressQtDebugOutput = true; // Suppress debug output from Qt if not started with --verbose.
+ bool useDesktopBehavior = true; // Use traditional desktop behavior if not started with --flickable.
+
+ for (int i = 1; i < argc; ++i) {
+ if (!qstrcmp(argv[i], "--verbose"))
+ suppressQtDebugOutput = false;
+ else if (!qstrcmp(argv[i], "--flickable"))
+ useDesktopBehavior = false;
+ }
+
+ QQuickWebViewExperimental::setFlickableViewportEnabled(!useDesktopBehavior);
+
+ // Has to be done before QApplication is constructed in case
+ // QApplication itself produces debug output.
+ if (suppressQtDebugOutput) {
+ qInstallMessageHandler(messageHandler);
+ if (qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT").isEmpty())
+ qputenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT", "1");
+ }
+
+ QGuiApplication app(argc, argv);
+ addQtWebProcessToPath();
+
+ return TestWebKitAPI::TestsController::shared().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp
deleted file mode 100644
index 1b9823d97..000000000
--- a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PlatformUtilities.h"
-
-#include <WebKit2/WKStringCF.h>
-#include <WebKit2/WKURLCF.h>
-#include <wtf/RetainPtr.h>
-
-#if USE(CFNETWORK)
-#include <WebKit2/WKURLResponseCF.h>
-#endif
-
-namespace TestWebKitAPI {
-namespace Util {
-
-#ifdef DEBUG_ALL
-const char* injectedBundleDLL = "TestWebKitAPIInjectedBundle_debug.dll";
-#else
-const char* injectedBundleDLL = "TestWebKitAPIInjectedBundle.dll";
-#endif
-
-void run(bool* done)
-{
- while (!*done) {
- MSG msg;
- BOOL result = ::GetMessageW(&msg, 0, 0, 0);
- if (!result || result == -1)
- break;
-
- if (shouldTranslateMessage(msg))
- ::TranslateMessage(&msg);
- ::DispatchMessage(&msg);
- }
-}
-
-bool shouldTranslateMessage(const MSG& msg)
-{
- // Only these four messages are actually translated by ::TranslateMessage or ::TranslateAccelerator.
- // It's useless (though harmless) to call those functions for other messages, so we always allow other messages to be translated.
- if (msg.message != WM_KEYDOWN && msg.message != WM_SYSKEYDOWN && msg.message != WM_KEYUP && msg.message != WM_SYSKEYUP)
- return true;
-
- wchar_t className[256];
- if (!::GetClassNameW(msg.hwnd, className, ARRAYSIZE(className)))
- return true;
-
- // Don't call TranslateMessage() on key events destined for a WebKit2 view, WebKit will do this if it doesn't handle the message.
- // It would be nice to use some API here instead of hard-coding the window class name.
- return wcscmp(className, L"WebKit2WebViewWindowClass");
-}
-
-void sleep(double seconds)
-{
- ::Sleep(seconds * 1000);
-}
-
-RetainPtr<CFStringRef> cf(const char* utf8String)
-{
- return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, utf8String, kCFStringEncodingUTF8));
-}
-
-WKStringRef createInjectedBundlePath()
-{
- RetainPtr<CFURLRef> executableURL(AdoptCF, CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
- RetainPtr<CFURLRef> executableContainerURL(AdoptCF, CFURLCreateCopyDeletingLastPathComponent(0, executableURL.get()));
- RetainPtr<CFStringRef> dllFilename(AdoptCF, CFStringCreateWithCStringNoCopy(0, injectedBundleDLL, kCFStringEncodingWindowsLatin1, kCFAllocatorNull));
- RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateCopyAppendingPathComponent(0, executableContainerURL.get(), dllFilename.get(), false));
- RetainPtr<CFStringRef> bundlePath(AdoptCF, CFURLCopyFileSystemPath(bundleURL.get(), kCFURLWindowsPathStyle));
- return WKStringCreateWithCFString(bundlePath.get());
-}
-
-WKURLRef createURLForResource(const char* resource, const char* extension)
-{
- RetainPtr<CFURLRef> url(AdoptCF, CFBundleCopyResourceURL(CFBundleGetMainBundle(), cf(resource).get(), cf(extension).get(), 0));
- return WKURLCreateWithCFURL(url.get());
-}
-
-WKURLRef URLForNonExistentResource()
-{
- return WKURLCreateWithUTF8CString("file:///does-not-exist.html");
-}
-
-WKRetainPtr<WKStringRef> MIMETypeForWKURLResponse(WKURLResponseRef wkResponse)
-{
-#if USE(CFNETWORK)
- RetainPtr<CFURLResponseRef> response(AdoptCF, WKURLResponseCopyCFURLResponse(0, wkResponse));
- return adoptWK(WKStringCreateWithCFString(CFURLResponseGetMIMEType(response.get())));
-#else
- return 0;
-#endif
-}
-
-bool isKeyDown(WKNativeEventPtr event)
-{
- return event->message == WM_KEYDOWN;
-}
-
-} // namespace Util
-} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp b/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp
deleted file mode 100644
index 2015f2634..000000000
--- a/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PlatformWebView.h"
-
-#include "WindowMessageObserver.h"
-
-namespace TestWebKitAPI {
-
-static const wchar_t* hostWindowClassName = L"org.WebKit.TestWebKitAPI.PlatformWebViewHostWindow";
-static const wchar_t* webViewPointerProperty = L"org.WebKit.TestWebKitAPI.PlatformWebView.InstancePointer";
-
-// These offsets come from rom <http://msdn.microsoft.com/en-us/library/ms646280(VS.85).aspx>.
-static const size_t repeatCountBitOffset = 0;
-static const size_t scanCodeBitOffset = 16;
-static const size_t contextCodeBitOffset = 29;
-static const size_t previousStateBitOffset = 30;
-static const size_t transitionStateBitOffset = 31;
-
-void PlatformWebView::registerWindowClass()
-{
- static bool initialized;
- if (initialized)
- return;
- initialized = true;
-
- WNDCLASSEXW wndClass = {0};
- wndClass.cbSize = sizeof(wndClass);
- wndClass.style = CS_HREDRAW | CS_VREDRAW;
- wndClass.lpfnWndProc = wndProc;
- wndClass.hCursor = LoadCursor(0, IDC_ARROW);
- wndClass.lpszClassName = hostWindowClassName;
-
- ::RegisterClassExW(&wndClass);
-}
-
-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
- : m_parentWindowMessageObserver(0)
-{
- registerWindowClass();
-
- RECT viewRect = {0, 0, 800, 600};
- m_window = CreateWindowExW(0, hostWindowClassName, L"TestWebKitAPI", WS_OVERLAPPEDWINDOW, viewRect.left, viewRect.top, viewRect.right, viewRect.bottom, 0, 0, 0, this);
- m_view = WKViewCreate(viewRect, contextRef, pageGroupRef, m_window);
-}
-
-PlatformWebView::~PlatformWebView()
-{
- ::DestroyWindow(m_window);
- WKRelease(m_view);
-}
-
-WKPageRef PlatformWebView::page() const
-{
- return WKViewGetPage(m_view);
-}
-
-void PlatformWebView::resizeTo(unsigned width, unsigned height)
-{
- ::SetWindowPos(WKViewGetWindow(m_view), 0, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
-}
-
-void PlatformWebView::simulateSpacebarKeyPress()
-{
- HWND window = WKViewGetWindow(m_view);
-
- // These values match what happens when you press the spacebar in Notepad, as observed by Spy++.
- ::SendMessageW(window, WM_KEYDOWN, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
- ::SendMessageW(window, WM_CHAR, ' ', (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
- ::SendMessageW(window, WM_KEYUP, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
-}
-
-void PlatformWebView::simulateAKeyDown()
-{
- HWND window = WKViewGetWindow(m_view);
-
- // These values match what happens when you press the 'A' key in Notepad, as observed by Spy++.
- ::SendMessageW(window, WM_KEYDOWN, 'A', (1 << repeatCountBitOffset) | (30 << scanCodeBitOffset));
-}
-
-void PlatformWebView::simulateAltKeyPress()
-{
- HWND window = WKViewGetWindow(m_view);
-
- // These values match what happens when you press the Alt key in Notepad, as observed by Spy++.
- ::SendMessageW(window, WM_SYSKEYDOWN, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << contextCodeBitOffset));
- ::SendMessageW(window, WM_SYSKEYUP, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
-}
-
-void PlatformWebView::simulateRightClick(unsigned x, unsigned y)
-{
- HWND window = WKViewGetWindow(m_view);
-
- ::SendMessageW(window, WM_RBUTTONDOWN, 0, MAKELPARAM(x, y));
- ::SendMessageW(window, WM_RBUTTONUP, 0, MAKELPARAM(x, y));
-}
-
-void PlatformWebView::simulateMouseMove(unsigned x, unsigned y)
-{
- HWND window = WKViewGetWindow(m_view);
-
- ::SendMessageW(window, WM_MOUSEMOVE, 0, MAKELPARAM(x, y));
-}
-
-LRESULT PlatformWebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- PlatformWebView* webView;
- if (message == WM_CREATE) {
- CREATESTRUCT* createStruct = reinterpret_cast<CREATESTRUCT*>(lParam);
- webView = static_cast<PlatformWebView*>(createStruct->lpCreateParams);
- ::SetPropW(hWnd, webViewPointerProperty, webView);
- } else
- webView = reinterpret_cast<PlatformWebView*>(::GetPropW(hWnd, webViewPointerProperty));
-
- if (webView && webView->m_parentWindowMessageObserver)
- webView->m_parentWindowMessageObserver->windowReceivedMessage(hWnd, message, wParam, lParam);
-
- if (message == WM_NCDESTROY)
- ::RemovePropW(hWnd, webViewPointerProperty);
-
- return ::DefWindowProcW(hWnd, message, wParam, lParam);
-}
-
-} // namespace TestWebKitAPI
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPI.sln b/Tools/TestWebKitAPI/win/TestWebKitAPI.sln
deleted file mode 100644
index ae601ef49..000000000
--- a/Tools/TestWebKitAPI/win/TestWebKitAPI.sln
+++ /dev/null
@@ -1,66 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPI", "TestWebKitAPI.vcproj", "{3E48AB23-D249-488F-A1C4-43CDF52FBD28}"
- ProjectSection(ProjectDependencies) = postProject
- {45C45411-7F0E-404D-919A-4EE9BB60BE86} = {45C45411-7F0E-404D-919A-4EE9BB60BE86}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPIGenerated", "TestWebKitAPIGenerated.vcproj", "{45C45411-7F0E-404D-919A-4EE9BB60BE86}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPIInjectedBundle", "TestWebKitAPIInjectedBundle.vcproj", "{B0101604-B483-4F8C-9C51-90B46A2B1CD3}"
- ProjectSection(ProjectDependencies) = postProject
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28} = {3E48AB23-D249-488F-A1C4-43CDF52FBD28}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug_All|Win32 = Debug_All|Win32
- Debug_Cairo_CFLite|Win32 = Debug_Cairo_CFLite|Win32
- Debug|Win32 = Debug|Win32
- Release_Cairo_CFLite|Win32 = Release_Cairo_CFLite|Win32
- Production|Win32 = Production|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug|Win32.ActiveCfg = Debug|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug|Win32.Build.0 = Debug|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Production|Win32.ActiveCfg = Production|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Production|Win32.Build.0 = Production|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.ActiveCfg = Release|Win32
- {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.Build.0 = Release|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug|Win32.ActiveCfg = Debug|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug|Win32.Build.0 = Debug|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Production|Win32.ActiveCfg = Production|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Production|Win32.Build.0 = Production|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.ActiveCfg = Release|Win32
- {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.Build.0 = Release|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_All|Win32.Build.0 = Debug_All|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug|Win32.ActiveCfg = Debug|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Debug|Win32.Build.0 = Debug|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Production|Win32.ActiveCfg = Production|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Production|Win32.Build.0 = Production|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.ActiveCfg = Release|Win32
- {B0101604-B483-4F8C-9C51-90B46A2B1CD3}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj b/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj
deleted file mode 100644
index 96b2d256e..000000000
--- a/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj
+++ /dev/null
@@ -1,751 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestWebKitAPI"
- ProjectGUID="{3E48AB23-D249-488F-A1C4-43CDF52FBD28}"
- RootNamespace="TestWebKitAPI"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebug.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_All|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugAll.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_Cairo_CFLite|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugCairoCFLite.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release_Cairo_CFLite|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIReleaseCairoCFLite.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Production|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="win"
- >
- <File
- RelativePath=".\HostWindow.cpp"
- >
- </File>
- <File
- RelativePath=".\HostWindow.h"
- >
- </File>
- <File
- RelativePath=".\InjectedBundleControllerWin.cpp"
- >
- </File>
- <File
- RelativePath=".\main.cpp"
- >
- </File>
- <File
- RelativePath=".\PlatformUtilitiesWin.cpp"
- >
- </File>
- <File
- RelativePath=".\PlatformWebViewWin.cpp"
- >
- </File>
- <File
- RelativePath=".\WindowMessageObserver.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Tests"
- >
- <Filter
- Name="WebCore"
- >
- <Filter
- Name="win"
- >
- <File
- RelativePath="..\Tests\WebCore\win\BitmapImage.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="WebKit2"
- >
- <File
- RelativePath="..\Tests\WebKit2\18-characters.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\AboutBlankLoad.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\CanHandleRequest.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\CookieManager.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\DocumentStartUserScriptAlertCrash.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\DownloadDecideDestinationCrash.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\EvaluateJavaScript.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\FailedLoad.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\file-with-anchor.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\Find.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\find.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\ForceRepaint.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\FrameMIMETypeHTML.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\FrameMIMETypePNG.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\icon.png"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\InjectedBundleBasic.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\LoadAlternateHTMLStringWithNonDirectoryURL.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\LoadCanceledNoServerRedirectCallback.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\mouse-move-listener.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\MouseMoveAfterCrash.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\PageLoadBasic.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\PageLoadDidChangeLocationWithinPageForFrame.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\PreventEmptyUserAgent.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\PrivateBrowsingPushStateNoHistoryCallback.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\push-state.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\RestoreSessionStateContainingFormData.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\simple-accelerated-compositing.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\simple-form.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\simple-iframe.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\simple.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\spacebar-scrolling.html"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\SpacebarScrolling.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\UserMessage.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\WebArchive.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\WKPreferences.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\WKString.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\WKStringJSString.cpp"
- >
- </File>
- <Filter
- Name="win"
- >
- <File
- RelativePath="..\Tests\WebKit2\win\AltKeyGeneratesWMSysCommand.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\win\DoNotCopyANullCFURLResponse.cpp"
- >
- <FileConfiguration
- Name="Debug_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\Tests\WebKit2\win\HideFindIndicator.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\win\ResizeViewWhileHidden.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\win\TranslateMessageGeneratesWMChar.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\win\WMCloseCallsUIClientClose.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="WTF"
- >
- <Filter
- Name="cf"
- >
- <File
- RelativePath="..\Tests\WTF\cf\RetainPtrHashing.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\cf\RetainPtr.cpp"
- >
- </File>
- </Filter>
- <File
- RelativePath="..\Tests\WTF\CheckedArithmeticOperations.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\Functional.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\HashMap.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\MathExtras.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\MediaTime.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\SaturatedArithmeticOperations.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\StringOperators.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\TemporaryChange.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\Vector.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\VectorBasic.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WTF\VectorReverse.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="WebKit"
- >
- <Filter
- Name="win"
- >
- <File
- RelativePath="..\Tests\WebKit\win\WebViewDestruction.cpp"
- >
- </File>
- </Filter>
- </Filter>
- </Filter>
- <File
- RelativePath="..\config.h"
- >
- </File>
- <File
- RelativePath="..\JavaScriptTest.cpp"
- >
- </File>
- <File
- RelativePath="..\JavaScriptTest.h"
- >
- </File>
- <File
- RelativePath="..\PlatformUtilities.cpp"
- >
- </File>
- <File
- RelativePath="..\PlatformUtilities.h"
- >
- </File>
- <File
- RelativePath="..\PlatformWebView.h"
- >
- </File>
- <File
- RelativePath="..\Test.h"
- >
- </File>
- <File
- RelativePath="..\TestsController.cpp"
- >
- </File>
- <File
- RelativePath="..\TestsController.h"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj b/Tools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj
deleted file mode 100644
index aa9cdae05..000000000
--- a/Tools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestWebKitAPIGenerated"
- ProjectGUID="{45C45411-7F0E-404D-919A-4EE9BB60BE86}"
- Keyword="MakeFileProj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_All|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- <Configuration
- Name="Production|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- <Configuration
- Name="Release_Cairo_CFLite|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_Cairo_CFLite|Win32"
- ConfigurationType="0"
- InheritedPropertySheets=".\TestWebKitAPIGeneratedCommon.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\copy-resources.cmd"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIGeneratedCommon.vsprops b/Tools/TestWebKitAPI/win/TestWebKitAPIGeneratedCommon.vsprops
deleted file mode 100644
index 8a5f40231..000000000
--- a/Tools/TestWebKitAPI/win/TestWebKitAPIGeneratedCommon.vsprops
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestWebKitAPIGeneratedCommon"
- InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops"
- >
- <Tool
- Name="VCNMakeTool"
- BuildCommandLine="set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)&#x0D;&#x0A;copy-resources.cmd"
- ReBuildCommandLine="set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)&#x0D;&#x0A;copy-resources.cmd rebuild"
- CleanCommandLine="set CONFIGURATIONBUILDDIR=$(ConfigurationBuildDir)&#x0D;&#x0A;copy-resources.cmd clean"
- />
-</VisualStudioPropertySheet>
diff --git a/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj b/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj
deleted file mode 100644
index 832c70b78..000000000
--- a/Tools/TestWebKitAPI/win/TestWebKitAPIInjectedBundle.vcproj
+++ /dev/null
@@ -1,471 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestWebKitAPIInjectedBundle"
- ProjectGUID="{B0101604-B483-4F8C-9C51-90B46A2B1CD3}"
- RootNamespace="TestWebKitAPIInjectedBundle"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebug.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_All|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugAll.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Production|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIRelease.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug_Cairo_CFLite|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIDebugCairoCFLite.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release_Cairo_CFLite|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="..\Configurations\TestWebKitAPIReleaseCairoCFLite.vsprops;..\Configurations\TestWebKitAPIInjectedBundleCommon.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="win"
- >
- <File
- RelativePath=".\InjectedBundleControllerWin.cpp"
- >
- </File>
- <File
- RelativePath=".\PlatformUtilitiesWin.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Tests"
- >
- <Filter
- Name="WebKit2"
- >
- <File
- RelativePath="..\Tests\WebKit2\CanHandleRequest_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\DocumentStartUserScriptAlertCrash_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\HitTestResultNodeHandle_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\InjectedBundleBasic_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\LoadCanceledNoServerRedirectCallback_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\MouseMoveAfterCrash_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\ResponsivenessTimerDoesntFireEarly_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\UserMessage_Bundle.cpp"
- >
- </File>
- <File
- RelativePath="..\Tests\WebKit2\WebArchive_Bundle.cpp"
- >
- </File>
- </Filter>
- </Filter>
- <File
- RelativePath="..\InjectedBundleController.cpp"
- >
- </File>
- <File
- RelativePath="..\InjectedBundleController.h"
- >
- </File>
- <File
- RelativePath="..\InjectedBundleMain.cpp"
- >
- </File>
- <File
- RelativePath="..\InjectedBundleTest.h"
- >
- </File>
- <File
- RelativePath="..\PlatformUtilities.cpp"
- >
- </File>
- <File
- RelativePath="..\PlatformUtilities.h"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/Tools/TestWebKitAPI/win/copy-resources.cmd b/Tools/TestWebKitAPI/win/copy-resources.cmd
deleted file mode 100755
index deaf74468..000000000
--- a/Tools/TestWebKitAPI/win/copy-resources.cmd
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-
-set ResourcesDirectory=%CONFIGURATIONBUILDDIR%\bin\TestWebKitAPI.resources
-
-if "%1" EQU "clean" goto :clean
-if "%1" EQU "rebuild" call :clean
-
-echo Copying resources...
-mkdir 2>NUL "%ResourcesDirectory%"
-for %%f in (
- ..\Tests\WebKit2\18-characters.html
- ..\Tests\WebKit2\file-with-anchor.html
- ..\Tests\WebKit2\find.html
- ..\Tests\WebKit2\icon.png
- ..\Tests\WebKit2\mouse-move-listener.html
- ..\Tests\WebKit2\push-state.html
- ..\Tests\WebKit2\simple.html
- ..\Tests\WebKit2\simple-accelerated-compositing.html
- ..\Tests\WebKit2\simple-form.html
- ..\Tests\WebKit2\simple-iframe.html
- ..\Tests\WebKit2\spacebar-scrolling.html
-) do (
- xcopy /y /d %%f "%ResourcesDirectory%"
-)
-
-goto :EOF
-
-:clean
-
-echo Deleting resources...
-del /s /q "%ResourcesDirectory%"
diff --git a/Tools/TestWebKitAPI/win/main.cpp b/Tools/TestWebKitAPI/win/main.cpp
index 6782c476e..265471bd0 100644
--- a/Tools/TestWebKitAPI/win/main.cpp
+++ b/Tools/TestWebKitAPI/win/main.cpp
@@ -25,6 +25,22 @@
#include "config.h"
#include "TestsController.h"
+#include <windows.h>
+
+#if defined _M_IX86
+#define PROCESSORARCHITECTURE "x86"
+#elif defined _M_IA64
+#define PROCESSORARCHITECTURE "ia64"
+#elif defined _M_X64
+#define PROCESSORARCHITECTURE "amd64"
+#else
+#define PROCESSORARCHITECTURE "*"
+#endif
+
+#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='6595b64144ccf1df' language='*'\"")
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\"")
+#endif
int main(int argc, char** argv)
{