Commit bdf92bf9 authored by Viktor Semeniuk's avatar Viktor Semeniuk Committed by Commit Bot

[iOS] Fixed TestShowHidePassword on iOS14

Replaced [controller().tableView cellForRowAtIndexPath:indexOfPassword]
with [controller() tableView:controller().tableView
cellForRowAtIndexPath:indexOfPassword]

Bug: 1111183
Change-Id: I1554377a9f149dfd2ece052a6dcc248141a5aa65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2330013Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
Cr-Commit-Position: refs/heads/master@{#793597}
parent 8ec868fc
...@@ -185,19 +185,15 @@ TEST_F(PasswordDetailsViewControllerTest, TestCompromisedPassword) { ...@@ -185,19 +185,15 @@ TEST_F(PasswordDetailsViewControllerTest, TestCompromisedPassword) {
// Tests that password is shown/hidden. // Tests that password is shown/hidden.
TEST_F(PasswordDetailsViewControllerTest, TestShowHidePassword) { TEST_F(PasswordDetailsViewControllerTest, TestShowHidePassword) {
// TODO(crbug.com/1111183): Investigate why this is failing on iOS14.
if (base::ios::IsRunningOnIOS14OrLater()) {
return;
}
SetPassword(); SetPassword();
CheckEditCellText(kMaskedPassword, 0, 2); CheckEditCellText(kMaskedPassword, 0, 2);
NSIndexPath* indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0]; NSIndexPath* indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0];
TableViewTextEditCell* textFieldCell = TableViewTextEditCell* textFieldCell =
base::mac::ObjCCastStrict<TableViewTextEditCell>( base::mac::ObjCCastStrict<TableViewTextEditCell>([controller()
[controller().tableView cellForRowAtIndexPath:indexOfPassword]); tableView:controller().tableView
ASSERT_TRUE(textFieldCell != nil); cellForRowAtIndexPath:indexOfPassword]);
EXPECT_TRUE(textFieldCell);
[textFieldCell.identifyingIconButton [textFieldCell.identifyingIconButton
sendActionsForControlEvents:UIControlEventTouchUpInside]; sendActionsForControlEvents:UIControlEventTouchUpInside];
...@@ -213,11 +209,6 @@ TEST_F(PasswordDetailsViewControllerTest, TestShowHidePassword) { ...@@ -213,11 +209,6 @@ TEST_F(PasswordDetailsViewControllerTest, TestShowHidePassword) {
// Tests that passwords was not shown in case reauth failed. // Tests that passwords was not shown in case reauth failed.
TEST_F(PasswordDetailsViewControllerTest, TestShowPasswordReauthFailed) { TEST_F(PasswordDetailsViewControllerTest, TestShowPasswordReauthFailed) {
// TODO(crbug.com/1111183): Investigate why this is failing on iOS14.
if (base::ios::IsRunningOnIOS14OrLater()) {
return;
}
SetPassword(); SetPassword();
CheckEditCellText(kMaskedPassword, 0, 2); CheckEditCellText(kMaskedPassword, 0, 2);
...@@ -225,9 +216,10 @@ TEST_F(PasswordDetailsViewControllerTest, TestShowPasswordReauthFailed) { ...@@ -225,9 +216,10 @@ TEST_F(PasswordDetailsViewControllerTest, TestShowPasswordReauthFailed) {
reauth().expectedResult = ReauthenticationResult::kFailure; reauth().expectedResult = ReauthenticationResult::kFailure;
NSIndexPath* indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0]; NSIndexPath* indexOfPassword = [NSIndexPath indexPathForRow:2 inSection:0];
TableViewTextEditCell* textFieldCell = TableViewTextEditCell* textFieldCell =
base::mac::ObjCCastStrict<TableViewTextEditCell>( base::mac::ObjCCastStrict<TableViewTextEditCell>([controller()
[controller().tableView cellForRowAtIndexPath:indexOfPassword]); tableView:controller().tableView
ASSERT_TRUE(textFieldCell != nil); cellForRowAtIndexPath:indexOfPassword]);
EXPECT_TRUE(textFieldCell);
[textFieldCell.identifyingIconButton [textFieldCell.identifyingIconButton
sendActionsForControlEvents:UIControlEventTouchUpInside]; sendActionsForControlEvents:UIControlEventTouchUpInside];
......
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