Commit b1ab1067 authored by Tao Bai's avatar Tao Bai Committed by Commit Bot

[WebView Autofill]Add id to HtmlInfo

Bug: 786420
Change-Id: Ida64aef0ecde9b093dab58bfa097b0779079e3c5
Reviewed-on: https://chromium-review.googlesource.com/780802
Commit-Queue: Tao Bai <michaelbai@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518314}
parent 1e5ed951
......@@ -85,6 +85,7 @@ public class AwAutofillProvider extends AutofillProvider {
.addAttribute("name", field.mName)
.addAttribute("type", field.mType)
.addAttribute("label", field.mLabel)
.addAttribute("id", field.mId)
.build());
switch (field.getControlType()) {
case FormFieldData.TYPE_LIST:
......
......@@ -610,6 +610,7 @@ public class AwAutofillTest {
assertEquals("name", child0.getAutofillHints()[1]);
TestViewStructure.AwHtmlInfo htmlInfo0 = child0.getHtmlInfo();
assertEquals("text", htmlInfo0.getAttribute("type"));
assertEquals("text1", htmlInfo0.getAttribute("id"));
assertEquals("username", htmlInfo0.getAttribute("name"));
assertEquals("User Name:", htmlInfo0.getAttribute("label"));
......@@ -620,6 +621,7 @@ public class AwAutofillTest {
assertNull(child1.getAutofillHints());
TestViewStructure.AwHtmlInfo htmlInfo1 = child1.getHtmlInfo();
assertEquals("checkbox", htmlInfo1.getAttribute("type"));
assertEquals("checkbox1", htmlInfo1.getAttribute("id"));
assertEquals("showpassword", htmlInfo1.getAttribute("name"));
assertEquals("", htmlInfo1.getAttribute("label"));
......@@ -630,6 +632,7 @@ public class AwAutofillTest {
assertNull(child2.getAutofillHints());
TestViewStructure.AwHtmlInfo htmlInfo2 = child2.getHtmlInfo();
assertEquals("month", htmlInfo2.getAttribute("name"));
assertEquals("select1", htmlInfo2.getAttribute("id"));
CharSequence[] options = child2.getAutofillOptions();
assertEquals("Jan", options[0]);
assertEquals("Feb", options[1]);
......
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