Commit f4ee960f authored by Anna Malova's avatar Anna Malova Committed by Commit Bot

Fix and enable AwAutofillTest#testPageScrollTriggerViewExitAndEnter test.

Bug: 1008592
Change-Id: I392f02daff125ff26c327ecf5467e6fe141aeb36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943127
Commit-Queue: Anna Malova <amalova@chromium.org>
Reviewed-by: default avatarTobias Sargeant <tobiasjs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720934}
parent 13b7185b
...@@ -14,6 +14,7 @@ import android.content.Context; ...@@ -14,6 +14,7 @@ import android.content.Context;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Build; import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle; import android.os.Bundle;
import android.os.LocaleList; import android.os.LocaleList;
import android.os.Parcel; import android.os.Parcel;
...@@ -48,7 +49,6 @@ import org.chromium.base.metrics.RecordHistogram; ...@@ -48,7 +49,6 @@ import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.task.PostTask; import org.chromium.base.task.PostTask;
import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.DisableIf;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MetricsUtils; import org.chromium.base.test.util.MetricsUtils;
import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.base.test.util.MinAndroidSdkLevel;
...@@ -1816,7 +1816,6 @@ public class AwAutofillTest { ...@@ -1816,7 +1816,6 @@ public class AwAutofillTest {
@Test @Test
@SmallTest @SmallTest
@DisabledTest
@Feature({"AndroidWebView"}) @Feature({"AndroidWebView"})
public void testPageScrollTriggerViewExitAndEnter() throws Throwable { public void testPageScrollTriggerViewExitAndEnter() throws Throwable {
TestWebServer webServer = TestWebServer.start(); TestWebServer webServer = TestWebServer.start();
...@@ -1838,12 +1837,18 @@ public class AwAutofillTest { ...@@ -1838,12 +1837,18 @@ public class AwAutofillTest {
// AUTOFILL_VIEW_ENTERED. // AUTOFILL_VIEW_ENTERED.
scrollToBottom(); scrollToBottom();
dispatchDownAndUpKeyEvents(KeyEvent.KEYCODE_B); dispatchDownAndUpKeyEvents(KeyEvent.KEYCODE_B);
List<Integer> expectedValues = new ArrayList<>();
// On Android version below P scroll triggers additional
// AUTOFILL_VIEW_ENTERED (@see AwAutofillProvider#onTextFieldDidScroll).
if (VERSION.SDK_INT < Build.VERSION_CODES.P) {
expectedValues.add(AUTOFILL_VIEW_ENTERED);
}
// Check if NotifyVirtualValueChanged() called again and with extra AUTOFILL_VIEW_EXITED // Check if NotifyVirtualValueChanged() called again and with extra AUTOFILL_VIEW_EXITED
// and AUTOFILL_VIEW_ENTERED // and AUTOFILL_VIEW_ENTERED
waitForCallbackAndVerifyTypes(cnt, expectedValues.addAll(Arrays.asList(
new Integer[] { AUTOFILL_VIEW_EXITED, AUTOFILL_VIEW_ENTERED, AUTOFILL_VALUE_CHANGED));
AUTOFILL_VIEW_EXITED, AUTOFILL_VIEW_ENTERED, AUTOFILL_VALUE_CHANGED}); waitForCallbackAndVerifyTypes(cnt, expectedValues.toArray(new Integer[0]));
} finally { } finally {
webServer.shutdown(); webServer.shutdown();
} }
......
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