Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc

Issue 697693004: Supervised users: if history recording is off, allow incognito and deleting history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/prefs/testing_pref_store.h" 8 #include "base/prefs/testing_pref_store.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 10 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const base::DictionaryValue* dict_value = NULL; 194 const base::DictionaryValue* dict_value = NULL;
195 ASSERT_TRUE(value->GetAsDictionary(&dict_value)); 195 ASSERT_TRUE(value->GetAsDictionary(&dict_value));
196 EXPECT_TRUE(dict_value->Equals(&dict)); 196 EXPECT_TRUE(dict_value->Equals(&dict));
197 } 197 }
198 198
199 TEST_F(SupervisedUserSettingsServiceTest, SetLocalSetting) { 199 TEST_F(SupervisedUserSettingsServiceTest, SetLocalSetting) {
200 const base::Value* value = NULL; 200 const base::Value* value = NULL;
201 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSettingsName, &value)); 201 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSettingsName, &value));
202 202
203 settings_.reset(); 203 settings_.reset();
204 settings_service_.SetLocalSettingForTesting( 204 settings_service_.SetLocalSetting(
205 kSettingsName, 205 kSettingsName,
206 scoped_ptr<base::Value>(new base::StringValue(kSettingsValue))); 206 scoped_ptr<base::Value>(new base::StringValue(kSettingsValue)));
207 ASSERT_TRUE(settings_); 207 ASSERT_TRUE(settings_);
208 ASSERT_TRUE(settings_->GetWithoutPathExpansion(kSettingsName, &value)); 208 ASSERT_TRUE(settings_->GetWithoutPathExpansion(kSettingsName, &value));
209 std::string string_value; 209 std::string string_value;
210 EXPECT_TRUE(value->GetAsString(&string_value)); 210 EXPECT_TRUE(value->GetAsString(&string_value));
211 EXPECT_EQ(kSettingsValue, string_value); 211 EXPECT_EQ(kSettingsValue, string_value);
212 } 212 }
213 213
214 TEST_F(SupervisedUserSettingsServiceTest, UploadItem) { 214 TEST_F(SupervisedUserSettingsServiceTest, UploadItem) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // The uploaded items should not show up as settings. 280 // The uploaded items should not show up as settings.
281 const base::Value* value = NULL; 281 const base::Value* value = NULL;
282 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kAtomicItemName, &value)); 282 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kAtomicItemName, &value));
283 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSplitItemName, &value)); 283 EXPECT_FALSE(settings_->GetWithoutPathExpansion(kSplitItemName, &value));
284 284
285 // Restarting sync should not create any new changes. 285 // Restarting sync should not create any new changes.
286 settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS); 286 settings_service_.StopSyncing(syncer::SUPERVISED_USER_SETTINGS);
287 StartSyncing(sync_data); 287 StartSyncing(sync_data);
288 ASSERT_EQ(0u, sync_processor_->changes().size()); 288 ASSERT_EQ(0u, sync_processor_->changes().size());
289 } 289 }
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_settings_service.cc ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698