Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326

This commit is contained in:
Josh Matthews 2017-10-12 09:25:50 -04:00
parent 462c272380
commit 1f531f66ea
5377 changed files with 174916 additions and 84369 deletions

View file

@ -0,0 +1,36 @@
import time
def url_dir(request):
return '/'.join(request.url_parts.path.split('/')[:-1]) + '/'
def stash_write(request, key, value):
"""Write to the stash, overwriting any previous value"""
request.server.stash.take(key, url_dir(request))
request.server.stash.put(key, value, url_dir(request))
def main(request, response):
stateKey = request.GET.first("stateKey", "")
abortKey = request.GET.first("abortKey", "")
if stateKey:
stash_write(request, stateKey, 'open')
response.headers.set("Content-type", "text/plain")
response.write_status_headers()
# Writing an initial 2k so browsers realise it's there. *shrug*
response.writer.write("." * 2048)
while True:
if not response.writer.flush():
break
if abortKey and request.server.stash.take(abortKey, url_dir(request)):
break
response.writer.write(".")
time.sleep(0.01)
if stateKey:
stash_write(request, stateKey, 'closed')