#include <memory>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/interstitials/security_interstitial_page_test_utils.h"
#include "chrome/browser/preloading/prerender/prerender_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/security_interstitials/content/security_interstitial_page.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "components/security_interstitials/core/controller_client.h"
#include "content/public/browser/preloading_trigger_type.h"
#include "content/public/browser/prerender_handle.h"
#include "content/public/browser/reload_type.h"
#include "content/public/browser/ssl_host_state_delegate.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/prerender_test_util.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/url_loader_interceptor.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/cert_test_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
IsShowingSSLInterstitial;
EvalJs;
ExecJs;
RenderFrameHost;
SSLHostStateDelegate;
TestNavigationManager;
URLLoaderInterceptor;
WebContents;
PrerenderHostObserver;
EmbeddedTestServer;
NavigateToURL;
namespace {
std::unique_ptr<net::EmbeddedTestServer> CreateExpiredCertServer(
const base::FilePath& data_dir) { … }
std::unique_ptr<net::EmbeddedTestServer> CreateHTTPSServer(
const base::FilePath& data_dir) { … }
std::string GetFilePathWithHostAndPortReplacement(
const std::string& original_file_path,
const net::HostPortPair& host_port_pair) { … }
}
class SSLPrerenderTest : public InProcessBrowserTest { … };
class SecurityVisibleStateObserver : public content::WebContentsObserver { … };
IN_PROC_BROWSER_TEST_F(SSLPrerenderTest, TestNoInterstitialInPrerender) { … }
IN_PROC_BROWSER_TEST_F(SSLPrerenderTest,
DISABLED_TestNoInterstitialInPrerenderSW) { … }
IN_PROC_BROWSER_TEST_F(SSLPrerenderTest,
InsecureFormSubmissionCancelsPrerender) { … }
IN_PROC_BROWSER_TEST_F(SSLPrerenderTest,
InsecureFormSubmissionCancelsPrerenderEvenIfProceeding) { … }
IN_PROC_BROWSER_TEST_F(SSLPrerenderTest,
TestNoVisibleStateChangedOnInitialPrerendering) { … }