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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "build/build_config.h" |
14 #include "chrome/common/service_messages.h" | 15 #include "chrome/common/service_messages.h" |
15 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
16 #include "ipc/ipc_channel_handle.h" | 17 #include "ipc/ipc_channel_handle.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 void PumpCurrentLoop() { | 22 void PumpCurrentLoop() { |
22 base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower( | 23 base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower( |
23 base::MessageLoop::current()); | 24 base::MessageLoop::current()); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 new FakeMessageHandler(true /* should_handle */); | 255 new FakeMessageHandler(true /* should_handle */); |
255 server_->AddMessageHandler(make_scoped_ptr(handler2)); | 256 server_->AddMessageHandler(make_scoped_ptr(handler2)); |
256 FakeMessageHandler* handler3 = | 257 FakeMessageHandler* handler3 = |
257 new FakeMessageHandler(true /* should_handle */); | 258 new FakeMessageHandler(true /* should_handle */); |
258 server_->AddMessageHandler(make_scoped_ptr(handler3)); | 259 server_->AddMessageHandler(make_scoped_ptr(handler3)); |
259 SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); | 260 SendToServiceProcess(new ServiceMsg_DisableCloudPrintProxy()); |
260 ASSERT_EQ(1, handler1->handle_message_calls_); | 261 ASSERT_EQ(1, handler1->handle_message_calls_); |
261 ASSERT_EQ(1, handler2->handle_message_calls_); | 262 ASSERT_EQ(1, handler2->handle_message_calls_); |
262 ASSERT_EQ(0, handler3->handle_message_calls_); | 263 ASSERT_EQ(0, handler3->handle_message_calls_); |
263 } | 264 } |
OLD | NEW |