diff options
Diffstat (limited to 'chromium/weblayer/browser/no_state_prefetch')
11 files changed, 27 insertions, 24 deletions
diff --git a/chromium/weblayer/browser/no_state_prefetch/no_state_prefetch_browsertest.cc b/chromium/weblayer/browser/no_state_prefetch/no_state_prefetch_browsertest.cc index 6c20eb885e5..539ba425605 100644 --- a/chromium/weblayer/browser/no_state_prefetch/no_state_prefetch_browsertest.cc +++ b/chromium/weblayer/browser/no_state_prefetch/no_state_prefetch_browsertest.cc @@ -5,11 +5,12 @@ #include <memory> #include "base/run_loop.h" +#include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" -#include "components/prerender/browser/prerender_histograms.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_histograms.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/url_loader_monitor.h" #include "net/test/embedded_test_server/embedded_test_server.h" @@ -37,7 +38,7 @@ class NoStatePrefetchBrowserTest : public WebLayerBrowserTest { public: #if defined(OS_ANDROID) void SetUp() override { - InstallTestGmsBridge(/* user_consent= */ true); + InstallTestGmsBridge(ConsentType::kConsent); WebLayerBrowserTest::SetUp(); } @@ -196,21 +197,23 @@ IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, prerendered_page_fetched_->Run(); } -// link-rel="next" happens even when NoStatePrefetch has been disabled. +// link-rel="next" URLs should not be prefetched. IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, LinkRelNextWithNSPDisabled) { - GetProfile()->SetBooleanSetting(SettingType::NETWORK_PREDICTION_ENABLED, - false); NavigateAndWaitForCompletion( GURL(https_server_->GetURL("/link_rel_next_parent.html")), shell()); - - prerendered_page_fetched_->Run(); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(prerendered_page_was_fetched_); } // Non-web initiated prerender succeeds and subsequent navigations reuse // previously downloaded resources. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, ExternalPrerender) { - // std::unique_ptr<PrerenderControllerImpl> controller = - // PrerenderControllerImpl::Create(shell()->browser()); +// TODO(https://crbug.com/1144282): Fix failures on Asan. +#if defined(ADDRESS_SANITIZER) +#define MAYBE_ExternalPrerender DISABLED_ExternalPrerender +#else +#define MAYBE_ExternalPrerender ExternalPrerender +#endif +IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, MAYBE_ExternalPrerender) { GetProfile()->GetPrerenderController()->Prerender( GURL(https_server_->GetURL("/prerendered_page.html"))); diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_controller_impl.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_controller_impl.cc index a5dd8f788a1..ccefb205263 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_controller_impl.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_controller_impl.cc @@ -5,8 +5,8 @@ #include "weblayer/browser/no_state_prefetch/prerender_controller_impl.h" #include "build/build_config.h" -#include "components/prerender/browser/prerender_handle.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_handle.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "content/public/browser/browser_context.h" #include "ui/gfx/geometry/rect.h" #include "url/gurl.h" diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.cc index d7f715628e3..4b453fae327 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.cc @@ -5,8 +5,8 @@ #include "weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -#include "components/prerender/browser/prerender_link_manager.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_link_manager.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "weblayer/browser/no_state_prefetch/prerender_manager_factory.h" namespace weblayer { diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h b/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h index 7369249c063..a4d4d72e951 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" -#include "components/prerender/browser/prerender_link_manager.h" +#include "components/no_state_prefetch/browser/prerender_link_manager.h" namespace content { class BrowserContext; diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.cc index 7194cdb225e..66f074e52a8 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.cc @@ -4,7 +4,7 @@ #include "weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h" -#include "components/prerender/browser/prerender_contents_delegate.h" +#include "components/no_state_prefetch/browser/prerender_contents_delegate.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "weblayer/browser/browser_context_impl.h" diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h index 788a8cad121..9dd3189d04d 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h @@ -6,7 +6,7 @@ #define WEBLAYER_BROWSER_NO_STATE_PREFETCH_PRERENDER_MANAGER_DELEGATE_IMPL_H_ #include "components/content_settings/core/browser/cookie_settings.h" -#include "components/prerender/browser/prerender_manager_delegate.h" +#include "components/no_state_prefetch/browser/prerender_manager_delegate.h" namespace content { class BrowserContext; diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_factory.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_factory.cc index b99e036662f..700f38773e9 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_manager_factory.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_manager_factory.cc @@ -5,7 +5,7 @@ #include "weblayer/browser/no_state_prefetch/prerender_manager_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "weblayer/browser/no_state_prefetch/prerender_manager_delegate_impl.h" namespace weblayer { diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.cc index 1bc7022b279..e6ce7de3c6d 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.cc @@ -4,7 +4,7 @@ #include "weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.h" -#include "components/prerender/browser/prerender_link_manager.h" +#include "components/no_state_prefetch/browser/prerender_link_manager.h" #include "content/public/browser/browser_context.h" #include "weblayer/browser/no_state_prefetch/prerender_link_manager_factory.h" diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.h b/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.h index 1221e85b2da..322bdc25594 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.h +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_processor_impl_delegate_impl.h @@ -5,7 +5,7 @@ #ifndef WEBLAYER_BROWSER_NO_STATE_PREFETCH_PRERENDER_PROCESSOR_IMPL_DELEGATE_IMPL_H_ #define WEBLAYER_BROWSER_NO_STATE_PREFETCH_PRERENDER_PROCESSOR_IMPL_DELEGATE_IMPL_H_ -#include "components/prerender/browser/prerender_processor_impl_delegate.h" +#include "components/no_state_prefetch/browser/prerender_processor_impl_delegate.h" namespace content { class BrowserContext; diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_tab_helper.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_tab_helper.cc index 2825aa9b8a5..438ccf4c98b 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_tab_helper.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_tab_helper.cc @@ -4,7 +4,7 @@ #include "weblayer/browser/no_state_prefetch/prerender_tab_helper.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "weblayer/browser/no_state_prefetch/prerender_manager_factory.h" diff --git a/chromium/weblayer/browser/no_state_prefetch/prerender_utils.cc b/chromium/weblayer/browser/no_state_prefetch/prerender_utils.cc index 177a16adbea..0162939bd3f 100644 --- a/chromium/weblayer/browser/no_state_prefetch/prerender_utils.cc +++ b/chromium/weblayer/browser/no_state_prefetch/prerender_utils.cc @@ -4,8 +4,8 @@ #include "weblayer/browser/no_state_prefetch/prerender_utils.h" -#include "components/prerender/browser/prerender_contents.h" -#include "components/prerender/browser/prerender_manager.h" +#include "components/no_state_prefetch/browser/prerender_contents.h" +#include "components/no_state_prefetch/browser/prerender_manager.h" #include "content/public/browser/web_contents.h" #include "weblayer/browser/no_state_prefetch/prerender_manager_factory.h" |