Commit b9e83a0a authored by Ian Struiksma's avatar Ian Struiksma Committed by Commit Bot

Use more reliable element to grab Autofill info

For each input element, we grab the autofill information from
the html element and log it. FormCache writes to 2 elements, and
sometimes title is used on the page, so switching to use
"autofill-information" instead

Also, making the lack of this element a simple log line instead
of a failure as it doesn't affect validation or execution of test.

Bug: 984664
Change-Id: I934db1eb8d787a8fe799525bda14a33ee0cfa72d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931656
Auto-Submit: Ian Struiksma <ianstruiksma@google.com>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718556}
parent a3fd32a2
...@@ -1148,13 +1148,14 @@ bool TestRecipeReplayer::ExecuteValidateFieldValueAction( ...@@ -1148,13 +1148,14 @@ bool TestRecipeReplayer::ExecuteValidateFieldValueAction(
// If we are validating the value of a Chrome autofilled field, print the // If we are validating the value of a Chrome autofilled field, print the
// Chrome Autofill's field annotation for debugging purpose. // Chrome Autofill's field annotation for debugging purpose.
std::string title; std::string autofill_information;
if (GetElementProperty(frame, xpath, "return target.getAttribute('title');", if (GetElementProperty(
&title)) { frame, xpath, "return target.getAttribute('autofill-information');",
VLOG(1) << title; &autofill_information)) {
VLOG(1) << autofill_information;
} else { } else {
ADD_FAILURE() // Only used for logging purposes, so don't ADD_FAILURE() if it fails.
<< "Failed to obtain the field's Chrome Autofill annotation!"; VLOG(1) << "Failed to obtain the field's Chrome Autofill annotation!";
} }
std::string expected_autofill_prediction_type = std::string expected_autofill_prediction_type =
......
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