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

Side by Side Diff: chrome/browser/prefs/pref_model_associator_unittest.cc

Issue 7634018: base: Rename ValueType to something less redundant as _just_ Type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/prefs/default_pref_store.cc ('k') | chrome/browser/prefs/pref_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/values.h" 6 #include "base/values.h"
7 #include "chrome/browser/prefs/pref_model_associator.h" 7 #include "chrome/browser/prefs/pref_model_associator.h"
8 #include "chrome/browser/prefs/scoped_user_pref_update.h" 8 #include "chrome/browser/prefs/scoped_user_pref_update.h"
9 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "chrome/test/base/testing_browser_process_test.h" 10 #include "chrome/test/base/testing_browser_process_test.h"
(...skipping 21 matching lines...) Expand all
32 expression_dict->SetWithoutPathExpansion( 32 expression_dict->SetWithoutPathExpansion(
33 content_type, 33 content_type,
34 Value::CreateIntegerValue(setting)); 34 Value::CreateIntegerValue(setting));
35 } 35 }
36 36
37 void SetPrefToEmpty(const std::string& pref_name) { 37 void SetPrefToEmpty(const std::string& pref_name) {
38 scoped_ptr<Value> empty_value; 38 scoped_ptr<Value> empty_value;
39 const PrefService::Preference* pref = 39 const PrefService::Preference* pref =
40 pref_service_->FindPreference(pref_name.c_str()); 40 pref_service_->FindPreference(pref_name.c_str());
41 ASSERT_TRUE(pref); 41 ASSERT_TRUE(pref);
42 Value::ValueType type = pref->GetType(); 42 base::Value::Type type = pref->GetType();
43 if (type == Value::TYPE_DICTIONARY) 43 if (type == Value::TYPE_DICTIONARY)
44 empty_value.reset(new DictionaryValue); 44 empty_value.reset(new DictionaryValue);
45 else if (type == Value::TYPE_LIST) 45 else if (type == Value::TYPE_LIST)
46 empty_value.reset(new ListValue); 46 empty_value.reset(new ListValue);
47 else 47 else
48 FAIL(); 48 FAIL();
49 pref_service_->Set(pref_name.c_str(), *empty_value); 49 pref_service_->Set(pref_name.c_str(), *empty_value);
50 } 50 }
51 51
52 TestingProfile profile_; 52 TestingProfile profile_;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 EXPECT_TRUE(MergeListPreference(prefs::kDesktopNotificationDeniedOrigins)); 394 EXPECT_TRUE(MergeListPreference(prefs::kDesktopNotificationDeniedOrigins));
395 } 395 }
396 396
397 TEST_F(IndividualPreferenceMergeTest, ContentSettingsPatterns) { 397 TEST_F(IndividualPreferenceMergeTest, ContentSettingsPatterns) {
398 EXPECT_TRUE(MergeDictionaryPreference(prefs::kContentSettingsPatterns)); 398 EXPECT_TRUE(MergeDictionaryPreference(prefs::kContentSettingsPatterns));
399 } 399 }
400 400
401 TEST_F(IndividualPreferenceMergeTest, GeolocationContentSettings) { 401 TEST_F(IndividualPreferenceMergeTest, GeolocationContentSettings) {
402 EXPECT_TRUE(MergeDictionaryPreference(prefs::kGeolocationContentSettings)); 402 EXPECT_TRUE(MergeDictionaryPreference(prefs::kGeolocationContentSettings));
403 } 403 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/default_pref_store.cc ('k') | chrome/browser/prefs/pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698