Title: [239477] trunk
Revision
239477
Author
[email protected]
Date
2018-12-20 16:40:09 -0800 (Thu, 20 Dec 2018)

Log Message

Use Optional::hasValue() instead of Optional::has_value()
https://bugs.webkit.org/show_bug.cgi?id=192948

Reviewed by Tim Horton.

Source/_javascript_Core:

* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):

Source/WebCore:

* bindings/js/DOMPromiseProxy.h:
(WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
(WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
(WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::hasItems const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::captionDisplayMode):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::wouldTaintOrigin const):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcUpdatePresentationSize):
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::ScrollerStyle::recommendedScrollerStyle):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::setExplicitValue):

Source/WebKit:

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::AutomationCommandError::toProtocolString):
(WebKit::WebAutomationSession::willClosePage):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):

Source/WTF:

* wtf/Hasher.h:
(WTF::add):
* wtf/Optional.h:

Tools:

* TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (239476 => 239477)


--- trunk/Source/_javascript_Core/ChangeLog	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1,3 +1,14 @@
+2018-12-20  Chris Dumez  <[email protected]>
+
+        Use Optional::hasValue() instead of Optional::has_value()
+        https://bugs.webkit.org/show_bug.cgi?id=192948
+
+        Reviewed by Tim Horton.
+
+        * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
+        (CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
+        (CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
+
 2018-12-20  Keith Miller  <[email protected]>
 
         Add support for globalThis

Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py (239476 => 239477)


--- trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py	2018-12-21 00:40:09 UTC (rev 239477)
@@ -169,7 +169,7 @@
 
             if parameter.is_optional:
                 if CppGenerator.should_use_wrapper_for_return_type(parameter.type):
-                    out_parameter_assignments.append('    if (%(parameterName)s.has_value())' % param_args)
+                    out_parameter_assignments.append('    if (%(parameterName)s.hasValue())' % param_args)
                     out_parameter_assignments.append('        jsonMessage->%(keyedSetMethod)s("%(parameterKey)s"_s, *%(parameterName)s);' % param_args)
                 else:
                     out_parameter_assignments.append('    if (%(parameterName)s)' % param_args)
@@ -264,7 +264,7 @@
                 out_parameter_declarations.append('    %(parameterType)s out_%(parameterName)s;' % param_args)
                 if parameter.is_optional:
                     if CppGenerator.should_use_wrapper_for_return_type(parameter.type):
-                        out_parameter_assignments.append('        if (out_%(parameterName)s.has_value())' % param_args)
+                        out_parameter_assignments.append('        if (out_%(parameterName)s.hasValue())' % param_args)
                         out_parameter_assignments.append('            result->%(keyedSetMethod)s("%(parameterKey)s"_s, *out_%(parameterName)s);' % param_args)
                     else:
                         out_parameter_assignments.append('        if (out_%(parameterName)s)' % param_args)

Modified: trunk/Source/WTF/ChangeLog (239476 => 239477)


--- trunk/Source/WTF/ChangeLog	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WTF/ChangeLog	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1,5 +1,16 @@
 2018-12-20  Chris Dumez  <[email protected]>
 
+        Use Optional::hasValue() instead of Optional::has_value()
+        https://bugs.webkit.org/show_bug.cgi?id=192948
+
+        Reviewed by Tim Horton.
+
+        * wtf/Hasher.h:
+        (WTF::add):
+        * wtf/Optional.h:
+
+2018-12-20  Chris Dumez  <[email protected]>
+
         Use Optional::valueOr() instead of Optional::value_or()
         https://bugs.webkit.org/show_bug.cgi?id=192933
 

Modified: trunk/Source/WTF/wtf/Hasher.h (239476 => 239477)


--- trunk/Source/WTF/wtf/Hasher.h	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WTF/wtf/Hasher.h	2018-12-21 00:40:09 UTC (rev 239477)
@@ -142,8 +142,8 @@
 
 template<typename T> void add(Hasher& hasher, const Optional<T>& optional)
 {
-    add(hasher, optional.has_value());
-    if (optional.has_value())
+    add(hasher, optional.hasValue());
+    if (optional.hasValue())
         add(hasher, optional.value());
 }
 

Modified: trunk/Source/WTF/wtf/Optional.h (239476 => 239477)


--- trunk/Source/WTF/wtf/Optional.h	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WTF/wtf/Optional.h	2018-12-21 00:40:09 UTC (rev 239477)
@@ -506,7 +506,6 @@
   // 20.5.4.5, Observers
 
   explicit constexpr operator bool() const __NOEXCEPT { return initialized(); }
-  constexpr bool has_value() const __NOEXCEPT { return initialized(); } // FIXME: Remove this.
   constexpr bool hasValue() const __NOEXCEPT { return initialized(); }
 
   constexpr T const* operator ->() const {
@@ -673,7 +672,7 @@
     return ref != nullptr;
   }
 
-  constexpr bool has_value() const __NOEXCEPT {
+  constexpr bool hasValue() const __NOEXCEPT {
     return ref != nullptr;
   }
 

Modified: trunk/Source/WebCore/ChangeLog (239476 => 239477)


--- trunk/Source/WebCore/ChangeLog	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/ChangeLog	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1,5 +1,35 @@
 2018-12-20  Chris Dumez  <[email protected]>
 
+        Use Optional::hasValue() instead of Optional::has_value()
+        https://bugs.webkit.org/show_bug.cgi?id=192948
+
+        Reviewed by Tim Horton.
+
+        * bindings/js/DOMPromiseProxy.h:
+        (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
+        (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
+        (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
+        * dom/DataTransferItemList.h:
+        (WebCore::DataTransferItemList::hasItems const):
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::addEventListener):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::captionDisplayMode):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::wouldTaintOrigin const):
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
+        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
+        (webKitMediaSrcUpdatePresentationSize):
+        * platform/mac/NSScrollerImpDetails.mm:
+        (WebCore::ScrollerStyle::recommendedScrollerStyle):
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::setExplicitValue):
+
+2018-12-20  Chris Dumez  <[email protected]>
+
         Move HTTPS_UPGRADE code behind a runtime flag, off by default
         https://bugs.webkit.org/show_bug.cgi?id=192937
 

Modified: trunk/Source/WebCore/bindings/js/DOMPromiseProxy.h (239476 => 239477)


--- trunk/Source/WebCore/bindings/js/DOMPromiseProxy.h	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/bindings/js/DOMPromiseProxy.h	2018-12-21 00:40:09 UTC (rev 239477)
@@ -145,7 +145,7 @@
 template<typename IDLType>
 inline bool DOMPromiseProxy<IDLType>::isFulfilled() const
 {
-    return m_valueOrException.has_value();
+    return m_valueOrException.hasValue();
 }
 
 template<typename IDLType>
@@ -213,7 +213,7 @@
 
 inline bool DOMPromiseProxy<IDLVoid>::isFulfilled() const
 {
-    return m_valueOrException.has_value();
+    return m_valueOrException.hasValue();
 }
 
 inline void DOMPromiseProxy<IDLVoid>::resolve()
@@ -282,7 +282,7 @@
 template<typename IDLType>
 inline bool DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled() const
 {
-    return m_valueOrException.has_value();
+    return m_valueOrException.hasValue();
 }
 
 template<typename IDLType>

Modified: trunk/Source/WebCore/dom/DataTransferItemList.h (239476 => 239477)


--- trunk/Source/WebCore/dom/DataTransferItemList.h	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/dom/DataTransferItemList.h	2018-12-21 00:40:09 UTC (rev 239477)
@@ -65,7 +65,7 @@
 
     void didClearStringData(const String& type);
     void didSetStringData(const String& type);
-    bool hasItems() const { return m_items.has_value(); }
+    bool hasItems() const { return m_items.hasValue(); }
     const Vector<Ref<DataTransferItem>>& items() const
     {
         ASSERT(m_items);

Modified: trunk/Source/WebCore/dom/EventTarget.cpp (239476 => 239477)


--- trunk/Source/WebCore/dom/EventTarget.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/dom/EventTarget.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -67,7 +67,7 @@
 {
     auto passive = options.passive;
 
-    if (!passive.has_value() && eventNames().isTouchScrollBlockingEventType(eventType)) {
+    if (!passive.hasValue() && eventNames().isTouchScrollBlockingEventType(eventType)) {
         if (is<DOMWindow>(*this)) {
             auto& window = downcast<DOMWindow>(*this);
             if (auto* document = window.document())

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (239476 => 239477)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -6583,7 +6583,7 @@
 
 CaptionUserPreferences::CaptionDisplayMode HTMLMediaElement::captionDisplayMode()
 {
-    if (!m_captionDisplayMode.has_value()) {
+    if (!m_captionDisplayMode.hasValue()) {
         if (document().page())
             m_captionDisplayMode = document().page()->group().captionPreferences().captionDisplayMode();
         else

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (239476 => 239477)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1061,7 +1061,7 @@
 bool MediaPlayer::wouldTaintOrigin(const SecurityOrigin& origin) const
 {
     auto wouldTaint = m_private->wouldTaintOrigin(origin);
-    if (wouldTaint.has_value())
+    if (wouldTaint.hasValue())
         return wouldTaint.value();
 
     if (m_url.protocolIsData())

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (239476 => 239477)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -383,7 +383,7 @@
             m_streamType = WebCore::MediaSourceStreamTypeGStreamer::Invalid;
     } else if (doCapsHaveType(m_demuxerSrcPadCaps.get(), GST_VIDEO_CAPS_TYPE_PREFIX)) {
         Optional<FloatSize> size = getVideoResolutionFromCaps(m_demuxerSrcPadCaps.get());
-        if (size.has_value())
+        if (size.hasValue())
             m_presentationSize = size.value();
         else
             m_presentationSize = WebCore::FloatSize();

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp (239476 => 239477)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -721,7 +721,7 @@
 
     if (doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) {
         Optional<FloatSize> size = getVideoResolutionFromCaps(caps);
-        if (size.has_value())
+        if (size.hasValue())
             m_videoSize = size.value();
     }
 

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp (239476 => 239477)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -459,7 +459,7 @@
     GST_OBJECT_LOCK(stream->parent);
     if (WebCore::doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) {
         Optional<WebCore::FloatSize> size = WebCore::getVideoResolutionFromCaps(caps);
-        if (size.has_value())
+        if (size.hasValue())
             stream->presentationSize = size.value();
         else
             stream->presentationSize = WebCore::FloatSize();

Modified: trunk/Source/WebCore/platform/mac/NSScrollerImpDetails.mm (239476 => 239477)


--- trunk/Source/WebCore/platform/mac/NSScrollerImpDetails.mm	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/platform/mac/NSScrollerImpDetails.mm	2018-12-21 00:40:09 UTC (rev 239477)
@@ -38,7 +38,7 @@
 
 NSScrollerStyle ScrollerStyle::recommendedScrollerStyle()
 {
-    if (m_useOverlayScrollbars.has_value())
+    if (m_useOverlayScrollbars.hasValue())
         return *m_useOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
     
     if (DeprecatedGlobalSettings::usesOverlayScrollbars())

Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (239476 => 239477)


--- trunk/Source/WebCore/rendering/RenderListItem.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -407,7 +407,7 @@
         if (m_valueWasSetExplicitly && m_value == value)
             return;
     }
-    m_valueWasSetExplicitly = value.has_value();
+    m_valueWasSetExplicitly = value.hasValue();
     m_value = value;
     explicitValueChanged();
 }

Modified: trunk/Source/WebKit/ChangeLog (239476 => 239477)


--- trunk/Source/WebKit/ChangeLog	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebKit/ChangeLog	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1,3 +1,16 @@
+2018-12-20  Chris Dumez  <[email protected]>
+
+        Use Optional::hasValue() instead of Optional::has_value()
+        https://bugs.webkit.org/show_bug.cgi?id=192948
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::AutomationCommandError::toProtocolString):
+        (WebKit::WebAutomationSession::willClosePage):
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::WebAutomationSessionProxy::computeElementLayout):
+
 2018-12-20  Jeremy Jones  <[email protected]>
 
         Flicker when exiting element fullscreen.

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (239476 => 239477)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -58,7 +58,7 @@
 String AutomationCommandError::toProtocolString()
 {
     String protocolErrorName = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(type);
-    if (!message.has_value())
+    if (!message.hasValue())
         return protocolErrorName;
 
     return makeString(protocolErrorName, errorNameAndDetailsSeparator, message.value());
@@ -784,7 +784,7 @@
 
     // Then tell the input dispatcher to cancel so timers are stopped, and let it go out of scope.
     Optional<Ref<SimulatedInputDispatcher>> inputDispatcher = m_inputDispatchersByPage.take(page.pageID());
-    if (inputDispatcher.has_value())
+    if (inputDispatcher.hasValue())
         inputDispatcher.value()->cancel();
 }
 

Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (239476 => 239477)


--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -594,7 +594,7 @@
     bool isObscured = false;
     if (containerElement) {
         Optional<WebCore::FloatPoint> frameInViewCenterPoint = elementInViewClientCenterPoint(*containerElement, isObscured);
-        if (frameInViewCenterPoint.has_value()) {
+        if (frameInViewCenterPoint.hasValue()) {
             WebCore::IntPoint rootInViewCenterPoint = mainView->rootViewToContents(frameView->contentsToRootView(WebCore::IntPoint(frameInViewCenterPoint.value())));
             switch (coordinateSystem) {
             case CoordinateSystem::Page:

Modified: trunk/Tools/ChangeLog (239476 => 239477)


--- trunk/Tools/ChangeLog	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Tools/ChangeLog	2018-12-21 00:40:09 UTC (rev 239477)
@@ -1,5 +1,19 @@
 2018-12-20  Chris Dumez  <[email protected]>
 
+        Use Optional::hasValue() instead of Optional::has_value()
+        https://bugs.webkit.org/show_bug.cgi?id=192948
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
+        (TestWebKitAPI::TEST_F):
+
+2018-12-20  Chris Dumez  <[email protected]>
+
         Add style script rule to check for uses of std::optional<>
         https://bugs.webkit.org/show_bug.cgi?id=192931
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp (239476 => 239477)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -64,7 +64,7 @@
 
     for (const UintTestCase& testCase : kUintTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Unsigned);
         EXPECT_EQ(cbor.value().getInteger(), testCase.value);
     }
@@ -109,7 +109,7 @@
     CBORReader::DecoderError errorCode;
     for (const auto& nonMinimalUint : nonMinimalUintEncodings) {
         Optional<CBORValue> cbor = CBORReader::read(nonMinimalUint, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::NonMinimalCBOREncoding);
     }
 }
@@ -135,7 +135,7 @@
 
     for (const NegativeIntTestCase& testCase : kNegativeIntTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Negative);
         EXPECT_EQ(cbor.value().getInteger(), testCase.negativeInt);
     }
@@ -155,7 +155,7 @@
 
     for (const ByteTestCase& testCase : kByteStringTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::ByteString);
         EXPECT_TRUE(cbor.value().getByteString() == testCase.value);
     }
@@ -180,7 +180,7 @@
 
     for (const StringTestCase& testCase : kStringTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String);
         EXPECT_TRUE(cbor.value().getString() == testCase.value);
     }
@@ -208,7 +208,7 @@
 
     for (const auto& testCase : kStringTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String);
         EXPECT_TRUE(cbor.value().getString() == testCase.value);
     }
@@ -225,7 +225,7 @@
     };
     CBORReader::DecoderError errorCode;
     Optional<CBORValue> cbor = CBORReader::read(stringWithInvalidContinuationByte, &errorCode);
-    EXPECT_FALSE(cbor.has_value());
+    EXPECT_FALSE(cbor.hasValue());
     EXPECT_TRUE(errorCode == CBORReader::DecoderError::InvalidUTF8);
 }
 
@@ -239,7 +239,7 @@
     };
 
     Optional<CBORValue> cbor = CBORReader::read(kArrayTestCaseCBOR);
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     const CBORValue cborArray = WTFMove(cbor.value());
     ASSERT_TRUE(cborArray.type() == CBORValue::Type::Array);
     ASSERT_EQ(cborArray.getArray().size(), 25u);
@@ -269,7 +269,7 @@
     };
 
     Optional<CBORValue> cbor = CBORReader::read(kMapTestCaseCBOR);
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     const CBORValue cborVal = WTFMove(cbor.value());
     ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map);
     ASSERT_EQ(cborVal.getMap().size(), 4u);
@@ -313,7 +313,7 @@
     };
 
     Optional<CBORValue> cbor = CBORReader::read(kMapWithIntegerKeyCBOR);
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     const CBORValue cborVal = WTFMove(cbor.value());
     ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map);
     ASSERT_EQ(cborVal.getMap().size(), 4u);
