0

[iOS] Fixing iOS17 EG Bookmarks test failures

In iOS 17, when the Bookmarks UI is being shutdown, both the
`BookmarksHomeViewController` and the `UISearchController` embedded
inside the `BookmarksHomeViewController` dismissal functionality are
being invoked. This double invocation is causing a crash because a
property that has been set to null by the `BookmarksHomeViewController`
dismissal function is being used in the `UISearchController` dismissal
function. To get around this, `UISearchController` is being explicitly
dismissed during the shutdown process.

Change-Id: I4b6729401d3a3becd18156ad0ed35dce018a1565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4650590
Commit-Queue: Daniel White <danieltwhite@google.com>
Reviewed-by: Éric Noyau <noyau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1164785}
This commit is contained in:
Daniel White
2023-06-30 17:58:34 +00:00
committed by Chromium LUCI CQ
parent 7c9be0fb3b
commit 381a46d89a

@ -276,6 +276,7 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
self.mediator = nil;
self.browser = nullptr;
self.browserState = nullptr;
[self.searchController dismissViewControllerAnimated:YES completion:nil];
_profileBookmarkModel = nullptr;
_profileBookmarkModelBridge.reset();
_accountBookmarkModel = nullptr;