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> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // The initial last update time used in test. There is no leap second a few | 108 // The initial last update time used in test. There is no leap second a few |
109 // days around this time used in the test. | 109 // days around this time used in the test. |
110 // Note: No time zone is specified. Local time will be assumed by | 110 // Note: No time zone is specified. Local time will be assumed by |
111 // base::Time::FromString below. | 111 // base::Time::FromString below. |
112 const char kLastUpdateTime[] = "Wed, 18 Sep 2013 03:45:26"; | 112 const char kLastUpdateTime[] = "Wed, 18 Sep 2013 03:45:26"; |
113 | 113 |
114 class DataReductionProxyCompressionStatsTest : public testing::Test { | 114 class DataReductionProxyCompressionStatsTest : public testing::Test { |
115 protected: | 115 protected: |
116 DataReductionProxyCompressionStatsTest() { | 116 DataReductionProxyCompressionStatsTest() { |
117 base::Time::FromString(kLastUpdateTime, &now_); | 117 EXPECT_TRUE(base::Time::FromString(kLastUpdateTime, &now_)); |
118 } | 118 } |
119 | 119 |
120 void SetUp() override { | 120 void SetUp() override { |
121 drp_test_context_ = DataReductionProxyTestContext::Builder().Build(); | 121 drp_test_context_ = DataReductionProxyTestContext::Builder().Build(); |
122 | 122 |
123 compression_stats_.reset(new DataReductionProxyCompressionStats( | 123 compression_stats_.reset(new DataReductionProxyCompressionStats( |
124 data_reduction_proxy_service(), pref_service(), base::TimeDelta())); | 124 data_reduction_proxy_service(), pref_service(), base::TimeDelta())); |
125 } | 125 } |
126 | 126 |
127 void ResetCompressionStatsWithDelay(const base::TimeDelta& delay) { | 127 void ResetCompressionStatsWithDelay(const base::TimeDelta& delay) { |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 expected_data_usage = | 1356 expected_data_usage = |
1357 base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>( | 1357 base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>( |
1358 kNumExpectedBuckets); | 1358 kNumExpectedBuckets); |
1359 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); | 1359 DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); |
1360 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, | 1360 LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, |
1361 base::Unretained(&verifier2))); | 1361 base::Unretained(&verifier2))); |
1362 base::RunLoop().RunUntilIdle(); | 1362 base::RunLoop().RunUntilIdle(); |
1363 } | 1363 } |
1364 | 1364 |
1365 } // namespace data_reduction_proxy | 1365 } // namespace data_reduction_proxy |
OLD | NEW |