Update web-platform-tests to revision 5dbe45af3ad3a933c03187c72f1c12cbe2877703

This commit is contained in:
Ms2ger 2015-12-09 01:38:02 -05:00
parent 6c0eb115f4
commit 9aa1b1e408
129 changed files with 2604 additions and 290 deletions

View file

@ -374,6 +374,6 @@ def load(tests_root, manifest):
def write(manifest, manifest_path):
with open(manifest_path, "w") as f:
with open(manifest_path, "wb") as f:
json.dump(manifest.to_json(), f, sort_keys=True, indent=2, separators=(',', ': '))
f.write("\n")

View file

@ -285,6 +285,10 @@ VisualOutput.prototype = {
var json = this.runner.results.to_json();
if (document.getElementById("dumpit").checked) {
this.json_results_area = Array.prototype.slice.call(this.elem.querySelectorAll("textarea"));
for(var i = 0,t = this.json_results_area.length; i < t; i++){
this.elem.removeChild(this.json_results_area[i]);
}
this.json_results_area = document.createElement("textarea");
this.json_results_area.style.width = "100%";
this.json_results_area.setAttribute("rows", "50");

View file

@ -30,7 +30,7 @@ def filesystem_path(base_path, request, url_base="/"):
if base_path is None:
base_path = request.doc_root
path = request.url_parts.path
path = urllib.unquote(request.url_parts.path)
if path.startswith(url_base):
path = path[len(url_base):]
@ -70,7 +70,7 @@ class DirectoryHandler(object):
<h1>Directory listing for %(path)s</h1>
<ul>
%(items)s
</li>
</ul>
""" % {"path": cgi.escape(request.url_parts.path),
"items": "\n".join(self.list_items(request, path))}
@ -86,7 +86,7 @@ class DirectoryHandler(object):
base_path += "/"
if base_path != "/":
link = urlparse.urljoin(base_path, "..")
yield ("""<li class="dir"><a href="%(link)s">%(name)s</a>""" %
yield ("""<li class="dir"><a href="%(link)s">%(name)s</a></li>""" %
{"link": link, "name": ".."})
for item in sorted(os.listdir(path)):
link = cgi.escape(urllib.quote(item))
@ -95,7 +95,7 @@ class DirectoryHandler(object):
class_ = "dir"
else:
class_ = "file"
yield ("""<li class="%(class)s"><a href="%(link)s">%(name)s</a>""" %
yield ("""<li class="%(class)s"><a href="%(link)s">%(name)s</a></li>""" %
{"link": link, "name": cgi.escape(item), "class": class_})

View file

@ -406,6 +406,8 @@ def template(request, content):
"query": "?%s" % request.url_parts.query}
elif field == "uuid()":
value = str(uuid.uuid4())
elif field == "url_base":
value = request.url_base
else:
raise Exception("Undefined template variable %s" % field)
@ -419,7 +421,7 @@ def template(request, content):
#Should possibly support escaping for other contexts e.g. script
#TODO: read the encoding of the response
return escape(unicode(value)).encode("utf-8")
return escape(unicode(value), quote=True).encode("utf-8")
template_regexp = re.compile(r"{{([^}]*)}}")
new_content, count = template_regexp.subn(config_replacement, content)

View file

@ -179,6 +179,10 @@ class Request(object):
Request path as it appears in the HTTP request.
.. attribute:: url_base
The prefix part of the path; typically / unless the handler has a url_base set
.. attribute:: url
Absolute URL for the request.
@ -253,6 +257,7 @@ class Request(object):
host, port = host.split(":", 1)
self.request_path = request_handler.path
self.url_base = "/"
if self.request_path.startswith(scheme + "://"):
self.url = request_handler.path

View file

@ -237,6 +237,8 @@ class WebTestRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# set update the doc_root of the request to reflect this
if hasattr(handler, "base_path") and handler.base_path:
request.doc_root = handler.base_path
if hasattr(handler, "url_base") and handler.url_base != "/":
request.url_base = handler.url_base
if self.server.latency is not None:
if callable(self.server.latency):