OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/message_loop/message_loop.h" |
7 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
8 #include "dbus/bus.h" | 9 #include "dbus/bus.h" |
9 #include "dbus/test_service.h" | 10 #include "dbus/test_service.h" |
10 | 11 |
11 int main(int argc, char** argv) { | 12 int main(int argc, char** argv) { |
12 base::AtExitManager exit_manager; | 13 base::AtExitManager exit_manager; |
13 base::CommandLine::Init(argc, argv); | 14 base::CommandLine::Init(argc, argv); |
14 TestTimeouts::Initialize(); | 15 TestTimeouts::Initialize(); |
15 | 16 |
16 base::Thread dbus_thread("D-Bus Thread"); | 17 base::Thread dbus_thread("D-Bus Thread"); |
17 base::Thread::Options thread_options; | 18 base::Thread::Options thread_options; |
18 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; | 19 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; |
19 CHECK(dbus_thread.StartWithOptions(thread_options)); | 20 CHECK(dbus_thread.StartWithOptions(thread_options)); |
20 | 21 |
21 dbus::TestService::Options options; | 22 dbus::TestService::Options options; |
22 options.dbus_task_runner = dbus_thread.task_runner(); | 23 options.dbus_task_runner = dbus_thread.task_runner(); |
23 dbus::TestService* test_service = new dbus::TestService(options); | 24 dbus::TestService* test_service = new dbus::TestService(options); |
24 CHECK(test_service->StartService()); | 25 CHECK(test_service->StartService()); |
25 CHECK(test_service->WaitUntilServiceIsStarted()); | 26 CHECK(test_service->WaitUntilServiceIsStarted()); |
26 CHECK(test_service->HasDBusThread()); | 27 CHECK(test_service->HasDBusThread()); |
27 } | 28 } |
OLD | NEW |