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

Unified Diff: components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc

Issue 2424793002: Revert of Replace for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 2 months 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/ui/card_unmask_prompt_controller_impl_unittest.cc
diff --git a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc
index 7a6ff9f04fcc1be8550ef65c65a0322390f74d2d..b6c39f3c40d9535305073bc21cf4c8915c8caa9d 100644
--- a/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc
+++ b/components/autofill/core/browser/ui/card_unmask_prompt_controller_impl_unittest.cc
@@ -449,16 +449,16 @@
ShowPrompt();
- for (const CvcCase& cvc_case : cvc_cases) {
- EXPECT_EQ(cvc_case.valid,
- controller_->InputCvcIsValid(ASCIIToUTF16(cvc_case.input)));
- if (!cvc_case.valid)
+ for (size_t i = 0; i < arraysize(cvc_cases); ++i) {
+ EXPECT_EQ(cvc_cases[i].valid,
+ controller_->InputCvcIsValid(ASCIIToUTF16(cvc_cases[i].input)));
+ if (!cvc_cases[i].valid)
continue;
- controller_->OnUnmaskResponse(ASCIIToUTF16(cvc_case.input),
+ controller_->OnUnmaskResponse(ASCIIToUTF16(cvc_cases[i].input),
ASCIIToUTF16("1"), ASCIIToUTF16("2050"),
false);
- EXPECT_EQ(ASCIIToUTF16(cvc_case.canonicalized_input),
+ EXPECT_EQ(ASCIIToUTF16(cvc_cases[i].canonicalized_input),
delegate_->response().cvc);
}
@@ -473,15 +473,16 @@
ShowPromptAmex();
- for (const CvcCase& cvc_case_amex : cvc_cases_amex) {
- EXPECT_EQ(cvc_case_amex.valid,
- controller_->InputCvcIsValid(ASCIIToUTF16(cvc_case_amex.input)));
- if (!cvc_case_amex.valid)
+ for (size_t i = 0; i < arraysize(cvc_cases_amex); ++i) {
+ EXPECT_EQ(
+ cvc_cases_amex[i].valid,
+ controller_->InputCvcIsValid(ASCIIToUTF16(cvc_cases_amex[i].input)));
+ if (!cvc_cases_amex[i].valid)
continue;
- controller_->OnUnmaskResponse(ASCIIToUTF16(cvc_case_amex.input),
+ controller_->OnUnmaskResponse(ASCIIToUTF16(cvc_cases_amex[i].input),
base::string16(), base::string16(), false);
- EXPECT_EQ(ASCIIToUTF16(cvc_case_amex.canonicalized_input),
+ EXPECT_EQ(ASCIIToUTF16(cvc_cases_amex[i].canonicalized_input),
delegate_->response().cvc);
}
}
@@ -502,10 +503,10 @@
ShowPrompt();
- for (const auto& exp_case : exp_cases) {
- EXPECT_EQ(exp_case.valid, controller_->InputExpirationIsValid(
- ASCIIToUTF16(exp_case.input_month),
- ASCIIToUTF16(exp_case.input_year)));
+ for (size_t i = 0; i < arraysize(exp_cases); ++i) {
+ EXPECT_EQ(exp_cases[i].valid, controller_->InputExpirationIsValid(
+ ASCIIToUTF16(exp_cases[i].input_month),
+ ASCIIToUTF16(exp_cases[i].input_year)));
}
}
« no previous file with comments | « components/autofill/core/browser/state_names.cc ('k') | components/autofill/core/browser/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698