@@ -353,7 +353,7 @@
     };
 
     Optional<CBORValue> cbor = CBORReader::read(kMapArrayTestCaseCBOR);
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     const CBORValue cborVal = WTFMove(cbor.value());
     ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map);
     ASSERT_EQ(cborVal.getMap().size(), 2u);
@@ -392,7 +392,7 @@
     };
 
     Optional<CBORValue> cbor = CBORReader::read(kNestedMapTestCase);
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     const CBORValue cborVal = WTFMove(cbor.value());
     ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map);
     ASSERT_EQ(cborVal.getMap().size(), 2u);
@@ -429,11 +429,11 @@
     };
 
     Optional<CBORValue> maxPositiveInt = CBORReader::read(kMaxPositiveInt);
-    ASSERT_TRUE(maxPositiveInt.has_value());
+    ASSERT_TRUE(maxPositiveInt.hasValue());
     EXPECT_EQ(maxPositiveInt.value().getInteger(), INT64_MAX);
 
     Optional<CBORValue> minNegativeInt = CBORReader::read(kMinNegativeInt);
-    ASSERT_TRUE(minNegativeInt.has_value());
+    ASSERT_TRUE(minNegativeInt.hasValue());
     EXPECT_EQ(minNegativeInt.value().getInteger(), INT64_MIN);
 }
 
