haikuwebkit/Source/WebDriver/win/WebDriverServiceWin.cpp

72 lines
2.4 KiB
C++
Raw Permalink Normal View History

[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
/*
* Copyright (C) 2019 Sony Interactive Entertainment Inc.
*
* 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 "WebDriverService.h"
#include "Capabilities.h"
[PlayStation][WinCairo] Enable WebDriver target on PlayStation and client for WinCairo https://bugs.webkit.org/show_bug.cgi?id=216908 Reviewed by Don Olmstead. Source/JavaScriptCore: Implement automation session correctly for PlayStation and WinCairo. * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::parseTargetListJSON): * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::stopInternal): (Inspector::RemoteInspector::requestAutomationSession): (Inspector::RemoteInspector::startAutomationSession): Source/WebDriver: Extend WebDriver client binary to support connection to remote device for both PlayStation and WinCairo. We've implemented a simple web server to accept WebDriver request natively and bypass them to RemoteInspector. * Capabilities.h: * HTTPServer.h: * PlatformPlayStation.cmake: Added. * PlatformWin.cmake: * SessionHost.h: (WebDriver::SessionHost::setHostAddress): * WebDriverMain.cpp: (main): (dllLauncherEntryPoint): * WebDriverService.cpp: (WebDriver::printUsageStatement): (WebDriver::WebDriverService::run): (WebDriver::WebDriverService::connectToBrowser): * WebDriverService.h: * gtk/WebDriverServiceGtk.cpp: (WebDriver::WebDriverService::platformInit): * playstation/WebDriverServicePlayStation.cpp: Copied from Source\WebDriver\win\WebDriverServiceWin.cpp. (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): (WebDriver::WebDriverService::platformSupportProxyType const): * socket/CapabilitiesSocket.cpp: Copied from Source\WebDriver\socket\SessionHostSocket.cpp. (WebDriver::CapabilitiesSocket::parseCapabilities): * socket/CapabilitiesSocket.h: Copied from Source\WebDriver\socket\HTTPServerSocket.cpp. * socket/HTTPParser.cpp: Added. (WebDriver::HTTPParser::parse): (WebDriver::HTTPParser::handlePhase): (WebDriver::HTTPParser::abortProcess): (WebDriver::HTTPParser::parseFirstLine): (WebDriver::HTTPParser::readLine): (WebDriver::HTTPParser::expectedBodyLength const): * socket/HTTPParser.h: Copied from Source\WebDriver\HTTPServer.h. (WebDriver::HTTPParser::pullMessage): * socket/HTTPServerSocket.cpp: (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): (WebDriver::HTTPServer::doAccept): (WebDriver::HTTPServer::didClose): (WebDriver::HTTPRequestHandler::connect): (WebDriver::HTTPRequestHandler::reset): (WebDriver::HTTPRequestHandler::didReceive): (WebDriver::HTTPRequestHandler::sendResponse): (WebDriver::HTTPRequestHandler::packHTTPMessage const): (WebDriver::HTTPRequestHandler::didClose): * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::dispatchMap): (WebDriver::SessionHost::sendWebInspectorEvent): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::didClose): (WebDriver::SessionHost::parseTargetList): (WebDriver::SessionHost::receivedSetTargetList): (WebDriver::SessionHost::receivedSendMessageToFrontend): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::setTargetList): (WebDriver::SessionHost::sendMessageToBackend): * win/WebDriverServiceWin.cpp: (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformParseCapabilities const): * wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformInit): Canonical link: https://commits.webkit.org/229926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-30 21:22:57 +00:00
#include "CapabilitiesSocket.h"
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
namespace WebDriver {
[PlayStation][WinCairo] Enable WebDriver target on PlayStation and client for WinCairo https://bugs.webkit.org/show_bug.cgi?id=216908 Reviewed by Don Olmstead. Source/JavaScriptCore: Implement automation session correctly for PlayStation and WinCairo. * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::parseTargetListJSON): * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::stopInternal): (Inspector::RemoteInspector::requestAutomationSession): (Inspector::RemoteInspector::startAutomationSession): Source/WebDriver: Extend WebDriver client binary to support connection to remote device for both PlayStation and WinCairo. We've implemented a simple web server to accept WebDriver request natively and bypass them to RemoteInspector. * Capabilities.h: * HTTPServer.h: * PlatformPlayStation.cmake: Added. * PlatformWin.cmake: * SessionHost.h: (WebDriver::SessionHost::setHostAddress): * WebDriverMain.cpp: (main): (dllLauncherEntryPoint): * WebDriverService.cpp: (WebDriver::printUsageStatement): (WebDriver::WebDriverService::run): (WebDriver::WebDriverService::connectToBrowser): * WebDriverService.h: * gtk/WebDriverServiceGtk.cpp: (WebDriver::WebDriverService::platformInit): * playstation/WebDriverServicePlayStation.cpp: Copied from Source\WebDriver\win\WebDriverServiceWin.cpp. (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): (WebDriver::WebDriverService::platformSupportProxyType const): * socket/CapabilitiesSocket.cpp: Copied from Source\WebDriver\socket\SessionHostSocket.cpp. (WebDriver::CapabilitiesSocket::parseCapabilities): * socket/CapabilitiesSocket.h: Copied from Source\WebDriver\socket\HTTPServerSocket.cpp. * socket/HTTPParser.cpp: Added. (WebDriver::HTTPParser::parse): (WebDriver::HTTPParser::handlePhase): (WebDriver::HTTPParser::abortProcess): (WebDriver::HTTPParser::parseFirstLine): (WebDriver::HTTPParser::readLine): (WebDriver::HTTPParser::expectedBodyLength const): * socket/HTTPParser.h: Copied from Source\WebDriver\HTTPServer.h. (WebDriver::HTTPParser::pullMessage): * socket/HTTPServerSocket.cpp: (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): (WebDriver::HTTPServer::doAccept): (WebDriver::HTTPServer::didClose): (WebDriver::HTTPRequestHandler::connect): (WebDriver::HTTPRequestHandler::reset): (WebDriver::HTTPRequestHandler::didReceive): (WebDriver::HTTPRequestHandler::sendResponse): (WebDriver::HTTPRequestHandler::packHTTPMessage const): (WebDriver::HTTPRequestHandler::didClose): * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::dispatchMap): (WebDriver::SessionHost::sendWebInspectorEvent): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::didClose): (WebDriver::SessionHost::parseTargetList): (WebDriver::SessionHost::receivedSetTargetList): (WebDriver::SessionHost::receivedSendMessageToFrontend): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::setTargetList): (WebDriver::SessionHost::sendMessageToBackend): * win/WebDriverServiceWin.cpp: (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformParseCapabilities const): * wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformInit): Canonical link: https://commits.webkit.org/229926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-30 21:22:57 +00:00
void WebDriverService::platformInit()
{
}
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
Capabilities WebDriverService::platformCapabilities()
{
Capabilities capabilities;
capabilities.platformName = String("win");
capabilities.setWindowRect = true;
return capabilities;
}
bool WebDriverService::platformCompareBrowserVersions(const String& requiredVersion, const String& proposedVersion)
{
return true;
}
Web Inspector: modernize generated backend protocol code https://bugs.webkit.org/show_bug.cgi?id=216302 <rdar://problem/68547649> Reviewed by Brian Burg. Source/JavaScriptCore: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * inspector/scripts/codegen/generator.py: (Generator.generate_includes_from_entries): * inspector/scripts/codegen/cpp_generator_templates.py: * inspector/scripts/codegen/cpp_generator.py: (CppGenerator.helpers_namespace): (CppGenerator.cpp_getter_method_for_type): (CppGenerator.cpp_setter_method_for_type): (CppGenerator.cpp_protocol_type_for_type): (CppGenerator.cpp_type_for_type_member_argument): Added. (CppGenerator.cpp_type_for_command_parameter): Added. (CppGenerator.cpp_type_for_command_return_declaration): Added. (CppGenerator.cpp_type_for_command_return_argument): Added. (CppGenerator.cpp_type_for_event_parameter): Added. (CppGenerator.cpp_type_for_enum): Added. (CppGenerator.should_move_argument): Added. (CppGenerator.should_release_argument): Added. (CppGenerator.should_dereference_argument): Added. (CppGenerator.cpp_protocol_type_for_type_member): Deleted. (CppGenerator.cpp_type_for_unchecked_formal_in_parameter): Deleted. (CppGenerator.cpp_type_for_checked_formal_event_parameter): Deleted. (CppGenerator.cpp_type_for_type_member): Deleted. (CppGenerator.cpp_type_for_type_with_name): Deleted. (CppGenerator.cpp_type_for_formal_out_parameter): Deleted. (CppGenerator.cpp_type_for_formal_async_parameter): Deleted. (CppGenerator.cpp_type_for_stack_in_parameter): Deleted. (CppGenerator.cpp_type_for_stack_out_parameter): Deleted. (CppGenerator.cpp_assertion_method_for_type_member): Deleted. (CppGenerator.cpp_assertion_method_for_type_member.assertion_method_for_type): Deleted. (CppGenerator.should_use_wrapper_for_return_type): Deleted. (CppGenerator.should_use_references_for_type): Deleted. (CppGenerator.should_pass_by_copy_for_return_type): Deleted. * inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py: (CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppAlternateBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command): * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: (CppBackendDispatcherHeaderGenerator.generate_output): (CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain): (CppBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter): Deleted. * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: (CppBackendDispatcherImplementationGenerator._generate_secondary_header_includes): (CppBackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain): (CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain): (CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: (CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppFrontendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_event): * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: (CppFrontendDispatcherImplementationGenerator._generate_secondary_header_includes): (CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event): * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_secondary_header_includes): (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain): (CppProtocolTypesImplementationGenerator._generate_open_field_names): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: (ObjCBackendDispatcherHeaderGenerator._generate_objc_handler_declaration_for_command): * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: (ObjCBackendDispatcherImplementationGenerator._generate_handler_implementation_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command.and): (ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command.in_param_expression): (ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_invocation_for_command): * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py: (ObjCFrontendDispatcherImplementationGenerator._generate_event): (ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters): * inspector/scripts/codegen/objc_generator_templates.py: * inspector/scripts/codegen/objc_generator.py: (ObjCGenerator.protocol_type_for_type): (ObjCGenerator.objc_type_for_param_internal): (ObjCGenerator.objc_protocol_import_expression_for_parameter): * inspector/protocol/Page.json: Now that enums are processed before being passed to backend dispacher handlers, the `appearance` parameter of `Page.setForcedAppearance` must be marked `optional` as there's no way for it to accept an empty string, as that's not possible for an enum. * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorAgent.cpp: * inspector/agents/InspectorAuditAgent.h: * inspector/agents/InspectorAuditAgent.cpp: * inspector/agents/InspectorConsoleAgent.h: * inspector/agents/InspectorConsoleAgent.cpp: * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: * inspector/agents/InspectorHeapAgent.h: * inspector/agents/InspectorHeapAgent.cpp: * inspector/agents/InspectorRuntimeAgent.h: * inspector/agents/InspectorRuntimeAgent.cpp: * inspector/agents/InspectorScriptProfilerAgent.h: * inspector/agents/InspectorScriptProfilerAgent.cpp: * inspector/agents/InspectorTargetAgent.h: * inspector/agents/InspectorTargetAgent.cpp: * inspector/agents/JSGlobalObjectAuditAgent.h: * inspector/agents/JSGlobalObjectAuditAgent.cpp: * inspector/agents/JSGlobalObjectDebuggerAgent.h: * inspector/agents/JSGlobalObjectDebuggerAgent.cpp: * inspector/agents/JSGlobalObjectRuntimeAgent.h: * inspector/agents/JSGlobalObjectRuntimeAgent.cpp: * inspector/JSGlobalObjectConsoleClient.cpp: * inspector/JSGlobalObjectInspectorController.cpp: Elided backend dispatcher handler changes describe above. * bindings/ScriptValue.cpp: (Inspector::jsToInspectorValue): * inspector/AsyncStackTrace.h: * inspector/AsyncStackTrace.cpp: (Inspector::AsyncStackTrace::buildInspectorObject const): * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::addToFrontend): * inspector/InjectedScriptBase.h: * inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeEvalCall): (Inspector::InjectedScriptBase::checkCallResult): (Inspector::InjectedScriptBase::checkAsyncCallResult): * inspector/InjectedScript.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::execute): (Inspector::InjectedScript::evaluate): (Inspector::InjectedScript::callFunctionOn): (Inspector::InjectedScript::evaluateOnCallFrame): (Inspector::InjectedScript::getFunctionDetails): (Inspector::InjectedScript::functionDetails): (Inspector::InjectedScript::getPreview): (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): (Inspector::InjectedScript::getInternalProperties): (Inspector::InjectedScript::getCollectionEntries): (Inspector::InjectedScript::saveResult): (Inspector::InjectedScript::wrapCallFrames const): (Inspector::InjectedScript::wrapObject const): (Inspector::InjectedScript::wrapJSONString const): (Inspector::InjectedScript::wrapTable const): (Inspector::InjectedScript::previewValue const): * inspector/InjectedScriptManager.cpp: (Inspector::InjectedScriptManager::injectedScriptForObjectId): * inspector/InspectorBackendDispatcher.h: * inspector/InspectorBackendDispatcher.cpp: (Inspector::BackendDispatcher::CallbackBase::sendSuccess): (Inspector::BackendDispatcher::dispatch): (Inspector::BackendDispatcher::sendResponse): (Inspector::BackendDispatcher::getPropertyValue): (Inspector::BackendDispatcher::getBoolean): (Inspector::BackendDispatcher::getInteger): (Inspector::BackendDispatcher::getDouble): (Inspector::BackendDispatcher::getString): (Inspector::BackendDispatcher::getValue): (Inspector::BackendDispatcher::getObject): (Inspector::BackendDispatcher::getArray): (Inspector::castToInteger): Deleted. (Inspector::castToNumber): Deleted. * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast): (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::extractEvent): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::pushListingsNow): * runtime/TypeSet.cpp: (JSC::StructureShape::inspectorRepresentation): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. * inspector/scripts/tests/enum-values.json: * inspector/scripts/tests/expected/command-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/expected/domain-debuggableTypes.json-result: * inspector/scripts/tests/expected/domain-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/domain-targetTypes.json-result: * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/expected/enum-values.json-result: * inspector/scripts/tests/expected/event-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/events-with-optional-parameters.json-result: * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/expected/same-type-id-different-domain.json-result: * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result: * inspector/scripts/tests/expected/should-strip-comments.json-result: * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: * inspector/scripts/tests/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: * inspector/scripts/tests/expected/type-declaration-object-type.json-result: * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: * inspector/scripts/tests/expected/type-with-open-parameters.json-result: * inspector/scripts/tests/expected/version.json-result: Source/WebCore: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * inspector/InspectorAuditResourcesObject.cpp: * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: * inspector/InspectorController.cpp: * inspector/InspectorStyleSheet.h: * inspector/InspectorStyleSheet.cpp: * inspector/agents/InspectorAnimationAgent.h: * inspector/agents/InspectorAnimationAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCPUProfilerAgent.h: * inspector/agents/InspectorCPUProfilerAgent.cpp: * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorCSSAgent.cpp: * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: * inspector/agents/InspectorDatabaseAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorIndexedDBAgent.cpp: * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: * inspector/agents/InspectorMemoryAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/InspectorWorkerAgent.h: * inspector/agents/InspectorWorkerAgent.cpp: * inspector/agents/WebConsoleAgent.h: * inspector/agents/WebDebuggerAgent.h: * inspector/agents/WebDebuggerAgent.cpp: * inspector/agents/WebHeapAgent.h: * inspector/agents/WebHeapAgent.cpp: * inspector/agents/page/PageAuditAgent.h: * inspector/agents/page/PageAuditAgent.cpp: * inspector/agents/page/PageConsoleAgent.h: * inspector/agents/page/PageConsoleAgent.cpp: * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: * inspector/agents/page/PageDebuggerAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageHeapAgent.h: * inspector/agents/page/PageHeapAgent.cpp: * inspector/agents/page/PageNetworkAgent.h: * inspector/agents/page/PageNetworkAgent.cpp: * inspector/agents/page/PageRuntimeAgent.h: * inspector/agents/page/PageRuntimeAgent.cpp: * inspector/agents/worker/ServiceWorkerAgent.h: * inspector/agents/worker/ServiceWorkerAgent.cpp: * inspector/agents/worker/WorkerAuditAgent.h: * inspector/agents/worker/WorkerConsoleAgent.h: * inspector/agents/worker/WorkerAuditAgent.cpp: * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: * inspector/agents/worker/WorkerDebuggerAgent.h: * inspector/agents/worker/WorkerDebuggerAgent.cpp: * inspector/agents/worker/WorkerNetworkAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: * inspector/agents/worker/WorkerRuntimeAgent.h: * inspector/agents/worker/WorkerRuntimeAgent.cpp: Elided backend dispatcher handler changes describe above. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): (WebCore::CommandLineAPIHost::clearConsoleMessages): * inspector/InspectorFrontendHost.cpp: (WebCore::valuePayloadFromJSONValue): (WebCore::InspectorFrontendHost::logDiagnosticEvent): * inspector/TimelineRecordFactory.h: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::appendLayoutRoot): * Modules/applicationmanifest/ApplicationManifestParser.cpp: (WebCore::ApplicationManifestParser::parseManifest): (WebCore::ApplicationManifestParser::parseStartURL): (WebCore::ApplicationManifestParser::parseDisplay): (WebCore::ApplicationManifestParser::parseScope): (WebCore::ApplicationManifestParser::parseGenericString): * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): * platform/encryptedmedia/CDMUtilities.cpp: (WebCore::CDMUtilities::parseJSONObject): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::parseLicenseReleaseAcknowledgementFormat): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::parseJSONValue): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WebDriver: * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): * Session.cpp: (WebDriver::firstWindowHandleInResult): (WebDriver::Session::getTimeouts): (WebDriver::Session::createTopLevelBrowsingContext): (WebDriver::Session::handleUserPrompts): (WebDriver::Session::reportUnexpectedAlertOpen): (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::getWindowHandle): (WebDriver::Session::closeTopLevelBrowsingContext): (WebDriver::Session::switchToWindow): (WebDriver::Session::getWindowHandles): (WebDriver::Session::newWindow): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::getToplevelBrowsingContextRect): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::createElement): (WebDriver::Session::extractElementID): (WebDriver::Session::computeElementLayout): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::waitForNavigationToComplete): (WebDriver::Session::elementIsFileUpload): (WebDriver::Session::parseElementIsFileUploadResult): (WebDriver::Session::selectOptionElement): (WebDriver::Session::elementClick): (WebDriver::Session::elementIsEditable): (WebDriver::Session::elementClear): (WebDriver::Session::setInputFileUploadFiles): (WebDriver::Session::elementSendKeys): (WebDriver::Session::getPageSource): (WebDriver::Session::handleScriptResult): (WebDriver::Session::executeScript): (WebDriver::Session::performMouseInteraction): (WebDriver::Session::performKeyboardInteractions): (WebDriver::builtAutomationCookie): (WebDriver::serializeCookie): (WebDriver::Session::getAllCookies): (WebDriver::Session::getNamedCookie): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::releaseActions): (WebDriver::Session::dismissAlert): (WebDriver::Session::acceptAlert): (WebDriver::Session::getAlertText): (WebDriver::Session::sendAlertText): (WebDriver::Session::takeScreenshot): * SessionHost.cpp: (WebDriver::SessionHost::dispatchMessage): * WebDriverService.h: * WebDriverService.cpp: (WebDriver::WebDriverService::handleRequest): (WebDriver::WebDriverService::sendResponse const): (WebDriver::valueAsNumberInRange): (WebDriver::deserializeTimeouts): (WebDriver::deserializeProxy): (WebDriver::WebDriverService::parseCapabilities const): (WebDriver::WebDriverService::findSessionOrCompleteWithError): (WebDriver::WebDriverService::validatedCapabilities const): (WebDriver::WebDriverService::mergeCapabilities const): (WebDriver::WebDriverService::matchCapabilities const): (WebDriver::WebDriverService::processCapabilities const): (WebDriver::WebDriverService::createSession): (WebDriver::WebDriverService::deleteSession): (WebDriver::WebDriverService::go): (WebDriver::WebDriverService::setWindowRect): (WebDriver::WebDriverService::closeWindow): (WebDriver::WebDriverService::switchToWindow): (WebDriver::WebDriverService::newWindow): (WebDriver::WebDriverService::switchToFrame): (WebDriver::findElementOrCompleteWithError): (WebDriver::findStrategyAndSelectorOrCompleteWithError): (WebDriver::WebDriverService::getElementAttribute): (WebDriver::WebDriverService::getElementProperty): (WebDriver::WebDriverService::getElementCSSValue): (WebDriver::WebDriverService::elementSendKeys): (WebDriver::findScriptAndArgumentsOrCompleteWithError): (WebDriver::WebDriverService::getNamedCookie): (WebDriver::deserializeCookie): (WebDriver::WebDriverService::addCookie): (WebDriver::WebDriverService::deleteCookie): (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::sendAlertText): * WebDriver/gtk/WebDriverServiceGtk.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): * WebDriver/win/WebDriverServiceWin.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): * WebDriver/wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WebInspectorUI: * UserInterface/Controllers/CSSManager.js: (WI.CSSManager.prototype.set forcedAppearance): Now that enums are processed before being passed to backend dispacher handlers, the `appearance` parameter of `Page.setForcedAppearance` must be marked `optional` as there's no way for it to accept an empty string, as that's not possible for an enum. As such, rework the frontend logic for invoking `Page.setForcedAppearance` to instead not provide an `appearance` parameter at all when wanting to "unset" it. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createConsoleSettingsView): Now that all logging channels matching a `Console.ChannelSource` are returned instead of just the hardcoded list, check for a matching `WI.UIString` before showing a `<select>`. Source/WebKit: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * UIProcess/Automation/Automation.json: `CoordinateSystem` has `Page` and `Viewport` enum values, but `WebAutomationSession` checks for `"Page"` and `"LayoutViewport"`. Add a `LayoutViewport` enum value now that enums are processed before being passed to backend dispacher handlers to preserve functionality. * UIProcess/Inspector/Agents/InspectorBrowserAgent.h: * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp: * UIProcess/Automation/WebAutomationSessionMacros.h: * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Elided backend dispatcher handler changes describe above. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setTargetList): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WTF: * wtf/JSONValues.h: (WTF::JSONImpl::ObjectBase::setValue): (WTF::JSONImpl::ObjectBase::setObject): (WTF::JSONImpl::ObjectBase::setArray): (WTF::JSONImpl::ArrayBase::pushValue): (WTF::JSONImpl::ArrayBase::pushObject): (WTF::JSONImpl::ArrayBase::pushArray): (WTF::JSONImpl::ArrayOf::ArrayOf): Deleted. (WTF::JSONImpl::ArrayOf::castedArray): Deleted. (WTF::JSONImpl::ArrayOf::addItem): Deleted. (WTF::JSONImpl::ArrayOf::create): Deleted. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::asValue): (WTF::JSONImpl::Value::asObject): (WTF::JSONImpl::Value::asArray): (WTF::JSONImpl::Value::parseJSON): (WTF::JSONImpl::Value::asBoolean const): (WTF::JSONImpl::Value::asDouble const): (WTF::JSONImpl::Value::asInteger const): (WTF::JSONImpl::Value::asString const): (WTF::JSONImpl::ObjectBase::asObject): (WTF::JSONImpl::ObjectBase::memoryCost const): (WTF::JSONImpl::ObjectBase::getBoolean const): (WTF::JSONImpl::ObjectBase::getDouble const): (WTF::JSONImpl::ObjectBase::getInteger const): (WTF::JSONImpl::ObjectBase::getString const): (WTF::JSONImpl::ObjectBase::getObject const): (WTF::JSONImpl::ObjectBase::getArray const): (WTF::JSONImpl::ObjectBase::getValue const): (WTF::JSONImpl::ObjectBase::ObjectBase): (WTF::JSONImpl::ArrayBase::asArray): (WTF::JSONImpl::ArrayBase::writeJSON const): (WTF::JSONImpl::ArrayBase::ArrayBase): (WTF::JSONImpl::ArrayBase::get const): (WTF::JSONImpl::ArrayBase::memoryCost const): (WTF::JSONImpl::ObjectBase::openAccessors): Deleted. Use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently assumed to exist. Remove unused overloads and allow subclasses to call `as*` instead of `openAccessors` as they're effectively the same thing. Tools: * TestWebKitAPI/Tests/WTF/JSONValue.cpp: LayoutTests: * inspector/canvas/requestShaderSource-expected.txt: * inspector/canvas/updateShader-expected.txt: * inspector/console/webcore-logging-expected.txt: * inspector/dom/highlightQuad-expected.txt: * inspector/worker/dom-debugger-dom-breakpoints-expected.txt: Canonical link: https://commits.webkit.org/229208@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-10 19:23:17 +00:00
bool WebDriverService::platformValidateCapability(const String& name, const Ref<JSON::Value>& value) const
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
{
return true;
}
Web Inspector: modernize generated backend protocol code https://bugs.webkit.org/show_bug.cgi?id=216302 <rdar://problem/68547649> Reviewed by Brian Burg. Source/JavaScriptCore: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * inspector/scripts/codegen/generator.py: (Generator.generate_includes_from_entries): * inspector/scripts/codegen/cpp_generator_templates.py: * inspector/scripts/codegen/cpp_generator.py: (CppGenerator.helpers_namespace): (CppGenerator.cpp_getter_method_for_type): (CppGenerator.cpp_setter_method_for_type): (CppGenerator.cpp_protocol_type_for_type): (CppGenerator.cpp_type_for_type_member_argument): Added. (CppGenerator.cpp_type_for_command_parameter): Added. (CppGenerator.cpp_type_for_command_return_declaration): Added. (CppGenerator.cpp_type_for_command_return_argument): Added. (CppGenerator.cpp_type_for_event_parameter): Added. (CppGenerator.cpp_type_for_enum): Added. (CppGenerator.should_move_argument): Added. (CppGenerator.should_release_argument): Added. (CppGenerator.should_dereference_argument): Added. (CppGenerator.cpp_protocol_type_for_type_member): Deleted. (CppGenerator.cpp_type_for_unchecked_formal_in_parameter): Deleted. (CppGenerator.cpp_type_for_checked_formal_event_parameter): Deleted. (CppGenerator.cpp_type_for_type_member): Deleted. (CppGenerator.cpp_type_for_type_with_name): Deleted. (CppGenerator.cpp_type_for_formal_out_parameter): Deleted. (CppGenerator.cpp_type_for_formal_async_parameter): Deleted. (CppGenerator.cpp_type_for_stack_in_parameter): Deleted. (CppGenerator.cpp_type_for_stack_out_parameter): Deleted. (CppGenerator.cpp_assertion_method_for_type_member): Deleted. (CppGenerator.cpp_assertion_method_for_type_member.assertion_method_for_type): Deleted. (CppGenerator.should_use_wrapper_for_return_type): Deleted. (CppGenerator.should_use_references_for_type): Deleted. (CppGenerator.should_pass_by_copy_for_return_type): Deleted. * inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py: (CppAlternateBackendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppAlternateBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command): * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: (CppBackendDispatcherHeaderGenerator.generate_output): (CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain): (CppBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command): (CppBackendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter): Deleted. * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: (CppBackendDispatcherImplementationGenerator._generate_secondary_header_includes): (CppBackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain): (CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain): (CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: (CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): (CppFrontendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_event): * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: (CppFrontendDispatcherImplementationGenerator._generate_secondary_header_includes): (CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event): * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_secondary_header_includes): (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain): (CppProtocolTypesImplementationGenerator._generate_open_field_names): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: (ObjCBackendDispatcherHeaderGenerator._generate_objc_handler_declaration_for_command): * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: (ObjCBackendDispatcherImplementationGenerator._generate_handler_implementation_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_success_block_for_command.and): (ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command.in_param_expression): (ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command): (ObjCBackendDispatcherImplementationGenerator._generate_invocation_for_command): * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py: (ObjCFrontendDispatcherImplementationGenerator._generate_event): (ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters): * inspector/scripts/codegen/objc_generator_templates.py: * inspector/scripts/codegen/objc_generator.py: (ObjCGenerator.protocol_type_for_type): (ObjCGenerator.objc_type_for_param_internal): (ObjCGenerator.objc_protocol_import_expression_for_parameter): * inspector/protocol/Page.json: Now that enums are processed before being passed to backend dispacher handlers, the `appearance` parameter of `Page.setForcedAppearance` must be marked `optional` as there's no way for it to accept an empty string, as that's not possible for an enum. * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorAgent.cpp: * inspector/agents/InspectorAuditAgent.h: * inspector/agents/InspectorAuditAgent.cpp: * inspector/agents/InspectorConsoleAgent.h: * inspector/agents/InspectorConsoleAgent.cpp: * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: * inspector/agents/InspectorHeapAgent.h: * inspector/agents/InspectorHeapAgent.cpp: * inspector/agents/InspectorRuntimeAgent.h: * inspector/agents/InspectorRuntimeAgent.cpp: * inspector/agents/InspectorScriptProfilerAgent.h: * inspector/agents/InspectorScriptProfilerAgent.cpp: * inspector/agents/InspectorTargetAgent.h: * inspector/agents/InspectorTargetAgent.cpp: * inspector/agents/JSGlobalObjectAuditAgent.h: * inspector/agents/JSGlobalObjectAuditAgent.cpp: * inspector/agents/JSGlobalObjectDebuggerAgent.h: * inspector/agents/JSGlobalObjectDebuggerAgent.cpp: * inspector/agents/JSGlobalObjectRuntimeAgent.h: * inspector/agents/JSGlobalObjectRuntimeAgent.cpp: * inspector/JSGlobalObjectConsoleClient.cpp: * inspector/JSGlobalObjectInspectorController.cpp: Elided backend dispatcher handler changes describe above. * bindings/ScriptValue.cpp: (Inspector::jsToInspectorValue): * inspector/AsyncStackTrace.h: * inspector/AsyncStackTrace.cpp: (Inspector::AsyncStackTrace::buildInspectorObject const): * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::addToFrontend): * inspector/InjectedScriptBase.h: * inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeEvalCall): (Inspector::InjectedScriptBase::checkCallResult): (Inspector::InjectedScriptBase::checkAsyncCallResult): * inspector/InjectedScript.h: * inspector/InjectedScript.cpp: (Inspector::InjectedScript::execute): (Inspector::InjectedScript::evaluate): (Inspector::InjectedScript::callFunctionOn): (Inspector::InjectedScript::evaluateOnCallFrame): (Inspector::InjectedScript::getFunctionDetails): (Inspector::InjectedScript::functionDetails): (Inspector::InjectedScript::getPreview): (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): (Inspector::InjectedScript::getInternalProperties): (Inspector::InjectedScript::getCollectionEntries): (Inspector::InjectedScript::saveResult): (Inspector::InjectedScript::wrapCallFrames const): (Inspector::InjectedScript::wrapObject const): (Inspector::InjectedScript::wrapJSONString const): (Inspector::InjectedScript::wrapTable const): (Inspector::InjectedScript::previewValue const): * inspector/InjectedScriptManager.cpp: (Inspector::InjectedScriptManager::injectedScriptForObjectId): * inspector/InspectorBackendDispatcher.h: * inspector/InspectorBackendDispatcher.cpp: (Inspector::BackendDispatcher::CallbackBase::sendSuccess): (Inspector::BackendDispatcher::dispatch): (Inspector::BackendDispatcher::sendResponse): (Inspector::BackendDispatcher::getPropertyValue): (Inspector::BackendDispatcher::getBoolean): (Inspector::BackendDispatcher::getInteger): (Inspector::BackendDispatcher::getDouble): (Inspector::BackendDispatcher::getString): (Inspector::BackendDispatcher::getValue): (Inspector::BackendDispatcher::getObject): (Inspector::BackendDispatcher::getArray): (Inspector::castToInteger): Deleted. (Inspector::castToNumber): Deleted. * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast): (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::extractEvent): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::pushListingsNow): * runtime/TypeSet.cpp: (JSC::StructureShape::inspectorRepresentation): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. * inspector/scripts/tests/enum-values.json: * inspector/scripts/tests/expected/command-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/expected/domain-debuggableTypes.json-result: * inspector/scripts/tests/expected/domain-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/domain-targetTypes.json-result: * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/expected/enum-values.json-result: * inspector/scripts/tests/expected/event-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/expected/events-with-optional-parameters.json-result: * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/expected/same-type-id-different-domain.json-result: * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result: * inspector/scripts/tests/expected/should-strip-comments.json-result: * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: * inspector/scripts/tests/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: * inspector/scripts/tests/expected/type-declaration-object-type.json-result: * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: * inspector/scripts/tests/expected/type-with-open-parameters.json-result: * inspector/scripts/tests/expected/version.json-result: Source/WebCore: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * inspector/InspectorAuditResourcesObject.cpp: * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: * inspector/InspectorController.cpp: * inspector/InspectorStyleSheet.h: * inspector/InspectorStyleSheet.cpp: * inspector/agents/InspectorAnimationAgent.h: * inspector/agents/InspectorAnimationAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCPUProfilerAgent.h: * inspector/agents/InspectorCPUProfilerAgent.cpp: * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorCSSAgent.cpp: * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: * inspector/agents/InspectorDatabaseAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorIndexedDBAgent.cpp: * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: * inspector/agents/InspectorMemoryAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/InspectorWorkerAgent.h: * inspector/agents/InspectorWorkerAgent.cpp: * inspector/agents/WebConsoleAgent.h: * inspector/agents/WebDebuggerAgent.h: * inspector/agents/WebDebuggerAgent.cpp: * inspector/agents/WebHeapAgent.h: * inspector/agents/WebHeapAgent.cpp: * inspector/agents/page/PageAuditAgent.h: * inspector/agents/page/PageAuditAgent.cpp: * inspector/agents/page/PageConsoleAgent.h: * inspector/agents/page/PageConsoleAgent.cpp: * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: * inspector/agents/page/PageDebuggerAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageHeapAgent.h: * inspector/agents/page/PageHeapAgent.cpp: * inspector/agents/page/PageNetworkAgent.h: * inspector/agents/page/PageNetworkAgent.cpp: * inspector/agents/page/PageRuntimeAgent.h: * inspector/agents/page/PageRuntimeAgent.cpp: * inspector/agents/worker/ServiceWorkerAgent.h: * inspector/agents/worker/ServiceWorkerAgent.cpp: * inspector/agents/worker/WorkerAuditAgent.h: * inspector/agents/worker/WorkerConsoleAgent.h: * inspector/agents/worker/WorkerAuditAgent.cpp: * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: * inspector/agents/worker/WorkerDebuggerAgent.h: * inspector/agents/worker/WorkerDebuggerAgent.cpp: * inspector/agents/worker/WorkerNetworkAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: * inspector/agents/worker/WorkerRuntimeAgent.h: * inspector/agents/worker/WorkerRuntimeAgent.cpp: Elided backend dispatcher handler changes describe above. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): (WebCore::CommandLineAPIHost::clearConsoleMessages): * inspector/InspectorFrontendHost.cpp: (WebCore::valuePayloadFromJSONValue): (WebCore::InspectorFrontendHost::logDiagnosticEvent): * inspector/TimelineRecordFactory.h: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::appendLayoutRoot): * Modules/applicationmanifest/ApplicationManifestParser.cpp: (WebCore::ApplicationManifestParser::parseManifest): (WebCore::ApplicationManifestParser::parseStartURL): (WebCore::ApplicationManifestParser::parseDisplay): (WebCore::ApplicationManifestParser::parseScope): (WebCore::ApplicationManifestParser::parseGenericString): * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): * platform/encryptedmedia/CDMUtilities.cpp: (WebCore::CDMUtilities::parseJSONObject): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::parseLicenseReleaseAcknowledgementFormat): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::parseJSONValue): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WebDriver: * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): * Session.cpp: (WebDriver::firstWindowHandleInResult): (WebDriver::Session::getTimeouts): (WebDriver::Session::createTopLevelBrowsingContext): (WebDriver::Session::handleUserPrompts): (WebDriver::Session::reportUnexpectedAlertOpen): (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::getWindowHandle): (WebDriver::Session::closeTopLevelBrowsingContext): (WebDriver::Session::switchToWindow): (WebDriver::Session::getWindowHandles): (WebDriver::Session::newWindow): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::getToplevelBrowsingContextRect): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::createElement): (WebDriver::Session::extractElementID): (WebDriver::Session::computeElementLayout): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::waitForNavigationToComplete): (WebDriver::Session::elementIsFileUpload): (WebDriver::Session::parseElementIsFileUploadResult): (WebDriver::Session::selectOptionElement): (WebDriver::Session::elementClick): (WebDriver::Session::elementIsEditable): (WebDriver::Session::elementClear): (WebDriver::Session::setInputFileUploadFiles): (WebDriver::Session::elementSendKeys): (WebDriver::Session::getPageSource): (WebDriver::Session::handleScriptResult): (WebDriver::Session::executeScript): (WebDriver::Session::performMouseInteraction): (WebDriver::Session::performKeyboardInteractions): (WebDriver::builtAutomationCookie): (WebDriver::serializeCookie): (WebDriver::Session::getAllCookies): (WebDriver::Session::getNamedCookie): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::releaseActions): (WebDriver::Session::dismissAlert): (WebDriver::Session::acceptAlert): (WebDriver::Session::getAlertText): (WebDriver::Session::sendAlertText): (WebDriver::Session::takeScreenshot): * SessionHost.cpp: (WebDriver::SessionHost::dispatchMessage): * WebDriverService.h: * WebDriverService.cpp: (WebDriver::WebDriverService::handleRequest): (WebDriver::WebDriverService::sendResponse const): (WebDriver::valueAsNumberInRange): (WebDriver::deserializeTimeouts): (WebDriver::deserializeProxy): (WebDriver::WebDriverService::parseCapabilities const): (WebDriver::WebDriverService::findSessionOrCompleteWithError): (WebDriver::WebDriverService::validatedCapabilities const): (WebDriver::WebDriverService::mergeCapabilities const): (WebDriver::WebDriverService::matchCapabilities const): (WebDriver::WebDriverService::processCapabilities const): (WebDriver::WebDriverService::createSession): (WebDriver::WebDriverService::deleteSession): (WebDriver::WebDriverService::go): (WebDriver::WebDriverService::setWindowRect): (WebDriver::WebDriverService::closeWindow): (WebDriver::WebDriverService::switchToWindow): (WebDriver::WebDriverService::newWindow): (WebDriver::WebDriverService::switchToFrame): (WebDriver::findElementOrCompleteWithError): (WebDriver::findStrategyAndSelectorOrCompleteWithError): (WebDriver::WebDriverService::getElementAttribute): (WebDriver::WebDriverService::getElementProperty): (WebDriver::WebDriverService::getElementCSSValue): (WebDriver::WebDriverService::elementSendKeys): (WebDriver::findScriptAndArgumentsOrCompleteWithError): (WebDriver::WebDriverService::getNamedCookie): (WebDriver::deserializeCookie): (WebDriver::WebDriverService::addCookie): (WebDriver::WebDriverService::deleteCookie): (WebDriver::processPauseAction): (WebDriver::processNullAction): (WebDriver::processKeyAction): (WebDriver::processPointerAction): (WebDriver::processPointerParameters): (WebDriver::processInputActionSequence): (WebDriver::WebDriverService::performActions): (WebDriver::WebDriverService::sendAlertText): * WebDriver/gtk/WebDriverServiceGtk.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): * WebDriver/win/WebDriverServiceWin.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): * WebDriver/wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformMatchCapability): (WebDriver::WebDriverService::platformValidateCapability): (WebDriver::WebDriverService::platformParseCapabilities): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WebInspectorUI: * UserInterface/Controllers/CSSManager.js: (WI.CSSManager.prototype.set forcedAppearance): Now that enums are processed before being passed to backend dispacher handlers, the `appearance` parameter of `Page.setForcedAppearance` must be marked `optional` as there's no way for it to accept an empty string, as that's not possible for an enum. As such, rework the frontend logic for invoking `Page.setForcedAppearance` to instead not provide an `appearance` parameter at all when wanting to "unset" it. * UserInterface/Views/SettingsTabContentView.js: (WI.SettingsTabContentView.prototype._createConsoleSettingsView): Now that all logging channels matching a `Console.ChannelSource` are returned instead of just the hardcoded list, check for a matching `WI.UIString` before showing a `<select>`. Source/WebKit: Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * UIProcess/Automation/Automation.json: `CoordinateSystem` has `Page` and `Viewport` enum values, but `WebAutomationSession` checks for `"Page"` and `"LayoutViewport"`. Add a `LayoutViewport` enum value now that enums are processed before being passed to backend dispacher handlers to preserve functionality. * UIProcess/Inspector/Agents/InspectorBrowserAgent.h: * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp: * UIProcess/Automation/WebAutomationSessionMacros.h: * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Elided backend dispatcher handler changes describe above. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setTargetList): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. Source/WTF: * wtf/JSONValues.h: (WTF::JSONImpl::ObjectBase::setValue): (WTF::JSONImpl::ObjectBase::setObject): (WTF::JSONImpl::ObjectBase::setArray): (WTF::JSONImpl::ArrayBase::pushValue): (WTF::JSONImpl::ArrayBase::pushObject): (WTF::JSONImpl::ArrayBase::pushArray): (WTF::JSONImpl::ArrayOf::ArrayOf): Deleted. (WTF::JSONImpl::ArrayOf::castedArray): Deleted. (WTF::JSONImpl::ArrayOf::addItem): Deleted. (WTF::JSONImpl::ArrayOf::create): Deleted. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::asValue): (WTF::JSONImpl::Value::asObject): (WTF::JSONImpl::Value::asArray): (WTF::JSONImpl::Value::parseJSON): (WTF::JSONImpl::Value::asBoolean const): (WTF::JSONImpl::Value::asDouble const): (WTF::JSONImpl::Value::asInteger const): (WTF::JSONImpl::Value::asString const): (WTF::JSONImpl::ObjectBase::asObject): (WTF::JSONImpl::ObjectBase::memoryCost const): (WTF::JSONImpl::ObjectBase::getBoolean const): (WTF::JSONImpl::ObjectBase::getDouble const): (WTF::JSONImpl::ObjectBase::getInteger const): (WTF::JSONImpl::ObjectBase::getString const): (WTF::JSONImpl::ObjectBase::getObject const): (WTF::JSONImpl::ObjectBase::getArray const): (WTF::JSONImpl::ObjectBase::getValue const): (WTF::JSONImpl::ObjectBase::ObjectBase): (WTF::JSONImpl::ArrayBase::asArray): (WTF::JSONImpl::ArrayBase::writeJSON const): (WTF::JSONImpl::ArrayBase::ArrayBase): (WTF::JSONImpl::ArrayBase::get const): (WTF::JSONImpl::ArrayBase::memoryCost const): (WTF::JSONImpl::ObjectBase::openAccessors): Deleted. Use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently assumed to exist. Remove unused overloads and allow subclasses to call `as*` instead of `openAccessors` as they're effectively the same thing. Tools: * TestWebKitAPI/Tests/WTF/JSONValue.cpp: LayoutTests: * inspector/canvas/requestShaderSource-expected.txt: * inspector/canvas/updateShader-expected.txt: * inspector/console/webcore-logging-expected.txt: * inspector/dom/highlightQuad-expected.txt: * inspector/worker/dom-debugger-dom-breakpoints-expected.txt: Canonical link: https://commits.webkit.org/229208@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-10 19:23:17 +00:00
bool WebDriverService::platformMatchCapability(const String&, const Ref<JSON::Value>&) const
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
{
return true;
}
void WebDriverService::platformParseCapabilities(const JSON::Object& matchedCapabilities, Capabilities& capabilities) const
{
[PlayStation][WinCairo] Enable WebDriver target on PlayStation and client for WinCairo https://bugs.webkit.org/show_bug.cgi?id=216908 Reviewed by Don Olmstead. Source/JavaScriptCore: Implement automation session correctly for PlayStation and WinCairo. * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::parseTargetListJSON): * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::stopInternal): (Inspector::RemoteInspector::requestAutomationSession): (Inspector::RemoteInspector::startAutomationSession): Source/WebDriver: Extend WebDriver client binary to support connection to remote device for both PlayStation and WinCairo. We've implemented a simple web server to accept WebDriver request natively and bypass them to RemoteInspector. * Capabilities.h: * HTTPServer.h: * PlatformPlayStation.cmake: Added. * PlatformWin.cmake: * SessionHost.h: (WebDriver::SessionHost::setHostAddress): * WebDriverMain.cpp: (main): (dllLauncherEntryPoint): * WebDriverService.cpp: (WebDriver::printUsageStatement): (WebDriver::WebDriverService::run): (WebDriver::WebDriverService::connectToBrowser): * WebDriverService.h: * gtk/WebDriverServiceGtk.cpp: (WebDriver::WebDriverService::platformInit): * playstation/WebDriverServicePlayStation.cpp: Copied from Source\WebDriver\win\WebDriverServiceWin.cpp. (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): (WebDriver::WebDriverService::platformSupportProxyType const): * socket/CapabilitiesSocket.cpp: Copied from Source\WebDriver\socket\SessionHostSocket.cpp. (WebDriver::CapabilitiesSocket::parseCapabilities): * socket/CapabilitiesSocket.h: Copied from Source\WebDriver\socket\HTTPServerSocket.cpp. * socket/HTTPParser.cpp: Added. (WebDriver::HTTPParser::parse): (WebDriver::HTTPParser::handlePhase): (WebDriver::HTTPParser::abortProcess): (WebDriver::HTTPParser::parseFirstLine): (WebDriver::HTTPParser::readLine): (WebDriver::HTTPParser::expectedBodyLength const): * socket/HTTPParser.h: Copied from Source\WebDriver\HTTPServer.h. (WebDriver::HTTPParser::pullMessage): * socket/HTTPServerSocket.cpp: (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): (WebDriver::HTTPServer::doAccept): (WebDriver::HTTPServer::didClose): (WebDriver::HTTPRequestHandler::connect): (WebDriver::HTTPRequestHandler::reset): (WebDriver::HTTPRequestHandler::didReceive): (WebDriver::HTTPRequestHandler::sendResponse): (WebDriver::HTTPRequestHandler::packHTTPMessage const): (WebDriver::HTTPRequestHandler::didClose): * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::dispatchMap): (WebDriver::SessionHost::sendWebInspectorEvent): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::didClose): (WebDriver::SessionHost::parseTargetList): (WebDriver::SessionHost::receivedSetTargetList): (WebDriver::SessionHost::receivedSendMessageToFrontend): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::setTargetList): (WebDriver::SessionHost::sendMessageToBackend): * win/WebDriverServiceWin.cpp: (WebDriver::WebDriverService::platformInit): (WebDriver::WebDriverService::platformParseCapabilities const): * wpe/WebDriverServiceWPE.cpp: (WebDriver::WebDriverService::platformInit): Canonical link: https://commits.webkit.org/229926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-30 21:22:57 +00:00
CapabilitiesSocket::parseCapabilities(matchedCapabilities, capabilities);
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
}
WebDriver: implement proxy support https://bugs.webkit.org/show_bug.cgi?id=180408 Reviewed by Carlos Alberto Lopez Perez. Source/JavaScriptCore: Add optional Proxy struct to session capabilities. * inspector/remote/RemoteInspector.h: * inspector/remote/glib/RemoteInspectorServer.cpp: (Inspector::processSessionCapabilities): Source/WebDriver: Handle proxy object in capabilities. * Capabilities.h: Add Proxy struct. * WebDriverService.cpp: (WebDriver::deserializeProxy): Deserialize the proxy from capabilities. (WebDriver::WebDriverService::parseCapabilities const): Get the deserialized proxy. (WebDriver::WebDriverService::validatedCapabilities const): Ensure proxy object is valid. (WebDriver::WebDriverService::matchCapabilities const): Check proxy type is supported by the platform. (WebDriver::WebDriverService::createSession): Only set an empty proxy object in capabilities if we don't have a deserialized proxy. * WebDriverService.h: * glib/SessionHostGlib.cpp: (WebDriver::SessionHost::buildSessionCapabilities const): Send the proxy settings to the browser. * glib/WebDriverServiceGLib.cpp: (WebDriver::WebDriverService::platformSupportProxyType const): Return false if proxy type is "pac". Source/WebKit: * UIProcess/API/glib/WebKitAutomationSession.cpp: (parseProxyCapabilities): Parse the proxy settings from capabilities. (webkitAutomationSessionCreate): Set the proxy settings received from capabilities. WebDriverTests: Unskip the tests that are now passing. * TestExpectations.json: Canonical link: https://commits.webkit.org/217382@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-11 15:16:16 +00:00
bool WebDriverService::platformSupportProxyType(const String&) const
{
return false;
}
[WinCairo] Build WebDriver https://bugs.webkit.org/show_bug.cgi?id=198056 Reviewed by Carlos Garcia Campos. .: Add ENABLE_WEBDRIVER as an experimental feature for WinCairo. * Source/cmake/OptionsWin.cmake: Source/WebDriver: Add the platform and source files to get WinCairo to compile a WebDriver executable. * CMakeLists.txt: * PlatformWin.cmake: Added. * Session.cpp: (WebDriver::Session::go): (WebDriver::Session::getCurrentURL): (WebDriver::Session::back): (WebDriver::Session::forward): (WebDriver::Session::refresh): (WebDriver::Session::getTitle): (WebDriver::Session::switchToFrame): (WebDriver::Session::switchToParentFrame): (WebDriver::Session::setWindowRect): (WebDriver::Session::maximizeWindow): (WebDriver::Session::minimizeWindow): (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::getActiveElement): (WebDriver::Session::isElementSelected): (WebDriver::Session::getElementText): (WebDriver::Session::getElementTagName): (WebDriver::Session::getElementRect): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::getElementProperty): (WebDriver::Session::getElementCSSValue): (WebDriver::Session::elementClick): (WebDriver::Session::elementClear): (WebDriver::Session::elementSendKeys): (WebDriver::Session::executeScript): (WebDriver::Session::getAllCookies): (WebDriver::Session::addCookie): (WebDriver::Session::deleteCookie): (WebDriver::Session::deleteAllCookies): (WebDriver::Session::performActions): (WebDriver::Session::takeScreenshot): With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested lambda. * socket/HTTPServerSocket.cpp: Added. (WebDriver::HTTPServer::listen): (WebDriver::HTTPServer::disconnect): Add stubs for HTTPServer when using a raw socket. * socket/SessionHostSocket.cpp: Added. (WebDriver::SessionHost::~SessionHost): (WebDriver::SessionHost::connectToBrowser): (WebDriver::SessionHost::isConnected const): (WebDriver::SessionHost::startAutomationSession): (WebDriver::SessionHost::sendMessageToBackend): Add stubs for SessionHost when using a raw socket. * win/WebDriverServiceWin.cpp: Added. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformCompareBrowserVersions): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Add stubs for WebDriverService on Windows. Canonical link: https://commits.webkit.org/212160@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-05-21 13:10:52 +00:00
} // namespace WebDriver