Commit 5cd4a47a 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: I274b578a76090f7bbd1a608fcd3da2d704e11fc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591882
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837025}
parent a349be15
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "ios/chrome/browser/infobars/confirm_infobar_metrics_recorder.h" #include "ios/chrome/browser/infobars/confirm_infobar_metrics_recorder.h"
#include "ios/chrome/browser/infobars/infobar_manager_impl.h" #include "ios/chrome/browser/infobars/infobar_manager_impl.h"
#import "ios/chrome/browser/web/chrome_web_test.h" #import "ios/chrome/browser/web/chrome_web_test.h"
#import "ios/web/public/test/fakes/test_navigation_manager.h"
#import "ios/web/public/test/fakes/test_web_state.h"
#import "ios/web/public/test/fakes/test_web_state_delegate.h" #import "ios/web/public/test/fakes/test_web_state_delegate.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h" #include "url/gurl.h"
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include "ios/web/common/features.h" #include "ios/web/common/features.h"
#import "ios/web/common/web_view_creation_util.h" #import "ios/web/common/web_view_creation_util.h"
#import "ios/web/public/test/error_test_util.h" #import "ios/web/public/test/error_test_util.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"
#import "ios/web/public/test/js_test_util.h" #import "ios/web/public/test/js_test_util.h"
#include "ios/web/public/test/scoped_testing_web_client.h" #include "ios/web/public/test/scoped_testing_web_client.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
...@@ -186,8 +186,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostNonOtr) { ...@@ -186,8 +186,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostNonOtr) {
callback_called = true; callback_called = true;
page = error_html; page = error_html;
}); });
web::TestWebState test_web_state; web::FakeWebState web_state;
web_client.PrepareErrorPage(&test_web_state, GURL(kTestUrl), error, web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
/*is_post=*/false, /*is_post=*/false,
/*is_off_the_record=*/false, /*is_off_the_record=*/false,
/*info=*/base::nullopt, /*info=*/base::nullopt,
...@@ -212,8 +212,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPagePostNonOtr) { ...@@ -212,8 +212,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPagePostNonOtr) {
callback_called = true; callback_called = true;
page = error_html; page = error_html;
}); });
web::TestWebState test_web_state; web::FakeWebState web_state;
web_client.PrepareErrorPage(&test_web_state, GURL(kTestUrl), error, web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
/*is_post=*/true, /*is_post=*/true,
/*is_off_the_record=*/false, /*is_off_the_record=*/false,
/*info=*/base::nullopt, /*info=*/base::nullopt,
...@@ -238,8 +238,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostOtr) { ...@@ -238,8 +238,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageNonPostOtr) {
callback_called = true; callback_called = true;
page = error_html; page = error_html;
}); });
web::TestWebState test_web_state; web::FakeWebState web_state;
web_client.PrepareErrorPage(&test_web_state, GURL(kTestUrl), error, web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
/*is_post=*/false, /*is_post=*/false,
/*is_off_the_record=*/true, /*is_off_the_record=*/true,
/*info=*/base::nullopt, /*info=*/base::nullopt,
...@@ -264,8 +264,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPagePostOtr) { ...@@ -264,8 +264,8 @@ TEST_F(ChromeWebClientTest, PrepareErrorPagePostOtr) {
callback_called = true; callback_called = true;
page = error_html; page = error_html;
}); });
web::TestWebState test_web_state; web::FakeWebState web_state;
web_client.PrepareErrorPage(&test_web_state, GURL(kTestUrl), error, web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
/*is_post=*/true, /*is_post=*/true,
/*is_off_the_record=*/true, /*is_off_the_record=*/true,
/*info=*/base::nullopt, /*info=*/base::nullopt,
...@@ -301,9 +301,9 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) { ...@@ -301,9 +301,9 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) {
callback_called = true; callback_called = true;
page = error_html; page = error_html;
}); });
web::TestWebState test_web_state; web::FakeWebState web_state;
security_interstitials::IOSBlockingPageTabHelper::CreateForWebState( security_interstitials::IOSBlockingPageTabHelper::CreateForWebState(
&test_web_state); &web_state);
// Use a test URLLoaderFactory so that the captive portal detector doesn't // Use a test URLLoaderFactory so that the captive portal detector doesn't
// make an actual network request. // make an actual network request.
...@@ -314,11 +314,11 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) { ...@@ -314,11 +314,11 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) {
id captive_portal_detector_tab_helper_delegate = [OCMockObject id captive_portal_detector_tab_helper_delegate = [OCMockObject
mockForProtocol:@protocol(CaptivePortalDetectorTabHelperDelegate)]; mockForProtocol:@protocol(CaptivePortalDetectorTabHelperDelegate)];
CaptivePortalDetectorTabHelper::CreateForWebState( CaptivePortalDetectorTabHelper::CreateForWebState(
&test_web_state, captive_portal_detector_tab_helper_delegate, &web_state, captive_portal_detector_tab_helper_delegate,
&test_loader_factory); &test_loader_factory);
test_web_state.SetBrowserState(browser_state()); web_state.SetBrowserState(browser_state());
web_client.PrepareErrorPage(&test_web_state, GURL(kTestUrl), error, web_client.PrepareErrorPage(&web_state, GURL(kTestUrl), error,
/*is_post=*/false, /*is_post=*/false,
/*is_off_the_record=*/false, /*is_off_the_record=*/false,
/*info=*/ssl_info, /*info=*/ssl_info,
...@@ -336,7 +336,7 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) { ...@@ -336,7 +336,7 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageWithSSLInfo) {
// committed safe browsing interstitial. // committed safe browsing interstitial.
TEST_F(ChromeWebClientTest, PrepareErrorPageForSafeBrowsingError) { TEST_F(ChromeWebClientTest, PrepareErrorPageForSafeBrowsingError) {
// Store an unsafe resource in |web_state|'s container. // Store an unsafe resource in |web_state|'s container.
web::TestWebState web_state; web::FakeWebState web_state;
web_state.SetBrowserState(browser_state()); web_state.SetBrowserState(browser_state());
SafeBrowsingUrlAllowList::CreateForWebState(&web_state); SafeBrowsingUrlAllowList::CreateForWebState(&web_state);
SafeBrowsingUnsafeResourceContainer::CreateForWebState(&web_state); SafeBrowsingUnsafeResourceContainer::CreateForWebState(&web_state);
...@@ -379,12 +379,12 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForSafeBrowsingError) { ...@@ -379,12 +379,12 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForSafeBrowsingError) {
// Tests PrepareErrorPage for a lookalike error, which results in a // Tests PrepareErrorPage for a lookalike error, which results in a
// committed lookalike interstitial. // committed lookalike interstitial.
TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlError) { TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlError) {
web::TestWebState web_state; web::FakeWebState web_state;
web_state.SetBrowserState(browser_state()); web_state.SetBrowserState(browser_state());
LookalikeUrlContainer::CreateForWebState(&web_state); LookalikeUrlContainer::CreateForWebState(&web_state);
security_interstitials::IOSBlockingPageTabHelper::CreateForWebState( security_interstitials::IOSBlockingPageTabHelper::CreateForWebState(
&web_state); &web_state);
auto navigation_manager = std::make_unique<web::TestNavigationManager>(); auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
web_state.SetNavigationManager(std::move(navigation_manager)); web_state.SetNavigationManager(std::move(navigation_manager));
LookalikeUrlContainer::FromWebState(&web_state) LookalikeUrlContainer::FromWebState(&web_state)
...@@ -420,12 +420,12 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlError) { ...@@ -420,12 +420,12 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlError) {
// which results in a committed lookalike interstitial that has a 'Close page' // which results in a committed lookalike interstitial that has a 'Close page'
// button instead of 'Back to safety' (when there is no back item). // button instead of 'Back to safety' (when there is no back item).
TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlErrorNoSuggestion) { TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlErrorNoSuggestion) {
web::TestWebState web_state; web::FakeWebState web_state;
web_state.SetBrowserState(browser_state()); web_state.SetBrowserState(browser_state());
LookalikeUrlContainer::CreateForWebState(&web_state); LookalikeUrlContainer::CreateForWebState(&web_state);
security_interstitials::IOSBlockingPageTabHelper::CreateForWebState( security_interstitials::IOSBlockingPageTabHelper::CreateForWebState(
&web_state); &web_state);
auto navigation_manager = std::make_unique<web::TestNavigationManager>(); auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
web_state.SetNavigationManager(std::move(navigation_manager)); web_state.SetNavigationManager(std::move(navigation_manager));
LookalikeUrlContainer::FromWebState(&web_state) LookalikeUrlContainer::FromWebState(&web_state)
...@@ -464,11 +464,11 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlErrorNoSuggestion) { ...@@ -464,11 +464,11 @@ TEST_F(ChromeWebClientTest, PrepareErrorPageForLookalikeUrlErrorNoSuggestion) {
// Tests PrepareErrorPage for a legacy TLS error, which results in a // Tests PrepareErrorPage for a legacy TLS error, which results in a
// committed legacy TLS interstitial. // committed legacy TLS interstitial.
TEST_F(ChromeWebClientTest, PrepareErrorPageForLegacyTLSError) { TEST_F(ChromeWebClientTest, PrepareErrorPageForLegacyTLSError) {
web::TestWebState web_state; web::FakeWebState web_state;
web_state.SetBrowserState(browser_state()); web_state.SetBrowserState(browser_state());
security_interstitials::IOSBlockingPageTabHelper::CreateForWebState( security_interstitials::IOSBlockingPageTabHelper::CreateForWebState(
&web_state); &web_state);
auto navigation_manager = std::make_unique<web::TestNavigationManager>(); auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
web_state.SetNavigationManager(std::move(navigation_manager)); web_state.SetNavigationManager(std::move(navigation_manager));
NSError* error = [NSError errorWithDomain:net::kNSErrorDomain NSError* error = [NSError errorWithDomain:net::kNSErrorDomain
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "ios/chrome/browser/web/features.h" #include "ios/chrome/browser/web/features.h"
#include "ios/web/public/test/fakes/fake_web_frame.h" #include "ios/web/public/test/fakes/fake_web_frame.h"
#import "ios/web/public/test/fakes/fake_web_frames_manager.h" #import "ios/web/public/test/fakes/fake_web_frames_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"
#import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/OCMock/OCMock.h"
...@@ -99,7 +99,7 @@ class FontSizeTabHelperTest : public PlatformTest { ...@@ -99,7 +99,7 @@ class FontSizeTabHelperTest : public PlatformTest {
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
base::test::TaskEnvironment task_environment_; base::test::TaskEnvironment task_environment_;
std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; std::unique_ptr<TestChromeBrowserState> chrome_browser_state_;
web::TestWebState web_state_; web::FakeWebState web_state_;
web::FakeWebFrame* fake_main_frame_ = nullptr; web::FakeWebFrame* fake_main_frame_ = nullptr;
web::FakeWebFramesManager* fake_web_frames_manager_ = nullptr; web::FakeWebFramesManager* fake_web_frames_manager_ = nullptr;
UIContentSizeCategory preferred_content_size_category_ = UIContentSizeCategory preferred_content_size_category_ =
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "ios/net/protocol_handler_util.h" #import "ios/net/protocol_handler_util.h"
#import "ios/web/public/navigation/web_state_policy_decider.h" #import "ios/web/public/navigation/web_state_policy_decider.h"
#import "ios/web/public/test/fakes/test_web_state.h" #import "ios/web/public/test/fakes/fake_web_state.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "testing/gtest_mac.h" #include "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -36,7 +36,7 @@ class InvalidUrlTabHelperTest : public PlatformTest { ...@@ -36,7 +36,7 @@ class InvalidUrlTabHelperTest : public PlatformTest {
return web_state_.ShouldAllowRequest(request, info); return web_state_.ShouldAllowRequest(request, info);
} }
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that navigation is allowed for https url link. // Tests that navigation is allowed for https url link.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "base/time/time.h" #include "base/time/time.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/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -32,7 +32,7 @@ class LoadTimingTabHelperTest : public PlatformTest { ...@@ -32,7 +32,7 @@ class LoadTimingTabHelperTest : public PlatformTest {
.empty()); .empty());
} }
web::TestWebState web_state_; web::FakeWebState web_state_;
base::HistogramTester histogram_tester_; base::HistogramTester histogram_tester_;
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h"
#import "ios/chrome/browser/ui/util/named_guide.h" #import "ios/chrome/browser/ui/util/named_guide.h"
#import "ios/chrome/test/scoped_key_window.h" #import "ios/chrome/test/scoped_key_window.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/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -30,7 +30,7 @@ class PagePlaceholderTabHelperTest : public PlatformTest { ...@@ -30,7 +30,7 @@ class PagePlaceholderTabHelperTest : public PlatformTest {
protected: protected:
PagePlaceholderTabHelperTest() { PagePlaceholderTabHelperTest() {
browser_state_ = TestChromeBrowserState::Builder().Build(); browser_state_ = TestChromeBrowserState::Builder().Build();
web_state_ = std::make_unique<web::TestWebState>(); web_state_ = std::make_unique<web::FakeWebState>();
web_state_->SetBrowserState(browser_state_.get()); web_state_->SetBrowserState(browser_state_.get());
CGRect frame = {CGPointZero, CGSizeMake(400, 300)}; CGRect frame = {CGPointZero, CGSizeMake(400, 300)};
...@@ -58,7 +58,7 @@ class PagePlaceholderTabHelperTest : public PlatformTest { ...@@ -58,7 +58,7 @@ class PagePlaceholderTabHelperTest : public PlatformTest {
web::WebTaskEnvironment task_environment_; web::WebTaskEnvironment task_environment_;
ScopedKeyWindow scoped_key_window_; ScopedKeyWindow scoped_key_window_;
std::unique_ptr<ChromeBrowserState> browser_state_; std::unique_ptr<ChromeBrowserState> browser_state_;
std::unique_ptr<web::TestWebState> web_state_; std::unique_ptr<web::FakeWebState> web_state_;
UIView* web_state_view_ = nil; UIView* web_state_view_ = nil;
}; };
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/bind.h" #include "base/bind.h"
#import "ios/chrome/browser/web/repost_form_tab_helper_delegate.h" #import "ios/chrome/browser/web/repost_form_tab_helper_delegate.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"
...@@ -82,7 +82,7 @@ void IgnoreBool(bool) {} ...@@ -82,7 +82,7 @@ void IgnoreBool(bool) {}
class RepostFormTabHelperTest : public PlatformTest { class RepostFormTabHelperTest : public PlatformTest {
protected: protected:
RepostFormTabHelperTest() RepostFormTabHelperTest()
: web_state_(new web::TestWebState()), : web_state_(std::make_unique<web::FakeWebState>()),
delegate_([[RepostFormTabHelperTestDelegate alloc] init]), delegate_([[RepostFormTabHelperTestDelegate alloc] init]),
location_(CGPointMake(kDialogHLocation, kDialogVLocation)) { location_(CGPointMake(kDialogHLocation, kDialogVLocation)) {
RepostFormTabHelper::CreateForWebState(web_state_.get(), delegate_); RepostFormTabHelper::CreateForWebState(web_state_.get(), delegate_);
...@@ -94,7 +94,7 @@ class RepostFormTabHelperTest : public PlatformTest { ...@@ -94,7 +94,7 @@ class RepostFormTabHelperTest : public PlatformTest {
} }
protected: protected:
std::unique_ptr<web::TestWebState> web_state_; std::unique_ptr<web::FakeWebState> web_state_;
RepostFormTabHelperTestDelegate* delegate_; RepostFormTabHelperTestDelegate* delegate_;
CGPoint location_; CGPoint location_;
}; };
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#import "ios/chrome/browser/web/sad_tab_tab_helper_delegate.h" #import "ios/chrome/browser/web/sad_tab_tab_helper_delegate.h"
#import "ios/chrome/test/scoped_key_window.h" #import "ios/chrome/test/scoped_key_window.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_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"
#import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/OCMock/OCMock.h"
...@@ -85,8 +85,7 @@ class SadTabTabHelperTest : public PlatformTest { ...@@ -85,8 +85,7 @@ class SadTabTabHelperTest : public PlatformTest {
OCMStub([application_ sharedApplication]).andReturn(application_); OCMStub([application_ sharedApplication]).andReturn(application_);
// Setup navigation manager. // Setup navigation manager.
std::unique_ptr<web::TestNavigationManager> navigation_manager = auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
std::make_unique<web::TestNavigationManager>();
navigation_manager->SetBrowserState(browser_state_.get()); navigation_manager->SetBrowserState(browser_state_.get());
navigation_manager_ = navigation_manager.get(); navigation_manager_ = navigation_manager.get();
web_state_.SetNavigationManager(std::move(navigation_manager)); web_state_.SetNavigationManager(std::move(navigation_manager));
...@@ -103,8 +102,8 @@ class SadTabTabHelperTest : public PlatformTest { ...@@ -103,8 +102,8 @@ class SadTabTabHelperTest : public PlatformTest {
ScopedKeyWindow scoped_key_window_; ScopedKeyWindow scoped_key_window_;
UIView* web_state_view_; UIView* web_state_view_;
std::unique_ptr<ChromeBrowserState> browser_state_; std::unique_ptr<ChromeBrowserState> browser_state_;
web::TestWebState web_state_; web::FakeWebState web_state_;
web::TestNavigationManager* navigation_manager_; web::FakeNavigationManager* navigation_manager_;
id application_; id application_;
SadTabTabHelperTestDelegate* sad_tab_delegate_; SadTabTabHelperTestDelegate* sad_tab_delegate_;
}; };
...@@ -350,11 +349,10 @@ TEST_F(SadTabTabHelperTest, FailureInterval) { ...@@ -350,11 +349,10 @@ TEST_F(SadTabTabHelperTest, FailureInterval) {
std::unique_ptr<ChromeBrowserState> browser_state = std::unique_ptr<ChromeBrowserState> browser_state =
TestChromeBrowserState::Builder().Build(); TestChromeBrowserState::Builder().Build();
std::unique_ptr<web::TestNavigationManager> navigation_manager = auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
std::make_unique<web::TestNavigationManager>();
navigation_manager->SetBrowserState(browser_state_.get()); navigation_manager->SetBrowserState(browser_state_.get());
web::TestWebState web_state; web::FakeWebState web_state;
web_state.SetBrowserState(browser_state.get()); web_state.SetBrowserState(browser_state.get());
web_state.SetNavigationManager(std::move(navigation_manager)); web_state.SetNavigationManager(std::move(navigation_manager));
SadTabTabHelper::CreateForWebState(&web_state, 0.0f); SadTabTabHelper::CreateForWebState(&web_state, 0.0f);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#import "ios/chrome/browser/web/tab_id_tab_helper.h" #import "ios/chrome/browser/web/tab_id_tab_helper.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"
#import "testing/gtest_mac.h" #import "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
// Test fixture for TabIdTabHelper class. // Test fixture for TabIdTabHelper class.
class TabIdTabHelperTest : public PlatformTest { class TabIdTabHelperTest : public PlatformTest {
protected: protected:
web::TestWebState first_web_state_; web::FakeWebState first_web_state_;
web::TestWebState second_web_state_; web::FakeWebState second_web_state_;
}; };
// Tests that a tab ID is returned for a WebState, and tab ID's are different // Tests that a tab ID is returned for a WebState, and tab ID's are different
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#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/navigation/navigation_manager.h" #import "ios/web/public/navigation/navigation_manager.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"
#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/test/web_task_environment.h"
#import "ios/web/public/web_state.h" #import "ios/web/public/web_state.h"
#import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest/include/gtest/gtest.h"
...@@ -58,8 +58,8 @@ class WebNavigationBrowserAgentTest : public PlatformTest { ...@@ -58,8 +58,8 @@ class WebNavigationBrowserAgentTest : public PlatformTest {
agent_ = WebNavigationBrowserAgent::FromBrowser(browser_.get()); agent_ = WebNavigationBrowserAgent::FromBrowser(browser_.get());
agent_->SetDelegate(delegate_); agent_->SetDelegate(delegate_);
WebStateOpener opener; WebStateOpener opener;
auto web_state = std::make_unique<web::TestWebState>(); auto web_state = std::make_unique<web::FakeWebState>();
auto navigation_manager = std::make_unique<web::TestNavigationManager>(); auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
navigation_manager_ = navigation_manager.get(); navigation_manager_ = navigation_manager.get();
web_state->SetNavigationManager(std::move(navigation_manager)); web_state->SetNavigationManager(std::move(navigation_manager));
browser_->GetWebStateList()->InsertWebState( browser_->GetWebStateList()->InsertWebState(
...@@ -75,7 +75,7 @@ class WebNavigationBrowserAgentTest : public PlatformTest { ...@@ -75,7 +75,7 @@ class WebNavigationBrowserAgentTest : public PlatformTest {
WebNavigationBrowserAgent* agent_; WebNavigationBrowserAgent* agent_;
// Navigation manager for the web state at index 0 in |browser_|'s web state // Navigation manager for the web state at index 0 in |browser_|'s web state
// list. // list.
web::TestNavigationManager* navigation_manager_; web::FakeNavigationManager* navigation_manager_;
}; };
// Tests that reloading when there is no active NTP reloads the web state, and // Tests that reloading when there is no active NTP reloads the web state, and
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "base/test/metrics/user_action_tester.h" #include "base/test/metrics/user_action_tester.h"
#include "components/search_engines/template_url.h" #include "components/search_engines/template_url.h"
#import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/navigation/navigation_manager.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"
#import "testing/gtest_mac.h" #import "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
class WebNavigationUtilsTest : public PlatformTest { class WebNavigationUtilsTest : public PlatformTest {
protected: protected:
WebNavigationUtilsTest() { WebNavigationUtilsTest() {
auto navigation_manager = std::make_unique<web::TestNavigationManager>(); auto navigation_manager = std::make_unique<web::FakeNavigationManager>();
navigation_manager_ = navigation_manager.get(); navigation_manager_ = navigation_manager.get();
web_state_.SetNavigationManager(std::move(navigation_manager)); web_state_.SetNavigationManager(std::move(navigation_manager));
} }
web::TestWebState web_state_; web::FakeWebState web_state_;
web::TestNavigationManager* navigation_manager_ = nullptr; web::FakeNavigationManager* navigation_manager_ = nullptr;
base::UserActionTester user_action_tester_; base::UserActionTester user_action_tester_;
}; };
......
...@@ -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"
#import "ios/chrome/browser/overlays/public/web_content_area/http_auth_overlay.h" #import "ios/chrome/browser/overlays/public/web_content_area/http_auth_overlay.h"
#import "ios/chrome/browser/overlays/public/web_content_area/java_script_dialog_overlay.h" #import "ios/chrome/browser/overlays/public/web_content_area/java_script_dialog_overlay.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/ui/java_script_dialog_presenter.h" #include "ios/web/public/ui/java_script_dialog_presenter.h"
#include "ios/web/public/ui/java_script_dialog_type.h" #include "ios/web/public/ui/java_script_dialog_type.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -35,7 +35,7 @@ class WebStateDelegateTabHelperTest : public PlatformTest { ...@@ -35,7 +35,7 @@ class WebStateDelegateTabHelperTest : public PlatformTest {
} }
protected: protected:
web::TestWebState web_state_; web::FakeWebState web_state_;
}; };
// Tests that OnAuthRequired() adds an HTTP authentication overlay request to // Tests that OnAuthRequired() adds an HTTP authentication overlay request to
......
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