Unreviewed, rebaseline messages.py tests.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2020 21:41:09 +0000 (21:41 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2020 21:41:09 +0000 (21:41 +0000)
* Scripts/MessageNames.cpp:
(IPC::description):
(IPC::receiverName):
(IPC::isValidMessageName):
* Scripts/MessageNames.h:
(WTF::isValidEnum):
* Scripts/test-superclassMessagesReplies.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263696 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Scripts/MessageNames.cpp
Source/WebKit/Scripts/MessageNames.h
Source/WebKit/Scripts/test-superclassMessagesReplies.h

index 41b17ba..4ecdbee 100644 (file)
@@ -1,3 +1,15 @@
+2020-06-29  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rebaseline messages.py tests.
+
+        * Scripts/MessageNames.cpp:
+        (IPC::description):
+        (IPC::receiverName):
+        (IPC::isValidMessageName):
+        * Scripts/MessageNames.h:
+        (WTF::isValidEnum):
+        * Scripts/test-superclassMessagesReplies.h:
+
 2020-06-29  David Kilzer  <ddkilzer@apple.com>
 
         Crash in NetworkProcessProxy::getNetworkProcessConnection() lambda due to missing Optional<> value check
index db2cdf1..b82bf04 100644 (file)
@@ -50,6 +50,12 @@ const char* description(MessageName name)
     case MessageName::WebPage_TestAsyncMessageWithMultipleArgumentsReply:
         return "WebPage::TestAsyncMessageWithMultipleArgumentsReply";
 #endif
+#if ENABLE(TEST_FEATURE)
+    case MessageName::WebPage_TestAsyncMessageWithConnection:
+        return "WebPage::TestAsyncMessageWithConnection";
+    case MessageName::WebPage_TestAsyncMessageWithConnectionReply:
+        return "WebPage::TestAsyncMessageWithConnectionReply";
+#endif
     case MessageName::WebPage_TestSyncMessage:
         return "WebPage::TestSyncMessage";
     case MessageName::WebPage_TestSynchronousMessage:
@@ -200,6 +206,9 @@ ReceiverName receiverName(MessageName messageName)
 #if ENABLE(TEST_FEATURE)
     case MessageName::WebPage_TestAsyncMessageWithMultipleArguments:
 #endif
+#if ENABLE(TEST_FEATURE)
+    case MessageName::WebPage_TestAsyncMessageWithConnection:
+#endif
     case MessageName::WebPage_TestSyncMessage:
     case MessageName::WebPage_TestSynchronousMessage:
         return ReceiverName::WebPage;
@@ -290,6 +299,9 @@ ReceiverName receiverName(MessageName messageName)
 #if ENABLE(TEST_FEATURE)
     case MessageName::WebPage_TestAsyncMessageWithMultipleArgumentsReply:
 #endif
+#if ENABLE(TEST_FEATURE)
+    case MessageName::WebPage_TestAsyncMessageWithConnectionReply:
+#endif
         return ReceiverName::AsyncReply;
     case MessageName::WrappedAsyncMessageForTesting:
     case MessageName::SyncMessageReply:
@@ -323,6 +335,12 @@ bool isValidMessageName(MessageName messageName)
     if (messageName == IPC::MessageName::WebPage_TestAsyncMessageWithMultipleArgumentsReply)
         return true;
 #endif
+#if ENABLE(TEST_FEATURE)
+    if (messageName == IPC::MessageName::WebPage_TestAsyncMessageWithConnection)
+        return true;
+    if (messageName == IPC::MessageName::WebPage_TestAsyncMessageWithConnectionReply)
+        return true;
+#endif
     if (messageName == IPC::MessageName::WebPage_TestSyncMessage)
         return true;
     if (messageName == IPC::MessageName::WebPage_TestSynchronousMessage)
index 5475f7d..f5768c0 100644 (file)
@@ -51,88 +51,92 @@ enum class MessageName : uint16_t {
     , WebPage_TestAsyncMessageWithMultipleArguments = 6
     , WebPage_TestAsyncMessageWithMultipleArgumentsReply = 7
 #endif
-    , WebPage_TestSyncMessage = 8
-    , WebPage_TestSynchronousMessage = 9
-    , WebPage_LoadURL = 10
+#if ENABLE(TEST_FEATURE)
+    , WebPage_TestAsyncMessageWithConnection = 8
+    , WebPage_TestAsyncMessageWithConnectionReply = 9
+#endif
+    , WebPage_TestSyncMessage = 10
+    , WebPage_TestSynchronousMessage = 11
+    , WebPage_LoadURL = 12
 #if ENABLE(TOUCH_EVENTS)
-    , WebPage_LoadSomething = 11
+    , WebPage_LoadSomething = 13
 #endif
 #if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION || SOME_OTHER_MESSAGE_CONDITION))
-    , WebPage_TouchEvent = 12
+    , WebPage_TouchEvent = 14
 #endif
 #if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION && SOME_OTHER_MESSAGE_CONDITION))
-    , WebPage_AddEvent = 13
+    , WebPage_AddEvent = 15
 #endif
 #if ENABLE(TOUCH_EVENTS)
-    , WebPage_LoadSomethingElse = 14
-#endif
-    , WebPage_DidReceivePolicyDecision = 15
-    , WebPage_Close = 16
-    , WebPage_PreferencesDidChange = 17
-    , WebPage_SendDoubleAndFloat = 18
-    , WebPage_SendInts = 19
-    , WebPage_CreatePlugin = 20
-    , WebPage_RunJavaScriptAlert = 21
-    , WebPage_GetPlugins = 22
-    , WebPage_GetPluginProcessConnection = 23
-    , WebPage_TestMultipleAttributes = 24
-    , WebPage_TestParameterAttributes = 25
-    , WebPage_TemplateTest = 26
-    , WebPage_SetVideoLayerID = 27
+    , WebPage_LoadSomethingElse = 16
+#endif
+    , WebPage_DidReceivePolicyDecision = 17
+    , WebPage_Close = 18
+    , WebPage_PreferencesDidChange = 19
+    , WebPage_SendDoubleAndFloat = 20
+    , WebPage_SendInts = 21
+    , WebPage_CreatePlugin = 22
+    , WebPage_RunJavaScriptAlert = 23
+    , WebPage_GetPlugins = 24
+    , WebPage_GetPluginProcessConnection = 25
+    , WebPage_TestMultipleAttributes = 26
+    , WebPage_TestParameterAttributes = 27
+    , WebPage_TemplateTest = 28
+    , WebPage_SetVideoLayerID = 29
 #if PLATFORM(MAC)
-    , WebPage_DidCreateWebProcessConnection = 28
+    , WebPage_DidCreateWebProcessConnection = 30
 #endif
 #if PLATFORM(MAC)
-    , WebPage_InterpretKeyEvent = 29
+    , WebPage_InterpretKeyEvent = 31
 #endif
 #if ENABLE(DEPRECATED_FEATURE)
-    , WebPage_DeprecatedOperation = 30
+    , WebPage_DeprecatedOperation = 32
 #endif
 #if ENABLE(EXPERIMENTAL_FEATURE)
-    , WebPage_ExperimentalOperation = 31
+    , WebPage_ExperimentalOperation = 33
 #endif
-    , WebPage_LoadURL = 32
+    , WebPage_LoadURL = 34
 #if ENABLE(TOUCH_EVENTS)
-    , WebPage_LoadSomething = 33
+    , WebPage_LoadSomething = 35
 #endif
 #if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION || SOME_OTHER_MESSAGE_CONDITION))
-    , WebPage_TouchEvent = 34
+    , WebPage_TouchEvent = 36
 #endif
 #if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION && SOME_OTHER_MESSAGE_CONDITION))
-    , WebPage_AddEvent = 35
+    , WebPage_AddEvent = 37
 #endif
 #if ENABLE(TOUCH_EVENTS)
-    , WebPage_LoadSomethingElse = 36
-#endif
-    , WebPage_DidReceivePolicyDecision = 37
-    , WebPage_Close = 38
-    , WebPage_PreferencesDidChange = 39
-    , WebPage_SendDoubleAndFloat = 40
-    , WebPage_SendInts = 41
-    , WebPage_CreatePlugin = 42
-    , WebPage_RunJavaScriptAlert = 43
-    , WebPage_GetPlugins = 44
-    , WebPage_GetPluginProcessConnection = 45
-    , WebPage_TestMultipleAttributes = 46
-    , WebPage_TestParameterAttributes = 47
-    , WebPage_TemplateTest = 48
-    , WebPage_SetVideoLayerID = 49
+    , WebPage_LoadSomethingElse = 38
+#endif
+    , WebPage_DidReceivePolicyDecision = 39
+    , WebPage_Close = 40
+    , WebPage_PreferencesDidChange = 41
+    , WebPage_SendDoubleAndFloat = 42
+    , WebPage_SendInts = 43
+    , WebPage_CreatePlugin = 44
+    , WebPage_RunJavaScriptAlert = 45
+    , WebPage_GetPlugins = 46
+    , WebPage_GetPluginProcessConnection = 47
+    , WebPage_TestMultipleAttributes = 48
+    , WebPage_TestParameterAttributes = 49
+    , WebPage_TemplateTest = 50
+    , WebPage_SetVideoLayerID = 51
 #if PLATFORM(MAC)
-    , WebPage_DidCreateWebProcessConnection = 50
+    , WebPage_DidCreateWebProcessConnection = 52
 #endif
 #if PLATFORM(MAC)
-    , WebPage_InterpretKeyEvent = 51
+    , WebPage_InterpretKeyEvent = 53
 #endif
 #if ENABLE(DEPRECATED_FEATURE)
-    , WebPage_DeprecatedOperation = 52
+    , WebPage_DeprecatedOperation = 54
 #endif
 #if ENABLE(EXPERIMENTAL_FEATURE)
-    , WebPage_ExperimentalOperation = 53
+    , WebPage_ExperimentalOperation = 55
 #endif
-    , WrappedAsyncMessageForTesting = 54
-    , SyncMessageReply = 55
-    , InitializeConnection = 56
-    , LegacySessionState = 57
+    , WrappedAsyncMessageForTesting = 56
+    , SyncMessageReply = 57
+    , InitializeConnection = 58
+    , LegacySessionState = 59
 };
 
 ReceiverName receiverName(MessageName);
@@ -145,11 +149,11 @@ namespace WTF {
 
 template<>
 class HasCustomIsValidEnum<IPC::MessageName> : public std::true_type { };
-template<typename E, typename T, typename = std::enable_if_t<std::is_same<E, IPC::MessageName>::value>>
+template<typename E, typename T, std::enable_if_t<std::is_same_v<E, IPC::MessageName>>* = nullptr>
 bool isValidEnum(T messageName)
 {
-    static_assert(sizeof(T) == sizeof(IPC::MessageName), "isValidEnum<MessageName> should only be called with 16-bit types");
-    return IPC::isValidMessageName(static_cast<IPC::MessageName>(messageName));
+    static_assert(sizeof(T) == sizeof(E), "isValidEnum<IPC::MessageName> should only be called with 16-bit types");
+    return IPC::isValidMessageName(static_cast<E>(messageName));
 };
 
 } // namespace WTF
index fdd9719..2c6e1f2 100644 (file)
@@ -45,6 +45,10 @@ using TestAsyncMessageWithNoArgumentsAsyncReply = CompletionHandler<void()>;
 using TestAsyncMessageWithMultipleArgumentsAsyncReply = CompletionHandler<void(bool flag, uint64_t value)>;
 #endif
 
+#if ENABLE(TEST_FEATURE)
+using TestAsyncMessageWithConnectionAsyncReply = CompletionHandler<void(bool flag)>;
+#endif
+
 using TestSyncMessageDelayedReply = CompletionHandler<void(uint8_t reply)>;
 
 using TestSynchronousMessageDelayedReply = CompletionHandler<void(const Optional<WebKit::TestClassName>& optionalReply)>;