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

Unified Diff: chromeos/dbus/fake_session_manager_client.cc

Issue 228703004: Start session fail causes restart chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments and rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | chromeos/dbus/mock_session_manager_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_session_manager_client.cc
diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc
index 306ade59bb9f3b10c736b9f0a491593205535d31..db1c4a528beb0b46077d9de67191cad7440793be 100644
--- a/chromeos/dbus/fake_session_manager_client.cc
+++ b/chromeos/dbus/fake_session_manager_client.cc
@@ -46,11 +46,20 @@ void FakeSessionManagerClient::RestartJob(int pid,
const std::string& command_line) {
}
-void FakeSessionManagerClient::StartSession(const std::string& user_email) {
+void FakeSessionManagerClient::StartSession(
+ const std::string& user_email,
+ const StartSessionCallback& callback) {
DCHECK_EQ(0UL, user_sessions_.count(user_email));
std::string user_id_hash =
CryptohomeClient::GetStubSanitizedUsername(user_email);
user_sessions_[user_email] = user_id_hash;
+ base::MessageLoop* loop = base::MessageLoop::current();
+ // We need to check cause in some testing environments there is no loop and
+ // MessageLoop::current() returns NULL.
oshima 2014/04/22 10:03:32 Isn't it possible to create a message lop in such
Roman Sorokin (ftl) 2014/04/24 11:49:25 Yes, it is. In this browser test we need to start
+ if (loop)
+ loop->PostTask(FROM_HERE, base::Bind(callback, true));
+ else
+ callback.Run(true);
}
void FakeSessionManagerClient::StopSession() {
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | chromeos/dbus/mock_session_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698