Update web-platform-tests to revision 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a

This commit is contained in:
WPT Sync Bot 2018-02-13 20:15:58 -05:00
parent 4c3f1756da
commit 432648745e
164 changed files with 8354 additions and 595 deletions

View file

@ -203,6 +203,8 @@ subdomains = [u"www",
u"天気の良い日",
u"élève"]
not_subdomains = [u"nonexistent-origin"]
class RoutesBuilder(object):
def __init__(self):
self.forbidden_override = [("GET", "/tools/runner/*", handlers.file_handler),
@ -468,6 +470,24 @@ def get_subdomains(host):
for subdomain in subdomains}
def get_not_subdomains(host):
#This assumes that the tld is ascii-only or already in punycode
return {subdomain: (subdomain.encode("idna"), host)
for subdomain in not_subdomains}
def make_hosts_file(config, host):
rv = []
for domain in config["domains"].values():
rv.append("%s\t%s\n" % (host, domain))
for not_domain in config.get("not_domains", {}).values():
rv.append("0.0.0.0\t%s\n" % not_domain)
return "".join(rv)
def start_servers(host, ports, paths, routes, bind_hostname, config, ssl_config,
**kwargs):
servers = defaultdict(list)
@ -626,6 +646,7 @@ def get_ports(config, ssl_environment):
def normalise_config(config, ports):
host = config["external_host"] if config["external_host"] else config["host"]
domains = get_subdomains(host)
not_domains = get_not_subdomains(host)
ports_ = {}
for scheme, ports_used in ports.iteritems():
ports_[scheme] = ports_used
@ -633,6 +654,9 @@ def normalise_config(config, ports):
for key, value in domains.iteritems():
domains[key] = ".".join(value)
for key, value in not_domains.iteritems():
not_domains[key] = ".".join(value)
domains[""] = host
ports_ = {}
@ -644,6 +668,7 @@ def normalise_config(config, ports):
config_ = config.copy()
config_["host"] = host
config_["domains"] = domains
config_["not_domains"] = not_domains
config_["ports"] = ports_
return config_