OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/tools/tld_cleanup/tld_cleanup_util.h" | 5 #include "net/tools/tld_cleanup/tld_cleanup_util.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.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 { |
11 namespace tld_cleanup { | 11 namespace tld_cleanup { |
12 | 12 |
13 std::string SetupData(std::string icann_domains, std::string private_domains) { | 13 std::string SetupData(const std::string& icann_domains, |
| 14 const std::string& private_domains) { |
14 return "// ===BEGIN ICANN DOMAINS===\n" + | 15 return "// ===BEGIN ICANN DOMAINS===\n" + |
15 icann_domains + | 16 icann_domains + |
16 "// ===END ICANN DOMAINS===\n" + | 17 "// ===END ICANN DOMAINS===\n" + |
17 "// ===BEGIN PRIVATE DOMAINS===\n" + | 18 "// ===BEGIN PRIVATE DOMAINS===\n" + |
18 private_domains + | 19 private_domains + |
19 "// ===END PRIVATE DOMAINS===\n"; | 20 "// ===END PRIVATE DOMAINS===\n"; |
20 } | 21 } |
21 | 22 |
22 TEST(TldCleanupUtilTest, TwoRealTldsSuccessfullyRead) { | 23 TEST(TldCleanupUtilTest, TwoRealTldsSuccessfullyRead) { |
23 std::string icann_domains = "foo\n" | 24 std::string icann_domains = "foo\n" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 EXPECT_FALSE(bar_iter->second.is_private); | 159 EXPECT_FALSE(bar_iter->second.is_private); |
159 RuleMap::const_iterator baz_bar_iter = rules.find("baz.bar"); | 160 RuleMap::const_iterator baz_bar_iter = rules.find("baz.bar"); |
160 ASSERT_FALSE(rules.end() == baz_bar_iter); | 161 ASSERT_FALSE(rules.end() == baz_bar_iter); |
161 EXPECT_FALSE(baz_bar_iter->second.wildcard); | 162 EXPECT_FALSE(baz_bar_iter->second.wildcard); |
162 EXPECT_TRUE(baz_bar_iter->second.exception); | 163 EXPECT_TRUE(baz_bar_iter->second.exception); |
163 EXPECT_TRUE(baz_bar_iter->second.is_private); | 164 EXPECT_TRUE(baz_bar_iter->second.is_private); |
164 } | 165 } |
165 | 166 |
166 } // namespace tld_cleanup | 167 } // namespace tld_cleanup |
167 } // namespace net | 168 } // namespace net |
OLD | NEW |