mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Update web-platform-tests to revision 4d96cccabc2feacd48e1dab9afc22b8af2225572
This commit is contained in:
parent
0d236288cc
commit
c66c6af0ba
1067 changed files with 63768 additions and 10900 deletions
|
@ -111,6 +111,10 @@ class W3CTestOrgRegexp(Regexp):
|
|||
pattern = "w3c\-test\.org"
|
||||
error = "W3C-TEST.ORG"
|
||||
|
||||
class Webidl2Regexp(Regexp):
|
||||
pattern = "webidl2\.js"
|
||||
error = "WEBIDL2.JS"
|
||||
|
||||
class PrintRegexp(Regexp):
|
||||
pattern = "print(?:\s|\s*\()"
|
||||
error = "PRINT STATEMENT"
|
||||
|
@ -121,6 +125,7 @@ regexps = [item() for item in
|
|||
TabsRegexp,
|
||||
CRRegexp,
|
||||
W3CTestOrgRegexp,
|
||||
Webidl2Regexp,
|
||||
PrintRegexp]]
|
||||
|
||||
def check_regexp_line(path, f):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
|
@ -242,12 +242,10 @@ class WebSocketDaemon(object):
|
|||
# setup the wss server.
|
||||
if pywebsocket._import_ssl():
|
||||
tls_module = pywebsocket._TLS_BY_STANDARD_MODULE
|
||||
logger.debug("WebSocketDaemon: Using standard SSL module.")
|
||||
elif pywebsocket._import_pyopenssl():
|
||||
tls_module = pywebsocket._TLS_BY_PYOPENSSL
|
||||
logger.debug("WebSocketDaemon: Using PyOpenSSL module.")
|
||||
else:
|
||||
logger.critical("WebSocketDaemon: No SSL module is available.")
|
||||
print "No SSL module available"
|
||||
sys.exit(1)
|
||||
|
||||
cmd_args += ["--tls",
|
||||
|
@ -391,17 +389,18 @@ def value_set(config, key):
|
|||
return key in config and config[key] is not None
|
||||
|
||||
|
||||
def set_computed_defaults(config):
|
||||
if not value_set(config, "ws_doc_root"):
|
||||
if value_set(config, "doc_root"):
|
||||
root = config["doc_root"]
|
||||
else:
|
||||
root = repo_root
|
||||
config["ws_doc_root"] = os.path.join(repo_root, "websockets", "handlers")
|
||||
def get_value_or_default(config, key, default=None):
|
||||
return config[key] if value_set(config, key) else default
|
||||
|
||||
|
||||
def set_computed_defaults(config):
|
||||
if not value_set(config, "doc_root"):
|
||||
config["doc_root"] = repo_root
|
||||
|
||||
if not value_set(config, "ws_doc_root"):
|
||||
root = get_value_or_default(config, "doc_root", default=repo_root)
|
||||
config["ws_doc_root"] = os.path.join(root, "websockets", "handlers")
|
||||
|
||||
|
||||
def merge_json(base_obj, override_obj):
|
||||
rv = {}
|
||||
|
@ -450,6 +449,17 @@ def load_config(default_path, override_path=None, **kwargs):
|
|||
else:
|
||||
raise ValueError("Config path %s does not exist" % other_path)
|
||||
|
||||
overriding_path_args = [("doc_root", "Document root"),
|
||||
("ws_doc_root", "WebSockets document root")]
|
||||
for key, title in overriding_path_args:
|
||||
value = kwargs.get(key)
|
||||
if value is None:
|
||||
continue
|
||||
value = os.path.abspath(os.path.expanduser(value))
|
||||
if not os.path.exists(value):
|
||||
raise ValueError("%s path %s does not exist" % (title, value))
|
||||
rv[key] = value
|
||||
|
||||
set_computed_defaults(rv)
|
||||
return rv
|
||||
|
||||
|
@ -460,6 +470,10 @@ def get_parser():
|
|||
help="Artificial latency to add before sending http responses, in ms")
|
||||
parser.add_argument("--config", action="store", dest="config_path",
|
||||
help="Path to external config file")
|
||||
parser.add_argument("--doc_root", action="store", dest="doc_root",
|
||||
help="Path to document root. Overrides config.")
|
||||
parser.add_argument("--ws_doc_root", action="store", dest="ws_doc_root",
|
||||
help="Path to WebSockets document root. Overrides config.")
|
||||
return parser
|
||||
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ keyUsage = keyCertSign
|
|||
""" % {"root_dir": root_dir,
|
||||
"san_line": san_line,
|
||||
"duration": duration,
|
||||
"sep": os.path.sep}
|
||||
"sep": os.path.sep.replace("\\", "\\\\")}
|
||||
|
||||
return rv
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from setuptools import setup
|
||||
|
||||
PACKAGE_VERSION = '1.2.1'
|
||||
PACKAGE_VERSION = '1.3.0'
|
||||
deps = []
|
||||
|
||||
setup(name='wptserve',
|
||||
|
|
|
@ -52,6 +52,9 @@ class DirectoryHandler(object):
|
|||
self.url_base = url_base
|
||||
|
||||
def __call__(self, request, response):
|
||||
if not request.url_parts.path.endswith("/"):
|
||||
raise HTTPException(404)
|
||||
|
||||
path = filesystem_path(self.base_path, request, self.url_base)
|
||||
|
||||
assert os.path.isdir(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue