Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: components/autofill/core/browser/webdata/autofill_table_unittest.cc

Issue 2478463002: Reland of place for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_table_unittest.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
index dbef60bbf97f9f50e9839b81931bc00ec8c9d00f..7eb241f1ca010fc0672e9e242b11984bb4cdf60d 100644
--- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc
+++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1996,10 +1996,10 @@
{nullptr, nullptr}},
};
- for (size_t i = 0; i < arraysize(kTestCases); ++i) {
+ for (const auto& test_case : kTestCases) {
SCOPED_TRACE(testing::Message()
- << "suggestion = " << kTestCases[i].field_suggestion[0]
- << ", contents = " << kTestCases[i].field_contents);
+ << "suggestion = " << test_case.field_suggestion[0]
+ << ", contents = " << test_case.field_contents);
Time t1 = Time::Now();
@@ -2008,18 +2008,17 @@
FormFieldData field;
for (size_t k = 0; k < kMaxCount; ++k) {
field.name = ASCIIToUTF16("Name");
- field.value = ASCIIToUTF16(kTestCases[i].field_suggestion[k]);
+ field.value = ASCIIToUTF16(test_case.field_suggestion[k]);
table_->AddFormFieldValue(field, &changes);
}
std::vector<base::string16> v;
table_->GetFormValuesForElementName(
- ASCIIToUTF16("Name"), ASCIIToUTF16(kTestCases[i].field_contents), &v,
- 6);
-
- EXPECT_EQ(kTestCases[i].expected_suggestion_count, v.size());
- for (size_t j = 0; j < kTestCases[i].expected_suggestion_count; ++j) {
- EXPECT_EQ(ASCIIToUTF16(kTestCases[i].expected_suggestion[j]), v[j]);
+ ASCIIToUTF16("Name"), ASCIIToUTF16(test_case.field_contents), &v, 6);
+
+ EXPECT_EQ(test_case.expected_suggestion_count, v.size());
+ for (size_t j = 0; j < test_case.expected_suggestion_count; ++j) {
+ EXPECT_EQ(ASCIIToUTF16(test_case.expected_suggestion[j]), v[j]);
}
changes.clear();
« no previous file with comments | « components/autofill/core/browser/validation_unittest.cc ('k') | components/autofill/core/common/autofill_regexes_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698