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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } | 347 } |
348 | 348 |
349 void CloudExternalDataPolicyObserverTest::SetRegularUserAvatarPolicy( | 349 void CloudExternalDataPolicyObserverTest::SetRegularUserAvatarPolicy( |
350 const std::string& value) { | 350 const std::string& value) { |
351 PolicyMap policy_map; | 351 PolicyMap policy_map; |
352 if (!value.empty()) { | 352 if (!value.empty()) { |
353 policy_map.Set( | 353 policy_map.Set( |
354 key::kUserAvatarImage, | 354 key::kUserAvatarImage, |
355 POLICY_LEVEL_MANDATORY, | 355 POLICY_LEVEL_MANDATORY, |
356 POLICY_SCOPE_USER, | 356 POLICY_SCOPE_USER, |
| 357 POLICY_SOURCE_CLOUD, |
357 new base::StringValue(value), | 358 new base::StringValue(value), |
358 external_data_manager_.CreateExternalDataFetcher( | 359 external_data_manager_.CreateExternalDataFetcher( |
359 key::kUserAvatarImage).release()); | 360 key::kUserAvatarImage).release()); |
360 } | 361 } |
361 user_policy_provider_.UpdateChromePolicy(policy_map); | 362 user_policy_provider_.UpdateChromePolicy(policy_map); |
362 } | 363 } |
363 | 364 |
364 void CloudExternalDataPolicyObserverTest::LogInAsRegularUser() { | 365 void CloudExternalDataPolicyObserverTest::LogInAsRegularUser() { |
365 user_manager_->AddUser(kRegularUserID); | 366 user_manager_->AddUser(kRegularUserID); |
366 | 367 |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 | 950 |
950 EXPECT_TRUE(set_calls_.empty()); | 951 EXPECT_TRUE(set_calls_.empty()); |
951 EXPECT_TRUE(cleared_calls_.empty()); | 952 EXPECT_TRUE(cleared_calls_.empty()); |
952 ASSERT_EQ(1u, fetched_calls_.size()); | 953 ASSERT_EQ(1u, fetched_calls_.size()); |
953 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first); | 954 EXPECT_EQ(kRegularUserID, fetched_calls_.front().first); |
954 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second); | 955 EXPECT_EQ(avatar_policy_2_data_, fetched_calls_.front().second); |
955 ClearObservations(); | 956 ClearObservations(); |
956 } | 957 } |
957 | 958 |
958 } // namespace policy | 959 } // namespace policy |
OLD | NEW |