diff options
Diffstat (limited to 'chromeos/dbus/services')
-rw-r--r-- | chromeos/dbus/services/service_provider_test_helper.cc | 8 | ||||
-rw-r--r-- | chromeos/dbus/services/service_provider_test_helper.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/chromeos/dbus/services/service_provider_test_helper.cc b/chromeos/dbus/services/service_provider_test_helper.cc index c4c5c65..9b70172 100644 --- a/chromeos/dbus/services/service_provider_test_helper.cc +++ b/chromeos/dbus/services/service_provider_test_helper.cc @@ -20,6 +20,8 @@ namespace chromeos { ServiceProviderTestHelper::ServiceProviderTestHelper() : response_received_(false) { + if (!base::MessageLoop::current()) + message_loop_.reset(new base::MessageLoop()); } ServiceProviderTestHelper::~ServiceProviderTestHelper() { @@ -129,7 +131,7 @@ dbus::Response* ServiceProviderTestHelper::MockCallMethodAndBlock( base::Unretained(this))); // Check for a response. if (!response_received_) - message_loop_.Run(); + base::MessageLoop::current()->Run(); // Return response. return response_.release(); } @@ -155,8 +157,8 @@ void ServiceProviderTestHelper::OnResponse( scoped_ptr<dbus::Response> response) { response_ = response.Pass(); response_received_ = true; - if (message_loop_.is_running()) - message_loop_.Quit(); + if (base::MessageLoop::current()->is_running()) + base::MessageLoop::current()->Quit(); } } // namespace chromeos diff --git a/chromeos/dbus/services/service_provider_test_helper.h b/chromeos/dbus/services/service_provider_test_helper.h index 196f6a6..c5091b1 100644 --- a/chromeos/dbus/services/service_provider_test_helper.h +++ b/chromeos/dbus/services/service_provider_test_helper.h @@ -88,7 +88,7 @@ class ServiceProviderTestHelper { scoped_refptr<dbus::MockObjectProxy> mock_object_proxy_; dbus::ExportedObject::MethodCallCallback method_callback_; dbus::ObjectProxy::SignalCallback on_signal_callback_; - base::MessageLoop message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; bool response_received_; scoped_ptr<dbus::Response> response_; }; |