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_comp
ression_stats.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/prefs/pref_registry_simple.h" |
| 16 #include "base/prefs/pref_service.h" |
| 17 #include "base/prefs/testing_pref_service.h" |
15 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
16 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
17 #include "base/test/histogram_tester.h" | 20 #include "base/test/histogram_tester.h" |
18 #include "base/time/time.h" | 21 #include "base/time/time.h" |
19 #include "base/values.h" | 22 #include "base/values.h" |
20 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 23 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test
_utils.h" | 24 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test
_utils.h" |
22 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 25 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
23 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" | 26 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" |
24 #include "components/prefs/pref_registry_simple.h" | |
25 #include "components/prefs/pref_service.h" | |
26 #include "components/prefs/testing_pref_service.h" | |
27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 const int kWriteDelayMinutes = 60; | 31 const int kWriteDelayMinutes = 60; |
32 | 32 |
33 // Each bucket holds data usage for a 15 minute interval. History is maintained | 33 // Each bucket holds data usage for a 15 minute interval. History is maintained |
34 // for 60 days. | 34 // for 60 days. |
35 const int kNumExpectedBuckets = 60 * 24 * 60 / 15; | 35 const int kNumExpectedBuckets = 60 * 24 * 60 / 15; |
36 | 36 |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 expected_data_usage = | 1300 expected_data_usage = |
1301 make_scoped_ptr(new std::vector<data_reduction_proxy::DataUsageBucket>( | 1301 make_scoped_ptr(new std::vector<data_reduction_proxy::DataUsageBucket>( |
1302 kNumExpectedBuckets)); | 1302 kNumExpectedBuckets)); |
1303 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); | 1303 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); |
1304 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, | 1304 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, |
1305 base::Unretained(&verifier2))); | 1305 base::Unretained(&verifier2))); |
1306 base::RunLoop().RunUntilIdle(); | 1306 base::RunLoop().RunUntilIdle(); |
1307 } | 1307 } |
1308 | 1308 |
1309 } // namespace data_reduction_proxy | 1309 } // namespace data_reduction_proxy |
OLD | NEW |