@@ -471,7 +471,7 @@
 
     for (const auto& testCase : kSimpleValueTestCases) {
         Optional<CBORValue> cbor = CBORReader::read(testCase.cborData);
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         ASSERT_TRUE(cbor.value().type() == CBORValue::Type::SimpleValue);
         ASSERT_TRUE(cbor.value().getSimpleValue() == testCase.value);
     }
@@ -491,7 +491,7 @@
     for (const auto& unsupported_floating_point : floatingPointCbors) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(unsupported_floating_point, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedFloatingPointValue);
     }
 }
@@ -517,7 +517,7 @@
     for (const auto& incomplete_data : incompleteCborList) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(incomplete_data, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncompleteCBORData);
     }
 }
@@ -538,7 +538,7 @@
 
     CBORReader::DecoderError errorCode;
     Optional<CBORValue> cbor = CBORReader::read(kMapWithUintKey, &errorCode);
-    EXPECT_FALSE(cbor.has_value());
+    EXPECT_FALSE(cbor.hasValue());
     EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncorrectMapKeyType);
 }
 
@@ -567,7 +567,7 @@
     for (const auto& incorrect_cbor : kUnknownAdditionalInfoList) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(incorrect_cbor, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnknownAdditionalInfo);
     }
 }
@@ -590,7 +590,7 @@
     for (const auto& zeroDepthData : kZeroDepthCBORList) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(zeroDepthData, &errorCode, 0);
