blob: 448b177d46c7a65e68357222aaecc0edf4bf8b2a [file] [log] [blame]
[email protected]500456f2012-06-07 17:05:361// 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
3// found in the LICENSE file.
4
5#include "base/at_exit.h"
6#include "base/command_line.h"
Carlos Caballerodd8bf7b042019-07-30 14:14:157#include "base/message_loop/message_pump_type.h"
[email protected]500456f2012-06-07 17:05:368#include "base/test/test_timeouts.h"
9#include "dbus/bus.h"
10#include "dbus/test_service.h"
11
12int main(int argc, char** argv) {
13 base::AtExitManager exit_manager;
avi9ab037202014-12-22 23:49:5314 base::CommandLine::Init(argc, argv);
[email protected]500456f2012-06-07 17:05:3615 TestTimeouts::Initialize();
16
gab8504bff2016-07-21 13:42:5717 base::Thread dbus_thread("D-Bus Thread");
[email protected]500456f2012-06-07 17:05:3618 base::Thread::Options thread_options;
Carlos Caballerodd8bf7b042019-07-30 14:14:1519 thread_options.message_pump_type = base::MessagePumpType::IO;
gab8504bff2016-07-21 13:42:5720 CHECK(dbus_thread.StartWithOptions(thread_options));
[email protected]500456f2012-06-07 17:05:3621
22 dbus::TestService::Options options;
gab8504bff2016-07-21 13:42:5723 options.dbus_task_runner = dbus_thread.task_runner();
[email protected]500456f2012-06-07 17:05:3624 dbus::TestService* test_service = new dbus::TestService(options);
25 CHECK(test_service->StartService());
Ryo Hashimoto3bbeb5c2018-08-13 04:58:3926 test_service->WaitUntilServiceIsStarted();
[email protected]500456f2012-06-07 17:05:3627 CHECK(test_service->HasDBusThread());
[email protected]500456f2012-06-07 17:05:3628}