Commit bc2112fa authored by Christopher Thompson's avatar Christopher Thompson Committed by Commit Bot

Fix missing X509 cert in SSLErrorTabHelperTest

This constructs an SSLInfo with needed fields for SSLErrorTabHelperTest
tests (in particular, the SSLInfo.cert field). This fixes nullptr
dereference issues that were encountered in https://crrev.com/c/1046050

Change-Id: I154bf688fe9325f9094de59ab0c5f6cae2b137de
Reviewed-on: https://chromium-review.googlesource.com/1054103Reviewed-by: default avatarAdrienne Porter Felt <felt@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557587}
parent fda642f0
......@@ -36,11 +36,12 @@ class TestSSLBlockingPage : public SSLBlockingPage {
// |*destroyed_tracker| is set to true in the destructor.
TestSSLBlockingPage(content::WebContents* web_contents,
GURL request_url,
net::SSLInfo ssl_info,
bool* destroyed_tracker)
: SSLBlockingPage(
web_contents,
net::ERR_CERT_CONTAINS_ERRORS,
net::SSLInfo(),
ssl_info,
request_url,
0,
base::Time::NowFromSystemTime(),
......@@ -72,9 +73,13 @@ class SSLErrorTabHelperTest : public ChromeRenderViewHostTestHarness {
// corresponding blocking page is destroyed.
void CreateAssociatedBlockingPage(content::NavigationHandle* handle,
bool* destroyed_tracker) {
net::SSLInfo ssl_info;
ssl_info.cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem");
SSLErrorTabHelper::AssociateBlockingPage(
web_contents(), handle->GetNavigationId(),
std::make_unique<TestSSLBlockingPage>(web_contents(), GURL(),
std::make_unique<TestSSLBlockingPage>(web_contents(), GURL(), ssl_info,
destroyed_tracker));
}
};
......
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