| Index: chrome/browser/previews/previews_infobar_tab_helper_unittest.cc
|
| diff --git a/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc b/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc
|
| index 78a72efaba17d1187f309541326530b92cdcedb0..699aaf1267533eeb70bfb2a1c144c3ca4386f4ae 100644
|
| --- a/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc
|
| +++ b/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc
|
| @@ -12,22 +12,15 @@
|
| #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
|
| #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h"
|
| #include "chrome/browser/previews/previews_infobar_tab_helper.h"
|
| -#include "chrome/common/features.h"
|
| #include "chrome/test/base/chrome_render_view_host_test_harness.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
|
| -#include "components/offline_pages/offline_page_item.h"
|
| -#include "components/offline_pages/request_header/offline_page_header.h"
|
| #include "components/prefs/pref_registry_simple.h"
|
| #include "components/proxy_config/proxy_config_pref_names.h"
|
| #include "content/public/browser/navigation_handle.h"
|
| #include "content/public/test/web_contents_tester.h"
|
| #include "net/http/http_util.h"
|
| -
|
| -#if BUILDFLAG(ANDROID_JAVA_UI)
|
| -#include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
|
| -#endif // BUILDFLAG(ANDROID_JAVA_UI)
|
|
|
| namespace {
|
| const char kTestUrl[] = "http://www.test.com/";
|
| @@ -38,10 +31,6 @@
|
| protected:
|
| void SetUp() override {
|
| ChromeRenderViewHostTestHarness::SetUp();
|
| -// Insert an OfflinePageTabHelper before PreviewsInfoBarTabHelper.
|
| -#if BUILDFLAG(ANDROID_JAVA_UI)
|
| - offline_pages::OfflinePageTabHelper::CreateForWebContents(web_contents());
|
| -#endif // BUILDFLAG(ANDROID_JAVA_UI)
|
| InfoBarService::CreateForWebContents(web_contents());
|
| PreviewsInfoBarTabHelper::CreateForWebContents(web_contents());
|
| test_handle_ = content::NavigationHandle::CreateNavigationHandleForTesting(
|
| @@ -84,10 +73,6 @@
|
| test_handle_->CallWillProcessResponseForTesting(
|
| main_rfh(),
|
| net::HttpUtil::AssembleRawHeaders(headers.c_str(), headers.size()));
|
| - SimulateCommit();
|
| - }
|
| -
|
| - void SimulateCommit() {
|
| test_handle_->CallDidCommitNavigationForTesting(GURL(kTestUrl));
|
| }
|
|
|
| @@ -115,32 +100,5 @@
|
| // Navigate to reset the displayed state.
|
| content::WebContentsTester::For(web_contents())
|
| ->NavigateAndCommit(GURL(kTestUrl));
|
| -
|
| EXPECT_FALSE(infobar_tab_helper->displayed_preview_infobar());
|
| }
|
| -
|
| -#if BUILDFLAG(ANDROID_JAVA_UI)
|
| -TEST_F(PreviewsInfoBarTabHelperUnitTest, CreateOfflineInfoBar) {
|
| - PreviewsInfoBarTabHelper* infobar_tab_helper =
|
| - PreviewsInfoBarTabHelper::FromWebContents(web_contents());
|
| - EXPECT_FALSE(infobar_tab_helper->displayed_preview_infobar());
|
| -
|
| - SimulateCommit();
|
| - offline_pages::OfflinePageItem item;
|
| - offline_pages::OfflinePageHeader header;
|
| - offline_pages::OfflinePageTabHelper::FromWebContents(web_contents())
|
| - ->SetOfflinePage(item, header, true);
|
| - CallDidFinishNavigation();
|
| -
|
| - InfoBarService* infobar_service =
|
| - InfoBarService::FromWebContents(web_contents());
|
| - EXPECT_EQ(1U, infobar_service->infobar_count());
|
| - EXPECT_TRUE(infobar_tab_helper->displayed_preview_infobar());
|
| -
|
| - // Navigate to reset the displayed state.
|
| - content::WebContentsTester::For(web_contents())
|
| - ->NavigateAndCommit(GURL(kTestUrl));
|
| -
|
| - EXPECT_FALSE(infobar_tab_helper->displayed_preview_infobar());
|
| -}
|
| -#endif // BUILDFLAG(ANDROID_JAVA_UI)
|
|
|