Index: ipc/ipc_fuzzing_tests.cc |
=================================================================== |
--- ipc/ipc_fuzzing_tests.cc (revision 271040) |
+++ ipc/ipc_fuzzing_tests.cc (working copy) |
@@ -345,69 +345,4 @@ |
DestroyChannel(); |
} |
-// This class is for testing the IPC_BEGIN_MESSAGE_MAP_EX macros. |
-class ServerMacroExTest { |
- public: |
- ServerMacroExTest() : unhandled_msgs_(0) { |
- } |
- |
- virtual ~ServerMacroExTest() { |
- } |
- |
- virtual bool OnMessageReceived(const IPC::Message& msg) { |
- bool msg_is_ok = false; |
- IPC_BEGIN_MESSAGE_MAP_EX(ServerMacroExTest, msg, msg_is_ok) |
- IPC_MESSAGE_HANDLER(MsgClassIS, OnMsgClassISMessage) |
- IPC_MESSAGE_HANDLER(MsgClassSI, OnMsgClassSIMessage) |
- IPC_MESSAGE_UNHANDLED(++unhandled_msgs_) |
- IPC_END_MESSAGE_MAP_EX() |
- return msg_is_ok; |
- } |
- |
- int unhandled_msgs() const { |
- return unhandled_msgs_; |
- } |
- |
- private: |
- void OnMsgClassISMessage(int value, const std::wstring& text) { |
- } |
- void OnMsgClassSIMessage(const std::wstring& text, int value) { |
- } |
- |
- int unhandled_msgs_; |
- |
- DISALLOW_COPY_AND_ASSIGN(ServerMacroExTest); |
-}; |
- |
-TEST_F(IPCFuzzingTest, MsgMapExMacro) { |
- IPC::Message* msg = NULL; |
- ServerMacroExTest server; |
- |
- // Test the regular messages. |
- msg = new MsgClassIS(3, L"text3"); |
- EXPECT_TRUE(server.OnMessageReceived(*msg)); |
- delete msg; |
- msg = new MsgClassSI(L"text2", 2); |
- EXPECT_TRUE(server.OnMessageReceived(*msg)); |
- delete msg; |
- |
-#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
- // Test a bad message. |
- msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID, |
- IPC::Message::PRIORITY_NORMAL); |
- msg->WriteInt(2); |
- EXPECT_FALSE(server.OnMessageReceived(*msg)); |
- delete msg; |
- |
- msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID, |
- IPC::Message::PRIORITY_NORMAL); |
- msg->WriteInt(0x64); |
- msg->WriteInt(0x32); |
- EXPECT_FALSE(server.OnMessageReceived(*msg)); |
- delete msg; |
- |
- EXPECT_EQ(0, server.unhandled_msgs()); |
-#endif |
-} |
- |
} // namespace |