OLD | NEW |
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/prefs/pref_registry_simple.h" | |
10 #include "base/prefs/pref_service.h" | |
11 #include "base/prefs/scoped_user_pref_update.h" | |
12 #include "base/prefs/testing_pref_service.h" | |
13 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
14 #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" |
| 11 #include "components/prefs/pref_registry_simple.h" |
| 12 #include "components/prefs/pref_service.h" |
| 13 #include "components/prefs/scoped_user_pref_update.h" |
| 14 #include "components/prefs/testing_pref_service.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace data_reduction_proxy { | 17 namespace data_reduction_proxy { |
18 | 18 |
19 class DataReductionProxyPrefsTest : public testing::Test { | 19 class DataReductionProxyPrefsTest : public testing::Test { |
20 public: | 20 public: |
21 void SetUp() override { | 21 void SetUp() override { |
22 RegisterPrefs(local_state_prefs_.registry()); | 22 RegisterPrefs(local_state_prefs_.registry()); |
23 PrefRegistrySimple* profile_registry = profile_prefs_.registry(); | 23 PrefRegistrySimple* profile_registry = profile_prefs_.registry(); |
24 RegisterPrefs(profile_registry); | 24 RegisterPrefs(profile_registry); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 EXPECT_TRUE(profile_prefs()->GetBoolean(prefs::kStatisticsPrefsMigrated)); | 208 EXPECT_TRUE(profile_prefs()->GetBoolean(prefs::kStatisticsPrefsMigrated)); |
209 | 209 |
210 // Migration should only happen once. | 210 // Migration should only happen once. |
211 local_state_prefs()->SetInt64(prefs::kHttpReceivedContentLength, 456L); | 211 local_state_prefs()->SetInt64(prefs::kHttpReceivedContentLength, 456L); |
212 data_reduction_proxy::MigrateStatisticsPrefs(local_state_prefs(), | 212 data_reduction_proxy::MigrateStatisticsPrefs(local_state_prefs(), |
213 profile_prefs()); | 213 profile_prefs()); |
214 EXPECT_EQ(123L, profile_prefs()->GetInt64(prefs::kHttpReceivedContentLength)); | 214 EXPECT_EQ(123L, profile_prefs()->GetInt64(prefs::kHttpReceivedContentLength)); |
215 } | 215 } |
216 | 216 |
217 } // namespace data_reduction_proxy | 217 } // namespace data_reduction_proxy |
OLD | NEW |