Commit bbd84679 authored by Yiming Zhou's avatar Yiming Zhou Committed by Commit Bot

Fix an autofill profile setup bug in test.

The Captured Sites Autofill tests start with a default saved credit
card. Individual test recipes may overwrite this default with a specified
credit card. Today, there is a bug that prevents a recipe from
overwriting the default card owner by first name and last name. When
doing an override, the framework triggers a DCHECK in the saved credit
card code that asserts the credit card name is empty.

This fix address the DCHECK by setting the default credit card owner
name to an empty string before overwriting it.

Fixing an autofill profile setup bug in test.

The Captured Sites Autofill Tests starts with a default saved credit
card. A test recipe may override the default card with its own credit
card info. Today, a bug exists in the framework that prevents the recipe
from overriding the credit card owner by first name and last name. The
bug breaks a DCHECK assertion in the saved credit card code. This fix addresses the assertion by setting the credit card owner name to empty before overriding the recipe specified credit card name.

Bug: 902492
Change-Id: Iec86496bf408400b60c2a7183b15ef0bd7dfc14f
Reviewed-on: https://chromium-review.googlesource.com/c/1332694
Commit-Queue: Yiming Zhou <uwyiming@google.com>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607440}
parent 783103b6
...@@ -167,7 +167,12 @@ class AutofillCapturedSitesInteractiveTest ...@@ -167,7 +167,12 @@ class AutofillCapturedSitesInteractiveTest
base::CompareCase::INSENSITIVE_ASCII) || base::CompareCase::INSENSITIVE_ASCII) ||
base::StartsWith(field_type, "CREDIT_CARD_", base::StartsWith(field_type, "CREDIT_CARD_",
base::CompareCase::INSENSITIVE_ASCII)) { base::CompareCase::INSENSITIVE_ASCII)) {
card_.SetRawInfo(type, base::UTF8ToUTF16(field_value)); if (type == autofill::CREDIT_CARD_NAME_FIRST ||
type == autofill::CREDIT_CARD_NAME_LAST) {
card_.SetRawInfo(autofill::CREDIT_CARD_NAME_FULL,
base::ASCIIToUTF16(""));
card_.SetRawInfo(type, base::UTF8ToUTF16(field_value));
}
} else { } else {
profile_.SetRawInfo(type, base::UTF8ToUTF16(field_value)); profile_.SetRawInfo(type, base::UTF8ToUTF16(field_value));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment