Commit 285df703 authored by Tao Bai's avatar Tao Bai Committed by Commit Bot

Revert "Revert "WebView autofill test""

Reland
>WebView autofill test
>
> This patch add basic class for autofill test and a simple test.
> more tests will be added.
>
> But unfortunately, we will not have Android O trybot until 2018,
> This test will not be run in any trybot.
>
> Bug: 717658

This reverts commit e190e6a8.

Bug: 717658, 766984
Change-Id: I4e331c37913e6735491f53da92dc206c810f2c96
Reviewed-on: https://chromium-review.googlesource.com/677090Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarSelim Gurun <sgurun@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Tao Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503568}
parent 2d9ff04e
......@@ -10,6 +10,7 @@ import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.support.annotation.VisibleForTesting;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
......@@ -76,7 +77,7 @@ public class AwAutofillProvider extends AutofillProvider {
ViewStructure child = structure.newChild(index++);
int virtualId = toVirtualId(sessionId, fieldIndex++);
child.setAutofillId(structure.getAutofillId(), virtualId);
if (field.mAutocompleteAttr != null) {
if (field.mAutocompleteAttr != null && !field.mAutocompleteAttr.isEmpty()) {
child.setAutofillHints(field.mAutocompleteAttr.split(" +"));
}
child.setHint(field.mPlaceholder);
......@@ -199,6 +200,12 @@ public class AwAutofillProvider extends AutofillProvider {
mContainerView = containerView;
}
@VisibleForTesting
public AwAutofillProvider(ViewGroup containerView, AwAutofillManager manager) {
mAutofillManager = manager;
mContainerView = containerView;
}
@Override
public void onContainerViewChanged(ViewGroup containerView) {
mContainerView = containerView;
......@@ -274,6 +281,7 @@ public class AwAutofillProvider extends AutofillProvider {
private void notifyVirtualValueChanged(int index) {
AutofillValue autofillValue = mRequest.getFieldNewValue(index);
if (autofillValue == null) return;
mAutofillManager.notifyVirtualValueChanged(
mContainerView, mRequest.getVirtualId((short) index), autofillValue);
}
......
include_rules = [
"+components/autofill/android/java",
"+components/minidump_uploader/android/java",
"+components/minidump_uploader/android/javatests",
"+components/policy/android/java",
......
......@@ -116,6 +116,7 @@ instrumentation_test_apk("webview_instrumentation_test_apk") {
"//android_webview/test/embedded_test_server:aw_net_java_test_support",
"//base:base_java",
"//base:base_java_test_support",
"//components/autofill/android:provider_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/minidump_uploader:minidump_uploader_javatests",
"//components/policy/android:policy_java",
......@@ -139,6 +140,7 @@ instrumentation_test_apk("webview_instrumentation_test_apk") {
"../javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java",
"../javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java",
"../javatests/src/org/chromium/android_webview/test/ArchiveTest.java",
"../javatests/src/org/chromium/android_webview/test/AwAutofillTest.java",
"../javatests/src/org/chromium/android_webview/test/AwContentsAnchorViewTest.java",
"../javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java",
"../javatests/src/org/chromium/android_webview/test/AwContentsClientCallbackHelperTest.java",
......
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