Commit ba9a7de9 authored by Ewann's avatar Ewann Committed by Commit Bot

[iOS] Fixes the Page Info view on device rotation

This CL prevents the Page Info view to be dismissed on device rotation.

Fixed: 1112322
Change-Id: I11d5d4be1a5e3fbfedd94466c4dd5b1e9f3e1469
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335286Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795461}
parent 5ea64b82
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#import "ios/chrome/browser/ui/ntp/new_tab_page_coordinator.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_coordinator.h"
#import "ios/chrome/browser/ui/ntp/ntp_util.h" #import "ios/chrome/browser/ui/ntp/ntp_util.h"
#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.h" #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.h"
#import "ios/chrome/browser/ui/page_info/features.h"
#import "ios/chrome/browser/ui/popup_menu/popup_menu_coordinator.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_coordinator.h"
#import "ios/chrome/browser/ui/presenters/vertical_animation_container.h" #import "ios/chrome/browser/ui/presenters/vertical_animation_container.h"
#import "ios/chrome/browser/ui/sad_tab/sad_tab_coordinator.h" #import "ios/chrome/browser/ui/sad_tab/sad_tab_coordinator.h"
...@@ -2403,7 +2404,8 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -2403,7 +2404,8 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// be unrecognized. // be unrecognized.
if (_isShutdown) if (_isShutdown)
return; return;
if ([self.dispatcher respondsToSelector:@selector(hidePageInfo)]) if (!base::FeatureList::IsEnabled(kPageInfoRefactoring) &&
[self.dispatcher respondsToSelector:@selector(hidePageInfo)])
[self.dispatcher hidePageInfo]; [self.dispatcher hidePageInfo];
[self.dispatcher dismissPopupMenuAnimated:NO]; [self.dispatcher dismissPopupMenuAnimated:NO];
[self.helpHandler hideAllHelpBubbles]; [self.helpHandler hideAllHelpBubbles];
......
...@@ -126,6 +126,7 @@ source_set("eg2_tests") { ...@@ -126,6 +126,7 @@ source_set("eg2_tests") {
sources = [ "legacy_page_info_egtest.mm" ] sources = [ "legacy_page_info_egtest.mm" ]
deps = [ deps = [
":constants", ":constants",
"//ios/chrome/browser/ui/page_info:features",
"//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/popup_menu:constants",
"//ios/chrome/test/earl_grey:eg_test_support+eg2", "//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2", "//ios/testing/earl_grey:eg_test_support+eg2",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#import "ios/chrome/browser/ui/page_info/features.h"
#import "ios/chrome/browser/ui/page_info/page_info_constants.h" #import "ios/chrome/browser/ui/page_info/page_info_constants.h"
#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
...@@ -21,6 +22,12 @@ ...@@ -21,6 +22,12 @@
@implementation LegacyPageInfoTestCase @implementation LegacyPageInfoTestCase
- (AppLaunchConfiguration)appConfigurationForTestCase {
AppLaunchConfiguration config;
config.features_disabled.push_back(kPageInfoRefactoring);
return config;
}
// Tests that rotating the device will automatically dismiss the page info view. // Tests that rotating the device will automatically dismiss the page info view.
- (void)testShowPageInfoAndDismissOnDeviceRotation { - (void)testShowPageInfoAndDismissOnDeviceRotation {
// TODO(crbug.com/652465): Enable the test for iPad when rotation bug is // TODO(crbug.com/652465): Enable the test for iPad when rotation bug is
......
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