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

[iOS][Password Check] Removed reconfigureCellsForItems from loadModel

Fix introduced earlier doesn't solve the issue fully. The crash is
caused by calling reconfigureCellsForItems from loadModel. By removing
that the problem should be gone.

Bug: 1112344
Change-Id: I798b909182a5d59c653dc0c212c31225d59b9919
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336077
Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794545}
parent 54c22ea1
...@@ -446,16 +446,17 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf( ...@@ -446,16 +446,17 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
_passwordProblemsItem = [self passwordProblemsItem]; _passwordProblemsItem = [self passwordProblemsItem];
} }
[self updatePasswordCheckStatusLabelWithState:_passwordCheckState];
[model addItem:_passwordProblemsItem [model addItem:_passwordProblemsItem
toSectionWithIdentifier:SectionIdentifierPasswordCheck]; toSectionWithIdentifier:SectionIdentifierPasswordCheck];
if (!_checkForProblemsItem) { if (!_checkForProblemsItem) {
_checkForProblemsItem = [self checkForProblemsItem]; _checkForProblemsItem = [self checkForProblemsItem];
} }
[self updatePasswordCheckButtonWithState:_passwordCheckState];
[model addItem:_checkForProblemsItem [model addItem:_checkForProblemsItem
toSectionWithIdentifier:SectionIdentifierPasswordCheck]; toSectionWithIdentifier:SectionIdentifierPasswordCheck];
[self updatePasswordCheckButtonWithState:_passwordCheckState];
[self updatePasswordCheckStatusLabelWithState:_passwordCheckState];
} }
// Saved passwords. // Saved passwords.
...@@ -708,8 +709,14 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf( ...@@ -708,8 +709,14 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
- (void)setPasswordCheckUIState:(PasswordCheckUIState)state { - (void)setPasswordCheckUIState:(PasswordCheckUIState)state {
_passwordCheckState = state; _passwordCheckState = state;
[self updatePasswordCheckButtonWithState:state]; if (_checkForProblemsItem) {
[self updatePasswordCheckStatusLabelWithState:state]; [self updatePasswordCheckButtonWithState:state];
[self reconfigureCellsForItems:@[ _checkForProblemsItem ]];
}
if (_passwordProblemsItem) {
[self updatePasswordCheckStatusLabelWithState:state];
[self reconfigureCellsForItems:@[ _passwordProblemsItem ]];
}
} }
- (void)setPasswordsForms: - (void)setPasswordsForms:
...@@ -1020,7 +1027,6 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf( ...@@ -1020,7 +1027,6 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
UIAccessibilityTraitNotEnabled; UIAccessibilityTraitNotEnabled;
break; break;
} }
[self reconfigureCellsForItems:@[ _checkForProblemsItem ]];
} }
// Updates password check status label according to provided state. // Updates password check status label according to provided state.
...@@ -1081,7 +1087,6 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf( ...@@ -1081,7 +1087,6 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
break; break;
} }
} }
[self reconfigureCellsForItems:@[ _passwordProblemsItem ]];
} }
- (void)updateExportPasswordsButton { - (void)updateExportPasswordsButton {
......
...@@ -761,6 +761,12 @@ TEST_P(PasswordsTableViewControllerTest, PasswordStoreListener) { ...@@ -761,6 +761,12 @@ TEST_P(PasswordsTableViewControllerTest, PasswordStoreListener) {
EXPECT_EQ(1, NumberOfItemsInSection(GetSectionIndex(SavedPasswords))); EXPECT_EQ(1, NumberOfItemsInSection(GetSectionIndex(SavedPasswords)));
AddSavedForm2(); AddSavedForm2();
EXPECT_EQ(2, NumberOfItemsInSection(GetSectionIndex(SavedPasswords))); EXPECT_EQ(2, NumberOfItemsInSection(GetSectionIndex(SavedPasswords)));
auto password =
GetTestStore().stored_passwords().at("http://www.example.com/").at(0);
GetTestStore().RemoveLogin(password);
RunUntilIdle();
EXPECT_EQ(1, NumberOfItemsInSection(GetSectionIndex(SavedPasswords)));
} }
// Test verifies Passwords View Controller handles deletion of passwords. // Test verifies Passwords View Controller handles deletion of passwords.
......
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