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

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

Issue 1000333003: Properly decode IDN in interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move test commands to negative values, and control flow nit Created 5 years, 9 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/chrome_tests.gypi » ('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 581ebe48479e46f40bc3af9fd44f194f7e745bbc..841c4b26442f909016a8f5502f65801ee813cde8 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_util.h"
@@ -12,6 +13,7 @@
#include "base/time/time.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/interstitials/security_interstitial_page_test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/ssl_blocking_page.h"
#include "chrome/browser/ui/browser.h"
@@ -44,6 +46,8 @@
#include "net/base/net_errors.h"
#include "net/base/test_data_directory.h"
#include "net/cert/cert_status_flags.h"
+#include "net/cert/x509_certificate.h"
+#include "net/ssl/ssl_info.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#if defined(USE_NSS)
@@ -53,6 +57,7 @@
#endif // defined(USE_NSS)
using base::ASCIIToUTF16;
+using chrome_browser_interstitials::SecurityInterstitialIDNTest;
using content::InterstitialPage;
using content::NavigationController;
using content::NavigationEntry;
@@ -1928,6 +1933,25 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, InterstitialNotAffectedByHideShow) {
EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
}
+class SSLBlockingPageIDNTest : public SecurityInterstitialIDNTest {
+ protected:
+ // SecurityInterstitialIDNTest implementation
+ SecurityInterstitialPage* CreateInterstitial(
+ content::WebContents* contents,
+ const GURL& request_url) const override {
+ net::SSLInfo ssl_info;
+ ssl_info.cert = new net::X509Certificate(
+ request_url.host(), "CA", base::Time::Max(), base::Time::Max());
+ return new SSLBlockingPage(
+ contents, net::ERR_CERT_CONTAINS_ERRORS, ssl_info, request_url, 0,
+ base::Time::NowFromSystemTime(), base::Callback<void(bool)>());
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(SSLBlockingPageIDNTest, SSLBlockingPageDecodesIDN) {
+ EXPECT_TRUE(VerifyIDNDecoded());
+}
+
// TODO(jcampan): more tests to do below.
// Visit a page over https that contains a frame with a redirect.
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698