Commit b400d6c7 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF] Fix search in all passwords

If the password view controller was presenting something, it will stay
around. This is fixed and a test is added.

Bug: 1008421
Change-Id: I8248cbbf28be94bc4b84c65ccda42129a192db0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1826895
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702358}
parent 85f31621
......@@ -75,8 +75,9 @@
}
- (void)stop {
[self.passwordViewController dismissViewControllerAnimated:YES
completion:nil];
[self.passwordViewController.presentingViewController
dismissViewControllerAnimated:YES
completion:nil];
self.passwordViewController = nil;
self.passwordMediator = nil;
[super stop];
......
......@@ -527,6 +527,40 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
}
}
// Test that after searching in "Use Other Password" and selecting an option,
// the screen is dismissed.
- (void)testOtherPasswordsDismissAfterSearch {
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap the passwords icon.
[[EarlGrey selectElementWithMatcher:PasswordIconMatcher()]
performAction:grey_tap()];
// Tap "Use Other Password...".
[[EarlGrey selectElementWithMatcher:OtherPasswordsMatcher()]
performAction:grey_tap()];
// Verify "Use Other Passwords" opened.
[[EarlGrey selectElementWithMatcher:OtherPasswordsDismissMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
// Tap the password search bar.
[[EarlGrey selectElementWithMatcher:PasswordSearchBarMatcher()]
performAction:grey_typeText(@"user")];
// Select a username.
[[EarlGrey selectElementWithMatcher:UsernameButtonMatcher()]
performAction:grey_tap()];
// Verify the password list disappears.
[[EarlGrey selectElementWithMatcher:PasswordSearchBarMatcher()]
assertWithMatcher:grey_nil()];
[[EarlGrey selectElementWithMatcher:OtherPasswordsMatcher()]
assertWithMatcher:grey_nil()];
}
// Tests that the Password View Controller is dismissed when tapping the
// keyboard icon.
- (void)testKeyboardIconDismissPasswordController {
......
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