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

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

Issue 1365733005: Split captive portal metrics out of SSLErrorClassification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compiler error fix possibly for realsies Created 5 years, 3 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_error_classification.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_classification_unittest.cc
diff --git a/chrome/browser/ssl/ssl_error_classification_unittest.cc b/chrome/browser/ssl/ssl_error_classification_unittest.cc
index 318dbc9da1470b32d9f16fa0b2ecbed1fede9af6..b84676e032d12273a68940e381a226ac58a1d9a3 100644
--- a/chrome/browser/ssl/ssl_error_classification_unittest.cc
+++ b/chrome/browser/ssl/ssl_error_classification_unittest.cc
@@ -7,8 +7,6 @@
#include "base/files/file_path.h"
#include "base/strings/string_split.h"
#include "base/time/time.h"
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "content/public/browser/web_contents.h"
#include "net/base/net_errors.h"
#include "net/base/test_data_directory.h"
#include "net/cert/x509_cert_types.h"
@@ -19,14 +17,8 @@
#include "url/gurl.h"
using base::Time;
-using content::WebContents;
-class SSLErrorClassificationTest : public ChromeRenderViewHostTestHarness {
- public:
- SSLErrorClassificationTest() {
- SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
- }
-};
+class SSLErrorClassificationTest : public testing::Test {};
TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
scoped_refptr<net::X509Certificate> google_cert(
@@ -41,16 +33,11 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
std::vector<std::vector<std::string>> dns_name_tokens_google;
dns_name_tokens_google.push_back(dns_names_google);
int cert_error = net::ERR_CERT_COMMON_NAME_INVALID;
- WebContents* contents = web_contents();
{
GURL origin("https://google.com");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *google_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *google_cert);
EXPECT_TRUE(ssl_error.IsWWWSubDomainMatch());
EXPECT_FALSE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_google));
@@ -65,11 +52,7 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
GURL origin("https://foo.blah.google.com");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *google_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *google_cert);
EXPECT_FALSE(ssl_error.IsWWWSubDomainMatch());
EXPECT_FALSE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_google));
@@ -82,11 +65,7 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
GURL origin("https://foo.www.google.com");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *google_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *google_cert);
EXPECT_FALSE(ssl_error.IsWWWSubDomainMatch());
EXPECT_TRUE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_google));
@@ -99,11 +78,7 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
GURL origin("https://www.google.com.foo");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *google_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *google_cert);
EXPECT_FALSE(ssl_error.IsWWWSubDomainMatch());
EXPECT_FALSE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_google));
@@ -116,11 +91,7 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
GURL origin("https://www.foogoogle.com.");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *google_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *google_cert);
EXPECT_FALSE(ssl_error.IsWWWSubDomainMatch());
EXPECT_FALSE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_google));
@@ -142,11 +113,7 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
GURL origin("https://a.b.webkit.org");
std::vector<std::string> host_name_tokens = base::SplitString(
origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
- SSLErrorClassification ssl_error(contents,
- time,
- origin,
- cert_error,
- *webkit_cert);
+ SSLErrorClassification ssl_error(time, origin, cert_error, *webkit_cert);
EXPECT_FALSE(ssl_error.IsWWWSubDomainMatch());
EXPECT_FALSE(ssl_error.NameUnderAnyNames(host_name_tokens,
dns_name_tokens_webkit));
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698