OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/prefs/pref_service.h" | |
8 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" | 7 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice.h" |
9 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice_factory.h" | 8 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser
vice_factory.h" |
10 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" | 9 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service.h" |
11 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" | 10 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_
service_factory.h" |
12 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 11 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
13 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/prefs/pref_service.h" |
15 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 const char kFakeSupervisedUserId[] = "fakeID"; | 18 const char kFakeSupervisedUserId[] = "fakeID"; |
19 | 19 |
20 class SupervisedUserPrefMappingServiceTest : public ::testing::Test { | 20 class SupervisedUserPrefMappingServiceTest : public ::testing::Test { |
21 protected: | 21 protected: |
22 SupervisedUserPrefMappingServiceTest() { | 22 SupervisedUserPrefMappingServiceTest() { |
23 profile_.GetPrefs()->SetString(prefs::kSupervisedUserId, | 23 profile_.GetPrefs()->SetString(prefs::kSupervisedUserId, |
24 kFakeSupervisedUserId); | 24 kFakeSupervisedUserId); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 TEST_F(SupervisedUserPrefMappingServiceTest, CheckSharedSettingUpdate) { | 60 TEST_F(SupervisedUserPrefMappingServiceTest, CheckSharedSettingUpdate) { |
61 EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), -1); | 61 EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), -1); |
62 shared_settings_service_->SetValue(kFakeSupervisedUserId, | 62 shared_settings_service_->SetValue(kFakeSupervisedUserId, |
63 supervised_users::kChromeAvatarIndex, | 63 supervised_users::kChromeAvatarIndex, |
64 base::FundamentalValue(1)); | 64 base::FundamentalValue(1)); |
65 mapping_service_->OnSharedSettingChanged( | 65 mapping_service_->OnSharedSettingChanged( |
66 kFakeSupervisedUserId, | 66 kFakeSupervisedUserId, |
67 supervised_users::kChromeAvatarIndex); | 67 supervised_users::kChromeAvatarIndex); |
68 EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), 1); | 68 EXPECT_EQ(profile_.GetPrefs()->GetInteger(prefs::kProfileAvatarIndex), 1); |
69 } | 69 } |
OLD | NEW |