Added PSL tests

This commit is contained in:
M66B
2022-05-02 13:00:42 +02:00
parent ef8d3638eb
commit a8c37e45b9
2 changed files with 18 additions and 0 deletions

View File

@@ -366,4 +366,19 @@ public class UriHelper {
return (!uri.isOpaque() &&
("http".equals(uri.getScheme()) || "https".equals(uri.getScheme())));
}
static void test(Context context) {
String[] hosts = new String[]{
"child.parent.example.com", "parent.example.com", "example.com", "com",
"child.parent.co.uk", "parent.co.uk", "co.uk", "uk",
"child.parent.aaa.ck", "parent.aaa.ck", "aaa.ck", "ck",
"child.parent.www.ck", "parent.www.ck", "www.ck", "ck"
};
for (String host : hosts)
Log.i("PSL " + host + ":" +
" tld=" + getTld(context, host) +
" root=" + getRootDomain(context, host) +
" parent=" + getParentDomain(context, host));
}
}