OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "components/webdata/autofill/autofill_entry.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "chrome/browser/webdata/autofill_entry.h" | |
11 | 11 |
12 const unsigned int kMaxAutofillTimeStamps = 2; | 12 const unsigned int kMaxAutofillTimeStamps = 2; |
13 | 13 |
14 TEST(AutofillEntryTest, NoCulling) { | 14 TEST(AutofillEntryTest, NoCulling) { |
15 std::vector<base::Time> source, result; | 15 std::vector<base::Time> source, result; |
16 base::Time current = base::Time::Now(); | 16 base::Time current = base::Time::Now(); |
17 for (size_t i = 0; i < kMaxAutofillTimeStamps; ++i) | 17 for (size_t i = 0; i < kMaxAutofillTimeStamps; ++i) |
18 source.push_back(current); | 18 source.push_back(current); |
19 | 19 |
20 EXPECT_FALSE(AutofillEntry::CullTimeStamps(source, &result)); | 20 EXPECT_FALSE(AutofillEntry::CullTimeStamps(source, &result)); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // All outside the time limit. | 69 // All outside the time limit. |
70 timestamps.clear(); | 70 timestamps.clear(); |
71 timestamps.push_back(cutoff_time - one_hour); | 71 timestamps.push_back(cutoff_time - one_hour); |
72 timestamps.push_back(cutoff_time - one_hour * 2); | 72 timestamps.push_back(cutoff_time - one_hour * 2); |
73 timestamps.push_back(cutoff_time - one_hour * 3); | 73 timestamps.push_back(cutoff_time - one_hour * 3); |
74 | 74 |
75 AutofillEntry entry_outside_the_limits(key, timestamps); | 75 AutofillEntry entry_outside_the_limits(key, timestamps); |
76 EXPECT_TRUE(entry_outside_the_limits.IsExpired()); | 76 EXPECT_TRUE(entry_outside_the_limits.IsExpired()); |
77 EXPECT_TRUE(entry_outside_the_limits.timestamps_culled()); | 77 EXPECT_TRUE(entry_outside_the_limits.timestamps_culled()); |
78 } | 78 } |
OLD | NEW |