Commit 9a085676 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Build ssl_blocking_page_unittest.cc

This test currently isn't being built and has bitrotted. This CL adds
it to the build and gets it to build. It also doesn't pass, which this
CL doesn't attempt to fix (see linked bug).

Bug: 1026557
Change-Id: I66ecc1e5344047092d7ed0f30963c44cec796950
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925057
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarCarlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717642}
parent b4801041
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/security_interstitials/content/ssl_blocking_page.h" #include "chrome/browser/ssl/chrome_ssl_blocking_page.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -43,7 +43,11 @@ class SSLBlockingPageTest : public ChromeRenderViewHostTestHarness { ...@@ -43,7 +43,11 @@ class SSLBlockingPageTest : public ChromeRenderViewHostTestHarness {
extensions::TestEventRouter* test_event_router_; extensions::TestEventRouter* test_event_router_;
}; };
TEST_F(SSLBlockingPageTest, VerifySecurityInterstitialExtensionEvents) { // TODO(1026557): This test currently fails, and it looks like it also tests
// the pre-committed interstitials flow. It needs to be updated, made to pass,
// and potentially componentized to live next to SSLBlockingPage.
TEST_F(SSLBlockingPageTest,
DISABLED_VerifySecurityInterstitialExtensionEvents) {
safe_browsing::TestExtensionEventObserver observer(test_event_router()); safe_browsing::TestExtensionEventObserver observer(test_event_router());
// Sets up elements needed for a SSL blcocking page. // Sets up elements needed for a SSL blcocking page.
...@@ -54,7 +58,7 @@ TEST_F(SSLBlockingPageTest, VerifySecurityInterstitialExtensionEvents) { ...@@ -54,7 +58,7 @@ TEST_F(SSLBlockingPageTest, VerifySecurityInterstitialExtensionEvents) {
ssl_info.cert_status = net::CERT_STATUS_DATE_INVALID; ssl_info.cert_status = net::CERT_STATUS_DATE_INVALID;
// Simulates the showing of a SSL blocking page. // Simulates the showing of a SSL blocking page.
SSLBlockingPage* blocking_page = SSLBlockingPage::Create( SSLBlockingPage* blocking_page = ChromeSSLBlockingPage::Create(
web_contents(), net::ERR_CERT_DATE_INVALID, ssl_info, request_url, web_contents(), net::ERR_CERT_DATE_INVALID, ssl_info, request_url,
/*options_mask=*/0, base::Time::NowFromSystemTime(), /*options_mask=*/0, base::Time::NowFromSystemTime(),
/*support_url=*/GURL(), /*support_url=*/GURL(),
......
...@@ -4442,6 +4442,11 @@ test("unit_tests") { ...@@ -4442,6 +4442,11 @@ test("unit_tests") {
"../browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.h", "../browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.h",
"../browser/safe_browsing/test_extension_event_observer.cc", "../browser/safe_browsing/test_extension_event_observer.cc",
"../browser/safe_browsing/test_extension_event_observer.h", "../browser/safe_browsing/test_extension_event_observer.h",
# TODO(1026557): The below test depends on TestExtensionEventObserver.
# Maybe it should be changed to not use that class so that it could be
# run on all platforms and hopefully componentized?
"../browser/ssl/ssl_blocking_page_unittest.cc",
"../browser/sync/glue/extensions_activity_monitor_unittest.cc", "../browser/sync/glue/extensions_activity_monitor_unittest.cc",
"../browser/sync_file_system/drive_backend/callback_helper_unittest.cc", "../browser/sync_file_system/drive_backend/callback_helper_unittest.cc",
"../browser/sync_file_system/drive_backend/callback_tracker_unittest.cc", "../browser/sync_file_system/drive_backend/callback_tracker_unittest.cc",
......
...@@ -44,22 +44,6 @@ class SSLBlockingPage : public SSLBlockingPageBase { ...@@ -44,22 +44,6 @@ class SSLBlockingPage : public SSLBlockingPageBase {
~SSLBlockingPage() override; ~SSLBlockingPage() override;
// Creates an SSL blocking page. If the blocking page isn't shown, the caller
// is responsible for cleaning up the blocking page, otherwise the
// interstitial takes ownership when shown. |options_mask| must be a bitwise
// mask of SSLErrorOptionsMask values.
// This is static because the constructor uses expensive to compute parameters
// more than once (e.g. overrideable).
static SSLBlockingPage* Create(
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
int options_mask,
const base::Time& time_triggered,
const GURL& support_url,
std::unique_ptr<SSLCertReporter> ssl_cert_reporter);
// InterstitialPageDelegate method: // InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() override; InterstitialPageDelegate::TypeID GetTypeForTesting() override;
......
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