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

Side by Side Diff: ipc/ipc_channel_proxy_unittest.cc

Issue 2349713003: IPC::MessageFilter::OnFilterAdded: IPC::Sender -> IPC::Channel (Closed)
Patch Set: . Created 4 years, 3 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
« no previous file with comments | « gpu/ipc/service/gpu_channel.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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 last_filter_event_(NONE), 138 last_filter_event_(NONE),
139 message_filtering_enabled_(false) {} 139 message_filtering_enabled_(false) {}
140 140
141 MessageCountFilter(uint32_t supported_message_class) 141 MessageCountFilter(uint32_t supported_message_class)
142 : messages_received_(0), 142 : messages_received_(0),
143 supported_message_class_(supported_message_class), 143 supported_message_class_(supported_message_class),
144 is_global_filter_(false), 144 is_global_filter_(false),
145 last_filter_event_(NONE), 145 last_filter_event_(NONE),
146 message_filtering_enabled_(false) {} 146 message_filtering_enabled_(false) {}
147 147
148 void OnFilterAdded(IPC::Sender* sender) override { 148 void OnFilterAdded(IPC::Channel* channel) override {
149 EXPECT_TRUE(sender); 149 EXPECT_TRUE(channel);
150 EXPECT_EQ(NONE, last_filter_event_); 150 EXPECT_EQ(NONE, last_filter_event_);
151 last_filter_event_ = FILTER_ADDED; 151 last_filter_event_ = FILTER_ADDED;
152 } 152 }
153 153
154 void OnChannelConnected(int32_t peer_pid) override { 154 void OnChannelConnected(int32_t peer_pid) override {
155 EXPECT_EQ(FILTER_ADDED, last_filter_event_); 155 EXPECT_EQ(FILTER_ADDED, last_filter_event_);
156 EXPECT_NE(static_cast<int32_t>(base::kNullProcessId), peer_pid); 156 EXPECT_NE(static_cast<int32_t>(base::kNullProcessId), peer_pid);
157 last_filter_event_ = CHANNEL_CONNECTED; 157 last_filter_event_ = CHANNEL_CONNECTED;
158 } 158 }
159 159
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 IPCTestBase::GetChannelName("ChannelProxyClient"), &listener, 431 IPCTestBase::GetChannelName("ChannelProxyClient"), &listener,
432 main_message_loop.task_runner())); 432 main_message_loop.task_runner()));
433 CHECK(channel->Connect()); 433 CHECK(channel->Connect());
434 listener.Init(channel.get()); 434 listener.Init(channel.get());
435 435
436 base::RunLoop().Run(); 436 base::RunLoop().Run();
437 return 0; 437 return 0;
438 } 438 }
439 439
440 } // namespace 440 } // namespace
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698