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

Unified Diff: net/base/registry_controlled_domains/effective_tld_names_unittest1.cc

Issue 15140003: Add support for split Public Suffix List distinctions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/base/registry_controlled_domains/effective_tld_names_unittest1.cc
diff --git a/net/base/registry_controlled_domains/effective_tld_names_unittest1.cc b/net/base/registry_controlled_domains/effective_tld_names_unittest1.cc
index 90db7681fcca015c37390e498d038fa5728badd4..34e9e5d490f8ff18570b45ca8b1102066969e11c 100644
--- a/net/base/registry_controlled_domains/effective_tld_names_unittest1.cc
+++ b/net/base/registry_controlled_domains/effective_tld_names_unittest1.cc
@@ -41,14 +41,15 @@
struct DomainRule {
const char *name;
int type; // 1: exception, 2: wildcard
+ bool is_private;
};
-#define TOTAL_KEYWORDS 8
+#define TOTAL_KEYWORDS 11
#define MIN_WORD_LENGTH 1
#define MAX_WORD_LENGTH 11
#define MIN_HASH_VALUE 1
-#define MAX_HASH_VALUE 16
-/* maximum key range = 16, duplicates = 0 */
+#define MAX_HASH_VALUE 17
+/* maximum key range = 17, duplicates = 0 */
class Perfect_Hash_Test1
{
@@ -63,32 +64,32 @@ Perfect_Hash_Test1::hash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 0, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
- 17, 5, 0, 17, 17, 17, 0, 17, 17, 0,
- 17, 0, 0, 17, 0, 17, 17, 17, 17, 17,
- 17, 17, 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 0, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 0, 0, 0,
+ 18, 5, 0, 18, 18, 0, 0, 18, 18, 0,
+ 5, 0, 0, 18, 0, 18, 5, 18, 0, 18,
+ 18, 18, 0, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18
};
register int hval = len;
@@ -136,28 +137,34 @@ Perfect_Hash_Test1::FindDomain (register const char *str, register unsigned int
{
static const struct DomainRule wordlist[] =
{
-#line 21 "effective_tld_names_unittest1.gperf"
- {"c", 2},
-#line 15 "effective_tld_names_unittest1.gperf"
- {"jp", 0},
#line 22 "effective_tld_names_unittest1.gperf"
- {"b.c", 1},
+ {"c", 2, false},
#line 16 "effective_tld_names_unittest1.gperf"
- {"ac.jp", 0},
+ {"jp", 0, false},
+#line 23 "effective_tld_names_unittest1.gperf"
+ {"b.c", 1, false},
#line 17 "effective_tld_names_unittest1.gperf"
- {"bar.jp", 2},
+ {"ac.jp", 0, false},
#line 18 "effective_tld_names_unittest1.gperf"
- {"baz.bar.jp", 2},
-#line 20 "effective_tld_names_unittest1.gperf"
- {"bar.baz.com", 0},
+ {"bar.jp", 2, false},
+#line 24 "effective_tld_names_unittest1.gperf"
+ {"no", 0, false},
#line 19 "effective_tld_names_unittest1.gperf"
- {"pref.bar.jp", 1}
+ {"baz.bar.jp", 2, false},
+#line 21 "effective_tld_names_unittest1.gperf"
+ {"bar.baz.com", 0, false},
+#line 25 "effective_tld_names_unittest1.gperf"
+ {"priv.no", 0, true},
+#line 20 "effective_tld_names_unittest1.gperf"
+ {"pref.bar.jp", 1, false},
+#line 26 "effective_tld_names_unittest1.gperf"
+ {"private", 0, true}
};
static const signed char lookup[] =
{
- -1, 0, 1, 2, -1, 3, 4, -1, -1, -1, 5, 6, -1, -1,
- -1, -1, 7
+ -1, 0, 1, 2, -1, 3, 4, 5, -1, -1, 6, 7, 8, -1,
+ -1, -1, 9, 10
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -179,5 +186,5 @@ Perfect_Hash_Test1::FindDomain (register const char *str, register unsigned int
}
return 0;
}
-#line 23 "effective_tld_names_unittest1.gperf"
+#line 27 "effective_tld_names_unittest1.gperf"

Powered by Google App Engine
This is Rietveld 408576698