-        EXPECT_TRUE(cbor.has_value());
+        EXPECT_TRUE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError);
     }
 
@@ -610,11 +610,11 @@
 
     CBORReader::DecoderError errorCode;
     Optional<CBORValue> cborSingleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 1);
-    EXPECT_FALSE(cborSingleLayerMax.has_value());
+    EXPECT_FALSE(cborSingleLayerMax.hasValue());
     EXPECT_TRUE(errorCode == CBORReader::DecoderError::TooMuchNesting);
 
     Optional<CBORValue> cborDoubleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 2);
-    EXPECT_TRUE(cborDoubleLayerMax.has_value());
+    EXPECT_TRUE(cborDoubleLayerMax.hasValue());
     EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError);
 }
 
@@ -648,7 +648,7 @@
     for (const auto& unsortedMap : kMapsWithUnsortedKeys) {
         Optional<CBORValue> cbor =
         CBORReader::read(unsortedMap, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::OutOfOrderKey);
     }
 }
@@ -679,7 +679,7 @@
     CBORReader::DecoderError errorCode;
 
     Optional<CBORValue> cbor = CBORReader::read(kMapWithDuplicateKey, &errorCode);
-    EXPECT_FALSE(cbor.has_value());
+    EXPECT_FALSE(cbor.hasValue());
     EXPECT_TRUE(errorCode == CBORReader::DecoderError::DuplicateKey);
 }
 
