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

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

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 593afdebff5bdf1b56b4511ba33f93ee512b5e0c..13878d79605466f1b089876ddb6ee573058923b3 100644
--- a/chrome/browser/ssl/ssl_error_classification_unittest.cc
+++ b/chrome/browser/ssl/ssl_error_classification_unittest.cc
@@ -44,9 +44,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
WebContents* contents = web_contents();
{
GURL origin("https://google.com");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
@@ -63,9 +62,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
{
GURL origin("https://foo.blah.google.com");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
@@ -80,9 +78,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
{
GURL origin("https://foo.www.google.com");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
@@ -97,9 +94,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
{
GURL origin("https://www.google.com.foo");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
@@ -114,9 +110,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
{
GURL origin("https://www.foogoogle.com.");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
@@ -140,9 +135,8 @@ TEST_F(SSLErrorClassificationTest, TestNameMismatch) {
dns_name_tokens_webkit.push_back(dns_names_webkit);
{
GURL origin("https://a.b.webkit.org");
- std::string host_name = origin.host();
- std::vector<std::string> host_name_tokens;
- base::SplitStringDontTrim(host_name, '.', &host_name_tokens);
+ std::vector<std::string> host_name_tokens = base::SplitString(
+ origin.host(), ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
SSLErrorClassification ssl_error(contents,
time,
origin,
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification.cc ('k') | chrome/browser/supervised_user/supervised_user_whitelist_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698