OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/service/service_ipc_server.h" | 5 #include "chrome/service/service_ipc_server.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/common/service_messages.h" | 18 #include "chrome/common/service_messages.h" |
19 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
20 #include "ipc/ipc_channel_handle.h" | |
21 #include "ipc/ipc_channel_mojo.h" | 20 #include "ipc/ipc_channel_mojo.h" |
22 #include "mojo/public/cpp/system/message_pipe.h" | 21 #include "mojo/public/cpp/system/message_pipe.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
24 | 23 |
25 namespace { | 24 namespace { |
26 | 25 |
27 void PumpCurrentLoop() { | 26 void PumpCurrentLoop() { |
28 base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower( | 27 base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower( |
29 base::MessageLoop::current()); | 28 base::MessageLoop::current()); |
30 base::RunLoop().RunUntilIdle(); | 29 base::RunLoop().RunUntilIdle(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 new FakeMessageHandler(true /* should_handle */); | 256 new FakeMessageHandler(true /* should_handle */); |
258 server_->AddMessageHandler(base::WrapUnique(handler2)); | 257 server_->AddMessageHandler(base::WrapUnique(handler2)); |
259 FakeMessageHandler* handler3 = | 258 FakeMessageHandler* handler3 = |
260 new FakeMessageHandler(true /* should_handle */); | 259 new FakeMessageHandler(true /* should_handle */); |
261 server_->AddMessageHandler(base::WrapUnique(handler3)); | 260 server_->AddMessageHandler(base::WrapUnique(handler3)); |
262 SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); | 261 SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); |
263 ASSERT_EQ(1, handler1->handle_message_calls_); | 262 ASSERT_EQ(1, handler1->handle_message_calls_); |
264 ASSERT_EQ(1, handler2->handle_message_calls_); | 263 ASSERT_EQ(1, handler2->handle_message_calls_); |
265 ASSERT_EQ(0, handler3->handle_message_calls_); | 264 ASSERT_EQ(0, handler3->handle_message_calls_); |
266 } | 265 } |
OLD | NEW |