Commit 194d5c7b authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Stop NTP coordinator when leaving NTP

This CL stops the NTP coordinator when the NTP should be hidden.
This is necessary because crrev.com/c/1953764 remove the call to -stop
in dealloc for the coordinators.

Fixed: 1032191
Change-Id: Ibcd22388b0759ca1ba87cb302dbadb3f3a2277f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1959002Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723365}
parent fa8014ef
...@@ -4884,7 +4884,10 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -4884,7 +4884,10 @@ NSString* const kBrowserViewControllerSnackbarCategory =
newTabPageCoordinator.webState = webState; newTabPageCoordinator.webState = webState;
_ntpCoordinatorsForWebStates[webState] = newTabPageCoordinator; _ntpCoordinatorsForWebStates[webState] = newTabPageCoordinator;
} else { } else {
DCHECK(_ntpCoordinatorsForWebStates[webState]); NewTabPageCoordinator* newTabPageCoordinator =
_ntpCoordinatorsForWebStates[webState];
DCHECK(newTabPageCoordinator);
[newTabPageCoordinator stop];
_ntpCoordinatorsForWebStates.erase(webState); _ntpCoordinatorsForWebStates.erase(webState);
} }
if (self.active && self.currentWebState == webState) { if (self.active && self.currentWebState == webState) {
......
...@@ -199,8 +199,7 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) { ...@@ -199,8 +199,7 @@ GREYElementInteraction* CellWithMatcher(id<GREYMatcher> matcher) {
// Tests that when tapping a suggestion, it is opened. When going back, the // Tests that when tapping a suggestion, it is opened. When going back, the
// disposition of the collection takes into account the previous scroll, even // disposition of the collection takes into account the previous scroll, even
// when more is tapped. // when more is tapped.
// TODO(crbug.com/1032191): re-enable when fixed. - (void)testOpenPageAndGoBackWithMoreContent {
- (void)DISABLED_testOpenPageAndGoBackWithMoreContent {
// Set server up. // Set server up.
self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse)); self.testServer->RegisterRequestHandler(base::Bind(&StandardResponse));
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start."); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start.");
......
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