Commit 6123a89c authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Don't disable fullscreen for SSL with UI refresh enabled.

The omnibox and its security indicator remains on screen even when
in fullscreen mode, so there is no longer a need to disable fullscreen
for the UI refresh.

Bug: 840828
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I5eb89f2992fec399287807d77089a34af88d141c
Reviewed-on: https://chromium-review.googlesource.com/1050376Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556830}
parent 522710a2
......@@ -24,8 +24,12 @@
namespace {
// Returns whether fullscreen should be disabled for |web_state|'s SSL status.
// This will return true if the visible NavigationItem's SSL has a broken
// security style or is showing mixed content.
// security style or is showing mixed content. If the UI refresh is enabled,
// fullscreen does not need to be disabled for certificate issues, as the
// omnibox security indicator is never fully hidden in fullscreen mode.
bool ShouldDisableFullscreenForWebStateSSL(web::WebState* web_state) {
if (IsUIRefreshPhase1Enabled())
return false;
if (!web_state)
return false;
web::NavigationManager* manager = web_state->GetNavigationManager();
......
......@@ -110,6 +110,9 @@ TEST_F(FullscreenWebStateObserverTest, DisableDuringLoadWithUIRefreshEnabled) {
// Tests that the model is disabled when the SSL status is broken.
TEST_F(FullscreenWebStateObserverTest, DisableForBrokenSSL) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(kUIRefreshPhase1);
std::unique_ptr<web::NavigationItem> item = web::NavigationItem::Create();
item->GetSSL().security_style = web::SECURITY_STYLE_AUTHENTICATION_BROKEN;
navigation_manager().SetVisibleItem(item.get());
......@@ -120,3 +123,21 @@ TEST_F(FullscreenWebStateObserverTest, DisableForBrokenSSL) {
web_state().OnVisibleSecurityStateChanged();
EXPECT_TRUE(model().enabled());
}
// Tests that the model remains enabled when the SSL status is broken and the
// UI refresh flag is enabled.
TEST_F(FullscreenWebStateObserverTest,
DisableForBrokenSSLWithUIRefreshEnabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(kUIRefreshPhase1);
std::unique_ptr<web::NavigationItem> item = web::NavigationItem::Create();
item->GetSSL().security_style = web::SECURITY_STYLE_AUTHENTICATION_BROKEN;
navigation_manager().SetVisibleItem(item.get());
EXPECT_TRUE(model().enabled());
web_state().OnVisibleSecurityStateChanged();
EXPECT_TRUE(model().enabled());
navigation_manager().SetVisibleItem(nullptr);
web_state().OnVisibleSecurityStateChanged();
EXPECT_TRUE(model().enabled());
}
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