Changeset 262022 in webkit
- Timestamp:
- May 21, 2020 12:52:41 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 29 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r261965 r262022 1 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> 2 3 [PlayStation] Add minimal WKView API to enable TestWebKitAPI 4 https://bugs.webkit.org/show_bug.cgi?id=211868 5 6 Reviewed by Alex Christensen. 7 8 Enable TestWebKitAPI 9 10 * Source/cmake/OptionsPlayStation.cmake: 11 Disable FullScreen API and ContextMenus. 12 1 13 2020-05-20 ChangSeok Oh <changseok@webkit.org> 2 14 -
trunk/Source/WTF/ChangeLog
r262000 r262022 1 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> 2 3 [PlayStation] Add minimal WKView API to enable TestWebKitAPI 4 https://bugs.webkit.org/show_bug.cgi?id=211868 5 6 Reviewed by Alex Christensen. 7 8 Enable TestWebKitAPI 9 10 * wtf/PlatformPlayStation.cmake: 11 Link libc as a system library. 12 1 13 2020-05-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Source/WTF/wtf/PlatformPlayStation.cmake
r261428 r262022 19 19 20 20 list(APPEND WTF_LIBRARIES 21 ${C_STD_LIBRARY}22 21 ${KERNEL_LIBRARY} 23 22 Threads::Threads -
trunk/Source/WebCore/ChangeLog
r262016 r262022 1 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> 2 3 [PlayStation] Add minimal WKView API to enable TestWebKitAPI 4 https://bugs.webkit.org/show_bug.cgi?id=211868 5 6 Reviewed by Alex Christensen. 7 8 Enable TestWebKitAPI 9 10 * PlatformPlayStation.cmake: 11 Add WebKitRequirements library to WebCore_CopySharedLibs. 12 1 13 2020-05-21 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/PlatformPlayStation.cmake
r261571 r262022 97 97 ${OPENSSL_LIBRARIES} 98 98 ${PNG_LIBRARIES} 99 ${WebKitRequirements_LIBRARY} 99 100 ${WebP_LIBRARIES} 100 101 ) -
trunk/Source/WebKit/ChangeLog
r262005 r262022 1 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> 2 3 [PlayStation] Add minimal WKView API to enable TestWebKitAPI 4 https://bugs.webkit.org/show_bug.cgi?id=211868 5 6 Reviewed by Alex Christensen. 7 8 Enable TestWebKitAPI 9 10 * Platform/IPC/Connection.h: 11 * Platform/IPC/unix/ConnectionUnix.cpp: 12 (IPC::Connection::platformInvalidate): 13 (IPC::Connection::open): 14 Add SocketMonitor to monitor received messages. 15 16 * UIProcess/API/APIProcessPoolConfiguration.cpp: 17 (API::ProcessPoolConfiguration::copy): 18 * UIProcess/API/APIProcessPoolConfiguration.h: 19 Add PlayStation specific members: WebProcess and NetworkProcess paths, and user ID. 20 21 * UIProcess/Launcher/ProcessLauncher.h: 22 Add PlayStation specific members: Process path and user ID. 23 24 * NetworkProcess/EntryPoint/playstation/NetworkProcessMain.cpp: Copied from Tools\TestWebKitAPI\playstation\main.cpp. 25 (loadLibraryOrExit): 26 (main): 27 * PlatformPlayStation.cmake: 28 * Shared/API/c/playstation/WKEventPlayStation.cpp: Added. 29 (WKKeyboardEventMake): 30 (WKMouseEventMake): 31 (WKWheelEventMake): 32 * Shared/API/c/playstation/WKEventPlayStation.h: Added. 33 * UIProcess/API/C/playstation/WKAPICastPlayStation.h: 34 (WebKit::toAPI<>): 35 (WebKit::toImpl<>): 36 * UIProcess/API/C/playstation/WKContextConfigurationPlayStation.cpp: Copied from Tools\TestWebKitAPI\playstation\PlatformUtilitiesPlayStation.cpp. 37 (WKContextConfigurationSetWebProcessPath): 38 (WKContextConfigurationCopyWebProcessPath): 39 (WKContextConfigurationSetNetworkProcessPath): 40 (WKContextConfigurationCopyNetworkProcessPath): 41 (WKContextConfigurationSetUserId): 42 (WKContextConfigurationGetUserId): 43 * UIProcess/API/C/playstation/WKContextConfigurationPlayStation.h: Copied from Source\WebKit\UIProcess\API\C\playstation\WKView.h. 44 * UIProcess/API/C/playstation/WKPagePrivatePlayStation.cpp: Added. 45 (WKPageHandleKeyboardEvent): 46 (WKPageHandleMouseEvent): 47 (WKPageHandleWheelEvent): 48 * UIProcess/API/C/playstation/WKPagePrivatePlayStation.h: Copied from Source\WebKit\UIProcess\API\C\playstation\WKView.h. 49 * UIProcess/API/C/playstation/WKView.cpp: Copied from Source\WebKit\WebProcess\InjectedBundle\playstation\InjectedBundlePlayStation.cpp. 50 (WKViewCreate): 51 (WKViewGetPage): 52 * UIProcess/API/C/playstation/WKView.h: 53 * UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp: 54 (WebKit::defaultProcessPath): 55 (WebKit::ProcessLauncher::launchProcess): 56 (WebKit::ProcessLauncher::terminateProcess): 57 (WebKit::ProcessLauncher::platformInvalidate): 58 * UIProcess/Network/NetworkProcessProxy.cpp: 59 (WebKit::NetworkProcessProxy::getLaunchOptions): 60 * UIProcess/WebProcessPool.h: 61 * UIProcess/WebProcessProxy.cpp: 62 (WebKit::WebProcessProxy::getLaunchOptions): 63 * UIProcess/playstation/PageClientImpl.cpp: Added. 64 (WebKit::PageClientImpl::PageClientImpl): 65 (WebKit::PageClientImpl::createDrawingAreaProxy): 66 (WebKit::PageClientImpl::setViewNeedsDisplay): 67 (WebKit::PageClientImpl::requestScroll): 68 (WebKit::PageClientImpl::viewScrollPosition): 69 (WebKit::PageClientImpl::viewSize): 70 (WebKit::PageClientImpl::isViewWindowActive): 71 (WebKit::PageClientImpl::isViewFocused): 72 (WebKit::PageClientImpl::isViewVisible): 73 (WebKit::PageClientImpl::isViewInWindow): 74 (WebKit::PageClientImpl::processDidExit): 75 (WebKit::PageClientImpl::didRelaunchProcess): 76 (WebKit::PageClientImpl::pageClosed): 77 (WebKit::PageClientImpl::preferencesDidChange): 78 (WebKit::PageClientImpl::toolTipChanged): 79 (WebKit::PageClientImpl::didCommitLoadForMainFrame): 80 (WebKit::PageClientImpl::handleDownloadRequest): 81 (WebKit::PageClientImpl::didChangeContentSize): 82 (WebKit::PageClientImpl::setCursor): 83 (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): 84 (WebKit::PageClientImpl::didChangeViewportProperties): 85 (WebKit::PageClientImpl::registerEditCommand): 86 (WebKit::PageClientImpl::clearAllEditCommands): 87 (WebKit::PageClientImpl::canUndoRedo): 88 (WebKit::PageClientImpl::executeUndoRedo): 89 (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): 90 (WebKit::PageClientImpl::convertToDeviceSpace): 91 (WebKit::PageClientImpl::convertToUserSpace): 92 (WebKit::PageClientImpl::screenToRootView): 93 (WebKit::PageClientImpl::rootViewToScreen): 94 (WebKit::PageClientImpl::accessibilityScreenToRootView): 95 (WebKit::PageClientImpl::rootViewToAccessibilityScreen): 96 (WebKit::PageClientImpl::doneWithKeyEvent): 97 (WebKit::PageClientImpl::createPopupMenuProxy): 98 (WebKit::PageClientImpl::enterAcceleratedCompositingMode): 99 (WebKit::PageClientImpl::exitAcceleratedCompositingMode): 100 (WebKit::PageClientImpl::updateAcceleratedCompositingMode): 101 (WebKit::PageClientImpl::fullScreenManagerProxyClient): 102 (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider): 103 (WebKit::PageClientImpl::navigationGestureDidBegin): 104 (WebKit::PageClientImpl::navigationGestureWillEnd): 105 (WebKit::PageClientImpl::navigationGestureDidEnd): 106 (WebKit::PageClientImpl::willRecordNavigationSnapshot): 107 (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): 108 (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): 109 (WebKit::PageClientImpl::didFinishLoadForMainFrame): 110 (WebKit::PageClientImpl::didFailLoadForMainFrame): 111 (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): 112 (WebKit::PageClientImpl::didChangeBackgroundColor): 113 (WebKit::PageClientImpl::isPlayingAudioWillChange): 114 (WebKit::PageClientImpl::isPlayingAudioDidChange): 115 (WebKit::PageClientImpl::refView): 116 (WebKit::PageClientImpl::derefView): 117 (WebKit::PageClientImpl::didRestoreScrollPosition): 118 (WebKit::PageClientImpl::userInterfaceLayoutDirection): 119 (WebKit::PageClientImpl::requestDOMPasteAccess): 120 * UIProcess/playstation/PageClientImpl.h: Added. 121 * UIProcess/playstation/WebProcessPoolPlayStation.cpp: 122 (WebKit::WebProcessPool::platformInitialize): 123 * UIProcess/playstation/PlayStationWebView.cpp: Copied from Source\WebKit\UIProcess\playstation\WebProcessPoolPlayStation.cpp. 124 (WebKit::PlayStationWebView::create): 125 (WebKit::PlayStationWebView::PlayStationWebView): 126 (WebKit::PlayStationWebView::~PlayStationWebView): 127 (WebKit::PlayStationWebView::isActive const): 128 (WebKit::PlayStationWebView::isFocused const): 129 (WebKit::PlayStationWebView::isVisible const): 130 * UIProcess/playstation/PlayStationWebView.h: Copied from Source\WebKit\WebProcess\InjectedBundle\playstation\InjectedBundlePlayStation.cpp. 131 (WebKit::PlayStationWebView::page): 132 * WebProcess/EntryPoint/playstation/WebProcessMain.cpp: Copied from Tools\TestWebKitAPI\playstation\main.cpp. 133 (loadLibraryOrExit): 134 (main): 135 * WebProcess/InjectedBundle/playstation/InjectedBundlePlayStation.cpp: 136 (WebKit::InjectedBundle::initialize): 137 (WebKit::InjectedBundle::setBundleParameter): 138 * WebProcess/WebPage/AcceleratedSurface.cpp: 139 (WebKit::AcceleratedSurface::create): 140 1 141 2020-05-21 Chris Dumez <cdumez@apple.com> 2 142 -
trunk/Source/WebKit/NetworkProcess/EntryPoint/playstation/NetworkProcessMain.cpp
r262021 r262022 25 25 26 26 #include "config.h" 27 #include " TestsController.h"28 #include "process-initialization/nk-testwebkitapi.h" 27 #include "NetworkProcessMain.h" 28 29 29 #include <dlfcn.h> 30 #include <process-initialization/nk-networkprocess.h> 31 #include <stdio.h> 32 #include <stdlib.h> 33 #include <unistd.h> 34 35 static void loadLibraryOrExit(const char* name) 36 { 37 if (!dlopen(name, RTLD_NOW)) { 38 fprintf(stderr, "Failed to load %s.\n", name); 39 exit(EXIT_FAILURE); 40 } 41 } 30 42 31 43 int main(int argc, char** argv) 32 44 { 33 dlopen("libicu", RTLD_NOW); 34 #if defined(BUILDING_TestWebCore) || defined(BUILDING_TestWebKit) 35 dlopen("libpng16", RTLD_NOW); 36 dlopen("libfontconfig", RTLD_NOW); 37 dlopen("libfreetype", RTLD_NOW); 38 dlopen("libharfbuzz", RTLD_NOW); 39 dlopen("libcairo", RTLD_NOW); 40 dlopen("libSceNKWebKitRequirements", RTLD_NOW); 41 dlopen("libJavaScriptCore", RTLD_NOW); 42 #endif 43 #if defined(BUILDING_TestWebKit) 44 (dlopen("libcrypto", RTLD_NOW) && dlopen("libssl", RTLD_NOW)) || dlopen("LibreSSL", RTLD_NOW); 45 dlopen("libcurl", RTLD_NOW); 46 dlopen("libWebKit", RTLD_NOW); 47 #endif 48 return TestWebKitAPI::TestsController::singleton().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE; 45 if (argc < 2) { 46 fprintf(stderr, "Unexpected argument count %d\n", argc); 47 exit(EXIT_FAILURE); 48 } 49 50 if (!((dlopen("libcrypto", RTLD_NOW) && dlopen("libssl", RTLD_NOW)) || dlopen("LibreSSL", RTLD_NOW))) { 51 fprintf(stderr, "Failed to load SSL library.\n"); 52 exit(EXIT_FAILURE); 53 } 54 loadLibraryOrExit("libcurl"); 55 loadLibraryOrExit("libicu"); 56 loadLibraryOrExit("libSceNKWebKitRequirements"); 57 loadLibraryOrExit("libJavaScriptCore"); 58 loadLibraryOrExit("libWebKit"); 59 60 char* coreProcessIdentifier = argv[1]; 61 62 char connectionIdentifier[16]; 63 snprintf(connectionIdentifier, sizeof(connectionIdentifier), "%d", PlayStation::getConnectionIdentifier()); 64 65 char program[] = "dummy"; 66 char* internalArgv[] = { 67 program, 68 coreProcessIdentifier, 69 connectionIdentifier, 70 0 71 }; 72 return WebKit::NetworkProcessMain(sizeof(internalArgv) / sizeof(char*), internalArgv); 49 73 } -
trunk/Source/WebKit/Platform/IPC/Connection.h
r261812 r262022 411 411 GSocketMonitor m_writeSocketMonitor; 412 412 #endif 413 #if PLATFORM(PLAYSTATION) 414 RefPtr<WTF::Thread> m_socketMonitor; 415 #endif 413 416 #elif OS(DARWIN) 414 417 // Called on the connection queue. -
trunk/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
r261998 r262022 121 121 #endif 122 122 123 #if PLATFORM(PLAYSTATION) 124 if (m_socketMonitor) { 125 m_socketMonitor->detach(); 126 m_socketMonitor = nullptr; 127 } 128 #endif 129 123 130 m_socketDescriptor = -1; 124 131 m_isConnected = false; … … 360 367 return G_SOURCE_REMOVE; 361 368 }); 369 #endif 370 371 #if PLATFORM(PLAYSTATION) 372 m_socketMonitor = Thread::create("SocketMonitor", [protectedThis] { 373 { 374 int fd; 375 while ((fd = protectedThis->m_socketDescriptor) != -1) { 376 int maxFd = fd; 377 fd_set fdSet; 378 FD_ZERO(&fdSet); 379 FD_SET(fd, &fdSet); 380 381 if (-1 != select(maxFd + 1, &fdSet, 0, 0, 0)) { 382 if (FD_ISSET(fd, &fdSet)) 383 protectedThis->readyReadHandler(); 384 } 385 } 386 387 } 388 }); 389 return true; 362 390 #endif 363 391 -
trunk/Source/WebKit/PlatformPlayStation.cmake
r260387 r262022 1 set(WebKit_OUTPUT_NAME SceWebKit)2 set(WebProcess_OUTPUT_NAME WebKitWebProcess)3 set(NetworkProcess_OUTPUT_NAME WebKitNetworkProcess)4 set(GPUProcess_OUTPUT_NAME WebKitGPUProcess)5 set(PluginProcess_OUTPUT_NAME WebKitPluginProcess)6 7 1 include(Headers.cmake) 8 2 … … 12 6 13 7 list(APPEND WebProcess_SOURCES 14 WebProcess/EntryPoint/ unix/WebProcessMain.cpp8 WebProcess/EntryPoint/playstation/WebProcessMain.cpp 15 9 ) 16 10 17 11 list(APPEND NetworkProcess_SOURCES 18 NetworkProcess/EntryPoint/ unix/NetworkProcessMain.cpp12 NetworkProcess/EntryPoint/playstation/NetworkProcessMain.cpp 19 13 ) 20 14 … … 58 52 Shared/API/c/curl/WKCertificateInfoCurl.cpp 59 53 54 Shared/API/c/playstation/WKEventPlayStation.cpp 55 60 56 Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 61 57 Shared/CoordinatedGraphics/SimpleViewportController.cpp … … 91 87 UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp 92 88 89 UIProcess/API/C/playstation/WKContextConfigurationPlayStation.cpp 90 UIProcess/API/C/playstation/WKPagePrivatePlayStation.cpp 91 UIProcess/API/C/playstation/WKView.cpp 92 93 93 UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp 94 94 … … 105 105 UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp 106 106 107 UIProcess/playstation/PageClientImpl.cpp 108 UIProcess/playstation/PlayStationWebView.cpp 107 109 UIProcess/playstation/WebPageProxyPlayStation.cpp 108 110 UIProcess/playstation/WebProcessPoolPlayStation.cpp … … 139 141 "${WEBKIT_DIR}/UIProcess/API/C/playstation" 140 142 "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics" 143 "${WEBKIT_DIR}/UIProcess/playstation" 141 144 "${WEBKIT_DIR}/WebProcess/WebCoreSupport/curl" 142 145 "${WEBKIT_DIR}/WebProcess/WebPage/CoordinatedGraphics" … … 151 154 152 155 Shared/API/c/playstation/WKBasePlayStation.h 156 Shared/API/c/playstation/WKEventPlayStation.h 153 157 154 158 UIProcess/API/C/curl/WKProtectionSpaceCurl.h 155 159 UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.h 156 160 161 UIProcess/API/C/playstation/WKContextConfigurationPlayStation.h 162 UIProcess/API/C/playstation/WKPagePrivatePlayStation.h 157 163 UIProcess/API/C/playstation/WKView.h 158 164 ) … … 164 170 $<TARGET_OBJECTS:PAL> 165 171 $<TARGET_OBJECTS:WebCore> 172 WebKitRequirements::ProcessLauncher 166 173 ) -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
r260065 r262022 72 72 copy->m_useSystemAppearanceForScrollbars = m_useSystemAppearanceForScrollbars; 73 73 #endif 74 74 #if PLATFORM(PLAYSTATION) 75 copy->m_webProcessPath = this->m_webProcessPath; 76 copy->m_networkProcessPath = this->m_networkProcessPath; 77 copy->m_userId = this->m_userId; 78 #endif 75 79 return copy; 76 80 } -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
r260065 r262022 137 137 #endif 138 138 139 #if PLATFORM(PLAYSTATION) 140 const WTF::String& webProcessPath() const { return m_webProcessPath; } 141 void setWebProcessPath(const WTF::String& webProcessPath) { m_webProcessPath = webProcessPath; } 142 143 const WTF::String& networkProcessPath() const { return m_networkProcessPath; } 144 void setNetworkProcessPath(const WTF::String& networkProcessPath) { m_networkProcessPath = networkProcessPath; } 145 146 int32_t userId() const { return m_userId; } 147 void setUserId(const int32_t userId) { m_userId = userId; } 148 #endif 149 139 150 private: 140 151 WTF::String m_injectedBundlePath; … … 166 177 bool m_useSystemAppearanceForScrollbars { false }; 167 178 #endif 179 #if PLATFORM(PLAYSTATION) 180 WTF::String m_webProcessPath; 181 WTF::String m_networkProcessPath; 182 int32_t m_userId { -1 }; 183 #endif 168 184 }; 169 185 -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKAPICastPlayStation.h
r255685 r262022 31 31 #endif 32 32 33 namespace WebKit { 34 35 class PlayStationWebView; 36 37 WK_ADD_API_MAPPING(WKViewRef, PlayStationWebView) 38 39 template<> 40 inline WKViewRef toAPI<>(PlayStationWebView* view) 41 { 42 return reinterpret_cast<WKViewRef>(static_cast<void*>(view)); 43 } 44 45 template<> 46 inline PlayStationWebView* toImpl<>(WKViewRef view) 47 { 48 return static_cast<PlayStationWebView*>(static_cast<void*>(const_cast<typename std::remove_const<typename std::remove_pointer<WKViewRef>::type>::type*>(view))); 49 } 50 51 } 52 33 53 #endif /* WKAPICastPlayStation_h */ -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKContextConfigurationPlayStation.cpp
r262021 r262022 25 25 26 26 #include "config.h" 27 #include " PlatformUtilities.h"27 #include "WKContextConfigurationPlayStation.h" 28 28 29 #include <wtf/FileSystem.h>30 #include <wtf/URL.h>29 #include "APIProcessPoolConfiguration.h" 30 #include "WKAPICast.h" 31 31 32 namespace TestWebKitAPI { 33 namespace Util { 34 35 WKStringRef createInjectedBundlePath() 32 void WKContextConfigurationSetWebProcessPath(WKContextConfigurationRef configuration, WKStringRef webProcessPath) 36 33 { 37 return WKStringCreateWithUTF8CString("injectedbundle");34 WebKit::toImpl(configuration)->setWebProcessPath(WebKit::toImpl(webProcessPath)->string()); 38 35 } 39 36 40 WK URLRef createURLForResource(const char* resource, const char* extension)37 WKStringRef WKContextConfigurationCopyWebProcessPath(WKContextConfigurationRef configuration) 41 38 { 42 String filename = makeString(resource, '.', extension); 43 auto url = URL::fileURLWithFileSystemPath(filename); 44 return WKURLCreateWithUTF8CString(url.string().utf8().data()); 39 return WebKit::toCopiedAPI(WebKit::toImpl(configuration)->webProcessPath()); 45 40 } 46 41 47 WKURLRef URLForNonExistentResource()42 void WKContextConfigurationSetNetworkProcessPath(WKContextConfigurationRef configuration, WKStringRef networkProcessPath) 48 43 { 49 return WKURLCreateWithUTF8CString("file:///does-not-exist.html");44 WebKit::toImpl(configuration)->setNetworkProcessPath(WebKit::toImpl(networkProcessPath)->string()); 50 45 } 51 46 52 bool isKeyDown(WKNativeEventPtr event)47 WKStringRef WKContextConfigurationCopyNetworkProcessPath(WKContextConfigurationRef configuration) 53 48 { 54 // FIXME: implement this. 55 return false; 49 return WebKit::toCopiedAPI(WebKit::toImpl(configuration)->networkProcessPath()); 56 50 } 57 51 58 } // namespace Util 59 } // namespace TestWebKitAPI 52 void WKContextConfigurationSetUserId(WKContextConfigurationRef configuration, int32_t userId) 53 { 54 WebKit::toImpl(configuration)->setUserId(userId); 55 } 56 57 int32_t WKContextConfigurationGetUserId(WKContextConfigurationRef configuration) 58 { 59 return WebKit::toImpl(configuration)->userId(); 60 } -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKContextConfigurationPlayStation.h
r262021 r262022 24 24 */ 25 25 26 #ifndef WKView_h 27 #define WKView_h 26 #pragma once 28 27 29 28 #include <WebKit/WKBase.h> 29 #include <WebKit/WKContextConfigurationRef.h> 30 30 31 31 #ifdef __cplusplus … … 33 33 #endif 34 34 35 WK_EXPORT void WKContextConfigurationSetWebProcessPath(WKContextConfigurationRef configuration, WKStringRef webProcessPath); 36 WK_EXPORT WKStringRef WKContextConfigurationCopyWebProcessPath(WKContextConfigurationRef configuration); 37 38 WK_EXPORT void WKContextConfigurationSetNetworkProcessPath(WKContextConfigurationRef configuration, WKStringRef networkProcessPath); 39 WK_EXPORT WKStringRef WKContextConfigurationCopyNetworkProcessPath(WKContextConfigurationRef configuration); 40 41 WK_EXPORT void WKContextConfigurationSetUserId(WKContextConfigurationRef configuration, int32_t userId); 42 WK_EXPORT int32_t WKContextConfigurationGetUserId(WKContextConfigurationRef configuration); 43 35 44 #ifdef __cplusplus 36 45 } 37 46 #endif 38 39 #endif /* WKView_h */ -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKPagePrivatePlayStation.h
r262021 r262022 24 24 */ 25 25 26 #ifndef WKView_h 27 #define WKView_h 26 #pragma once 28 27 29 28 #include <WebKit/WKBase.h> 29 #include <WebKit/WKEventPlayStation.h> 30 30 31 31 #ifdef __cplusplus … … 33 33 #endif 34 34 35 WK_EXPORT void WKPageHandleKeyboardEvent(WKPageRef page, WKKeyboardEvent); 36 WK_EXPORT void WKPageHandleMouseEvent(WKPageRef page, WKMouseEvent); 37 WK_EXPORT void WKPageHandleWheelEvent(WKPageRef page, WKWheelEvent); 38 35 39 #ifdef __cplusplus 36 40 } 37 41 #endif 38 39 #endif /* WKView_h */ -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKView.cpp
r262021 r262022 25 25 26 26 #include "config.h" 27 #include " InjectedBundle.h"27 #include "WKView.h" 28 28 29 namespace WebKit { 29 #include "APIPageConfiguration.h" 30 #include "PlayStationWebView.h" 31 #include "WKAPICast.h" 30 32 31 bool InjectedBundle::initialize(const WebProcessCreationParameters&, API::Object* initializationUserData)33 WKViewRef WKViewCreate(WKPageConfigurationRef configuration) 32 34 { 33 return false;35 return WebKit::toAPI(WebKit::PlayStationWebView::create(*WebKit::toImpl(configuration)).leakRef()); 34 36 } 35 37 36 void InjectedBundle::setBundleParameter(WTF::String const&, IPC::DataReference const&)38 WKPageRef WKViewGetPage(WKViewRef viewRef) 37 39 { 40 return WebKit::toAPI(WebKit::toImpl(viewRef)->page()); 38 41 } 39 40 void InjectedBundle::setBundleParameters(const IPC::DataReference&)41 {42 }43 44 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/API/C/playstation/WKView.h
r255685 r262022 24 24 */ 25 25 26 #ifndef WKView_h 27 #define WKView_h 26 #pragma once 28 27 29 28 #include <WebKit/WKBase.h> … … 33 32 #endif 34 33 34 WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef configuration); 35 WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view); 36 35 37 #ifdef __cplusplus 36 38 } 37 39 #endif 38 39 #endif /* WKView_h */ -
trunk/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h
r253098 r262022 86 86 #endif 87 87 #endif 88 89 #if PLATFORM(PLAYSTATION) 90 String processPath; 91 int32_t userId { -1 }; 92 #endif 88 93 }; 89 94 -
trunk/Source/WebKit/UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp
r254713 r262022 30 30 #include "ProcessLauncher.h" 31 31 32 #include <process-launcher.h> 33 #include <stdint.h> 34 #include <sys/socket.h> 35 32 36 namespace WebKit { 37 38 #define MAKE_PROCESS_PATH(x) "/app0/" #x "Process.self" 39 static const char* defaultProcessPath(ProcessLauncher::ProcessType processType) 40 { 41 switch (processType) { 42 case ProcessLauncher::ProcessType::Network: 43 return MAKE_PROCESS_PATH(Network); 44 #if ENABLE(GPU_PROCESS) 45 case ProcessLauncher::ProcessType::GPU: 46 return MAKE_PROCESS_PATH(GPU); 47 #endif 48 case ProcessLauncher::ProcessType::Web: 49 default: 50 return MAKE_PROCESS_PATH(Web); 51 } 52 } 33 53 34 54 void ProcessLauncher::launchProcess() 35 55 { 56 IPC::Connection::Identifier serverIdentifier; 57 IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection(IPC::Connection::ConnectionOptions::SetCloexecOnServer); 58 59 int sendBufSize = 32 * 1024; 60 setsockopt(socketPair.server, SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); 61 setsockopt(socketPair.client, SOL_SOCKET, SO_SNDBUF, &sendBufSize, 4); 62 63 int recvBufSize = 32 * 1024; 64 setsockopt(socketPair.server, SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); 65 setsockopt(socketPair.client, SOL_SOCKET, SO_RCVBUF, &recvBufSize, 4); 66 67 char coreProcessIdentifierString[16]; 68 snprintf(coreProcessIdentifierString, sizeof coreProcessIdentifierString, "%ld", m_launchOptions.processIdentifier.toUInt64()); 69 70 char* argv[] = { 71 coreProcessIdentifierString, 72 nullptr 73 }; 74 75 PlayStation::LaunchParam param { socketPair.client, m_launchOptions.userId }; 76 int32_t appLocalPid = PlayStation::launchProcess( 77 !m_launchOptions.processPath.isEmpty() ? m_launchOptions.processPath.utf8().data() : defaultProcessPath(m_launchOptions.processType), 78 argv, param); 79 if (appLocalPid < 0) { 80 #ifndef NDEBUG 81 fprintf(stderr, "Failed to launch process. err=0x%08x path=%s\n", appLocalPid, m_launchOptions.processPath.utf8().data()); 82 #endif 83 return; 84 } 85 close(socketPair.client); 86 serverIdentifier = socketPair.server; 87 88 // We've finished launching the process, message back to the main run loop. 89 RefPtr<ProcessLauncher> protectedThis(this); 90 RunLoop::main().dispatch([=] { 91 protectedThis->didFinishLaunchingProcess(appLocalPid, serverIdentifier); 92 }); 36 93 } 37 94 38 95 void ProcessLauncher::terminateProcess() 39 96 { 97 if (!m_processIdentifier) 98 return; 99 100 PlayStation::terminateProcess(m_processIdentifier); 40 101 } 41 102 42 103 void ProcessLauncher::platformInvalidate() 43 104 { 105 m_processIdentifier = 0; 44 106 } 45 107 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r261963 r262022 110 110 launchOptions.shouldMakeProcessLaunchFailForTesting = true; 111 111 } 112 113 #if PLATFORM(PLAYSTATION) 114 launchOptions.processPath = m_processPool.networkProcessPath(); 115 launchOptions.userId = m_processPool.userId(); 116 #endif 112 117 } 113 118 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r261948 r262022 536 536 #endif 537 537 538 #if PLATFORM(PLAYSTATION) 539 const String& webProcessPath() const { return m_resolvedPaths.webProcessPath; } 540 const String& networkProcessPath() const { return m_resolvedPaths.networkProcessPath; } 541 int32_t userId() const { return m_userId; } 542 #endif 543 538 544 private: 539 545 void platformInitialize(); … … 763 769 #endif 764 770 771 #if PLATFORM(PLAYSTATION) 772 String webProcessPath; 773 String networkProcessPath; 774 #endif 775 765 776 Vector<String> additionalWebProcessSandboxExtensionPaths; 766 777 }; … … 799 810 }; 800 811 Optional<AudibleMediaActivity> m_audibleMediaActivity; 812 813 #if PLATFORM(PLAYSTATION) 814 int32_t m_userId { -1 }; 815 #endif 801 816 802 817 #if PLATFORM(IOS) -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r261288 r262022 333 333 launchOptions.extraInitializationData.add("is-prewarmed"_s, "1"_s); 334 334 335 #if PLATFORM(PLAYSTATION) 336 launchOptions.processPath = m_processPool->webProcessPath(); 337 launchOptions.userId = m_processPool->userId(); 338 #endif 339 335 340 if (processPool().shouldMakeNextWebProcessLaunchFailForTesting()) { 336 341 processPool().setShouldMakeNextWebProcessLaunchFailForTesting(false); -
trunk/Source/WebKit/UIProcess/playstation/PlayStationWebView.cpp
r262021 r262022 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 25 25 26 26 #include "config.h" 27 #include "PlayStationWebView.h" 28 29 #include "APIPageConfiguration.h" 30 #include "DrawingAreaProxyCoordinatedGraphics.h" 27 31 #include "WebProcessPool.h" 28 32 29 33 namespace WebKit { 30 34 31 void WebProcessPool::platformInitialize() 35 RefPtr<PlayStationWebView> PlayStationWebView::create(const API::PageConfiguration& configuration) 36 { 37 return adoptRef(*new PlayStationWebView(configuration)); 38 } 39 40 PlayStationWebView::PlayStationWebView(const API::PageConfiguration& conf) 41 : m_pageClient(makeUnique<PageClientImpl>(*this)) 42 { 43 auto configuration = conf.copy(); 44 auto* pool = configuration->processPool(); 45 m_page = pool->createWebPage(*m_pageClient, WTFMove(configuration)); 46 47 m_page->initializeWebPage(); 48 } 49 50 PlayStationWebView::~PlayStationWebView() 32 51 { 33 52 } 34 53 35 void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters&) 54 bool PlayStationWebView::isActive() const 36 55 { 37 notImplemented();56 return m_active; 38 57 } 39 58 40 void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy&, WebProcessCreationParameters&) 59 bool PlayStationWebView::isFocused() const 41 60 { 42 notImplemented();61 return m_focused; 43 62 } 44 63 45 void WebProcessPool::platformInvalidateContext() 64 bool PlayStationWebView::isVisible() const 46 65 { 47 notImplemented(); 48 } 49 50 void WebProcessPool::platformResolvePathsForSandboxExtensions() 51 { 66 return m_visible; 52 67 } 53 68 -
trunk/Source/WebKit/UIProcess/playstation/PlayStationWebView.h
r262021 r262022 24 24 */ 25 25 26 #include "config.h" 27 #include "InjectedBundle.h" 26 #pragma once 27 28 #include "APIObject.h" 29 #include "PageClientImpl.h" 30 #include "WKView.h" 31 #include "WebPageProxy.h" 28 32 29 33 namespace WebKit { 30 34 31 bool InjectedBundle::initialize(const WebProcessCreationParameters&, API::Object* initializationUserData) 32 { 33 return false; 34 } 35 class PlayStationWebView : public API::ObjectImpl<API::Object::Type::View> { 36 WTF_MAKE_FAST_ALLOCATED; 37 public: 38 static RefPtr<PlayStationWebView> create(const API::PageConfiguration&); 39 virtual ~PlayStationWebView(); 35 40 36 void InjectedBundle::setBundleParameter(WTF::String const&, IPC::DataReference const&) 37 { 38 } 41 WebPageProxy* page() { return m_page.get(); } 39 42 40 void InjectedBundle::setBundleParameters(const IPC::DataReference&) 41 { 42 } 43 bool isActive() const; 44 bool isFocused() const; 45 bool isVisible() const; 46 47 private: 48 PlayStationWebView(const API::PageConfiguration&); 49 50 std::unique_ptr<WebKit::PageClientImpl> m_pageClient; 51 RefPtr<WebPageProxy> m_page; 52 53 bool m_active { false }; 54 bool m_focused { false }; 55 bool m_visible { false }; 56 #if ENABLE(FULLSCREEN_API) 57 bool m_isFullScreen { false }; 58 #endif 59 }; 43 60 44 61 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/playstation/WebProcessPoolPlayStation.cpp
r254713 r262022 31 31 void WebProcessPool::platformInitialize() 32 32 { 33 m_userId = m_configuration->userId(); 33 34 } 34 35 -
trunk/Source/WebKit/WebProcess/EntryPoint/playstation/WebProcessMain.cpp
r262021 r262022 25 25 26 26 #include "config.h" 27 #include " TestsController.h"28 #include "process-initialization/nk-testwebkitapi.h" 27 #include "WebProcessMain.h" 28 29 29 #include <dlfcn.h> 30 #include <process-initialization/nk-webprocess.h> 31 #include <stdio.h> 32 #include <stdlib.h> 33 #include <unistd.h> 34 35 static void loadLibraryOrExit(const char* name) 36 { 37 if (!dlopen(name, RTLD_NOW)) { 38 fprintf(stderr, "Failed to load %s.\n", name); 39 exit(EXIT_FAILURE); 40 } 41 } 30 42 31 43 int main(int argc, char** argv) 32 44 { 33 dlopen("libicu", RTLD_NOW); 34 #if defined(BUILDING_TestWebCore) || defined(BUILDING_TestWebKit) 35 dlopen("libpng16", RTLD_NOW); 36 dlopen("libfontconfig", RTLD_NOW); 37 dlopen("libfreetype", RTLD_NOW); 38 dlopen("libharfbuzz", RTLD_NOW); 39 dlopen("libcairo", RTLD_NOW); 40 dlopen("libSceNKWebKitRequirements", RTLD_NOW); 41 dlopen("libJavaScriptCore", RTLD_NOW); 42 #endif 43 #if defined(BUILDING_TestWebKit) 44 (dlopen("libcrypto", RTLD_NOW) && dlopen("libssl", RTLD_NOW)) || dlopen("LibreSSL", RTLD_NOW); 45 dlopen("libcurl", RTLD_NOW); 46 dlopen("libWebKit", RTLD_NOW); 47 #endif 48 return TestWebKitAPI::TestsController::singleton().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE; 45 if (argc < 2) { 46 fprintf(stderr, "Unexpected argument count %d\n", argc); 47 exit(EXIT_FAILURE); 48 } 49 50 loadLibraryOrExit("libpng16"); 51 loadLibraryOrExit("libicu"); 52 loadLibraryOrExit("libfreetype"); 53 loadLibraryOrExit("libfontconfig"); 54 loadLibraryOrExit("libharfbuzz"); 55 loadLibraryOrExit("libcairo"); 56 loadLibraryOrExit("libSceNKWebKitRequirements"); 57 loadLibraryOrExit("libJavaScriptCore"); 58 loadLibraryOrExit("libWebKit"); 59 60 char* coreProcessIdentifier = argv[1]; 61 62 char connectionIdentifier[16]; 63 snprintf(connectionIdentifier, sizeof(connectionIdentifier), "%d", PlayStation::getConnectionIdentifier()); 64 65 char program[] = "dummy"; 66 char* internalArgv[] = { 67 program, 68 coreProcessIdentifier, 69 connectionIdentifier, 70 0 71 }; 72 return WebKit::WebProcessMain(sizeof(internalArgv) / sizeof(char*), internalArgv); 49 73 } -
trunk/Source/WebKit/WebProcess/InjectedBundle/playstation/InjectedBundlePlayStation.cpp
r254713 r262022 27 27 #include "InjectedBundle.h" 28 28 29 #include "WKBundleAPICast.h" 30 #include "WKBundleInitialize.h" 31 #include "library-bundle.h" 32 29 33 namespace WebKit { 30 34 31 bool InjectedBundle::initialize(const WebProcessCreationParameters& , API::Object* initializationUserData)35 bool InjectedBundle::initialize(const WebProcessCreationParameters& parameters, API::Object* initializationUserData) 32 36 { 33 return false; 37 auto bundle = LibraryBundle::create(m_path.utf8().data()); 38 m_platformBundle = bundle; 39 if (!m_platformBundle) { 40 printf("PlayStation::Bundle::create failed\n"); 41 return false; 42 } 43 WKBundleInitializeFunctionPtr initializeFunction = reinterpret_cast<WKBundleInitializeFunctionPtr>(bundle->resolve("WKBundleInitialize")); 44 if (!initializeFunction) { 45 printf("PlayStation::Bundle::resolve failed\n"); 46 return false; 47 } 48 initializeFunction(toAPI(this), toAPI(initializationUserData)); 49 return true; 34 50 } 35 51 36 52 void InjectedBundle::setBundleParameter(WTF::String const&, IPC::DataReference const&) 37 53 { 54 38 55 } 39 56 -
trunk/Source/WebKit/WebProcess/WebPage/AcceleratedSurface.cpp
r246308 r262022 59 59 return AcceleratedSurfaceX11::create(webPage, client); 60 60 #endif 61 #if USE( LIBWPE)61 #if USE(WPE_RENDERER) 62 62 if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::WPE) 63 63 return AcceleratedSurfaceLibWPE::create(webPage, client); -
trunk/Source/cmake/OptionsPlayStation.cmake
r261462 r262022 60 60 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE OFF) 61 61 62 # Enable in the future 63 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API PRIVATE OFF) 64 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CONTEXT_MENUS PRIVATE OFF) 65 62 66 # No support planned 63 67 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) … … 104 108 find_library(C_STD_LIBRARY c) 105 109 find_library(KERNEL_LIBRARY kernel) 110 find_package(WebKitRequirements REQUIRED 111 COMPONENTS 112 JPEG 113 LibPSL 114 LibXml2 115 ProcessLauncher 116 SQLite3 117 ZLIB 118 libwpe 119 ) 106 120 107 121 find_package(Cairo REQUIRED) … … 112 126 find_package(HarfBuzz REQUIRED COMPONENTS ICU) 113 127 find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc) 114 find_package(JPEG REQUIRED)115 find_package(LibPSL REQUIRED)116 find_package(LibXml2 REQUIRED)117 128 find_package(OpenSSL REQUIRED) 118 129 find_package(PNG REQUIRED) 119 find_package(SQLite3 REQUIRED)120 130 find_package(Threads REQUIRED) 121 131 find_package(WebP REQUIRED COMPONENTS demux) 122 find_package(WPE REQUIRED) 123 find_package(ZLIB REQUIRED) 132 133 set(CMAKE_C_STANDARD_LIBRARIES 134 "${CMAKE_C_STANDARD_LIBRARIES} ${C_STD_LIBRARY}" 135 ) 136 set(CMAKE_CXX_STANDARD_LIBRARIES 137 "${CMAKE_CXX_STANDARD_LIBRARIES} ${C_STD_LIBRARY}" 138 ) 124 139 125 140 # TODO: Add a check for HAVE_RSA_PSS for support of CryptoAlgorithmRSA_PSS … … 134 149 SET_AND_EXPOSE_TO_BUILD(USE_LIBWPE ON) 135 150 SET_AND_EXPOSE_TO_BUILD(USE_OPENSSL ON) 136 SET_AND_EXPOSE_TO_BUILD(USE_WPE_RENDERER O N)151 SET_AND_EXPOSE_TO_BUILD(USE_WPE_RENDERER OFF) 137 152 138 153 SET_AND_EXPOSE_TO_BUILD(USE_INSPECTOR_SOCKET_SERVER ${ENABLE_REMOTE_INSPECTOR}) -
trunk/Tools/ChangeLog
r262018 r262022 1 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> 2 3 [PlayStation] Add minimal WKView API to enable TestWebKitAPI 4 https://bugs.webkit.org/show_bug.cgi?id=211868 5 6 Reviewed by Alex Christensen. 7 8 Enable TestWebKitAPI 9 10 * TestWebKitAPI/PlatformPlayStation.cmake: 11 * TestWebKitAPI/PlatformWebView.h: 12 * TestWebKitAPI/playstation/PlatformUtilitiesPlayStation.cpp: 13 (TestWebKitAPI::Util::createInjectedBundlePath): 14 (TestWebKitAPI::Util::createURLForResource): 15 * TestWebKitAPI/playstation/PlatformWebViewPlayStation.cpp: 16 (TestWebKitAPI::PlatformWebView::PlatformWebView): 17 (TestWebKitAPI::PlatformWebView::~PlatformWebView): 18 (TestWebKitAPI::PlatformWebView::initialize): 19 (TestWebKitAPI::PlatformWebView::resizeTo): 20 (TestWebKitAPI::PlatformWebView::page const): 21 (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress): 22 (TestWebKitAPI::PlatformWebView::simulateMouseMove): 23 (TestWebKitAPI::PlatformWebView::simulateRightClick): 24 (TestWebKitAPI::PlatformWebView::simulateButtonClick): 25 * TestWebKitAPI/playstation/main.cpp: 26 (loadLibraryOrExit): 27 (main): 28 Add PlayStation Platform support. 29 30 * TestWebKitAPI/Tests/WebKit/WKPreferences.cpp: 31 (TestWebKitAPI::TEST): 32 Use the same expected default font preferences as GTK's. 33 1 34 2020-05-21 Alex Christensen <achristensen@webkit.org> 2 35 -
trunk/Tools/TestWebKitAPI/PlatformPlayStation.cmake
r260738 r262022 49 49 playstation/PlatformWebViewPlayStation.cpp 50 50 ) 51 52 # Exclude tests which don't finish. 53 list(REMOVE_ITEM TestWebKit_SOURCES 54 Tests/WebKit/ForceRepaint.cpp 55 Tests/WebKit/Geolocation.cpp 56 ) 51 57 endif () 52 58 … … 56 62 set_target_properties(TestWTF TestWebCore TestWebKit PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") 57 63 endif () 64 65 add_definitions( 66 -DTEST_WEBKIT_RESOURCES_DIR=\"${TOOLS_DIR}/TestWebKitAPI/Tests/WebKit\" 67 ) -
trunk/Tools/TestWebKitAPI/PlatformWebView.h
r255899 r262022 61 61 typedef HWND PlatformWindow; 62 62 #elif PLATFORM(PLAYSTATION) 63 typedef void*PlatformWKView;63 typedef WKViewRef PlatformWKView; 64 64 typedef void* PlatformWindow; 65 65 #endif … … 88 88 void simulateRightClick(unsigned x, unsigned y); 89 89 void simulateMouseMove(unsigned x, unsigned y, WKEventModifiers = 0); 90 #if PLATFORM(MAC) 90 #if PLATFORM(MAC) || PLATFORM(PLAYSTATION) 91 91 void simulateButtonClick(WKEventMouseButton, unsigned x, unsigned y, WKEventModifiers); 92 92 #endif -
trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPreferences.cpp
r250345 r262022 45 45 TEST(WebKit, WKPreferencesDefaults) 46 46 { 47 #if PLATFORM(GTK) 47 #if PLATFORM(GTK) || PLATFORM(PLAYSTATION) 48 48 static const char* expectedStandardFontFamily = "Times"; 49 49 static const char* expectedFixedFontFamily = "Courier New"; -
trunk/Tools/TestWebKitAPI/playstation/PlatformUtilitiesPlayStation.cpp
r255708 r262022 35 35 WKStringRef createInjectedBundlePath() 36 36 { 37 return WKStringCreateWithUTF8CString(" injectedbundle");37 return WKStringCreateWithUTF8CString("/app0/libTestWebKitAPIInjectedBundle.sprx"); 38 38 } 39 39 40 40 WKURLRef createURLForResource(const char* resource, const char* extension) 41 41 { 42 String filename = makeString(resource, '.', extension);43 auto url = URL::fileURLWithFileSystemPath(filename);44 return WKURLCreateWithUTF8CString(url .string().utf8().data());42 char url[512]; // Sufficient buffer size for the prefix and the actual path. 43 snprintf(url, sizeof(url), "file:///host/%s/%s.%s", TEST_WEBKIT_RESOURCES_DIR, resource, extension); 44 return WKURLCreateWithUTF8CString(url); 45 45 } 46 46 -
trunk/Tools/TestWebKitAPI/playstation/PlatformWebViewPlayStation.cpp
r255708 r262022 27 27 #include "PlatformWebView.h" 28 28 29 #include <KeyboardEvents.h> 30 #include <WebKit/WKContextConfigurationPlayStation.h> 31 #include <WebKit/WKPageConfigurationRef.h> 32 #include <WebKit/WKPagePrivatePlayStation.h> 33 #include <WebKit/WKRetainPtr.h> 34 #include <WebKit/WebKit2_C.h> 35 29 36 namespace TestWebKitAPI { 37 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) 38 { 39 WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageConfigurationCreate()); 40 WKPageConfigurationSetContext(configuration.get(), contextRef); 41 WKPageConfigurationSetPageGroup(configuration.get(), pageGroupRef); 30 42 31 PlatformWebView::PlatformWebView(WKContextRef, WKPageGroupRef) 32 { 43 initialize(configuration.get()); 33 44 } 34 45 35 PlatformWebView::PlatformWebView(WKPageConfigurationRef )46 PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration) 36 47 { 48 initialize(configuration); 37 49 } 38 50 39 PlatformWebView::PlatformWebView(WKPageRef )51 PlatformWebView::PlatformWebView(WKPageRef relatedPage) 40 52 { 53 WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageConfigurationCreate()); 54 WKPageConfigurationSetContext(configuration.get(), WKPageGetContext(relatedPage)); 55 WKPageConfigurationSetPageGroup(configuration.get(), WKPageGetPageGroup(relatedPage)); 56 WKPageConfigurationSetRelatedPage(configuration.get(), relatedPage); 57 58 initialize(configuration.get()); 41 59 } 42 60 43 61 PlatformWebView::~PlatformWebView() 44 62 { 63 WKPageClose(page()); 64 WKRelease(m_view); 45 65 } 46 66 47 void PlatformWebView::initialize(WKPageConfigurationRef )67 void PlatformWebView::initialize(WKPageConfigurationRef configuration) 48 68 { 69 m_view = WKViewCreate(configuration); 70 resizeTo(800, 600); 71 } 72 73 void PlatformWebView::resizeTo(unsigned width, unsigned height) 74 { 75 // Not implemented. 49 76 } 50 77 51 78 WKPageRef PlatformWebView::page() const 52 79 { 53 return nullptr; 54 } 55 56 void PlatformWebView::resizeTo(unsigned, unsigned) 57 { 58 } 59 60 void PlatformWebView::focus() 61 { 80 return WKViewGetPage(m_view); 62 81 } 63 82 64 83 void PlatformWebView::simulateSpacebarKeyPress() 65 84 { 85 WKPageHandleKeyboardEvent(page(), WKKeyboardEventMake(kWKEventKeyDown, kWKInputTypeNormal, " ", 1, keyIdentifierForKeyCode(0x20), 0x20, -1, 0, 0)); 86 WKPageHandleKeyboardEvent(page(), WKKeyboardEventMake(kWKEventKeyUp, kWKInputTypeNormal, " ", 1, keyIdentifierForKeyCode(0x20), 0x20, -1, 0, 0)); 66 87 } 67 88 68 void PlatformWebView::simulate AltKeyPress()89 void PlatformWebView::simulateMouseMove(unsigned x, unsigned y, WKEventModifiers modifiers) 69 90 { 91 WKPageHandleMouseEvent(page(), WKMouseEventMake(kWKEventMouseMove, kWKEventMouseButtonNoButton, WKPointMake(x, y), 0, modifiers)); 70 92 } 71 93 72 void PlatformWebView::simulate MouseMove(unsigned, unsigned, WKEventModifiers)94 void PlatformWebView::simulateRightClick(unsigned x, unsigned y) 73 95 { 96 simulateButtonClick(kWKEventMouseButtonRightButton, x, y, 0); 74 97 } 75 98 76 void PlatformWebView::simulate RightClick(unsigned, unsigned)99 void PlatformWebView::simulateButtonClick(WKEventMouseButton button, unsigned x, unsigned y, WKEventModifiers modifiers) 77 100 { 101 WKPageHandleMouseEvent(page(), WKMouseEventMake(kWKEventMouseDown, button, WKPointMake(x, y), 0, modifiers)); 102 WKPageHandleMouseEvent(page(), WKMouseEventMake(kWKEventMouseUp, button, WKPointMake(x, y), 0, modifiers)); 78 103 } 79 104 -
trunk/Tools/TestWebKitAPI/playstation/main.cpp
r260738 r262022 29 29 #include <dlfcn.h> 30 30 31 static void loadLibraryOrExit(const char* name) 32 { 33 if (!dlopen(name, RTLD_NOW)) { 34 fprintf(stderr, "Failed to load %s.\n", name); 35 exit(EXIT_FAILURE); 36 } 37 } 38 31 39 int main(int argc, char** argv) 32 40 { 33 dlopen("libicu", RTLD_NOW);41 loadLibraryOrExit("libicu"); 34 42 #if defined(BUILDING_TestWebCore) || defined(BUILDING_TestWebKit) 35 dlopen("libpng16", RTLD_NOW);36 dlopen("libfontconfig", RTLD_NOW);37 dlopen("libfreetype", RTLD_NOW);38 dlopen("libharfbuzz", RTLD_NOW);39 dlopen("libcairo", RTLD_NOW);40 dlopen("libSceNKWebKitRequirements", RTLD_NOW);41 dlopen("libJavaScriptCore", RTLD_NOW);43 loadLibraryOrExit("libpng16"); 44 loadLibraryOrExit("libfontconfig"); 45 loadLibraryOrExit("libfreetype"); 46 loadLibraryOrExit("libharfbuzz"); 47 loadLibraryOrExit("libcairo"); 48 loadLibraryOrExit("libSceNKWebKitRequirements"); 49 loadLibraryOrExit("libJavaScriptCore"); 42 50 #endif 43 51 #if defined(BUILDING_TestWebKit) 44 (dlopen("libcrypto", RTLD_NOW) && dlopen("libssl", RTLD_NOW)) || dlopen("LibreSSL", RTLD_NOW); 45 dlopen("libcurl", RTLD_NOW); 46 dlopen("libWebKit", RTLD_NOW); 52 if (!((dlopen("libcrypto", RTLD_NOW) && dlopen("libssl", RTLD_NOW)) || dlopen("LibreSSL", RTLD_NOW))) { 53 fprintf(stderr, "Failed to load SSL library.\n"); 54 exit(EXIT_FAILURE); 55 } 56 loadLibraryOrExit("libcurl"); 57 loadLibraryOrExit("libWebKit"); 47 58 #endif 48 59 return TestWebKitAPI::TestsController::singleton().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
Note: See TracChangeset
for help on using the changeset viewer.