Commit 1a0fe0d2 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Mfill Android] Reenable Password integration tests

This CL reenables the first set of integrations tests whose flakiness
should be resolved since the FakeKeyboard replaces the flaky, emulated
soft keyboard.

Bug: 911056
Change-Id: I096fb08df3b76f7c07bdd819f7c66f2eee099417
Reviewed-on: https://chromium-review.googlesource.com/c/1358433Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Friedrich Horschig [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613094}
parent 3812b6f6
......@@ -20,7 +20,6 @@ import org.junit.runner.RunWith;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.chrome.R;
......@@ -102,11 +101,7 @@ public class AutofillKeyboardAccessoryIntegrationTest {
*/
@Test
@MediumTest
@Feature({"keyboard-accessory"})
@DisabledTest(message = "crbug.com/854224")
// TODO(fhorschig): Figure out why this test exists. If a keyboard is shown, the accessory
// should be there. If there is no keyboard, there shouldn't be an accessory. Looks more like a
// keyboard test than an accessory test.
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
public void testAutofocusedFieldDoesNotShowKeyboardAccessory()
throws ExecutionException, InterruptedException, TimeoutException {
loadTestPage(false);
......@@ -118,7 +113,7 @@ public class AutofillKeyboardAccessoryIntegrationTest {
*/
@Test
@MediumTest
@Feature({"keyboard-accessory"})
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@DisabledTest(message = "crbug.com/854224")
public void testTapInputFieldShowsKeyboardAccessory()
throws ExecutionException, InterruptedException, TimeoutException {
......@@ -137,7 +132,7 @@ public class AutofillKeyboardAccessoryIntegrationTest {
*/
@Test
@MediumTest
@Feature({"keyboard-accessory"})
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@DisabledTest(message = "crbug.com/836027")
public void testSwitchFieldsRescrollsKeyboardAccessory()
throws ExecutionException, InterruptedException, TimeoutException {
......@@ -163,7 +158,7 @@ public class AutofillKeyboardAccessoryIntegrationTest {
*/
@Test
@MediumTest
@Feature({"keyboard-accessory"})
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@DisabledTest(message = "crbug.com/847959")
public void testSelectSuggestionHidesKeyboardAccessory()
throws ExecutionException, InterruptedException, TimeoutException {
......
......@@ -22,7 +22,6 @@ import static org.chromium.chrome.browser.autofill.keyboard_accessory.ManualFill
import static org.chromium.chrome.browser.autofill.keyboard_accessory.ManualFillingTestHelper.selectTabAtPosition;
import static org.chromium.chrome.browser.autofill.keyboard_accessory.ManualFillingTestHelper.whenDisplayed;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.matcher.BoundedMatcher;
import android.support.test.filters.SmallTest;
import android.text.method.PasswordTransformationMethod;
......@@ -39,7 +38,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
......@@ -126,7 +124,6 @@ public class PasswordAccessoryIntegrationTest {
@Test
@SmallTest
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@FlakyTest(message = "https://crbug.com/854326")
public void testPasswordSheetDisplaysProvidedItems()
throws InterruptedException, TimeoutException {
mHelper.loadTestPage(false);
......@@ -154,7 +151,6 @@ public class PasswordAccessoryIntegrationTest {
@Test
@SmallTest
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@FlakyTest(message = "https://crbug.com/854326")
public void testPasswordSheetDisplaysNoPasswordsMessageAndOptions()
throws InterruptedException, TimeoutException {
mHelper.loadTestPage(false);
......@@ -185,18 +181,17 @@ public class PasswordAccessoryIntegrationTest {
@Test
@SmallTest
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@FlakyTest(message = "crbug.com/855617")
public void testPasswordSheetTriggersCallback() throws InterruptedException, TimeoutException {
mHelper.loadTestPage(false);
final AtomicReference<Field> clicked = new AtomicReference<>();
AccessorySheetData accessorySheetData = new AccessorySheetData("Passwords");
accessorySheetData.getUserInfoList().add(
createUserInfo("mpark@abc.com", "ShorterPassword"));
createUserInfo("mpark@abc.com", "ShorterPassword", clicked::set));
accessorySheetData.getUserInfoList().add(createUserInfo("mayap@xyz.com", "PWD"));
accessorySheetData.getUserInfoList().add(createUserInfo("park@googlemail.com", "P@$$W0rt"));
accessorySheetData.getUserInfoList().add(
createUserInfo("mayapark@gmail.com", "SomeHiddenLongPassword", clicked::set));
createUserInfo("mayapark@gmail.com", "SomeHiddenLongPassword"));
mHelper.sendCredentials(accessorySheetData);
// Focus the field to bring up the accessory.
......@@ -204,19 +199,17 @@ public class PasswordAccessoryIntegrationTest {
mHelper.waitForKeyboard();
whenDisplayed(withId(R.id.tabs)).perform(selectTabAtPosition(0));
// Scroll down and click the suggestion.
whenDisplayed(withChild(withText("Passwords"))).perform(scrollToPosition(7));
whenDisplayed(withText("mayapark@gmail.com")).perform(click());
// Click the suggestion.
whenDisplayed(withText("mpark@abc.com")).perform(click());
// The callback should have triggered and set the reference to the selected Item.
assertThat(clicked.get(), notNullValue());
assertThat(clicked.get().getDisplayText(), equalTo("mayapark@gmail.com"));
assertThat(clicked.get().getDisplayText(), equalTo("mpark@abc.com"));
}
@Test
@SmallTest
@EnableFeatures({ChromeFeatureList.PASSWORDS_KEYBOARD_ACCESSORY})
@FlakyTest(message = "crbug.com/855617")
public void testDisplaysEmptyStateMessageWithoutSavedPasswords()
throws InterruptedException, TimeoutException {
mHelper.loadTestPage(false);
......@@ -229,12 +222,8 @@ public class PasswordAccessoryIntegrationTest {
whenDisplayed(withId(R.id.tabs)).perform(selectTabAtPosition(0));
mHelper.waitForKeyboardToDisappear();
whenDisplayed(withId(R.id.keyboard_accessory_sheet));
onView(withText(containsString("No saved passwords"))).check(matches(isDisplayed()));
Espresso.pressBack();
mHelper.waitToBeHidden(withId(R.id.keyboard_accessory_sheet));
mHelper.waitToBeHidden(withId(R.id.keyboard_accessory));
onView(withText(containsString("No Saved passwords for this site")))
.check(matches(isDisplayed()));
}
/**
......
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