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

Side by Side Diff: net/base/ssl_false_start_blacklist_unittest.cc

Issue 7623015: Revert 95907 - Clean up SSL false start blacklist code. Numerous changes, including: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/ssl_false_start_blacklist_process.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:eol-style
- LF
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/ssl_false_start_blacklist.h" 5 #include "net/base/ssl_false_start_blacklist.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace net { 8 namespace net {
9 9
10 TEST(SSLFalseStartBlacklistTest, LastTwoComponents) { 10 TEST(SSLFalseStartBlacklistTest, LastTwoLabels) {
11 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("a.b.c.d"), "c.d"); 11 #define F SSLFalseStartBlacklist::LastTwoLabels
12 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("a.b"), "a.b"); 12 EXPECT_STREQ(F("a.b.c.d"), "c.d");
13 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("www.a.de"), "a.de"); 13 EXPECT_STREQ(F("a.b"), "a.b");
14 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("www.www.a.de"), "a.de"); 14 EXPECT_STREQ(F("example.com"), "example.com");
15 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("a.com."), "a.com"); 15 EXPECT_STREQ(F("www.example.com"), "example.com");
16 EXPECT_EQ(SSLFalseStartBlacklist::LastTwoComponents("a.com.."), "a.com"); 16 EXPECT_STREQ(F("www.www.example.com"), "example.com");
17 17
18 EXPECT_TRUE(SSLFalseStartBlacklist::LastTwoComponents("com").empty()); 18 EXPECT_TRUE(F("com") == NULL);
19 EXPECT_TRUE(SSLFalseStartBlacklist::LastTwoComponents(".com").empty()); 19 EXPECT_TRUE(F(".com") == NULL);
20 EXPECT_TRUE(SSLFalseStartBlacklist::LastTwoComponents("").empty()); 20 EXPECT_TRUE(F("") == NULL);
21 #undef F
21 } 22 }
22 23
23 TEST(SSLFalseStartBlacklistTest, IsMember) { 24 TEST(SSLFalseStartBlacklistTest, IsMember) {
24 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("example.com")); 25 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("example.com"));
25 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("www.example.com")); 26 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("www.example.com"));
26 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("a.b.example.com")); 27 EXPECT_TRUE(SSLFalseStartBlacklist::IsMember("a.b.example.com"));
27 EXPECT_FALSE(SSLFalseStartBlacklist::IsMember("aexample.com")); 28 EXPECT_FALSE(SSLFalseStartBlacklist::IsMember("aexample.com"));
28 EXPECT_FALSE(SSLFalseStartBlacklist::IsMember("com")); 29 EXPECT_FALSE(SSLFalseStartBlacklist::IsMember("com"));
29 } 30 }
30 31
31 } // namespace net 32 } // namespace net
OLDNEW
« no previous file with comments | « net/base/ssl_false_start_blacklist_process.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698