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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/net/safe_search_util.h" | 10 #include "chrome/browser/net/safe_search_util.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 EXPECT_EQ(1u, fixture.changed_prefs()->size()); | 140 EXPECT_EQ(1u, fixture.changed_prefs()->size()); |
141 ASSERT_TRUE(fixture.changed_prefs()->GetDictionary( | 141 ASSERT_TRUE(fixture.changed_prefs()->GetDictionary( |
142 prefs::kSupervisedUserManualHosts, &manual_hosts)); | 142 prefs::kSupervisedUserManualHosts, &manual_hosts)); |
143 EXPECT_TRUE(manual_hosts->Equals(dict.get())); | 143 EXPECT_TRUE(manual_hosts->Equals(dict.get())); |
144 | 144 |
145 // kForceGoogleSafeSearch and kForceYouTubeRestrict can be configured by the | 145 // kForceGoogleSafeSearch and kForceYouTubeRestrict can be configured by the |
146 // custodian, overriding the hardcoded default. | 146 // custodian, overriding the hardcoded default. |
147 fixture.changed_prefs()->Clear(); | 147 fixture.changed_prefs()->Clear(); |
148 service_.SetLocalSetting( | 148 service_.SetLocalSetting( |
149 supervised_users::kForceSafeSearch, | 149 supervised_users::kForceSafeSearch, |
150 std::unique_ptr<base::Value>(new base::FundamentalValue(false))); | 150 std::unique_ptr<base::Value>(new base::Value(false))); |
151 EXPECT_EQ(1u, fixture.changed_prefs()->size()); | 151 EXPECT_EQ(1u, fixture.changed_prefs()->size()); |
152 EXPECT_TRUE(fixture.changed_prefs()->GetBoolean(prefs::kForceGoogleSafeSearch, | 152 EXPECT_TRUE(fixture.changed_prefs()->GetBoolean(prefs::kForceGoogleSafeSearch, |
153 &force_google_safesearch)); | 153 &force_google_safesearch)); |
154 EXPECT_TRUE(fixture.changed_prefs()->GetInteger(prefs::kForceYouTubeRestrict, | 154 EXPECT_TRUE(fixture.changed_prefs()->GetInteger(prefs::kForceYouTubeRestrict, |
155 &force_youtube_restrict)); | 155 &force_youtube_restrict)); |
156 EXPECT_FALSE(force_google_safesearch); | 156 EXPECT_FALSE(force_google_safesearch); |
157 EXPECT_EQ(force_youtube_restrict, safe_search_util::YOUTUBE_RESTRICT_OFF); | 157 EXPECT_EQ(force_youtube_restrict, safe_search_util::YOUTUBE_RESTRICT_OFF); |
158 } | 158 } |
159 | 159 |
160 TEST_F(SupervisedUserPrefStoreTest, ActivateSettingsBeforeInitialization) { | 160 TEST_F(SupervisedUserPrefStoreTest, ActivateSettingsBeforeInitialization) { |
(...skipping 11 matching lines...) Expand all Loading... |
172 | 172 |
173 TEST_F(SupervisedUserPrefStoreTest, CreatePrefStoreAfterInitialization) { | 173 TEST_F(SupervisedUserPrefStoreTest, CreatePrefStoreAfterInitialization) { |
174 pref_store_->SetInitializationCompleted(); | 174 pref_store_->SetInitializationCompleted(); |
175 service_.SetActive(true); | 175 service_.SetActive(true); |
176 | 176 |
177 SupervisedUserPrefStoreFixture fixture(&service_); | 177 SupervisedUserPrefStoreFixture fixture(&service_); |
178 EXPECT_TRUE(fixture.initialization_completed()); | 178 EXPECT_TRUE(fixture.initialization_completed()); |
179 EXPECT_EQ(0u, fixture.changed_prefs()->size()); | 179 EXPECT_EQ(0u, fixture.changed_prefs()->size()); |
180 } | 180 } |
181 | 181 |
OLD | NEW |