Commit 5375b227 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes FullscreenWebStateObserverTest with the UIRefresh flag on.

BUG=818736

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ib36d98ce7d4a89b1384f8ea5169705d7b64a87c9
Reviewed-on: https://chromium-review.googlesource.com/1022370
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552438}
parent d3ddfcbe
......@@ -135,6 +135,8 @@ source_set("unit_tests") {
":fullscreen",
":internal",
":ui",
"//base/test:test_support",
"//ios/chrome/browser/ui:feature_flags",
"//ios/chrome/browser/ui:ui_util",
"//ios/chrome/browser/ui/broadcaster",
"//ios/chrome/browser/ui/fullscreen/test",
......
......@@ -4,10 +4,12 @@
#import "ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.h"
#include "base/test/scoped_feature_list.h"
#import "ios/chrome/browser/ui/fullscreen/fullscreen_model.h"
#import "ios/chrome/browser/ui/fullscreen/test/fullscreen_model_test_util.h"
#import "ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h"
#import "ios/chrome/browser/ui/fullscreen/test/test_fullscreen_mediator.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/web/public/navigation_item.h"
#include "ios/web/public/ssl_status.h"
#import "ios/web/public/test/fakes/fake_navigation_context.h"
......@@ -83,7 +85,10 @@ TEST_F(FullscreenWebStateObserverTest, NoResetForSameDocument) {
}
// Tests that the model is disabled when a load is occurring.
TEST_F(FullscreenWebStateObserverTest, DisableDuringLoad) {
TEST_F(FullscreenWebStateObserverTest, DisableDuringLoadWithUIRefreshDisabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(kUIRefreshPhase1);
EXPECT_TRUE(model().enabled());
web_state().SetLoading(true);
EXPECT_FALSE(model().enabled());
......@@ -91,6 +96,18 @@ TEST_F(FullscreenWebStateObserverTest, DisableDuringLoad) {
EXPECT_TRUE(model().enabled());
}
// Tests that the model is not disabled when a load is occurring.
TEST_F(FullscreenWebStateObserverTest, DisableDuringLoadWithUIRefreshEnabled) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(kUIRefreshPhase1);
EXPECT_TRUE(model().enabled());
web_state().SetLoading(true);
EXPECT_TRUE(model().enabled());
web_state().SetLoading(false);
EXPECT_TRUE(model().enabled());
}
// Tests that the model is disabled when the SSL status is broken.
TEST_F(FullscreenWebStateObserverTest, DisableForBrokenSSL) {
std::unique_ptr<web::NavigationItem> item = web::NavigationItem::Create();
......
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