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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h"
(...skipping 21 matching lines...) Expand all
32 return &profile_prefs_; 32 return &profile_prefs_;
33 } 33 }
34 34
35 // Initializes a list with ten string representations of successive int64_t 35 // Initializes a list with ten string representations of successive int64_t
36 // values, starting with |starting_value|. 36 // values, starting with |starting_value|.
37 void InitializeList(const char* pref_name, 37 void InitializeList(const char* pref_name,
38 int64_t starting_value, 38 int64_t starting_value,
39 PrefService* pref_service) { 39 PrefService* pref_service) {
40 ListPrefUpdate list(local_state_prefs(), pref_name); 40 ListPrefUpdate list(local_state_prefs(), pref_name);
41 for (int64_t i = 0; i < 10L; ++i) { 41 for (int64_t i = 0; i < 10L; ++i) {
42 list->Set(i, new base::StringValue( 42 list->Set(i, new base::Value(base::Int64ToString(i + starting_value)));
43 base::Int64ToString(i + starting_value)));
44 } 43 }
45 } 44 }
46 45
47 // Verifies that ten string repreentations of successive int64_t values 46 // Verifies that ten string repreentations of successive int64_t values
48 // starting with |starting_value| are found in the |ListValue| with the 47 // starting with |starting_value| are found in the |ListValue| with the
49 // associated |pref_name|. 48 // associated |pref_name|.
50 void VerifyList(const char* pref_name, 49 void VerifyList(const char* pref_name,
51 int64_t starting_value, 50 int64_t starting_value,
52 PrefService* pref_service) { 51 PrefService* pref_service) {
53 const base::ListValue* list_value = pref_service->GetList(pref_name); 52 const base::ListValue* list_value = pref_service->GetList(pref_name);
(...skipping 30 matching lines...) Expand all
84 registry->RegisterListPref(prefs::kDailyContentLengthViaDataReductionProxy); 83 registry->RegisterListPref(prefs::kDailyContentLengthViaDataReductionProxy);
85 registry->RegisterInt64Pref( 84 registry->RegisterInt64Pref(
86 prefs::kDailyHttpContentLengthLastUpdateDate, 0L); 85 prefs::kDailyHttpContentLengthLastUpdateDate, 0L);
87 } 86 }
88 87
89 TestingPrefServiceSimple local_state_prefs_; 88 TestingPrefServiceSimple local_state_prefs_;
90 TestingPrefServiceSimple profile_prefs_; 89 TestingPrefServiceSimple profile_prefs_;
91 }; 90 };
92 91
93 } // namespace data_reduction_proxy 92 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698