@@ -699,7 +699,7 @@
     CBORReader::DecoderError errorCode;
     for (const auto& cbor_byte : utf8CharacterEncodings) {
         Optional<CBORValue> correctlyEncodedCbor = CBORReader::read(cbor_byte, &errorCode);
-        EXPECT_TRUE(correctlyEncodedCbor.has_value());
+        EXPECT_TRUE(correctlyEncodedCbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError);
     }
 
@@ -728,7 +728,7 @@
     for (const auto& extraneous_cborData : zeroPaddedCborList) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(extraneous_cborData, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::ExtraneousData);
     }
 }
@@ -759,7 +759,7 @@
     for (const auto& unsupportedSimpleVal : unsupportedSimpleValues) {
         CBORReader::DecoderError errorCode;
         Optional<CBORValue> cbor = CBORReader::read(unsupportedSimpleVal, &errorCode);
-        EXPECT_FALSE(cbor.has_value());
+        EXPECT_FALSE(cbor.hasValue());
         EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedSimpleValue);
     }
 }

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp (239476 => 239477)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -81,7 +81,7 @@
 
     for (const UintTestCase& testCase : kUintTestCases) {
         auto cbor = CBORWriter::write(CBORValue(testCase.value));
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         EXPECT_TRUE(eq(cbor.value(), testCase.cbor));
     }
 }
