Commit 652aacdd authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[Prerender] Remove SSL browsertests.

These are deleted either because the useful test cases here are already
covered by NoStatePrefetch browser tests: SSLCertRequestInfo and
SSLSubresourceError.

See this spreadsheet for more details:
https://docs.google.com/spreadsheets/d/1LFPB4UhPWQkBRz481lz49zmS25znhjSDUtagtTTSPQo/edit?usp=sharing

Bug: 898955
Change-Id: If7531f6dfd7b5ff7cd1b78111597af71375dd8a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2250178Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779720}
parent 9ed7333d
...@@ -1091,111 +1091,6 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ...@@ -1091,111 +1091,6 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
WindowOpenDisposition::CURRENT_TAB, false); WindowOpenDisposition::CURRENT_TAB, false);
} }
// Sets up HTTPS server for prerendered page, and checks that an SSL error will
// cancel the prerender. The prerenderer loader will be served through HTTP.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLErrorTopLevel) {
net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_MISMATCHED_NAME);
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
ASSERT_TRUE(https_server.Start());
GURL https_url = https_server.GetURL("/prerender/prerender_page.html");
PrerenderTestURL(https_url, FINAL_STATUS_SSL_ERROR, 0);
}
class TestClientCertStore : public net::ClientCertStore {
public:
explicit TestClientCertStore(const net::CertificateList& certs)
: certs_(certs) {}
~TestClientCertStore() override {}
// net::ClientCertStore:
void GetClientCerts(const net::SSLCertRequestInfo& cert_request_info,
ClientCertListCallback callback) override {
std::move(callback).Run(
FakeClientCertIdentityListFromCertificateList(certs_));
}
private:
net::CertificateList certs_;
};
std::unique_ptr<net::ClientCertStore> CreateCertStore(
scoped_refptr<net::X509Certificate> available_cert) {
return std::unique_ptr<net::ClientCertStore>(
new TestClientCertStore(net::CertificateList(1, available_cert)));
}
// Checks that a top-level page which would normally request an SSL client
// certificate will never be seen since it's an https top-level resource.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLClientCertTopLevel) {
ProfileNetworkContextServiceFactory::GetForContext(
current_browser()->profile())
->set_client_cert_store_factory_for_testing(base::BindRepeating(
&CreateCertStore, net::ImportCertFromFile(
net::GetTestCertsDirectory(), "ok_cert.pem")));
net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
net::SSLServerConfig ssl_config;
ssl_config.client_cert_type =
net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
ASSERT_TRUE(https_server.Start());
GURL https_url = https_server.GetURL("/prerender/prerender_page.html");
PrerenderTestURL(https_url, FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED, 0);
}
// Checks that an SSL Client Certificate request that originates from a
// subresource will cancel the prerendered page.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderSSLClientCertSubresource) {
ProfileNetworkContextServiceFactory::GetForContext(
current_browser()->profile())
->set_client_cert_store_factory_for_testing(base::BindRepeating(
&CreateCertStore, net::ImportCertFromFile(
net::GetTestCertsDirectory(), "ok_cert.pem")));
net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
net::SSLServerConfig ssl_config;
ssl_config.client_cert_type =
net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
ASSERT_TRUE(https_server.Start());
GURL https_url = https_server.GetURL(kPrefetchJpeg);
base::StringPairs replacement_text;
replacement_text.push_back(
std::make_pair("REPLACE_WITH_IMAGE_URL", https_url.spec()));
std::string replacement_path = net::test_server::GetFilePathWithReplacements(
"/prerender/prerender_with_image.html", replacement_text);
PrerenderTestURL(replacement_path,
FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED, 0);
}
// Checks that an SSL Client Certificate request that originates from an
// iframe will cancel the prerendered page.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLClientCertIframe) {
ProfileNetworkContextServiceFactory::GetForContext(
current_browser()->profile())
->set_client_cert_store_factory_for_testing(base::BindRepeating(
&CreateCertStore, net::ImportCertFromFile(
net::GetTestCertsDirectory(), "ok_cert.pem")));
net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
net::SSLServerConfig ssl_config;
ssl_config.client_cert_type =
net::SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config);
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
ASSERT_TRUE(https_server.Start());
GURL https_url =
https_server.GetURL("/prerender/prerender_embedded_content.html");
base::StringPairs replacement_text;
replacement_text.push_back(
std::make_pair("REPLACE_WITH_URL", https_url.spec()));
std::string replacement_path = net::test_server::GetFilePathWithReplacements(
"/prerender/prerender_with_iframe.html", replacement_text);
PrerenderTestURL(replacement_path,
FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED, 0);
}
// Checks that the favicon is properly loaded on prerender. // Checks that the favicon is properly loaded on prerender.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) { IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderFavicon) {
std::unique_ptr<TestPrerender> prerender = PrerenderTestURL( std::unique_ptr<TestPrerender> prerender = PrerenderTestURL(
......
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