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_usage_store.h" | 5 #include "components/data_reduction_proxy/core/browser/data_usage_store.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 11 matching lines...) Expand all Loading... |
22 // for 60 days. | 22 // for 60 days. |
23 const unsigned kNumExpectedBuckets = 60 * 24 * 60 / 15; | 23 const unsigned kNumExpectedBuckets = 60 * 24 * 60 / 15; |
24 const int kBucketsInHour = 60 / 15; | 24 const int kBucketsInHour = 60 / 15; |
25 const int kTestCurrentBucketIndex = 2880; | 25 const int kTestCurrentBucketIndex = 2880; |
26 | 26 |
27 base::Time::Exploded TestExplodedTime() { | 27 base::Time::Exploded TestExplodedTime() { |
28 base::Time::Exploded exploded; | 28 base::Time::Exploded exploded; |
29 exploded.year = 2001; | 29 exploded.year = 2001; |
30 exploded.month = 12; | 30 exploded.month = 12; |
31 exploded.day_of_month = 31; | 31 exploded.day_of_month = 31; |
| 32 exploded.day_of_week = 1; |
32 exploded.hour = 12; | 33 exploded.hour = 12; |
33 exploded.minute = 1; | 34 exploded.minute = 1; |
34 exploded.second = 0; | 35 exploded.second = 0; |
35 exploded.millisecond = 0; | 36 exploded.millisecond = 0; |
36 | 37 |
37 return exploded; | 38 return exploded; |
38 } | 39 } |
39 } | 40 } |
40 | 41 |
41 namespace data_reduction_proxy { | 42 namespace data_reduction_proxy { |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 ASSERT_TRUE(store()->map()->find(base::StringPrintf( | 462 ASSERT_TRUE(store()->map()->find(base::StringPrintf( |
462 "data_usage_bucket:%d", kNumExpectedBuckets - 2)) != | 463 "data_usage_bucket:%d", kNumExpectedBuckets - 2)) != |
463 store()->map()->end()); | 464 store()->map()->end()); |
464 | 465 |
465 data_usage_store()->DeleteBrowsingHistory(now - base::TimeDelta::FromDays(60), | 466 data_usage_store()->DeleteBrowsingHistory(now - base::TimeDelta::FromDays(60), |
466 now); | 467 now); |
467 ASSERT_EQ(1u, store()->map()->size()); | 468 ASSERT_EQ(1u, store()->map()->size()); |
468 } | 469 } |
469 | 470 |
470 } // namespace data_reduction_proxy | 471 } // namespace data_reduction_proxy |
OLD | NEW |