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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 Time t1 = Time::Now(); | 133 Time t1 = Time::Now(); |
134 | 134 |
135 // Simulate the submission of a handful of entries in a field called "Name", | 135 // Simulate the submission of a handful of entries in a field called "Name", |
136 // some more often than others. | 136 // some more often than others. |
137 AutofillChangeList changes; | 137 AutofillChangeList changes; |
138 FormFieldData field; | 138 FormFieldData field; |
139 field.name = ASCIIToUTF16("Name"); | 139 field.name = ASCIIToUTF16("Name"); |
140 field.value = ASCIIToUTF16("Superman"); | 140 field.value = ASCIIToUTF16("Superman"); |
141 base::Time now = base::Time::Now(); | 141 base::Time now = base::Time::Now(); |
142 base::TimeDelta two_seconds = base::TimeDelta::FromSeconds(2); | 142 base::TimeDelta two_seconds = base::TimeDelta::FromSeconds(2); |
143 EXPECT_FALSE(table_->HasFormElements()); | |
benm (inactive)
2013/04/29 18:00:03
+ a test where we EXPECT_TRUE ? :)
sgurun-gerrit only
2013/04/29 19:32:39
will do.
On 2013/04/29 18:00:03, benm wrote:
| |
143 EXPECT_TRUE(table_->AddFormFieldValue(field, &changes)); | 144 EXPECT_TRUE(table_->AddFormFieldValue(field, &changes)); |
144 std::vector<base::string16> v; | 145 std::vector<base::string16> v; |
145 for (int i = 0; i < 5; i++) { | 146 for (int i = 0; i < 5; i++) { |
146 field.value = ASCIIToUTF16("Clark Kent"); | 147 field.value = ASCIIToUTF16("Clark Kent"); |
147 EXPECT_TRUE(table_->AddFormFieldValueTime(field, &changes, | 148 EXPECT_TRUE(table_->AddFormFieldValueTime(field, &changes, |
148 now + i * two_seconds)); | 149 now + i * two_seconds)); |
149 } | 150 } |
150 for (int i = 0; i < 3; i++) { | 151 for (int i = 0; i < 3; i++) { |
151 field.value = ASCIIToUTF16("Clark Sutter"); | 152 field.value = ASCIIToUTF16("Clark Sutter"); |
152 EXPECT_TRUE(table_->AddFormFieldValueTime(field, &changes, | 153 EXPECT_TRUE(table_->AddFormFieldValueTime(field, &changes, |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1324 ASSERT_EQ(expected_entries.size(), entry_set.size()); | 1325 ASSERT_EQ(expected_entries.size(), entry_set.size()); |
1325 AutofillEntrySetIterator it; | 1326 AutofillEntrySetIterator it; |
1326 for (it = entry_set.begin(); it != entry_set.end(); it++) { | 1327 for (it = entry_set.begin(); it != entry_set.end(); it++) { |
1327 expected_entries.erase(*it); | 1328 expected_entries.erase(*it); |
1328 } | 1329 } |
1329 | 1330 |
1330 EXPECT_EQ(0U, expected_entries.size()); | 1331 EXPECT_EQ(0U, expected_entries.size()); |
1331 } | 1332 } |
1332 | 1333 |
1333 } // namespace autofill | 1334 } // namespace autofill |
OLD | NEW |