@@ -108,7 +108,7 @@
 
     for (const auto& testCase : kNegativeIntTestCases) {
         auto cbor = CBORWriter::write(CBORValue(testCase.negativeInt));
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         EXPECT_TRUE(eq(cbor.value(), testCase.cbor));
     }
 }
@@ -127,7 +127,7 @@
 
     for (const BytesTestCase& testCase : kBytesTestCases) {
         auto cbor = CBORWriter::write(CBORValue(testCase.bytes));
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         EXPECT_TRUE(eq(cbor.value(), testCase.cbor));
     }
 }
@@ -151,7 +151,7 @@
 
     for (const StringTestCase& testCase : kStringTestCases) {
         auto cbor = CBORWriter::write(CBORValue(testCase.string));
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         EXPECT_TRUE(eq(cbor.value(), testCase.cbor));
     }
 }
@@ -168,7 +168,7 @@
     for (int64_t i = 1; i <= 25; i++)
         array.append(CBORValue(i));
     auto cbor = CBORWriter::write(CBORValue(array));
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     EXPECT_TRUE(eq(cbor.value(), kArrayTestCaseCbor, sizeof(kArrayTestCaseCbor)));
 }
 
@@ -278,7 +278,7 @@
     map[CBORValue(int64_t(4294967296))] = CBORValue("i");
     map[CBORValue(std::numeric_limits<int64_t>::max())] = CBORValue("j");
     auto cbor = CBORWriter::write(CBORValue(map));
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     EXPECT_TRUE(eq(cbor.value(), kMapTestCaseCbor, sizeof(kMapTestCaseCbor)));
 }
 
@@ -301,7 +301,7 @@
     array.append(CBORValue(3));
     map[CBORValue("b")] = CBORValue(array);
     auto cbor = CBORWriter::write(CBORValue(map));
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     EXPECT_TRUE(eq(cbor.value(), kMapArrayTestCaseCbor, sizeof(kMapArrayTestCaseCbor)));
 }
 
@@ -327,7 +327,7 @@
     nestedMap[CBORValue("d")] = CBORValue(3);
     map[CBORValue("b")] = CBORValue(nestedMap);
     auto cbor = CBORWriter::write(CBORValue(map));
-    ASSERT_TRUE(cbor.has_value());
+    ASSERT_TRUE(cbor.hasValue());
     EXPECT_TRUE(eq(cbor.value(), kNestedMapTestCase, sizeof(kNestedMapTestCase)));
 }
 
@@ -345,7 +345,7 @@
 
     for (const auto& testCase : kSimpleTestCase) {
         auto cbor = CBORWriter::write(CBORValue(testCase.simpleValue));
-        ASSERT_TRUE(cbor.has_value());
+        ASSERT_TRUE(cbor.hasValue());
         EXPECT_TRUE(eq(cbor.value(), testCase.cbor));
     }
 }
@@ -370,18 +370,18 @@
     const CBORValue singleLayerCborMap = CBORValue(simpleMap);
     const CBORValue singleLayerCborArray = CBORValue(simpleArray);
 
-    EXPECT_TRUE(CBORWriter::write(simpleUint, 0).has_value());
-    EXPECT_TRUE(CBORWriter::write(simpleString, 0).has_value());
-    EXPECT_TRUE(CBORWriter::write(simpleBytestring, 0).has_value());
+    EXPECT_TRUE(CBORWriter::write(simpleUint, 0).hasValue());
+    EXPECT_TRUE(CBORWriter::write(simpleString, 0).hasValue());
+    EXPECT_TRUE(CBORWriter::write(simpleBytestring, 0).hasValue());
 
