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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/prefs/pref_registry_simple.h" | 6 #include "base/prefs/pref_registry_simple.h" |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" | 10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 namespace data_reduction_proxy { | 33 namespace data_reduction_proxy { |
34 | 34 |
35 class DataReductionProxyStatisticsPrefsTest : public testing::Test { | 35 class DataReductionProxyStatisticsPrefsTest : public testing::Test { |
36 protected: | 36 protected: |
37 DataReductionProxyStatisticsPrefsTest() | 37 DataReductionProxyStatisticsPrefsTest() |
38 : task_runner_(scoped_refptr<base::TestSimpleTaskRunner>( | 38 : task_runner_(scoped_refptr<base::TestSimpleTaskRunner>( |
39 new base::TestSimpleTaskRunner())) {} | 39 new base::TestSimpleTaskRunner())) {} |
40 | 40 |
41 virtual void SetUp() OVERRIDE { | 41 virtual void SetUp() override { |
42 RegisterPrefs(simple_pref_service_.registry()); | 42 RegisterPrefs(simple_pref_service_.registry()); |
43 } | 43 } |
44 | 44 |
45 // Create daily pref list of |kNumDaysInHistory| zero values. | 45 // Create daily pref list of |kNumDaysInHistory| zero values. |
46 void CreatePrefList(const char* pref) { | 46 void CreatePrefList(const char* pref) { |
47 base::ListValue* update = statistics_prefs_->GetList(pref); | 47 base::ListValue* update = statistics_prefs_->GetList(pref); |
48 update->Clear(); | 48 update->Clear(); |
49 for (size_t i = 0; i < kNumDaysInHistory; ++i) { | 49 for (size_t i = 0; i < kNumDaysInHistory; ++i) { |
50 update->Insert(0, new base::StringValue(base::Int64ToString(0))); | 50 update->Insert(0, new base::StringValue(base::Int64ToString(0))); |
51 } | 51 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 VerifyPrefWasWritten(data_reduction_proxy::prefs::kHttpOriginalContentLength); | 165 VerifyPrefWasWritten(data_reduction_proxy::prefs::kHttpOriginalContentLength); |
166 VerifyPrefWasWritten(data_reduction_proxy::prefs::kHttpReceivedContentLength); | 166 VerifyPrefWasWritten(data_reduction_proxy::prefs::kHttpReceivedContentLength); |
167 VerifyPrefListWasWritten( | 167 VerifyPrefListWasWritten( |
168 data_reduction_proxy::prefs::kDailyHttpOriginalContentLength); | 168 data_reduction_proxy::prefs::kDailyHttpOriginalContentLength); |
169 VerifyPrefListWasWritten( | 169 VerifyPrefListWasWritten( |
170 data_reduction_proxy::prefs::kDailyHttpReceivedContentLength); | 170 data_reduction_proxy::prefs::kDailyHttpReceivedContentLength); |
171 } | 171 } |
172 | 172 |
173 } // namespace data_reduction_proxy | 173 } // namespace data_reduction_proxy |
OLD | NEW |