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

Side by Side Diff: components/sync_preferences/pref_model_associator_unittest.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years 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
« no previous file with comments | « components/sync/syncable/entry_kernel.cc ('k') | components/test_runner/tracked_dictionary.cc » ('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 "components/sync_preferences/pref_model_associator.h" 5 #include "components/sync_preferences/pref_model_associator.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const std::string& expression, 65 const std::string& expression,
66 int setting) { 66 int setting) {
67 base::DictionaryValue* expression_dict; 67 base::DictionaryValue* expression_dict;
68 bool found = patterns_dict->GetDictionaryWithoutPathExpansion( 68 bool found = patterns_dict->GetDictionaryWithoutPathExpansion(
69 expression, &expression_dict); 69 expression, &expression_dict);
70 if (!found) { 70 if (!found) {
71 expression_dict = new base::DictionaryValue; 71 expression_dict = new base::DictionaryValue;
72 patterns_dict->SetWithoutPathExpansion(expression, expression_dict); 72 patterns_dict->SetWithoutPathExpansion(expression, expression_dict);
73 } 73 }
74 expression_dict->SetWithoutPathExpansion( 74 expression_dict->SetWithoutPathExpansion(
75 "setting", new base::FundamentalValue(setting)); 75 "setting", new base::Value(setting));
76 } 76 }
77 77
78 void SetPrefToEmpty(const std::string& pref_name) { 78 void SetPrefToEmpty(const std::string& pref_name) {
79 std::unique_ptr<base::Value> empty_value; 79 std::unique_ptr<base::Value> empty_value;
80 const PrefService::Preference* pref = 80 const PrefService::Preference* pref =
81 pref_service_->FindPreference(pref_name.c_str()); 81 pref_service_->FindPreference(pref_name.c_str());
82 ASSERT_TRUE(pref); 82 ASSERT_TRUE(pref);
83 base::Value::Type type = pref->GetType(); 83 base::Value::Type type = pref->GetType();
84 if (type == base::Value::TYPE_DICTIONARY) 84 if (type == base::Value::TYPE_DICTIONARY)
85 empty_value.reset(new base::DictionaryValue); 85 empty_value.reset(new base::DictionaryValue);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 base::DictionaryValue server_patterns_; 432 base::DictionaryValue server_patterns_;
433 }; 433 };
434 434
435 TEST_F(IndividualPreferenceMergeTest, ListPreference) { 435 TEST_F(IndividualPreferenceMergeTest, ListPreference) {
436 EXPECT_TRUE(MergeListPreference(kListPrefName)); 436 EXPECT_TRUE(MergeListPreference(kListPrefName));
437 } 437 }
438 438
439 } // namespace 439 } // namespace
440 440
441 } // namespace sync_preferences 441 } // namespace sync_preferences
OLDNEW
« no previous file with comments | « components/sync/syncable/entry_kernel.cc ('k') | components/test_runner/tracked_dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698