Fix for Geolocation webTCT failures
[platform/framework/web/chromium-efl.git] / dbus / test_server.cc
1 // Copyright 2012 The Chromium Authors
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"
7 #include "base/message_loop/message_pump_type.h"
8 #include "base/test/test_timeouts.h"
9 #include "base/time/time.h"
10 #include "dbus/bus.h"
11 #include "dbus/test_service.h"
12
13 int main(int argc, char** argv) {
14   base::AtExitManager exit_manager;
15   base::CommandLine::Init(argc, argv);
16   TestTimeouts::Initialize();
17
18   base::Thread dbus_thread("D-Bus Thread");
19   base::Thread::Options thread_options;
20   thread_options.message_pump_type = base::MessagePumpType::IO;
21   CHECK(dbus_thread.StartWithOptions(std::move(thread_options)));
22
23   dbus::TestService::Options options;
24   options.dbus_task_runner = dbus_thread.task_runner();
25   dbus::TestService* test_service = new dbus::TestService(options);
26   CHECK(test_service->StartService());
27   test_service->WaitUntilServiceIsStarted();
28   CHECK(test_service->HasDBusThread());
29 }