OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/registry_controlled_domains/registry_controlled_domain.h" | 5 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
6 #include "net/base/registry_controlled_domains/test_util.h" | |
6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "url/gurl.h" | 8 #include "url/gurl.h" |
8 | 9 |
9 namespace { | 10 namespace { |
10 namespace test1 { | 11 namespace test1 { |
11 #include "net/base/registry_controlled_domains/effective_tld_names_unittest1-inc .cc" | 12 #include "net/base/registry_controlled_domains/effective_tld_names_unittest1-inc .cc" |
12 } | 13 } |
13 namespace test2 { | 14 namespace test2 { |
14 #include "net/base/registry_controlled_domains/effective_tld_names_unittest2-inc .cc" | 15 #include "net/base/registry_controlled_domains/effective_tld_names_unittest2-inc .cc" |
15 } | 16 } |
16 namespace test3 { | 17 namespace test3 { |
17 #include "net/base/registry_controlled_domains/effective_tld_names_unittest3-inc .cc" | 18 #include "net/base/registry_controlled_domains/effective_tld_names_unittest3-inc .cc" |
18 } | 19 } |
19 namespace test4 { | 20 namespace test4 { |
20 #include "net/base/registry_controlled_domains/effective_tld_names_unittest4-inc .cc" | 21 #include "net/base/registry_controlled_domains/effective_tld_names_unittest4-inc .cc" |
21 } | 22 } |
22 namespace test5 { | 23 namespace test5 { |
23 #include "net/base/registry_controlled_domains/effective_tld_names_unittest5-inc .cc" | 24 #include "net/base/registry_controlled_domains/effective_tld_names_unittest5-inc .cc" |
24 } | 25 } |
25 namespace test6 { | 26 namespace test6 { |
26 #include "net/base/registry_controlled_domains/effective_tld_names_unittest6-inc .cc" | 27 #include "net/base/registry_controlled_domains/effective_tld_names_unittest6-inc .cc" |
27 } | 28 } |
28 } // namespace | 29 } // namespace |
29 | 30 |
30 namespace net { | 31 namespace net { |
32 namespace test { | |
33 namespace registry_controlled_domains { | |
34 void SetFindDomainTestGraph() { | |
Adam Rice
2015/01/19 05:18:56
I don't think you can put this here.
I think ther
yhirano
2015/01/19 05:56:21
Done.
Unfortunately, test_util.cc is more strictly
Adam Rice
2015/01/19 06:05:57
I think that's okay. The check is not perfect, and
| |
35 net::registry_controlled_domains::SetFindDomainGraph(test1::kDafsa, | |
36 sizeof(test1::kDafsa)); | |
37 } | |
38 } // namespace registry_controlled_domains | |
39 } // namespace test | |
40 } // namespace net | |
41 | |
42 namespace net { | |
31 namespace registry_controlled_domains { | 43 namespace registry_controlled_domains { |
32 namespace { | 44 namespace { |
33 | 45 |
34 std::string GetDomainFromURL(const std::string& url) { | 46 std::string GetDomainFromURL(const std::string& url) { |
35 return GetDomainAndRegistry(GURL(url), EXCLUDE_PRIVATE_REGISTRIES); | 47 return GetDomainAndRegistry(GURL(url), EXCLUDE_PRIVATE_REGISTRIES); |
36 } | 48 } |
37 | 49 |
38 std::string GetDomainFromHost(const std::string& host) { | 50 std::string GetDomainFromHost(const std::string& host) { |
39 return GetDomainAndRegistry(host, EXCLUDE_PRIVATE_REGISTRIES); | 51 return GetDomainAndRegistry(host, EXCLUDE_PRIVATE_REGISTRIES); |
40 } | 52 } |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 GetRegistryLengthFromHostIncludingPrivate( | 503 GetRegistryLengthFromHostIncludingPrivate( |
492 key4, EXCLUDE_UNKNOWN_REGISTRIES)); | 504 key4, EXCLUDE_UNKNOWN_REGISTRIES)); |
493 EXPECT_EQ(0U, | 505 EXPECT_EQ(0U, |
494 GetRegistryLengthFromHostIncludingPrivate( | 506 GetRegistryLengthFromHostIncludingPrivate( |
495 key5, EXCLUDE_UNKNOWN_REGISTRIES)); | 507 key5, EXCLUDE_UNKNOWN_REGISTRIES)); |
496 EXPECT_EQ(5U, GetRegistryLengthFromHost(key6, EXCLUDE_UNKNOWN_REGISTRIES)); | 508 EXPECT_EQ(5U, GetRegistryLengthFromHost(key6, EXCLUDE_UNKNOWN_REGISTRIES)); |
497 EXPECT_EQ(5U, GetRegistryLengthFromHost(key7, EXCLUDE_UNKNOWN_REGISTRIES)); | 509 EXPECT_EQ(5U, GetRegistryLengthFromHost(key7, EXCLUDE_UNKNOWN_REGISTRIES)); |
498 } | 510 } |
499 } // namespace registry_controlled_domains | 511 } // namespace registry_controlled_domains |
500 } // namespace net | 512 } // namespace net |
OLD | NEW |