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

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

Issue 8423028: Persist dynamically learned SPDY settings (like CWND). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « chrome/common/pref_names.cc ('k') | net/http/http_network_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/host_port_pair.h" 5 #include "net/base/host_port_pair.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 namespace { 11 namespace {
12 12
13 TEST(HostPortPairTest, Parsing) { 13 TEST(HostPortPairTest, Parsing) {
14 HostPortPair foo("foo.com", 10); 14 HostPortPair foo("foo.com", 10);
15 std::string foo_str = foo.ToString(); 15 std::string foo_str = foo.ToString();
16 EXPECT_EQ("foo.com:10", foo_str); 16 EXPECT_EQ("foo.com:10", foo_str);
17 HostPortPair bar = HostPortPair::FromString(foo_str); 17 HostPortPair bar = HostPortPair::FromString(foo_str);
18 EXPECT_TRUE(foo.Equals(bar)); 18 EXPECT_TRUE(foo.Equals(bar));
19 } 19 }
20 20
21 TEST(HostPortPairTest, BadString) {
22 HostPortPair foo = HostPortPair::FromString("foo.com:2:3");
23 EXPECT_TRUE(foo.host().empty());
24 EXPECT_EQ(0, foo.port());
25
26 HostPortPair bar = HostPortPair::FromString("bar.com:two");
27 EXPECT_TRUE(bar.host().empty());
28 EXPECT_EQ(0, bar.port());
29 }
30
21 } // namespace 31 } // namespace
22 32
23 } // namespace net 33 } // namespace net
OLDNEW
« no previous file with comments | « chrome/common/pref_names.cc ('k') | net/http/http_network_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698