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 "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "url/gurl.h" | 7 #include "url/gurl.h" |
8 | 8 |
9 #include "effective_tld_names_unittest1.cc" | 9 namespace { |
10 static const char* const Perfect_Hash_Test1_stringpool = stringpool1; | 10 namespace test1 { |
11 #undef TOTAL_KEYWORDS | 11 #include "effective_tld_names_unittest1-inc.cc" |
12 #undef MIN_WORD_LENGTH | 12 } |
13 #undef MAX_WORD_LENGTH | 13 namespace test2 { |
14 #undef MIN_HASH_VALUE | 14 #include "effective_tld_names_unittest2-inc.cc" |
15 #undef MAX_HASH_VALUE | 15 } |
16 #include "effective_tld_names_unittest2.cc" | 16 namespace test3 { |
17 static const char* const Perfect_Hash_Test2_stringpool = stringpool2; | 17 #include "effective_tld_names_unittest3-inc.cc" |
| 18 } |
| 19 namespace test4 { |
| 20 #include "effective_tld_names_unittest4-inc.cc" |
| 21 } |
| 22 namespace test5 { |
| 23 #include "effective_tld_names_unittest5-inc.cc" |
| 24 } |
| 25 namespace test6 { |
| 26 #include "effective_tld_names_unittest6-inc.cc" |
| 27 } |
| 28 } // namespace |
18 | 29 |
19 namespace net { | 30 namespace net { |
20 namespace registry_controlled_domains { | 31 namespace registry_controlled_domains { |
21 namespace { | 32 namespace { |
22 | 33 |
23 std::string GetDomainFromURL(const std::string& url) { | 34 std::string GetDomainFromURL(const std::string& url) { |
24 return GetDomainAndRegistry(GURL(url), EXCLUDE_PRIVATE_REGISTRIES); | 35 return GetDomainAndRegistry(GURL(url), EXCLUDE_PRIVATE_REGISTRIES); |
25 } | 36 } |
26 | 37 |
27 std::string GetDomainFromHost(const std::string& host) { | 38 std::string GetDomainFromHost(const std::string& host) { |
(...skipping 15 matching lines...) Expand all Loading... |
43 unknown_filter, | 54 unknown_filter, |
44 INCLUDE_PRIVATE_REGISTRIES); | 55 INCLUDE_PRIVATE_REGISTRIES); |
45 } | 56 } |
46 | 57 |
47 size_t GetRegistryLengthFromHost( | 58 size_t GetRegistryLengthFromHost( |
48 const std::string& host, | 59 const std::string& host, |
49 UnknownRegistryFilter unknown_filter) { | 60 UnknownRegistryFilter unknown_filter) { |
50 return GetRegistryLength(host, unknown_filter, EXCLUDE_PRIVATE_REGISTRIES); | 61 return GetRegistryLength(host, unknown_filter, EXCLUDE_PRIVATE_REGISTRIES); |
51 } | 62 } |
52 | 63 |
| 64 size_t GetRegistryLengthFromHostIncludingPrivate( |
| 65 const std::string& host, |
| 66 UnknownRegistryFilter unknown_filter) { |
| 67 return GetRegistryLength(host, unknown_filter, INCLUDE_PRIVATE_REGISTRIES); |
| 68 } |
| 69 |
53 bool CompareDomains(const std::string& url1, const std::string& url2) { | 70 bool CompareDomains(const std::string& url1, const std::string& url2) { |
54 GURL g1 = GURL(url1); | 71 GURL g1 = GURL(url1); |
55 GURL g2 = GURL(url2); | 72 GURL g2 = GURL(url2); |
56 return SameDomainOrHost(g1, g2, EXCLUDE_PRIVATE_REGISTRIES); | 73 return SameDomainOrHost(g1, g2, EXCLUDE_PRIVATE_REGISTRIES); |
57 } | 74 } |
58 | 75 |
59 } // namespace | 76 } // namespace |
60 | 77 |
61 class RegistryControlledDomainTest : public testing::Test { | 78 class RegistryControlledDomainTest : public testing::Test { |
62 protected: | 79 protected: |
63 void UseDomainData(FindDomainPtr function, const char* const stringpool) { | 80 template <typename Graph> |
64 SetFindDomainFunctionAndStringPoolForTesting(function, stringpool); | 81 void UseDomainData(const Graph& graph) { |
| 82 SetFindDomainGraph(graph, sizeof(Graph)); |
65 } | 83 } |
66 | 84 |
67 virtual void TearDown() { | 85 virtual void TearDown() { SetFindDomainGraph(); } |
68 SetFindDomainFunctionAndStringPoolForTesting(NULL, NULL); | |
69 } | |
70 }; | 86 }; |
71 | 87 |
72 TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) { | 88 TEST_F(RegistryControlledDomainTest, TestGetDomainAndRegistry) { |
73 UseDomainData(Perfect_Hash_Test1::FindDomain, Perfect_Hash_Test1_stringpool); | 89 UseDomainData(test1::kDafsa); |
74 | 90 |
75 // Test GURL version of GetDomainAndRegistry(). | 91 // Test GURL version of GetDomainAndRegistry(). |
76 EXPECT_EQ("baz.jp", GetDomainFromURL("http://a.baz.jp/file.html")); // 1 | 92 EXPECT_EQ("baz.jp", GetDomainFromURL("http://a.baz.jp/file.html")); // 1 |
77 EXPECT_EQ("baz.jp.", GetDomainFromURL("http://a.baz.jp./file.html")); // 1 | 93 EXPECT_EQ("baz.jp.", GetDomainFromURL("http://a.baz.jp./file.html")); // 1 |
78 EXPECT_EQ("", GetDomainFromURL("http://ac.jp")); // 2 | 94 EXPECT_EQ("", GetDomainFromURL("http://ac.jp")); // 2 |
79 EXPECT_EQ("", GetDomainFromURL("http://a.bar.jp")); // 3 | 95 EXPECT_EQ("", GetDomainFromURL("http://a.bar.jp")); // 3 |
80 EXPECT_EQ("", GetDomainFromURL("http://bar.jp")); // 3 | 96 EXPECT_EQ("", GetDomainFromURL("http://bar.jp")); // 3 |
81 EXPECT_EQ("", GetDomainFromURL("http://baz.bar.jp")); // 3 4 | 97 EXPECT_EQ("", GetDomainFromURL("http://baz.bar.jp")); // 3 4 |
82 EXPECT_EQ("a.b.baz.bar.jp", GetDomainFromURL("http://a.b.baz.bar.jp")); | 98 EXPECT_EQ("a.b.baz.bar.jp", GetDomainFromURL("http://a.b.baz.bar.jp")); |
83 // 4 | 99 // 4 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 138 |
123 EXPECT_EQ("", GetDomainFromHost(std::string())); | 139 EXPECT_EQ("", GetDomainFromHost(std::string())); |
124 EXPECT_EQ("", GetDomainFromHost("foo.com..")); | 140 EXPECT_EQ("", GetDomainFromHost("foo.com..")); |
125 EXPECT_EQ("", GetDomainFromHost("...")); | 141 EXPECT_EQ("", GetDomainFromHost("...")); |
126 EXPECT_EQ("", GetDomainFromHost("192.168.0.1")); | 142 EXPECT_EQ("", GetDomainFromHost("192.168.0.1")); |
127 EXPECT_EQ("", GetDomainFromHost("localhost.")); | 143 EXPECT_EQ("", GetDomainFromHost("localhost.")); |
128 EXPECT_EQ("", GetDomainFromHost(".localhost.")); | 144 EXPECT_EQ("", GetDomainFromHost(".localhost.")); |
129 } | 145 } |
130 | 146 |
131 TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) { | 147 TEST_F(RegistryControlledDomainTest, TestGetRegistryLength) { |
132 UseDomainData(Perfect_Hash_Test1::FindDomain, Perfect_Hash_Test1_stringpool); | 148 UseDomainData(test1::kDafsa); |
133 | 149 |
134 // Test GURL version of GetRegistryLength(). | 150 // Test GURL version of GetRegistryLength(). |
135 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://a.baz.jp/file.html", | 151 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://a.baz.jp/file.html", |
136 EXCLUDE_UNKNOWN_REGISTRIES)); // 1 | 152 EXCLUDE_UNKNOWN_REGISTRIES)); // 1 |
137 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://a.baz.jp./file.html", | 153 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://a.baz.jp./file.html", |
138 EXCLUDE_UNKNOWN_REGISTRIES)); // 1 | 154 EXCLUDE_UNKNOWN_REGISTRIES)); // 1 |
139 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://ac.jp", | 155 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://ac.jp", |
140 EXCLUDE_UNKNOWN_REGISTRIES)); // 2 | 156 EXCLUDE_UNKNOWN_REGISTRIES)); // 2 |
141 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://a.bar.jp", | 157 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://a.bar.jp", |
142 EXCLUDE_UNKNOWN_REGISTRIES)); // 3 | 158 EXCLUDE_UNKNOWN_REGISTRIES)); // 3 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 EXCLUDE_UNKNOWN_REGISTRIES)); | 257 EXCLUDE_UNKNOWN_REGISTRIES)); |
242 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost", | 258 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost", |
243 INCLUDE_UNKNOWN_REGISTRIES)); | 259 INCLUDE_UNKNOWN_REGISTRIES)); |
244 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost.", | 260 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost.", |
245 EXCLUDE_UNKNOWN_REGISTRIES)); | 261 EXCLUDE_UNKNOWN_REGISTRIES)); |
246 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost.", | 262 EXPECT_EQ(0U, GetRegistryLengthFromHost("localhost.", |
247 INCLUDE_UNKNOWN_REGISTRIES)); | 263 INCLUDE_UNKNOWN_REGISTRIES)); |
248 } | 264 } |
249 | 265 |
250 TEST_F(RegistryControlledDomainTest, TestSameDomainOrHost) { | 266 TEST_F(RegistryControlledDomainTest, TestSameDomainOrHost) { |
251 UseDomainData(Perfect_Hash_Test2::FindDomain, Perfect_Hash_Test2_stringpool); | 267 UseDomainData(test2::kDafsa); |
252 | 268 |
253 EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", | 269 EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", |
254 "http://a.b.bar.jp/file.html")); // b.bar.jp | 270 "http://a.b.bar.jp/file.html")); // b.bar.jp |
255 EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", | 271 EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", |
256 "http://b.b.bar.jp/file.html")); // b.bar.jp | 272 "http://b.b.bar.jp/file.html")); // b.bar.jp |
257 EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp | 273 EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp |
258 "http://a.not.jp/file.html")); // not.jp | 274 "http://a.not.jp/file.html")); // not.jp |
259 EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp | 275 EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp |
260 "http://a.foo.jp./file.html")); // foo.jp. | 276 "http://a.foo.jp./file.html")); // foo.jp. |
261 EXPECT_FALSE(CompareDomains("http://a.com/file.html", // a.com | 277 EXPECT_FALSE(CompareDomains("http://a.com/file.html", // a.com |
(...skipping 26 matching lines...) Expand all Loading... |
288 EXCLUDE_UNKNOWN_REGISTRIES)); | 304 EXCLUDE_UNKNOWN_REGISTRIES)); |
289 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://ferretcentral.org", | 305 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://ferretcentral.org", |
290 EXCLUDE_UNKNOWN_REGISTRIES)); | 306 EXCLUDE_UNKNOWN_REGISTRIES)); |
291 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://nowhere.foo", | 307 EXPECT_EQ(0U, GetRegistryLengthFromURL("http://nowhere.foo", |
292 EXCLUDE_UNKNOWN_REGISTRIES)); | 308 EXCLUDE_UNKNOWN_REGISTRIES)); |
293 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://nowhere.foo", | 309 EXPECT_EQ(3U, GetRegistryLengthFromURL("http://nowhere.foo", |
294 INCLUDE_UNKNOWN_REGISTRIES)); | 310 INCLUDE_UNKNOWN_REGISTRIES)); |
295 } | 311 } |
296 | 312 |
297 TEST_F(RegistryControlledDomainTest, TestPrivateRegistryHandling) { | 313 TEST_F(RegistryControlledDomainTest, TestPrivateRegistryHandling) { |
298 UseDomainData(Perfect_Hash_Test1::FindDomain, Perfect_Hash_Test1_stringpool); | 314 UseDomainData(test1::kDafsa); |
299 | 315 |
300 // Testing the same dataset for INCLUDE_PRIVATE_REGISTRIES and | 316 // Testing the same dataset for INCLUDE_PRIVATE_REGISTRIES and |
301 // EXCLUDE_PRIVATE_REGISTRIES arguments. | 317 // EXCLUDE_PRIVATE_REGISTRIES arguments. |
302 // For the domain data used for this test, the private registries are | 318 // For the domain data used for this test, the private registries are |
303 // 'priv.no' and 'private'. | 319 // 'priv.no' and 'private'. |
304 | 320 |
305 // Non-private registries. | 321 // Non-private registries. |
306 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://priv.no", | 322 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://priv.no", |
307 EXCLUDE_UNKNOWN_REGISTRIES)); | 323 EXCLUDE_UNKNOWN_REGISTRIES)); |
308 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://foo.priv.no", | 324 EXPECT_EQ(2U, GetRegistryLengthFromURL("http://foo.priv.no", |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 GetRegistryLengthFromURLIncludingPrivate("http://foo.private", | 356 GetRegistryLengthFromURLIncludingPrivate("http://foo.private", |
341 EXCLUDE_UNKNOWN_REGISTRIES)); | 357 EXCLUDE_UNKNOWN_REGISTRIES)); |
342 EXPECT_EQ(0U, | 358 EXPECT_EQ(0U, |
343 GetRegistryLengthFromURLIncludingPrivate("http://private", | 359 GetRegistryLengthFromURLIncludingPrivate("http://private", |
344 INCLUDE_UNKNOWN_REGISTRIES)); | 360 INCLUDE_UNKNOWN_REGISTRIES)); |
345 EXPECT_EQ(7U, | 361 EXPECT_EQ(7U, |
346 GetRegistryLengthFromURLIncludingPrivate("http://foo.private", | 362 GetRegistryLengthFromURLIncludingPrivate("http://foo.private", |
347 INCLUDE_UNKNOWN_REGISTRIES)); | 363 INCLUDE_UNKNOWN_REGISTRIES)); |
348 } | 364 } |
349 | 365 |
| 366 TEST_F(RegistryControlledDomainTest, TestDafsaTwoByteOffsets) { |
| 367 UseDomainData(test3::kDafsa); |
350 | 368 |
| 369 // Testing to lookup keys in a DAFSA with two byte offsets. |
| 370 // This DAFSA is constructed so that labels begin and end with unique |
| 371 // characters, which makes it impossible to merge labels. Each inner node |
| 372 // is about 100 bytes and a one byte offset can at most add 64 bytes to |
| 373 // previous offset. Thus the paths must go over two byte offsets. |
| 374 |
| 375 const char* key0 = |
| 376 "a.b.6____________________________________________________" |
| 377 "________________________________________________6"; |
| 378 const char* key1 = |
| 379 "a.b.7____________________________________________________" |
| 380 "________________________________________________7"; |
| 381 const char* key2 = |
| 382 "a.b.a____________________________________________________" |
| 383 "________________________________________________8"; |
| 384 |
| 385 EXPECT_EQ(102U, GetRegistryLengthFromHost(key0, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 386 EXPECT_EQ(0U, GetRegistryLengthFromHost(key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 387 EXPECT_EQ(102U, |
| 388 GetRegistryLengthFromHostIncludingPrivate( |
| 389 key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 390 EXPECT_EQ(0U, GetRegistryLengthFromHost(key2, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 391 } |
| 392 |
| 393 TEST_F(RegistryControlledDomainTest, TestDafsaThreeByteOffsets) { |
| 394 UseDomainData(test4::kDafsa); |
| 395 |
| 396 // Testing to lookup keys in a DAFSA with three byte offsets. |
| 397 // This DAFSA is constructed so that labels begin and end with unique |
| 398 // characters, which makes it impossible to merge labels. The byte array |
| 399 // has a size of ~54k. A two byte offset can add at most add 8k to the |
| 400 // previous offset. Since we can skip only forward in memory, the nodes |
| 401 // representing the return values must be located near the end of the byte |
| 402 // array. The probability that we can reach from an arbitrary inner node to |
| 403 // a return value without using a three byte offset is small (but not zero). |
| 404 // The test is repeated with some different keys and with a reasonable |
| 405 // probability at least one of the tested paths has go over a three byte |
| 406 // offset. |
| 407 |
| 408 const char* key0 = |
| 409 "a.b.Z6___________________________________________________" |
| 410 "_________________________________________________Z6"; |
| 411 const char* key1 = |
| 412 "a.b.Z7___________________________________________________" |
| 413 "_________________________________________________Z7"; |
| 414 const char* key2 = |
| 415 "a.b.Za___________________________________________________" |
| 416 "_________________________________________________Z8"; |
| 417 |
| 418 EXPECT_EQ(104U, GetRegistryLengthFromHost(key0, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 419 EXPECT_EQ(0U, GetRegistryLengthFromHost(key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 420 EXPECT_EQ(104U, |
| 421 GetRegistryLengthFromHostIncludingPrivate( |
| 422 key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 423 EXPECT_EQ(0U, GetRegistryLengthFromHost(key2, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 424 } |
| 425 |
| 426 TEST_F(RegistryControlledDomainTest, TestDafsaJoinedPrefixes) { |
| 427 UseDomainData(test5::kDafsa); |
| 428 |
| 429 // Testing to lookup keys in a DAFSA with compressed prefixes. |
| 430 // This DAFSA is constructed from words with similar prefixes but distinct |
| 431 // suffixes. The DAFSA will then form a trie with the implicit source node |
| 432 // as root. |
| 433 |
| 434 const char* key0 = "a.b.ai"; |
| 435 const char* key1 = "a.b.bj"; |
| 436 const char* key2 = "a.b.aak"; |
| 437 const char* key3 = "a.b.bbl"; |
| 438 const char* key4 = "a.b.aaa"; |
| 439 const char* key5 = "a.b.bbb"; |
| 440 const char* key6 = "a.b.aaaam"; |
| 441 const char* key7 = "a.b.bbbbn"; |
| 442 |
| 443 EXPECT_EQ(2U, GetRegistryLengthFromHost(key0, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 444 EXPECT_EQ(0U, GetRegistryLengthFromHost(key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 445 EXPECT_EQ(2U, |
| 446 GetRegistryLengthFromHostIncludingPrivate( |
| 447 key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 448 EXPECT_EQ(3U, GetRegistryLengthFromHost(key2, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 449 EXPECT_EQ(0U, GetRegistryLengthFromHost(key3, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 450 EXPECT_EQ(3U, |
| 451 GetRegistryLengthFromHostIncludingPrivate( |
| 452 key3, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 453 EXPECT_EQ(0U, |
| 454 GetRegistryLengthFromHostIncludingPrivate( |
| 455 key4, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 456 EXPECT_EQ(0U, |
| 457 GetRegistryLengthFromHostIncludingPrivate( |
| 458 key5, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 459 EXPECT_EQ(5U, GetRegistryLengthFromHost(key6, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 460 EXPECT_EQ(5U, GetRegistryLengthFromHost(key7, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 461 } |
| 462 |
| 463 TEST_F(RegistryControlledDomainTest, TestDafsaJoinedSuffixes) { |
| 464 UseDomainData(test6::kDafsa); |
| 465 |
| 466 // Testing to lookup keys in a DAFSA with compressed suffixes. |
| 467 // This DAFSA is constructed from words with similar suffixes but distinct |
| 468 // prefixes. The DAFSA will then form a trie with the implicit sink node as |
| 469 // root. |
| 470 |
| 471 const char* key0 = "a.b.ia"; |
| 472 const char* key1 = "a.b.jb"; |
| 473 const char* key2 = "a.b.kaa"; |
| 474 const char* key3 = "a.b.lbb"; |
| 475 const char* key4 = "a.b.aaa"; |
| 476 const char* key5 = "a.b.bbb"; |
| 477 const char* key6 = "a.b.maaaa"; |
| 478 const char* key7 = "a.b.nbbbb"; |
| 479 |
| 480 EXPECT_EQ(2U, GetRegistryLengthFromHost(key0, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 481 EXPECT_EQ(0U, GetRegistryLengthFromHost(key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 482 EXPECT_EQ(2U, |
| 483 GetRegistryLengthFromHostIncludingPrivate( |
| 484 key1, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 485 EXPECT_EQ(3U, GetRegistryLengthFromHost(key2, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 486 EXPECT_EQ(0U, GetRegistryLengthFromHost(key3, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 487 EXPECT_EQ(3U, |
| 488 GetRegistryLengthFromHostIncludingPrivate( |
| 489 key3, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 490 EXPECT_EQ(0U, |
| 491 GetRegistryLengthFromHostIncludingPrivate( |
| 492 key4, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 493 EXPECT_EQ(0U, |
| 494 GetRegistryLengthFromHostIncludingPrivate( |
| 495 key5, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 496 EXPECT_EQ(5U, GetRegistryLengthFromHost(key6, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 497 EXPECT_EQ(5U, GetRegistryLengthFromHost(key7, EXCLUDE_UNKNOWN_REGISTRIES)); |
| 498 } |
351 } // namespace registry_controlled_domains | 499 } // namespace registry_controlled_domains |
352 } // namespace net | 500 } // namespace net |
OLD | NEW |