haikuwebkit/Source/WebDriver/glib/WebDriverServiceGLib.cpp

89 lines
3.2 KiB
C++
Raw Permalink Normal View History

[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
/*
* Copyright (C) 2017 Igalia S.L.
*
* 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"
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
#include <wtf/text/StringToIntegerConversion.h>
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
namespace WebDriver {
static bool parseVersion(const String& version, uint64_t& major, uint64_t& minor, uint64_t& micro)
{
major = minor = micro = 0;
String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter https://bugs.webkit.org/show_bug.cgi?id=187963 Reviewed by Alex Christensen. Source/JavaScriptCore: * inspector/InspectorBackendDispatcher.cpp: (Inspector::BackendDispatcher::dispatch): * jsc.cpp: (ModuleName::ModuleName): (resolvePath): * runtime/IntlObject.cpp: (JSC::canonicalizeLanguageTag): (JSC::removeUnicodeLocaleExtension): Update split/splitAllowingEmptyEntries usage. Source/WebCore: * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::convert): * Modules/cache/DOMCache.cpp: (WebCore::hasResponseVaryStarHeaderValue): * Modules/cache/DOMCacheEngine.cpp: (WebCore::DOMCacheEngine::queryCacheMatch): * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::filterICECandidate): (WebCore::PeerConnectionBackend::filterSDP const): * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::checkResponseHeaders): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::determineARIADropEffects): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineARIADropEffects): * accessibility/AccessibilityRenderObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::shouldCancelDefaultAction): * editing/markup.cpp: (WebCore::fillContainerFromString): (WebCore::createFragmentFromText): * html/EmailInputType.cpp: (WebCore::EmailInputType::typeMismatchFor const): (WebCore::EmailInputType::sanitizeValue const): * html/HTMLInputElement.cpp: (WebCore::parseAcceptAttribute): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::setMessageDOMAndStartTimer): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::compileShader): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): * loader/FormSubmission.cpp: (WebCore::encodingFromAcceptCharset): * loader/ResourceTiming.cpp: (WebCore::passesTimingAllowCheck): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): (WebCore::parseDialogFeaturesMap): * platform/URL.cpp: (WebCore::isIPv4Address): (WebCore::isIPv6Address): * platform/graphics/GLContext.cpp: (WebCore::GLContext::version): * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::patternToFamilies): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::extractGStreamerOptionsFromCommandLine): * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions): * platform/gtk/PasteboardHelper.cpp: (WebCore::PasteboardHelper::fillSelectionData): * platform/gtk/SelectionData.cpp: (WebCore::SelectionData::setURIList): * platform/network/CacheValidation.cpp: (WebCore::collectVaryingRequestHeaders): * platform/network/HTTPParsers.cpp: (WebCore::filenameFromHTTPContentDisposition): (WebCore::parseXFrameOptionsHeader): (WebCore::parseAccessControlExposeHeadersAllowList): * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieHeader): * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::loadResponseHeaders): * platform/network/curl/CurlCacheManager.cpp: (WebCore::CurlCacheManager::loadIndex): * platform/network/soup/CookieJarSoup.cpp: (WebCore::setCookiesFromDOM): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::parseAttribute): * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::parseBeginOrEnd): * testing/MockCDMFactory.cpp: (WebCore::MockCDM::sanitizeResponse const): (WebCore::MockCDMInstance::updateLicense): Update split/splitAllowingEmptyEntries usage. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::findCommand): * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Update split/splitAllowingEmptyEntries usage. Source/WebKit: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::updateVaryInformation): * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::getPluginInfoFromPropertyLists): (WebKit::PluginVersion::parse): * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: (WebKit::NetscapePluginModule::parseMIMEDescription): * Shared/Plugins/unix/PluginSearchPath.cpp: (WebKit::pluginsDirectories): * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::initializeSandbox): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::isTransparentSilverlightBackgroundValue): Update split/splitAllowingEmptyEntries usage. Source/WebKitLegacy/win: * Plugins/PluginPackageWin.cpp: (WebCore::PluginPackage::fetchInfo): Update split/splitAllowingEmptyEntries usage. Source/WTF: * wtf/Assertions.cpp: Update split/splitAllowingEmptyEntries usage. * wtf/text/StringView.h: (WTF::StringView::splitAllowingEmptyEntries const): * wtf/text/WTFString.cpp: (WTF::String::splitInternal const): (WTF::String::split const): (WTF::String::splitAllowingEmptyEntries const): * wtf/text/WTFString.h: (WTF::String::split const): Introduce splitAllowingEmptyEntries instead of boolean or enum parameter. Tools: * TestWebKitAPI/Tests/WTF/WTFString.cpp: Add tests for String::split and String::splitAllowingEmptyEntries. * TestWebKitAPI/Tests/WTF/StringView.cpp: * WebKitTestRunner/TestController.cpp: (WTR::updateTestOptionsFromTestHeader): Update split/splitAllowingEmptyEntries usage. Canonical link: https://commits.webkit.org/203220@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-26 22:00:03 +00:00
Vector<String> tokens = version.split('.');
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
switch (tokens.size()) {
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
case 3: {
auto parsedMicro = parseIntegerAllowingTrailingJunk<uint64_t>(tokens[2]);
if (!parsedMicro)
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
return false;
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
micro = *parsedMicro;
}
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
FALLTHROUGH;
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
case 2: {
auto parsedMinor = parseIntegerAllowingTrailingJunk<uint64_t>(tokens[1]);
if (!parsedMinor)
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
return false;
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
minor = *parsedMinor;
}
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
FALLTHROUGH;
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
case 1: {
auto parsedMajor = parseIntegerAllowingTrailingJunk<uint64_t>(tokens[0]);
if (!parsedMajor)
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
return false;
Remove all remaining uses of the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225580 Reviewed by Sam Weinig. Source/WebCore: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): Use parseInteger<uint64_t> instead of String::toUInt64Strict. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): Ditto. * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::WebSocketExtensionDeflateFrame): Use a reference instead of a pointer. (WebCore::WebSocketExtensionDeflateFrame::processResponse): Use ASCIILiteral. Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Use auto. Use references instead of pointers. (WebCore::DeflateResultHolder::DeflateResultHolder): Use a reference. (WebCore::DeflateResultHolder::~DeflateResultHolder): Ditto. (WebCore::InflateResultHolder::InflateResultHolder): Ditto. (WebCore::InflateResultHolder::~InflateResultHolder): Ditto. (WebCore::WebSocketDeflateFramer::WebSocketDeflateFramer): Deleted. (WebCore::WebSocketDeflateFramer::createExtensionProcessor): Pass a reference. (WebCore::WebSocketDeflateFramer::deflate): Ditto. (WebCore::WebSocketDeflateFramer::inflate): Ditto. * Modules/websockets/WebSocketDeflateFramer.h: Use forward declarations instead of includes, references instead of pointers, initialize data members in the class definition, and remove an unnecessary explicit default constructor. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::headerHasValidHTTPVersion): Use parseInteger<int> instead of StringView::toIntStrict. (WebCore::WebSocketHandshake::readStatusLine): Ditto. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::headingLevel const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityNodeObject::hierarchicalLevel const): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::getIntegralAttribute const): Added. Since AccessibilityObject has its own getAttribute function, we need to re-implement Element::getIntegralAttribute here. (WebCore::AccessibilityObject::setSize const): Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityObject::posInSet const): Ditto. * accessibility/AccessibilityObject.h: Added getIntegralAttribute. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const):Use getIntegralAttribute instead of AtomString::toInt. (WebCore::AccessibilityTable::axColumnCount const): Ditto. (WebCore::AccessibilityTable::axRowCount const): Ditto. * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::axColumnIndex const): Ditto. (WebCore::AccessibilityTableCell::axRowIndex const): Ditto. (WebCore::AccessibilityTableCell::axColumnSpan const): Ditto. (WebCore::AccessibilityTableCell::axRowSpan const): Ditto. * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::axColumnIndex const): Ditto. (WebCore::AccessibilityTableRow::axRowIndex const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Use parseInteger<int> instead of String::toIntStrict * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::consumeEscape): Use parseInteger<uint32_t> instead of String::toUIntStrict. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. Also use StringView instead of String. (WebCore::dataDetectorStringForPath): Use makeString instead of StringBuilder. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::computedAttributesForElement): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForPath): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): Use parseHTMLInteger instead of AtomString::toInt. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Use parseInteger<uint64_t> instead of String::toUIntStrict. * loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Use parseInteger<uint64_t> instead of String::toUInt64Strict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use getIntegralAttribute instead of parseIntegerAllowingTrailingJunk<int>. * page/EventSource.cpp: (WebCore::EventSource::parseEventStreamLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of charactersToUInt64. * page/Location.cpp: (WebCore::Location::setPort): Use parseInteger<uint16_t> instead of parseUInt16. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::fromDatabaseIdentifier): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toInt, which allows us to remove some range checking and type conversion. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): Use parseIntegerAllowingTrailingJunk<int> instead of StringView::toInt. * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parsePort): Use parseInteger<uint16_t> instead of charactersToIntStrict. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::collectCPUUsage): Use parseInteger<pid_t> instead of String::toIntStrict. Also removed unneeded special cases for "." and ".." since both will fail to parse as an integer, and this no longer need to put d_name into a WTF::String. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): Use parseInteger<int> instead of String::toInt to parse a single-digit. Probably should write this another way. * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): Use parseIntegerAllowingTrailingJunk<int64_t> instead of String::toInt64. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::setResponseFromCachedHeaders): Use parseIntegerAllowingTrailingJunk<long long> instead of String::toInt64. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendOS2Table): Use parseHTMLInteger instead of parseIntegerAllowingTrailingJunk<int>. Might be even better to refactor to use getIntegralAttribute later. (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto. * testing/Internals.cpp: (WebCore::Internals::setSFrameCounter): Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. Source/WebDriver: * WebDriverService.cpp: (WebDriver::WebDriverService::run): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of String::toUInt. * glib/WebDriverServiceGLib.cpp: (WebDriver::parseVersion): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toInt64, and then assigning into a uint64_t. * socket/HTTPParser.cpp: (WebDriver::HTTPParser::expectedBodyLength const): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toInt. Also use StringView instead of String::substringSharingImpl and dropped an unneeded call to String::stripWhiteSpace. Source/WebKitLegacy/win: * Plugins/PluginDatabaseWin.cpp: (WebCore::parseVersionString): Use parseIntegerAllowinTrailingJunk<int> isnstead of String::toInt. * Plugins/PluginView.cpp: (WebCore::PluginView::handlePost): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toInt, and then assigning to an unsigned. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::numberAttributeValue): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. (WTR::AccessibilityUIElement::hierarchicalLevel const): Ditto. Canonical link: https://commits.webkit.org/237536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 16:57:02 +00:00
major = *parsedMajor;
}
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
break;
default:
return false;
}
return true;
}
bool WebDriverService::platformCompareBrowserVersions(const String& requiredVersion, const String& proposedVersion)
{
// We require clients to use format major.micro.minor as version string.
uint64_t requiredMajor, requiredMinor, requiredMicro;
if (!parseVersion(requiredVersion, requiredMajor, requiredMinor, requiredMicro))
return false;
uint64_t proposedMajor, proposedMinor, proposedMicro;
if (!parseVersion(proposedVersion, proposedMajor, proposedMinor, proposedMicro))
return false;
return proposedMajor > requiredMajor
|| (proposedMajor == requiredMajor && proposedMinor > requiredMinor)
|| (proposedMajor == requiredMajor && proposedMinor == requiredMinor && proposedMicro >= requiredMicro);
}
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& proxyType) const
{
return proxyType != "pac";
}
[WPE] Add initial support for WebDriver https://bugs.webkit.org/show_bug.cgi?id=179727 Reviewed by Michael Catanzaro. .: Enable WebDriver by default in WPE. * Source/cmake/OptionsWPE.cmake: Source/WebDriver: Add WPE implementation for platform-specific methods. Move the version handling to a common file WebDriverServiceGLib.cpp. * Capabilities.h: * PlatformGTK.cmake: * PlatformWPE.cmake: * glib/WebDriverServiceGLib.cpp: Added. (WebDriver::parseVersion): (WebDriver::WebDriverService::platformCompareBrowserVersions): * gtk/WebDriverServiceGtk.cpp: * wpe/WebDriverServiceWPE.cpp: Copied from Source/WebDriver/gtk/WebDriverServiceGtk.cpp. (WebDriver::WebDriverService::platformCapabilities): (WebDriver::WebDriverService::platformValidateCapability const): (WebDriver::WebDriverService::platformMatchCapability const): (WebDriver::WebDriverService::platformParseCapabilities const): Tools: Make it possible to run WebDriver tests with WPE. * Scripts/run-webdriver-tests: Add --wpe alias for --platform=wpe. * Scripts/webkitpy/port/wpe.py: (WPEPort.__init__): Initialize _display_server from options. (WPEPort._driver_class): Use WaylandDriver when wayland is passed as display server option. * Scripts/webkitpy/webdriver_tests/webdriver_driver.py: (WebDriver.browser_env): Add virtual method to get the environment that should be used. * Scripts/webkitpy/webdriver_tests/webdriver_driver_wpe.py: Copied from Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver.py. (WebDriverWPE): (WebDriverWPE.__init__): (WebDriverWPE.binary_path): (WebDriverWPE.browser_name): (WebDriverWPE.capabilities): (WebDriverWPE.browser_env): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: (WebDriverW3CExecutor.__init__): Update the environment with the one provided by the driver. * wpe/jhbuild.modules: Upgrade dyz to newer version that supports automation. Canonical link: https://commits.webkit.org/195790@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-16 12:48:22 +00:00
} // namespace WebDriver