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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 expression_dict->SetWithoutPathExpansion( 74 expression_dict->SetWithoutPathExpansion(
75 "setting", new base::FundamentalValue(setting)); 75 "setting", new base::FundamentalValue(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);
86 else if (type == base::Value::TYPE_LIST) 86 else if (type == base::Value::Type::LIST)
87 empty_value.reset(new base::ListValue); 87 empty_value.reset(new base::ListValue);
88 else 88 else
89 FAIL(); 89 FAIL();
90 pref_service_->Set(pref_name.c_str(), *empty_value); 90 pref_service_->Set(pref_name.c_str(), *empty_value);
91 } 91 }
92 92
93 TestPrefModelAssociatorClient client_; 93 TestPrefModelAssociatorClient client_;
94 std::unique_ptr<PrefServiceSyncable> pref_service_; 94 std::unique_ptr<PrefServiceSyncable> pref_service_;
95 PrefModelAssociator* pref_sync_service_; 95 PrefModelAssociator* pref_sync_service_;
96 }; 96 };
(...skipping 335 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_preferences/pref_model_associator.cc ('k') | components/tracing/browser/trace_config_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698