Chromium Code Reviews| Index: chrome/browser/policy/device_local_account_browsertest.cc |
| diff --git a/chrome/browser/policy/device_local_account_browsertest.cc b/chrome/browser/policy/device_local_account_browsertest.cc |
| index fe48d477160d2315868d77b700dd1208b23374a4..b24508d618f7895ffeb0e18354420a9ecada2a8c 100644 |
| --- a/chrome/browser/policy/device_local_account_browsertest.cc |
| +++ b/chrome/browser/policy/device_local_account_browsertest.cc |
| @@ -43,6 +43,7 @@ |
| #include "chromeos/dbus/cryptohome_client.h" |
| #include "chromeos/dbus/dbus_method_call_status.h" |
| #include "chromeos/dbus/dbus_thread_manager.h" |
| +#include "chromeos/dbus/fake_session_manager_client.h" |
|
bartfab (slow)
2013/02/25 16:51:23
You should update the list of includes, removing t
dconnelly
2013/02/26 18:04:15
Done.
|
| #include "chromeos/dbus/mock_dbus_thread_manager.h" |
| #include "chromeos/dbus/session_manager_client.h" |
| #include "content/public/browser/notification_observer.h" |
| @@ -107,97 +108,6 @@ class NotificationWatcher : public content::NotificationObserver { |
| DISALLOW_COPY_AND_ASSIGN(NotificationWatcher); |
| }; |
| -// A fake implementation of session_manager. Accepts policy blobs to be set and |
| -// returns them unmodified. |
| -class FakeSessionManagerClient : public chromeos::SessionManagerClient { |
| - public: |
| - FakeSessionManagerClient() {} |
| - virtual ~FakeSessionManagerClient() {} |
| - |
| - // SessionManagerClient: |
| - virtual void AddObserver(Observer* observer) OVERRIDE {} |
| - virtual void RemoveObserver(Observer* observer) OVERRIDE {} |
| - virtual bool HasObserver(Observer* observer) OVERRIDE { return false; } |
| - virtual void EmitLoginPromptReady() OVERRIDE {} |
| - virtual void EmitLoginPromptVisible() OVERRIDE {} |
| - virtual void RestartJob(int pid, const std::string& command_line) OVERRIDE {} |
| - virtual void RestartEntd() OVERRIDE {} |
| - virtual void StartSession(const std::string& user_email) OVERRIDE {} |
| - virtual void StopSession() OVERRIDE {} |
| - virtual void StartDeviceWipe() OVERRIDE {} |
| - virtual void RequestLockScreen() OVERRIDE {} |
| - virtual void NotifyLockScreenShown() OVERRIDE {} |
| - virtual void RequestUnlockScreen() OVERRIDE {} |
| - virtual void NotifyLockScreenDismissed() OVERRIDE {} |
| - virtual void RetrieveDevicePolicy( |
| - const RetrievePolicyCallback& callback) OVERRIDE { |
| - MessageLoop::current()->PostTask(FROM_HERE, |
| - base::Bind(callback, device_policy_)); |
| - } |
| - virtual void RetrieveUserPolicy( |
| - const RetrievePolicyCallback& callback) OVERRIDE { |
| - MessageLoop::current()->PostTask(FROM_HERE, |
| - base::Bind(callback, user_policy_)); |
| - } |
| - virtual void RetrieveDeviceLocalAccountPolicy( |
| - const std::string& account_id, |
| - const RetrievePolicyCallback& callback) OVERRIDE { |
| - MessageLoop::current()->PostTask( |
| - FROM_HERE, |
| - base::Bind(callback, device_local_account_policy_[account_id])); |
| - } |
| - virtual void StoreDevicePolicy(const std::string& policy_blob, |
| - const StorePolicyCallback& callback) OVERRIDE { |
| - device_policy_ = policy_blob; |
| - MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true)); |
| - } |
| - virtual void StoreUserPolicy(const std::string& policy_blob, |
| - const StorePolicyCallback& callback) OVERRIDE { |
| - user_policy_ = policy_blob; |
| - MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true)); |
| - } |
| - virtual void StoreDeviceLocalAccountPolicy( |
| - const std::string& account_id, |
| - const std::string& policy_blob, |
| - const StorePolicyCallback& callback) OVERRIDE { |
| - device_local_account_policy_[account_id] = policy_blob; |
| - MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true)); |
| - } |
| - |
| - const std::string& device_policy() const { |
| - return device_policy_; |
| - } |
| - void set_device_policy(const std::string& policy_blob) { |
| - device_policy_ = policy_blob; |
| - } |
| - |
| - const std::string& user_policy() const { |
| - return user_policy_; |
| - } |
| - void set_user_policy(const std::string& policy_blob) { |
| - user_policy_ = policy_blob; |
| - } |
| - |
| - const std::string& device_local_account_policy( |
| - const std::string& account_id) const { |
| - std::map<std::string, std::string>::const_iterator entry = |
| - device_local_account_policy_.find(account_id); |
| - return entry != device_local_account_policy_.end() ? entry->second |
| - : EmptyString(); |
| - } |
| - void set_device_local_account_policy(const std::string& account_id, |
| - const std::string& policy_blob) { |
| - device_local_account_policy_[account_id] = policy_blob; |
| - } |
| - |
| - private: |
| - std::string device_policy_; |
| - std::string user_policy_; |
| - std::map<std::string, std::string> device_local_account_policy_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(FakeSessionManagerClient); |
| -}; |
| - |
| class FakeCryptohomeClient : public chromeos::CryptohomeClient { |
| public: |
| using chromeos::CryptohomeClient::AsyncMethodCallback; |
| @@ -479,7 +389,7 @@ class DeviceLocalAccountTest : public InProcessBrowserTest { |
| LocalPolicyTestServer test_server_; |
| base::ScopedTempDir temp_dir_; |
| - FakeSessionManagerClient session_manager_client_; |
| + chromeos::FakeSessionManagerClient session_manager_client_; |
| FakeCryptohomeClient cryptohome_client_; |
| }; |