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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void ServiceProviderTestHelper::MockSendSignal(dbus::Signal* signal) { | 153 void ServiceProviderTestHelper::MockSendSignal(dbus::Signal* signal) { |
154 // Run the callback captured in MockConnectToSignal(). This will call | 154 // Run the callback captured in MockConnectToSignal(). This will call |
155 // OnSignalReceived(). | 155 // OnSignalReceived(). |
156 on_signal_callback_.Run(signal); | 156 on_signal_callback_.Run(signal); |
157 } | 157 } |
158 | 158 |
159 void ServiceProviderTestHelper::OnResponse( | 159 void ServiceProviderTestHelper::OnResponse( |
160 std::unique_ptr<dbus::Response> response) { | 160 std::unique_ptr<dbus::Response> response) { |
161 response_ = std::move(response); | 161 response_ = std::move(response); |
162 response_received_ = true; | 162 response_received_ = true; |
163 if (base::MessageLoop::current()->is_running()) | 163 if (base::RunLoop::IsRunningOnCurrentThread()) |
164 base::MessageLoop::current()->QuitWhenIdle(); | 164 base::MessageLoop::current()->QuitWhenIdle(); |
165 } | 165 } |
166 | 166 |
167 } // namespace chromeos | 167 } // namespace chromeos |
OLD | NEW |