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 "chromeos/dbus/services/service_provider_test_helper.h" | 5 #include "chromeos/dbus/services/service_provider_test_helper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void ServiceProviderTestHelper::MockSendSignal(dbus::Signal* signal) { | 151 void ServiceProviderTestHelper::MockSendSignal(dbus::Signal* signal) { |
152 // Run the callback captured in MockConnectToSignal(). This will call | 152 // Run the callback captured in MockConnectToSignal(). This will call |
153 // OnSignalReceived(). | 153 // OnSignalReceived(). |
154 on_signal_callback_.Run(signal); | 154 on_signal_callback_.Run(signal); |
155 } | 155 } |
156 | 156 |
157 void ServiceProviderTestHelper::OnResponse( | 157 void ServiceProviderTestHelper::OnResponse( |
158 std::unique_ptr<dbus::Response> response) { | 158 std::unique_ptr<dbus::Response> response) { |
159 response_ = std::move(response); | 159 response_ = std::move(response); |
160 response_received_ = true; | 160 response_received_ = true; |
161 if (base::MessageLoop::current()->is_running()) | 161 if (base::RunLoop::IsRunningOnCurrentThread()) |
162 base::MessageLoop::current()->QuitWhenIdle(); | 162 base::MessageLoop::current()->QuitWhenIdle(); |
163 } | 163 } |
164 | 164 |
165 } // namespace chromeos | 165 } // namespace chromeos |
OLD | NEW |