| OLD | NEW |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 uint32 supported_message_class_; | 225 uint32 supported_message_class_; |
| 226 bool is_global_filter_; | 226 bool is_global_filter_; |
| 227 | 227 |
| 228 FilterEvent last_filter_event_; | 228 FilterEvent last_filter_event_; |
| 229 bool message_filtering_enabled_; | 229 bool message_filtering_enabled_; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 class IPCChannelProxyTest : public IPCTestBase { | 232 class IPCChannelProxyTest : public IPCTestBase { |
| 233 public: | 233 public: |
| 234 IPCChannelProxyTest() {} | 234 IPCChannelProxyTest() {} |
| 235 virtual ~IPCChannelProxyTest() {} | 235 ~IPCChannelProxyTest() override {} |
| 236 | 236 |
| 237 virtual void SetUp() override { | 237 void SetUp() override { |
| 238 IPCTestBase::SetUp(); | 238 IPCTestBase::SetUp(); |
| 239 | 239 |
| 240 Init("ChannelProxyClient"); | 240 Init("ChannelProxyClient"); |
| 241 | 241 |
| 242 thread_.reset(new base::Thread("ChannelProxyTestServerThread")); | 242 thread_.reset(new base::Thread("ChannelProxyTestServerThread")); |
| 243 base::Thread::Options options; | 243 base::Thread::Options options; |
| 244 options.message_loop_type = base::MessageLoop::TYPE_IO; | 244 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 245 thread_->StartWithOptions(options); | 245 thread_->StartWithOptions(options); |
| 246 | 246 |
| 247 listener_.reset(new QuitListener()); | 247 listener_.reset(new QuitListener()); |
| 248 CreateChannelProxy(listener_.get(), thread_->message_loop_proxy().get()); | 248 CreateChannelProxy(listener_.get(), thread_->message_loop_proxy().get()); |
| 249 | 249 |
| 250 ASSERT_TRUE(StartClient()); | 250 ASSERT_TRUE(StartClient()); |
| 251 } | 251 } |
| 252 | 252 |
| 253 virtual void TearDown() { | 253 void TearDown() override { |
| 254 DestroyChannelProxy(); | 254 DestroyChannelProxy(); |
| 255 thread_.reset(); | 255 thread_.reset(); |
| 256 listener_.reset(); | 256 listener_.reset(); |
| 257 IPCTestBase::TearDown(); | 257 IPCTestBase::TearDown(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void SendQuitMessageAndWaitForIdle() { | 260 void SendQuitMessageAndWaitForIdle() { |
| 261 sender()->Send(new WorkerMsg_Quit); | 261 sender()->Send(new WorkerMsg_Quit); |
| 262 base::MessageLoop::current()->Run(); | 262 base::MessageLoop::current()->Run(); |
| 263 EXPECT_TRUE(WaitForClientShutdown()); | 263 EXPECT_TRUE(WaitForClientShutdown()); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |