chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "ui/base/l10n/l10n_util.h"

class InterstitialUITest : public InProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(InterstitialUITest, HomePage) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, InvalidURLShouldOpenHomePage) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest,
                       InvalidURLMatchingStartOfValidURLShouldBeInvalid) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, SSLInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, MITMSoftwareInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, PinnedCertInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, CTInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, EnterpriseBlockInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, EnterpriseWarnInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, MalwareInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, PhishingInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, UnwantedSoftwareInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, MalwareInterstitialQuiet) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, PhishingInterstitialQuiet) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, UnwantedSoftwareInterstitialQuiet) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, BillingInterstitialQuiet) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, ClientsideMalwareInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, ClientsidePhishingInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, BillingInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, CaptivePortalInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, CaptivePortalInterstitialWifi) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest, BlockedInterceptionInterstitial) {}

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
// Tests that the interstitials have the expected title and content.
IN_PROC_BROWSER_TEST_F(InterstitialUITest,
                       SupervisedUserVerificationInterstitial) {}

IN_PROC_BROWSER_TEST_F(InterstitialUITest,
                       SupervisedUserVerificationBlockedSiteInterstitial) {}
#endif

// Tests that back button works after opening an interstitial from
// chrome://interstitials.
IN_PROC_BROWSER_TEST_F(InterstitialUITest, InterstitialBackButton) {}

// Tests that view-source: works correctly on chrome://interstitials.
IN_PROC_BROWSER_TEST_F(InterstitialUITest, InterstitialViewSource) {}

// Tests that view-source: works correctly on a subpage of
// chrome://interstitials (using chrome://interstitials/ssl).

// Test is currently flaky on Windows (crbug.com/926392)
#if BUILDFLAG(IS_WIN)
#define MAYBE_InterstitialWithPathViewSource
#else
#define MAYBE_InterstitialWithPathViewSource
#endif

IN_PROC_BROWSER_TEST_F(InterstitialUITest,
                       MAYBE_InterstitialWithPathViewSource) {}

// Checks that the interstitial page uses correct web contents. If not, closing
// the tab might result in a freed web contents pointer and cause a crash.
// See https://crbug.com/611706 for details.
IN_PROC_BROWSER_TEST_F(InterstitialUITest, UseCorrectWebContents) {}