summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/fake_session_manager_client.cc8
-rw-r--r--chromeos/dbus/fake_session_manager_client.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc
index e979c00..6e5c162 100644
--- a/chromeos/dbus/fake_session_manager_client.cc
+++ b/chromeos/dbus/fake_session_manager_client.cc
@@ -8,6 +8,7 @@
#include "base/location.h"
#include "base/message_loop.h"
#include "base/string_util.h"
+#include "chromeos/dbus/cryptohome_client.h"
namespace chromeos {
@@ -47,6 +48,10 @@ void FakeSessionManagerClient::RestartEntd() {
}
void FakeSessionManagerClient::StartSession(const std::string& user_email) {
+ DCHECK_EQ(0UL, user_sessions_.count(user_email));
+ std::string user_id_hash =
+ CryptohomeClient::GetStubSanitizedUsername(user_email);
+ user_sessions_[user_email] = user_id_hash;
}
void FakeSessionManagerClient::StopSession() {
@@ -71,10 +76,9 @@ void FakeSessionManagerClient::NotifyLockScreenDismissed() {
void FakeSessionManagerClient::RetrieveActiveSessions(
const ActiveSessionsCallback& callback) {
- ActiveSessionsMap sessions;
MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback,
- sessions,
+ user_sessions_,
true));
}
diff --git a/chromeos/dbus/fake_session_manager_client.h b/chromeos/dbus/fake_session_manager_client.h
index 6ff37cc..044314f 100644
--- a/chromeos/dbus/fake_session_manager_client.h
+++ b/chromeos/dbus/fake_session_manager_client.h
@@ -93,6 +93,7 @@ class FakeSessionManagerClient : public chromeos::SessionManagerClient {
std::map<std::string, std::string> user_policies_;
std::map<std::string, std::string> device_local_account_policy_;
ObserverList<Observer> observers_;
+ SessionManagerClient::ActiveSessionsMap user_sessions_;
int emit_login_prompt_ready_call_count_;
int notify_lock_screen_shown_call_count_;