Update web-platform-tests to revision ac12b3e9488edb436f063b11213e954ae62d5a5e

This commit is contained in:
WPT Sync Bot 2019-01-30 20:36:46 -05:00
parent 65370f17c9
commit b56a3b8e69
111 changed files with 3122 additions and 68 deletions

View file

@ -0,0 +1,26 @@
import os.path
import time
def main(request, response):
name = request.GET.first("name")
sleepTime = float(request.GET.first("sleep")) / 1E3
numInitial = int(request.GET.first("numInitial"))
path = os.path.join(os.path.dirname(__file__), name)
body = open(path, "rb").read()
response.headers.set("Content-Type", "image")
response.headers.set("Content-Length", len(body))
response.headers.set("Cache-control", "no-cache, must-revalidate")
response.write_status_headers()
# Read from the beginning, |numInitial| bytes.
first = body[:numInitial]
response.writer.write_content(first)
response.writer.flush()
time.sleep(sleepTime)
# Read the remainder after having slept.
second = body[numInitial:]
response.writer.write_content(second)