| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" | 5 #include "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 class CloudExternalDataPolicyObserverTest | 91 class CloudExternalDataPolicyObserverTest |
| 92 : public chromeos::DeviceSettingsTestBase, | 92 : public chromeos::DeviceSettingsTestBase, |
| 93 public CloudExternalDataPolicyObserver::Delegate { | 93 public CloudExternalDataPolicyObserver::Delegate { |
| 94 public: | 94 public: |
| 95 typedef std::pair<std::string, std::string> FetchedCall; | 95 typedef std::pair<std::string, std::string> FetchedCall; |
| 96 | 96 |
| 97 CloudExternalDataPolicyObserverTest(); | 97 CloudExternalDataPolicyObserverTest(); |
| 98 virtual ~CloudExternalDataPolicyObserverTest(); | 98 virtual ~CloudExternalDataPolicyObserverTest(); |
| 99 | 99 |
| 100 // chromeos::DeviceSettingsTestBase: | 100 // chromeos::DeviceSettingsTestBase: |
| 101 virtual void SetUp() OVERRIDE; | 101 virtual void SetUp() override; |
| 102 virtual void TearDown() OVERRIDE; | 102 virtual void TearDown() override; |
| 103 | 103 |
| 104 // CloudExternalDataPolicyObserver::Delegate: | 104 // CloudExternalDataPolicyObserver::Delegate: |
| 105 virtual void OnExternalDataSet(const std::string& policy, | 105 virtual void OnExternalDataSet(const std::string& policy, |
| 106 const std::string& user_id) OVERRIDE; | 106 const std::string& user_id) override; |
| 107 virtual void OnExternalDataCleared(const std::string& policy, | 107 virtual void OnExternalDataCleared(const std::string& policy, |
| 108 const std::string& user_id) OVERRIDE; | 108 const std::string& user_id) override; |
| 109 virtual void OnExternalDataFetched(const std::string& policy, | 109 virtual void OnExternalDataFetched(const std::string& policy, |
| 110 const std::string& user_id, | 110 const std::string& user_id, |
| 111 scoped_ptr<std::string> data) OVERRIDE; | 111 scoped_ptr<std::string> data) override; |
| 112 | 112 |
| 113 void CreateObserver(); | 113 void CreateObserver(); |
| 114 | 114 |
| 115 void ClearObservations(); | 115 void ClearObservations(); |
| 116 | 116 |
| 117 void SetDeviceLocalAccountAvatarPolicy(const std::string& account_id, | 117 void SetDeviceLocalAccountAvatarPolicy(const std::string& account_id, |
| 118 const std::string& value); | 118 const std::string& value); |
| 119 | 119 |
| 120 void AddDeviceLocalAccount(const std::string& account_id); | 120 void AddDeviceLocalAccount(const std::string& account_id); |
| 121 void RemoveDeviceLocalAccount(const std::string& account_id); | 121 void RemoveDeviceLocalAccount(const std::string& account_id); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 | 947 |
| 948 EXPECT_TRUE(set_calls_.empty()); | 948 EXPECT_TRUE(set_calls_.empty()); |
| 949 EXPECT_TRUE(cleared_calls_.empty()); | 949 EXPECT_TRUE(cleared_calls_.empty()); |
| 950 ASSERT_EQ(1u, fetched_calls_.size()); | 950 ASSERT_EQ(1u, fetched_calls_.size()); |
| 951 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first); | 951 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first); |
| 952 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second); | 952 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second); |
| 953 ClearObservations(); | 953 ClearObservations(); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace policy | 956 } // namespace policy |
| OLD | NEW |