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

Side by Side Diff: ipc/ipc_channel_proxy_unittest.cc

Issue 324143002: Decouple IPC::MessageFilter from IPC::Channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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 | « content/renderer/pepper/pepper_hung_plugin_filter.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 last_filter_event_(NONE), 136 last_filter_event_(NONE),
137 message_filtering_enabled_(false) {} 137 message_filtering_enabled_(false) {}
138 138
139 MessageCountFilter(uint32 supported_message_class) 139 MessageCountFilter(uint32 supported_message_class)
140 : messages_received_(0), 140 : messages_received_(0),
141 supported_message_class_(supported_message_class), 141 supported_message_class_(supported_message_class),
142 is_global_filter_(false), 142 is_global_filter_(false),
143 last_filter_event_(NONE), 143 last_filter_event_(NONE),
144 message_filtering_enabled_(false) {} 144 message_filtering_enabled_(false) {}
145 145
146 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { 146 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE {
147 EXPECT_TRUE(channel); 147 EXPECT_TRUE(sender);
148 EXPECT_EQ(NONE, last_filter_event_); 148 EXPECT_EQ(NONE, last_filter_event_);
149 last_filter_event_ = FILTER_ADDED; 149 last_filter_event_ = FILTER_ADDED;
150 } 150 }
151 151
152 virtual void OnChannelConnected(int32_t peer_pid) OVERRIDE { 152 virtual void OnChannelConnected(int32_t peer_pid) OVERRIDE {
153 EXPECT_EQ(FILTER_ADDED, last_filter_event_); 153 EXPECT_EQ(FILTER_ADDED, last_filter_event_);
154 EXPECT_NE(static_cast<int32_t>(base::kNullProcessId), peer_pid); 154 EXPECT_NE(static_cast<int32_t>(base::kNullProcessId), peer_pid);
155 last_filter_event_ = CHANNEL_CONNECTED; 155 last_filter_event_ = CHANNEL_CONNECTED;
156 } 156 }
157 157
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 IPCTestBase::GetChannelName("ChannelProxyClient"), 432 IPCTestBase::GetChannelName("ChannelProxyClient"),
433 &listener)); 433 &listener));
434 CHECK(channel->Connect()); 434 CHECK(channel->Connect());
435 listener.Init(channel.get()); 435 listener.Init(channel.get());
436 436
437 base::MessageLoop::current()->Run(); 437 base::MessageLoop::current()->Run();
438 return 0; 438 return 0;
439 } 439 }
440 440
441 } // namespace 441 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_hung_plugin_filter.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698