-    EXPECT_TRUE(CBORWriter::write(emptyArrayValue, 0).has_value());
-    EXPECT_TRUE(CBORWriter::write(emptyMapValue, 0).has_value());
+    EXPECT_TRUE(CBORWriter::write(emptyArrayValue, 0).hasValue());
+    EXPECT_TRUE(CBORWriter::write(emptyMapValue, 0).hasValue());
 
-    EXPECT_FALSE(CBORWriter::write(singleLayerCborArray, 0).has_value());
-    EXPECT_TRUE(CBORWriter::write(singleLayerCborArray, 1).has_value());
+    EXPECT_FALSE(CBORWriter::write(singleLayerCborArray, 0).hasValue());
+    EXPECT_TRUE(CBORWriter::write(singleLayerCborArray, 1).hasValue());
 
-    EXPECT_FALSE(CBORWriter::write(singleLayerCborMap, 0).has_value());
-    EXPECT_TRUE(CBORWriter::write(singleLayerCborMap, 1).has_value());
+    EXPECT_FALSE(CBORWriter::write(singleLayerCborMap, 0).hasValue());
+    EXPECT_TRUE(CBORWriter::write(singleLayerCborMap, 1).hasValue());
 }
 
 // Major type 5 nested CBOR map value with following structure.
@@ -396,8 +396,8 @@
     nestedMap[CBORValue("c")] = CBORValue(2);
     nestedMap[CBORValue("d")] = CBORValue(3);
     cborMap[CBORValue("b")] = CBORValue(nestedMap);
-    EXPECT_TRUE(CBORWriter::write(CBORValue(cborMap), 2).has_value());
-    EXPECT_FALSE(CBORWriter::write(CBORValue(cborMap), 1).has_value());
+    EXPECT_TRUE(CBORWriter::write(CBORValue(cborMap), 2).hasValue());
+    EXPECT_FALSE(CBORWriter::write(CBORValue(cborMap), 1).hasValue());
 }
 
 // Testing Write() function for following CBOR structure with depth of 3.
@@ -422,8 +422,8 @@
     cborArray.append(CBORValue(3));
     cborArray.append(CBORValue(cborMap));
 
-    EXPECT_TRUE(CBORWriter::write(CBORValue(cborArray), 3).has_value());
-    EXPECT_FALSE(CBORWriter::write(CBORValue(cborArray), 2).has_value());
+    EXPECT_TRUE(CBORWriter::write(CBORValue(cborArray), 3).hasValue());
+    EXPECT_FALSE(CBORWriter::write(CBORValue(cborArray), 2).hasValue());
 }
 
 // Testing Write() function for following CBOR structure.
@@ -456,8 +456,8 @@
     nestedMap[CBORValue("h")] = CBORValue(innerNestedMap);
     map[CBORValue("b")] = CBORValue(nestedMap);
 
-    EXPECT_TRUE(CBORWriter::write(CBORValue(map), 5).has_value());
-    EXPECT_FALSE(CBORWriter::write(CBORValue(map), 4).has_value());
+    EXPECT_TRUE(CBORWriter::write(CBORValue(map), 5).hasValue());
+    EXPECT_FALSE(CBORWriter::write(CBORValue(map), 4).hasValue());
 }
 
 } // namespace TestWebKitAPI

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp (239476 => 239477)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp	2018-12-21 00:38:25 UTC (rev 239476)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp	2018-12-21 00:40:09 UTC (rev 239477)
@@ -129,12 +129,12 @@
 TEST_F(FileSystemTest, GetFileMetadataSymlink)
 {
     auto symlinkMetadata = FileSystem::fileMetadata(tempFileSymlinkPath());
-    ASSERT_TRUE(symlinkMetadata.has_value());
+    ASSERT_TRUE(symlinkMetadata.hasValue());
     EXPECT_TRUE(symlinkMetadata.value().type == FileMetadata::Type::SymbolicLink);
     EXPECT_FALSE(static_cast<size_t>(symlinkMetadata.value().length) == strlen(FileSystemTestData));
 
     auto targetMetadata = FileSystem::fileMetadataFollowingSymlinks(tempFileSymlinkPath());
-    ASSERT_TRUE(targetMetadata.has_value());
+    ASSERT_TRUE(targetMetadata.hasValue());
     EXPECT_TRUE(targetMetadata.value().type == FileMetadata::Type::File);
     EXPECT_EQ(strlen(FileSystemTestData), static_cast<size_t>(targetMetadata.value().length));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to