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/host_mapping_rules_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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/dns_util.cc ('k') | net/base/mime_sniffer_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_mapping_rules.h" 5 #include "net/base/host_mapping_rules.h"
6 6
7 #include "net/base/host_port_pair.h" 7 #include "net/base/host_port_pair.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 EXPECT_FALSE(rules.RewriteHost(&host_port)); 65 EXPECT_FALSE(rules.RewriteHost(&host_port));
66 EXPECT_EQ("wtf.foo.com", host_port.host()); 66 EXPECT_EQ("wtf.foo.com", host_port.host());
67 EXPECT_EQ(443u, host_port.port()); 67 EXPECT_EQ(443u, host_port.port());
68 } 68 }
69 69
70 // Parsing bad rules should silently discard the rule (and never crash). 70 // Parsing bad rules should silently discard the rule (and never crash).
71 TEST(HostMappingRulesTest, ParseInvalidRules) { 71 TEST(HostMappingRulesTest, ParseInvalidRules) {
72 HostMappingRules rules; 72 HostMappingRules rules;
73 73
74 EXPECT_FALSE(rules.AddRuleFromString("xyz")); 74 EXPECT_FALSE(rules.AddRuleFromString("xyz"));
75 EXPECT_FALSE(rules.AddRuleFromString("")); 75 EXPECT_FALSE(rules.AddRuleFromString(std::string()));
76 EXPECT_FALSE(rules.AddRuleFromString(" ")); 76 EXPECT_FALSE(rules.AddRuleFromString(" "));
77 EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE")); 77 EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE"));
78 EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE foo bar")); 78 EXPECT_FALSE(rules.AddRuleFromString("EXCLUDE foo bar"));
79 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE")); 79 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE"));
80 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE x")); 80 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE x"));
81 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE x :10")); 81 EXPECT_FALSE(rules.AddRuleFromString("INCLUDE x :10"));
82 } 82 }
83 83
84 } // namespace 84 } // namespace
85 85
86 } // namespace net 86 } // namespace net
OLDNEW
« no previous file with comments | « net/base/dns_util.cc ('k') | net/base/mime_sniffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698