Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: chromeos/dbus/services/service_provider_test_helper.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: fix compile and add RunLoopTests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698