Commit 08f4acc3 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Chromium LUCI CQ

Revert "[iOS] Dismiss unified consent screen from Recent Tabs."

This reverts commit 55b69ae2.

Reason for revert: Breaking iOS 12 FirstRunTestCase 

Original change's description:
> [iOS] Dismiss unified consent screen from Recent Tabs.
>
> Fixes a bug where the unified consent screen is not dismissed when
> interrupted by a Siri search on the Recent Tabs page.
>
> - Performs complete view controller cleanup on interrupt.
> - Dismisses UnifiedConsentViewController when explicitly required.
> - Does not explicitly release SigninCoordinator in scene controller,
> this is already handled in the completion callback.
>
> Bug: 1115997
> Change-Id: Ib4663fe1136a394020020abc76969761c5e0f170
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600835
> Reviewed-by: Gauthier Ambard <gambard@chromium.org>
> Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#840588}

TBR=gambard@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,fernandex@chromium.org

Change-Id: I09e836432fc7ce4d6091a3cf3795763c12a91fb5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1115997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612969Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840633}
parent 3e5b1be4
......@@ -115,7 +115,6 @@ source_set("eg2_tests") {
"//components/signin/public/base",
"//ios/chrome/app/strings",
"//ios/chrome/browser/ui/authentication:eg_test_support+eg2",
"//ios/chrome/browser/ui/authentication/unified_consent:constants",
"//ios/chrome/browser/ui/content_suggestions:feature_flags",
"//ios/chrome/browser/ui/recent_tabs:recent_tabs_ui_constants",
"//ios/chrome/browser/ui/settings:constants",
......
......@@ -8,7 +8,6 @@
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/unified_consent/unified_consent_constants.h"
#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_feature.h"
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_constants.h"
#include "ios/chrome/grit/ios_strings.h"
......@@ -334,29 +333,6 @@ void ChooseImportOrKeepDataSepareteDialog(id<GREYMatcher> choiceButtonMatcher) {
tapSettingsLink:NO];
}
// Tests to dismiss sign-in by opening an URL from another app.
// Sign-in opened from: recent tabs.
// Interrupted at: identity selection in user consent.
- (void)testDismissIdentityPickerSigninFromRecentTabs {
FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGrey addFakeIdentity:fakeIdentity];
[self openSigninFromView:OpenSigninMethodFromRecentTabs tapSettingsLink:NO];
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kIdentityPickerViewIdentifier)]
performAction:grey_tap()];
// Open the URL as if it was opened from another app.
[ChromeEarlGrey simulateExternalAppURLOpening];
// Check if the URL was opened.
const GURL expectedURL("http://www.example.com/");
GREYAssertEqual(expectedURL, [ChromeEarlGrey webStateVisibleURL],
@"Didn't open new tab with example.com.");
// Should be not signed in.
[SigninEarlGrey verifySignedOut];
}
// Tests to dismiss sign-in by opening an URL from another app.
// Sign-in opened from: recent tabs.
// Interrupted at: advanced sign-in.
......
......@@ -505,10 +505,10 @@ const CGFloat kFadeOutAnimationDuration = 0.16f;
__weak UserSigninCoordinator* weakSelf = self;
ProceduralBlock runCompletionCallback = ^{
[weakSelf
viewControllerDismissedWithResult:SigninCoordinatorResultInterrupted
identity:weakSelf.unifiedConsentCoordinator
.selectedIdentity
settingsLinkWasTapped:NO];
runCompletionCallbackWithSigninResult:SigninCoordinatorResultInterrupted
identity:self.unifiedConsentCoordinator
.selectedIdentity
showAdvancedSettingsSignin:NO];
if (completion) {
completion();
}
......
......@@ -52,11 +52,6 @@
[self.unifiedConsentMediator start];
}
- (void)stop {
[self.unifiedConsentViewController dismissViewControllerAnimated:YES
completion:nil];
}
- (void)scrollToBottom {
[self.unifiedConsentViewController scrollToBottom];
}
......
......@@ -807,10 +807,10 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
}
// The UI should be stopped before the models they observe are stopped.
// |self.signinCoordinator| will be released on completion.
[self.signinCoordinator
interruptWithAction:SigninCoordinatorInterruptActionNoDismiss
completion:nil];
self.signinCoordinator = nil;
[self.historyCoordinator stop];
self.historyCoordinator = nil;
......
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