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

Side by Side Diff: ipc/ipc_message_unittest.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_message_macros.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_message.h" 5 #include "ipc/ipc_message.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bad_msg.WriteInt(99); 81 bad_msg.WriteInt(99);
82 iter = PickleIterator(bad_msg); 82 iter = PickleIterator(bad_msg);
83 EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output)); 83 EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output));
84 } 84 }
85 85
86 class IPCMessageParameterTest : public testing::Test { 86 class IPCMessageParameterTest : public testing::Test {
87 public: 87 public:
88 IPCMessageParameterTest() : extra_param_("extra_param"), called_(false) {} 88 IPCMessageParameterTest() : extra_param_("extra_param"), called_(false) {}
89 89
90 bool OnMessageReceived(const IPC::Message& message) { 90 bool OnMessageReceived(const IPC::Message& message) {
91 bool msg_is_ok = true;
92 bool handled = true; 91 bool handled = true;
93 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(IPCMessageParameterTest, message, 92 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(IPCMessageParameterTest, message,
94 msg_is_ok, &extra_param_) 93 &extra_param_)
95 IPC_MESSAGE_HANDLER(TestMsgClassEmpty, OnEmpty) 94 IPC_MESSAGE_HANDLER(TestMsgClassEmpty, OnEmpty)
96 IPC_MESSAGE_HANDLER(TestMsgClassI, OnInt) 95 IPC_MESSAGE_HANDLER(TestMsgClassI, OnInt)
97 //IPC_MESSAGE_HANDLER(TestMsgClassIS, OnSync) 96 //IPC_MESSAGE_HANDLER(TestMsgClassIS, OnSync)
98 IPC_MESSAGE_UNHANDLED(handled = false) 97 IPC_MESSAGE_UNHANDLED(handled = false)
99 IPC_END_MESSAGE_MAP() 98 IPC_END_MESSAGE_MAP()
100 99
101 return handled; 100 return handled;
102 } 101 }
103 102
104 void OnEmpty(std::string* extra_param) { 103 void OnEmpty(std::string* extra_param) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 /* TODO: handle sync IPCs 143 /* TODO: handle sync IPCs
145 TEST_F(IPCMessageParameterTest, Sync) { 144 TEST_F(IPCMessageParameterTest, Sync) {
146 std::string output; 145 std::string output;
147 TestMsgClassIS message(42, &output); 146 TestMsgClassIS message(42, &output);
148 EXPECT_TRUE(OnMessageReceived(message)); 147 EXPECT_TRUE(OnMessageReceived(message));
149 EXPECT_TRUE(called_); 148 EXPECT_TRUE(called_);
150 EXPECT_EQ(output, std::string("out")); 149 EXPECT_EQ(output, std::string("out"));
151 }*/ 150 }*/
152 151
153 } // namespace 152 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_message_macros.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698