Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Unified Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 1317593002: Have SSLErrorHandler decide which type of interstitial to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/ssl/ssl_error_classification.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_browser_tests.cc
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index 451d4d00fed9ad2dd26ac4bd73f1a0bc8c50ce5d..d817a77cb1b5215198c521518052fe4eec6de847 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -14,6 +14,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/histogram_tester.h"
+#include "base/test/simple_test_clock.h"
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "chrome/app/chrome_command_ids.h"
@@ -22,6 +23,7 @@
#include "chrome/browser/interstitials/security_interstitial_page_test_utils.h"
#include "chrome/browser/net/certificate_error_reporter.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ssl/bad_clock_blocking_page.h"
#include "chrome/browser/ssl/cert_logger.pb.h"
#include "chrome/browser/ssl/cert_report_helper.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
@@ -31,6 +33,7 @@
#include "chrome/browser/ssl/common_name_mismatch_handler.h"
#include "chrome/browser/ssl/connection_security.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
+#include "chrome/browser/ssl/ssl_error_classification.h"
#include "chrome/browser/ssl/ssl_error_handler.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -779,6 +782,26 @@ IN_PROC_BROWSER_TEST_F(SSLUITestIgnoreLocalhostCertErrors,
EXPECT_EQ(title, expected_title);
}
+IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSErrorCausedByClock) {
+ ASSERT_TRUE(https_server_expired_.Start());
+
+ // Set up the build and current clock times to be more than a year apart.
+ scoped_ptr<base::SimpleTestClock> mock_clock(new base::SimpleTestClock());
+ mock_clock->SetNow(base::Time::NowFromSystemTime());
+ mock_clock->Advance(base::TimeDelta::FromDays(367));
+ SSLErrorHandler::SetClockForTest(mock_clock.get());
+ SSLErrorClassification::SetBuildTimeForTesting(
+ base::Time::NowFromSystemTime());
+
+ ui_test_utils::NavigateToURL(browser(), https_server_expired_.GetURL("/"));
+ WebContents* clock_tab = browser()->tab_strip_model()->GetActiveWebContents();
+ content::WaitForInterstitialAttach(clock_tab);
+ InterstitialPage* clock_interstitial = clock_tab->GetInterstitialPage();
+ ASSERT_TRUE(clock_interstitial);
+ EXPECT_EQ(BadClockBlockingPage::kTypeForTesting,
+ clock_interstitial->GetDelegateForTesting()->GetTypeForTesting());
+}
+
// Visits a page with https error and then goes back using Browser::GoBack.
IN_PROC_BROWSER_TEST_F(SSLUITest,
TestHTTPSExpiredCertAndGoBackViaButton) {
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/ssl/ssl_error_classification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698