Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: ipc/ipc_fuzzing_tests.cc

Issue 292443004: Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_message_filter.cc ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « extensions/browser/extension_message_filter.cc ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698