Commit 9ba78d48 authored by sandromaggi's avatar sandromaggi Committed by Commit Bot

[Autofill Assistant] UT IsCompleteX

This adds unit tests for
* IsCompleteContact
* IsCompleteShippingAddress
* IsCompleteCreditCard

This change rearranges the |IsCompleteCreditCard| checks to be more
easily understandable without changing the behaviour of the function
as a whole.

Bug: none
Change-Id: I0ed6bc657737b69e362e588156d8befbbadacfd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214889
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Reviewed-by: default avatarClemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#771701}
parent 30c98bf1
...@@ -317,7 +317,8 @@ bool IsCompleteCreditCard( ...@@ -317,7 +317,8 @@ bool IsCompleteCreditCard(
return true; return true;
} }
if (!credit_card || !billing_profile) { if (!credit_card || !billing_profile ||
credit_card->billing_address_id().empty()) {
return false; return false;
} }
...@@ -334,8 +335,7 @@ bool IsCompleteCreditCard( ...@@ -334,8 +335,7 @@ bool IsCompleteCreditCard(
return false; return false;
} }
if (!credit_card->HasValidExpirationDate() || if (!credit_card->HasValidExpirationDate()) {
credit_card->billing_address_id().empty()) {
return false; return false;
} }
...@@ -349,6 +349,7 @@ bool IsCompleteCreditCard( ...@@ -349,6 +349,7 @@ bool IsCompleteCreditCard(
collect_user_data_options.supported_basic_card_networks.end()) { collect_user_data_options.supported_basic_card_networks.end()) {
return false; return false;
} }
return true; return true;
} }
......
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