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 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/macros.h" | |
14 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
18 #include "base/test/histogram_tester.h" | 19 #include "base/test/histogram_tester.h" |
19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
20 #include "base/values.h" | 21 #include "base/values.h" |
21 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" | 22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" |
22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h" | 23 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test _utils.h" |
23 #include "components/data_reduction_proxy/core/browser/data_use_group.h" | 24 #include "components/data_reduction_proxy/core/browser/data_use_group.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 108 |
108 // The initial last update time used in test. There is no leap second a few | 109 // The initial last update time used in test. There is no leap second a few |
109 // days around this time used in the test. | 110 // days around this time used in the test. |
110 // Note: No time zone is specified. Local time will be assumed by | 111 // Note: No time zone is specified. Local time will be assumed by |
111 // base::Time::FromString below. | 112 // base::Time::FromString below. |
112 const char kLastUpdateTime[] = "Wed, 18 Sep 2013 03:45:26"; | 113 const char kLastUpdateTime[] = "Wed, 18 Sep 2013 03:45:26"; |
113 | 114 |
114 class DataReductionProxyCompressionStatsTest : public testing::Test { | 115 class DataReductionProxyCompressionStatsTest : public testing::Test { |
115 protected: | 116 protected: |
116 DataReductionProxyCompressionStatsTest() { | 117 DataReductionProxyCompressionStatsTest() { |
117 base::Time::FromString(kLastUpdateTime, &now_); | 118 ignore_result(base::Time::FromString(kLastUpdateTime, &now_)); |
Nico
2017/01/03 19:00:38
this can probably be EXPECT_TRUE too?
digit1
2017/01/05 10:26:28
Good point, I've changed that too. Thanks :)
| |
118 } | 119 } |
119 | 120 |
120 void SetUp() override { | 121 void SetUp() override { |
121 drp_test_context_ = DataReductionProxyTestContext::Builder().Build(); | 122 drp_test_context_ = DataReductionProxyTestContext::Builder().Build(); |
122 | 123 |
123 compression_stats_.reset(new DataReductionProxyCompressionStats( | 124 compression_stats_.reset(new DataReductionProxyCompressionStats( |
124 data_reduction_proxy_service(), pref_service(), base::TimeDelta())); | 125 data_reduction_proxy_service(), pref_service(), base::TimeDelta())); |
125 } | 126 } |
126 | 127 |
127 void ResetCompressionStatsWithDelay(const base::TimeDelta& delay) { | 128 void ResetCompressionStatsWithDelay(const base::TimeDelta& delay) { |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1356 expected_data_usage = | 1357 expected_data_usage = |
1357 base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>( | 1358 base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>( |
1358 kNumExpectedBuckets); | 1359 kNumExpectedBuckets); |
1359 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); | 1360 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); |
1360 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, | 1361 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, |
1361 base::Unretained(&verifier2))); | 1362 base::Unretained(&verifier2))); |
1362 base::RunLoop().RunUntilIdle(); | 1363 base::RunLoop().RunUntilIdle(); |
1363 } | 1364 } |
1364 | 1365 |
1365 } // namespace data_reduction_proxy | 1366 } // namespace data_reduction_proxy |
OLD | NEW |