Commit 27ffe82c authored by Eugene But's avatar Eugene But Committed by Chromium LUCI CQ

[ios] Use Fake term for ios/web/test/fake names

Bug: 688063
Change-Id: I427598e4cddad41f3f3628db9507166a30615e84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591819
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837446}
parent ece5b954
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h"
#import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/chrome/browser/web_state_list/web_state_opener.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/test/web_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -70,8 +70,7 @@ class InfobarOverlayBrowserAgentTest ...@@ -70,8 +70,7 @@ class InfobarOverlayBrowserAgentTest
browser_(browser_state_.get(), &web_state_list_) { browser_(browser_state_.get(), &web_state_list_) {
// Add an activated WebState into whose queues infobar OverlayRequests will // Add an activated WebState into whose queues infobar OverlayRequests will
// be added. // be added.
std::unique_ptr<web::WebState> web_state = auto web_state = std::make_unique<web::FakeWebState>();
std::make_unique<web::TestWebState>();
web_state_ = web_state.get(); web_state_ = web_state.get();
web_state_list_.InsertWebState(/*index=*/0, std::move(web_state), web_state_list_.InsertWebState(/*index=*/0, std::move(web_state),
WebStateList::INSERT_ACTIVATE, WebStateList::INSERT_ACTIVATE,
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#import "ios/chrome/browser/overlays/public/overlay_request_queue.h" #import "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h" #import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -31,7 +31,7 @@ class InfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -31,7 +31,7 @@ class InfobarBannerInteractionHandlerTest : public PlatformTest {
scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot}, scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot},
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
InfobarOverlayRequestInserter::CreateForWebState(&web_state_); InfobarOverlayRequestInserter::CreateForWebState(&web_state_);
...@@ -52,7 +52,7 @@ class InfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -52,7 +52,7 @@ class InfobarBannerInteractionHandlerTest : public PlatformTest {
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
InfobarBannerInteractionHandler handler_; InfobarBannerInteractionHandler handler_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_; InfoBarIOS* infobar_;
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "ios/chrome/browser/overlays/public/overlay_response.h" #include "ios/chrome/browser/overlays/public/overlay_response.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_request_callback_installer.h" #include "ios/chrome/browser/overlays/test/fake_overlay_request_callback_installer.h"
#include "ios/chrome/browser/overlays/test/overlay_test_macros.h" #include "ios/chrome/browser/overlays/test/overlay_test_macros.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -47,7 +47,7 @@ class InfobarBannerOverlayRequestCallbackInstallerTest : public PlatformTest { ...@@ -47,7 +47,7 @@ class InfobarBannerOverlayRequestCallbackInstallerTest : public PlatformTest {
protected: protected:
FakeInfobarIOS infobar_; FakeInfobarIOS infobar_;
web::TestWebState web_state_; web::FakeWebState web_state_;
OverlayRequest* request_ = nullptr; OverlayRequest* request_ = nullptr;
MockInfobarBannerInteractionHandler mock_handler_; MockInfobarBannerInteractionHandler mock_handler_;
InfobarBannerOverlayRequestCallbackInstaller installer_; InfobarBannerOverlayRequestCallbackInstaller installer_;
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#include "ios/chrome/browser/infobars/test/mock_infobar_delegate.h" #include "ios/chrome/browser/infobars/test/mock_infobar_delegate.h"
#import "ios/chrome/browser/overlays/public/overlay_request_queue.h" #import "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -28,7 +28,7 @@ class ConfirmInfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -28,7 +28,7 @@ class ConfirmInfobarBannerInteractionHandlerTest : public PlatformTest {
scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot}, scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot},
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState(&web_state_); InfobarOverlayRequestInserter::CreateForWebState(&web_state_);
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -48,7 +48,7 @@ class ConfirmInfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -48,7 +48,7 @@ class ConfirmInfobarBannerInteractionHandlerTest : public PlatformTest {
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
ConfirmInfobarBannerInteractionHandler handler_; ConfirmInfobarBannerInteractionHandler handler_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_; InfoBarIOS* infobar_;
}; };
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h" #import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h" #import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -32,7 +32,7 @@ class PasswordInfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -32,7 +32,7 @@ class PasswordInfobarBannerInteractionHandlerTest : public PlatformTest {
scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot}, scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot},
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState(&web_state_); InfobarOverlayRequestInserter::CreateForWebState(&web_state_);
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -54,7 +54,7 @@ class PasswordInfobarBannerInteractionHandlerTest : public PlatformTest { ...@@ -54,7 +54,7 @@ class PasswordInfobarBannerInteractionHandlerTest : public PlatformTest {
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
PasswordInfobarBannerInteractionHandler handler_; PasswordInfobarBannerInteractionHandler handler_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_; InfoBarIOS* infobar_;
}; };
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h" #import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h"
#import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/chrome/browser/web_state_list/web_state_opener.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/test/web_task_environment.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/OCMock/OCMock.h"
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h" #import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h" #import "ios/chrome/browser/ui/infobars/test/fake_infobar_ui_delegate.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -46,7 +46,7 @@ class PasswordInfobarModalOverlayRequestCallbackInstallerTest ...@@ -46,7 +46,7 @@ class PasswordInfobarModalOverlayRequestCallbackInstallerTest
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
// Create the infobar and add it to the WebState's manager. // Create the infobar and add it to the WebState's manager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
std::unique_ptr<InfoBarIOS> added_infobar = std::make_unique<InfoBarIOS>( std::unique_ptr<InfoBarIOS> added_infobar = std::make_unique<InfoBarIOS>(
[[FakeInfobarUIDelegate alloc] init], [[FakeInfobarUIDelegate alloc] init],
...@@ -74,7 +74,7 @@ class PasswordInfobarModalOverlayRequestCallbackInstallerTest ...@@ -74,7 +74,7 @@ class PasswordInfobarModalOverlayRequestCallbackInstallerTest
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_ = nullptr; InfoBarIOS* infobar_ = nullptr;
OverlayRequest* request_ = nullptr; OverlayRequest* request_ = nullptr;
MockPasswordInfobarModalInteractionHandler mock_handler_; MockPasswordInfobarModalInteractionHandler mock_handler_;
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/public/overlay_response.h" #include "ios/chrome/browser/overlays/public/overlay_response.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -46,7 +46,7 @@ class SaveCardInfobarBannerOverlayRequestCallbackInstallerTest ...@@ -46,7 +46,7 @@ class SaveCardInfobarBannerOverlayRequestCallbackInstallerTest
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
// Create the infobar and add it to the WebState's manager. // Create the infobar and add it to the WebState's manager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
std::unique_ptr<MockAutofillSaveCardInfoBarDelegateMobile> delegate = std::unique_ptr<MockAutofillSaveCardInfoBarDelegateMobile> delegate =
delegate_factory_ delegate_factory_
...@@ -79,7 +79,7 @@ class SaveCardInfobarBannerOverlayRequestCallbackInstallerTest ...@@ -79,7 +79,7 @@ class SaveCardInfobarBannerOverlayRequestCallbackInstallerTest
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<PrefService> prefs_; std::unique_ptr<PrefService> prefs_;
autofill::CreditCard card_; autofill::CreditCard card_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_ = nullptr; InfoBarIOS* infobar_ = nullptr;
OverlayRequest* request_ = nullptr; OverlayRequest* request_ = nullptr;
MockSaveCardInfobarBannerInteractionHandler mock_handler_; MockSaveCardInfobarBannerInteractionHandler mock_handler_;
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/public/overlay_response.h" #include "ios/chrome/browser/overlays/public/overlay_response.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -46,7 +46,7 @@ class SaveCardInfobarModalOverlayRequestCallbackInstallerTest ...@@ -46,7 +46,7 @@ class SaveCardInfobarModalOverlayRequestCallbackInstallerTest
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
// Create the infobar and add it to the WebState's manager. // Create the infobar and add it to the WebState's manager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
std::unique_ptr<MockAutofillSaveCardInfoBarDelegateMobile> delegate = std::unique_ptr<MockAutofillSaveCardInfoBarDelegateMobile> delegate =
delegate_factory_ delegate_factory_
...@@ -79,7 +79,7 @@ class SaveCardInfobarModalOverlayRequestCallbackInstallerTest ...@@ -79,7 +79,7 @@ class SaveCardInfobarModalOverlayRequestCallbackInstallerTest
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<PrefService> prefs_; std::unique_ptr<PrefService> prefs_;
autofill::CreditCard card_; autofill::CreditCard card_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_ = nullptr; InfoBarIOS* infobar_ = nullptr;
OverlayRequest* request_ = nullptr; OverlayRequest* request_ = nullptr;
MockSaveCardInfobarModalInteractionHandler mock_handler_; MockSaveCardInfobarModalInteractionHandler mock_handler_;
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include "ios/chrome/browser/overlays/public/overlay_response.h" #include "ios/chrome/browser/overlays/public/overlay_response.h"
#import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h" #import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -39,7 +39,7 @@ class TranslateInfobarModalOverlayRequestCallbackInstallerTest ...@@ -39,7 +39,7 @@ class TranslateInfobarModalOverlayRequestCallbackInstallerTest
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
// Create the infobar and add it to the WebState's manager. // Create the infobar and add it to the WebState's manager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
TranslateOverlayTabHelper::CreateForWebState(&web_state_); TranslateOverlayTabHelper::CreateForWebState(&web_state_);
std::unique_ptr<FakeTranslateInfoBarDelegate> delegate = std::unique_ptr<FakeTranslateInfoBarDelegate> delegate =
...@@ -69,7 +69,7 @@ class TranslateInfobarModalOverlayRequestCallbackInstallerTest ...@@ -69,7 +69,7 @@ class TranslateInfobarModalOverlayRequestCallbackInstallerTest
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
web::TestWebState web_state_; web::FakeWebState web_state_;
InfoBarIOS* infobar_ = nullptr; InfoBarIOS* infobar_ = nullptr;
OverlayRequest* request_ = nullptr; OverlayRequest* request_ = nullptr;
MockTranslateInfobarModalInteractionHandler mock_handler_; MockTranslateInfobarModalInteractionHandler mock_handler_;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request.h" #include "ios/chrome/browser/overlays/public/overlay_request.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -32,7 +32,7 @@ class InfobarBannerOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -32,7 +32,7 @@ class InfobarBannerOverlayRequestCancelHandlerTest : public PlatformTest {
InfobarBannerOverlayRequestCancelHandlerTest() { InfobarBannerOverlayRequestCancelHandlerTest() {
// Set up WebState and InfoBarManager. // Set up WebState and InfoBarManager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState( InfobarOverlayRequestInserter::CreateForWebState(
&web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>()); &web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -56,7 +56,7 @@ class InfobarBannerOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -56,7 +56,7 @@ class InfobarBannerOverlayRequestCancelHandlerTest : public PlatformTest {
} }
protected: protected:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that the request is replaced if its corresponding InfoBar is replaced // Tests that the request is replaced if its corresponding InfoBar is replaced
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h" #import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_request_cancel_handler.h" #include "ios/chrome/browser/overlays/test/fake_overlay_request_cancel_handler.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -45,7 +45,7 @@ class InfobarModalCompletionNotifierTest : public PlatformTest { ...@@ -45,7 +45,7 @@ class InfobarModalCompletionNotifierTest : public PlatformTest {
} }
protected: protected:
web::TestWebState web_state_; web::FakeWebState web_state_;
FakeInfobarIOS infobar_; FakeInfobarIOS infobar_;
InfobarModalCompletionNotifier notifier_; InfobarModalCompletionNotifier notifier_;
MockInfobarModalCompletionNotifierObserver observer_; MockInfobarModalCompletionNotifierObserver observer_;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request.h" #include "ios/chrome/browser/overlays/public/overlay_request.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -32,7 +32,7 @@ class InfobarModalOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -32,7 +32,7 @@ class InfobarModalOverlayRequestCancelHandlerTest : public PlatformTest {
InfobarModalOverlayRequestCancelHandlerTest() { InfobarModalOverlayRequestCancelHandlerTest() {
// Set up WebState and InfoBarManager. // Set up WebState and InfoBarManager.
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState( InfobarOverlayRequestInserter::CreateForWebState(
&web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>()); &web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -57,7 +57,7 @@ class InfobarModalOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -57,7 +57,7 @@ class InfobarModalOverlayRequestCancelHandlerTest : public PlatformTest {
} }
protected: protected:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that the request is cancelled after all modals originating from the // Tests that the request is cancelled after all modals originating from the
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request.h" #include "ios/chrome/browser/overlays/public/overlay_request.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -32,7 +32,7 @@ class InfobarOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -32,7 +32,7 @@ class InfobarOverlayRequestCancelHandlerTest : public PlatformTest {
public: public:
InfobarOverlayRequestCancelHandlerTest() { InfobarOverlayRequestCancelHandlerTest() {
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState( InfobarOverlayRequestInserter::CreateForWebState(
&web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>()); &web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -56,7 +56,7 @@ class InfobarOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -56,7 +56,7 @@ class InfobarOverlayRequestCancelHandlerTest : public PlatformTest {
} }
private: private:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that the request is cancelled when its corresponding InfoBar is removed // Tests that the request is cancelled when its corresponding InfoBar is removed
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h" #import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h"
#include "ios/chrome/browser/overlays/public/overlay_request.h" #include "ios/chrome/browser/overlays/public/overlay_request.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -38,7 +38,7 @@ class InfobarOverlayRequestInserterTest : public PlatformTest { ...@@ -38,7 +38,7 @@ class InfobarOverlayRequestInserterTest : public PlatformTest {
public: public:
InfobarOverlayRequestInserterTest() { InfobarOverlayRequestInserterTest() {
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfobarOverlayRequestInserter::CreateForWebState( InfobarOverlayRequestInserter::CreateForWebState(
&web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>()); &web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
...@@ -70,7 +70,7 @@ class InfobarOverlayRequestInserterTest : public PlatformTest { ...@@ -70,7 +70,7 @@ class InfobarOverlayRequestInserterTest : public PlatformTest {
} }
private: private:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that the inserter adds banner OverlayRequests to the correct queue. // Tests that the inserter adds banner OverlayRequests to the correct queue.
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "ios/chrome/browser/overlays/public/overlay_request.h" #include "ios/chrome/browser/overlays/public/overlay_request.h"
#import "ios/chrome/browser/overlays/public/overlay_request_queue.h" #import "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -35,7 +35,7 @@ class InfobarOverlayTabHelperTest : public PlatformTest { ...@@ -35,7 +35,7 @@ class InfobarOverlayTabHelperTest : public PlatformTest {
public: public:
InfobarOverlayTabHelperTest() { InfobarOverlayTabHelperTest() {
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
InfobarOverlayRequestInserter::CreateForWebState( InfobarOverlayRequestInserter::CreateForWebState(
&web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>()); &web_state_, std::make_unique<FakeInfobarOverlayRequestFactory>());
...@@ -53,7 +53,7 @@ class InfobarOverlayTabHelperTest : public PlatformTest { ...@@ -53,7 +53,7 @@ class InfobarOverlayTabHelperTest : public PlatformTest {
} }
private: private:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that adding an InfoBar to the manager creates a fake banner request. // Tests that adding an InfoBar to the manager creates a fake banner request.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h" #import "ios/chrome/browser/overlays/public/common/infobars/infobar_overlay_request_config.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/overlay_test_macros.h" #include "ios/chrome/browser/overlays/test/overlay_test_macros.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -75,7 +75,7 @@ TEST_F(InfobarOverlayUtilTest, GetOverlayRequestInfobarOverlayType) { ...@@ -75,7 +75,7 @@ TEST_F(InfobarOverlayUtilTest, GetOverlayRequestInfobarOverlayType) {
// Tests that GetInfobarOverlayRequestIndex() returns the correct indices. // Tests that GetInfobarOverlayRequestIndex() returns the correct indices.
TEST_F(InfobarOverlayUtilTest, GetInfobarOverlayRequestIndex) { TEST_F(InfobarOverlayUtilTest, GetInfobarOverlayRequestIndex) {
web::TestWebState web_state; web::FakeWebState web_state;
FakeInfobarIOS infobar0; FakeInfobarIOS infobar0;
FakeInfobarIOS infobar1; FakeInfobarIOS infobar1;
FakeInfobarIOS infobar2; FakeInfobarIOS infobar2;
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h" #import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h"
#import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/chrome/browser/web_state_list/web_state_opener.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/test/web_task_environment.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -38,12 +38,11 @@ class TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest ...@@ -38,12 +38,11 @@ class TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest
: public PlatformTest { : public PlatformTest {
public: public:
TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest() { TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest() {
std::unique_ptr<web::TestWebState> web_state = auto web_state = std::make_unique<web::FakeWebState>();
std::make_unique<web::TestWebState>();
web_state_ = web_state.get(); web_state_ = web_state.get();
// Set up WebState and InfoBarManager. // Set up WebState and InfoBarManager.
web_state->SetNavigationManager( web_state->SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
browser_.GetWebStateList()->InsertWebState(0, std::move(web_state), browser_.GetWebStateList()->InsertWebState(0, std::move(web_state),
WebStateList::INSERT_ACTIVATE, WebStateList::INSERT_ACTIVATE,
WebStateOpener()); WebStateOpener());
...@@ -68,7 +67,7 @@ class TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest ...@@ -68,7 +67,7 @@ class TranslateInfobarPlaceholderOverlayRequestCancelHandlerTest
protected: protected:
web::WebTaskEnvironment task_environment_; web::WebTaskEnvironment task_environment_;
web::TestWebState* web_state_; web::FakeWebState* web_state_;
FakeTranslateInfoBarDelegateFactory delegate_factory_; FakeTranslateInfoBarDelegateFactory delegate_factory_;
FakeOverlayPresentationContext presentation_context_; FakeOverlayPresentationContext presentation_context_;
FakeTranslateInfoBarDelegate* delegate_ = nullptr; FakeTranslateInfoBarDelegate* delegate_ = nullptr;
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h" #import "ios/chrome/browser/passwords/test/mock_ios_chrome_save_passwords_infobar_delegate.h"
#import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h" #import "ios/chrome/browser/translate/fake_translate_infobar_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -53,7 +53,7 @@ class TranslateInfobarOverlayTranslateOverlayTabHelperTest ...@@ -53,7 +53,7 @@ class TranslateInfobarOverlayTranslateOverlayTabHelperTest
scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot}, scoped_feature_list_.InitWithFeatures({kIOSInfobarUIReboot},
{kInfobarUIRebootOnlyiOS13}); {kInfobarUIRebootOnlyiOS13});
web_state_.SetNavigationManager( web_state_.SetNavigationManager(
std::make_unique<web::TestNavigationManager>()); std::make_unique<web::FakeNavigationManager>());
InfoBarManagerImpl::CreateForWebState(&web_state_); InfoBarManagerImpl::CreateForWebState(&web_state_);
InfobarOverlayRequestInserter::CreateForWebState(&web_state_); InfobarOverlayRequestInserter::CreateForWebState(&web_state_);
TranslateOverlayTabHelper::CreateForWebState(&web_state_); TranslateOverlayTabHelper::CreateForWebState(&web_state_);
...@@ -77,7 +77,7 @@ class TranslateInfobarOverlayTranslateOverlayTabHelperTest ...@@ -77,7 +77,7 @@ class TranslateInfobarOverlayTranslateOverlayTabHelperTest
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
web::TestWebState web_state_; web::FakeWebState web_state_;
FakeTranslateInfoBarDelegateFactory delegate_factory_; FakeTranslateInfoBarDelegateFactory delegate_factory_;
FakeTranslateInfoBarDelegate* delegate_ = nullptr; FakeTranslateInfoBarDelegate* delegate_ = nullptr;
InfoBarIOS* infobar_ = nullptr; InfoBarIOS* infobar_ = nullptr;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_context.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -29,10 +29,10 @@ class DefaultOverlayRequestCancelHandlerTest : public PlatformTest { ...@@ -29,10 +29,10 @@ class DefaultOverlayRequestCancelHandlerTest : public PlatformTest {
return OverlayRequestQueue::FromWebState(&web_state_, return OverlayRequestQueue::FromWebState(&web_state_,
OverlayModality::kWebContentArea); OverlayModality::kWebContentArea);
} }
web::TestWebState* web_state() { return &web_state_; } web::FakeWebState* web_state() { return &web_state_; }
private: private:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that the request is removed from the queue for committed, document- // Tests that the request is removed from the queue for committed, document-
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h"
#import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h"
#import "ios/chrome/browser/web_state_list/web_state_opener.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/test/web_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -83,7 +83,7 @@ class OverlayBrowserAgentBaseTest : public PlatformTest { ...@@ -83,7 +83,7 @@ class OverlayBrowserAgentBaseTest : public PlatformTest {
OverlayPresenter::FromBrowser(browser_.get(), kModality) OverlayPresenter::FromBrowser(browser_.get(), kModality)
->SetPresentationContext(&presentation_context_); ->SetPresentationContext(&presentation_context_);
// Add and active a WebState over which to present overlays. // Add and active a WebState over which to present overlays.
web_state_list_.InsertWebState(0, std::make_unique<web::TestWebState>(), web_state_list_.InsertWebState(0, std::make_unique<web::FakeWebState>(),
WebStateList::INSERT_ACTIVATE, WebStateList::INSERT_ACTIVATE,
WebStateOpener()); WebStateOpener());
web_state_ = web_state_list_.GetActiveWebState(); web_state_ = web_state_list_.GetActiveWebState();
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "ios/chrome/browser/overlays/public/overlay_request_queue.h" #import "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_request_callback_installer.h" #include "ios/chrome/browser/overlays/test/fake_overlay_request_callback_installer.h"
#include "ios/chrome/browser/overlays/test/overlay_test_macros.h" #include "ios/chrome/browser/overlays/test/overlay_test_macros.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -46,7 +46,7 @@ class OverlayRequestQueueCallbackInstallerTest : public PlatformTest { ...@@ -46,7 +46,7 @@ class OverlayRequestQueueCallbackInstallerTest : public PlatformTest {
} }
protected: protected:
web::TestWebState web_state_; web::FakeWebState web_state_;
testing::StrictMock<MockOverlayRequestCallbackReceiver> callback_receiver_; testing::StrictMock<MockOverlayRequestCallbackReceiver> callback_receiver_;
std::unique_ptr<OverlayRequestQueueCallbackInstaller> queue_installer_; std::unique_ptr<OverlayRequestQueueCallbackInstaller> queue_installer_;
}; };
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import "ios/chrome/browser/overlays/public/overlay_request_cancel_handler.h" #import "ios/chrome/browser/overlays/public/overlay_request_cancel_handler.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_request_cancel_handler.h" #include "ios/chrome/browser/overlays/test/fake_overlay_request_cancel_handler.h"
#include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h" #include "ios/chrome/browser/overlays/test/fake_overlay_user_data.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -103,7 +103,7 @@ class NoOpCancelHandler : public OverlayRequestCancelHandler { ...@@ -103,7 +103,7 @@ class NoOpCancelHandler : public OverlayRequestCancelHandler {
class OverlayRequestQueueImplTest : public PlatformTest { class OverlayRequestQueueImplTest : public PlatformTest {
public: public:
OverlayRequestQueueImplTest() OverlayRequestQueueImplTest()
: PlatformTest(), web_state_(std::make_unique<web::TestWebState>()) { : PlatformTest(), web_state_(std::make_unique<web::FakeWebState>()) {
OverlayRequestQueueImpl::Container::CreateForWebState(web_state_.get()); OverlayRequestQueueImpl::Container::CreateForWebState(web_state_.get());
queue()->SetDelegate(&delegate_); queue()->SetDelegate(&delegate_);
queue()->AddObserver(&observer_); queue()->AddObserver(&observer_);
...@@ -135,7 +135,7 @@ class OverlayRequestQueueImplTest : public PlatformTest { ...@@ -135,7 +135,7 @@ class OverlayRequestQueueImplTest : public PlatformTest {
protected: protected:
FakeOverlayRequestQueueImplDelegate delegate_; FakeOverlayRequestQueueImplDelegate delegate_;
MockOverlayRequestQueueImplObserver observer_; MockOverlayRequestQueueImplObserver observer_;
std::unique_ptr<web::TestWebState> web_state_; std::unique_ptr<web::FakeWebState> web_state_;
}; };
// Tests that state is updated correctly and observer callbacks are received // Tests that state is updated correctly and observer callbacks are received
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "ios/chrome/browser/overlays/public/overlay_request_queue.h" #include "ios/chrome/browser/overlays/public/overlay_request_queue.h"
#include "ios/chrome/browser/overlays/test/overlay_test_macros.h" #include "ios/chrome/browser/overlays/test/overlay_test_macros.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -35,7 +35,7 @@ using OverlayRequestQueueUtilTest = PlatformTest; ...@@ -35,7 +35,7 @@ using OverlayRequestQueueUtilTest = PlatformTest;
// Tests that the expected indices for matching configs returned. // Tests that the expected indices for matching configs returned.
TEST_F(OverlayRequestQueueUtilTest, MatchingConfigs) { TEST_F(OverlayRequestQueueUtilTest, MatchingConfigs) {
// Add requests to |web_state|'s queue. // Add requests to |web_state|'s queue.
web::TestWebState web_state; web::FakeWebState web_state;
OverlayRequestQueue* queue = OverlayRequestQueue* queue =
OverlayRequestQueue::FromWebState(&web_state, OverlayModality::kTesting); OverlayRequestQueue::FromWebState(&web_state, OverlayModality::kTesting);
queue->AddRequest(OverlayRequest::CreateWithConfig<FirstConfig>()); queue->AddRequest(OverlayRequest::CreateWithConfig<FirstConfig>());
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#import "ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.h" #import "ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.h"
#import "ios/chrome/browser/ui/elements/text_field_configuration.h" #import "ios/chrome/browser/ui/elements/text_field_configuration.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "testing/gtest_mac.h" #include "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -53,7 +53,7 @@ class JavaScriptDialogOverlayTest ...@@ -53,7 +53,7 @@ class JavaScriptDialogOverlayTest
return GetParam() == web::JAVASCRIPT_DIALOG_TYPE_PROMPT; return GetParam() == web::JAVASCRIPT_DIALOG_TYPE_PROMPT;
} }
web::TestWebState web_state_; web::FakeWebState web_state_;
GURL url_; GURL url_;
NSString* message_ = nil; NSString* message_ = nil;
NSString* default_text_field_value_ = nil; NSString* default_text_field_value_ = nil;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#import "ios/chrome/browser/web_state_list/web_state_opener.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h"
#import "ios/chrome/test/scoped_key_window.h" #import "ios/chrome/test/scoped_key_window.h"
#import "ios/web/common/crw_web_view_content_view.h" #import "ios/web/common/crw_web_view_content_view.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "ios/web/public/test/web_task_environment.h" #include "ios/web/public/test/web_task_environment.h"
#import "ios/web/public/ui/crw_web_view_proxy.h" #import "ios/web/public/ui/crw_web_view_proxy.h"
#import "ios/web/public/ui/crw_web_view_scroll_view_proxy.h" #import "ios/web/public/ui/crw_web_view_scroll_view_proxy.h"
...@@ -50,8 +50,7 @@ class OverlayPresentationContextFullscreenDisablerTest : public PlatformTest { ...@@ -50,8 +50,7 @@ class OverlayPresentationContextFullscreenDisablerTest : public PlatformTest {
// callbacks are sent. // callbacks are sent.
overlay_presenter()->SetPresentationContext(&presentation_context_); overlay_presenter()->SetPresentationContext(&presentation_context_);
std::unique_ptr<web::TestWebState> web_state = auto web_state = std::make_unique<web::FakeWebState>();
std::make_unique<web::TestWebState>();
web_state->SetView(content_view_); web_state->SetView(content_view_);
CRWWebViewScrollViewProxy* scroll_view_proxy = CRWWebViewScrollViewProxy* scroll_view_proxy =
[[CRWWebViewScrollViewProxy alloc] init]; [[CRWWebViewScrollViewProxy alloc] init];
......
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