mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Update web-platform-tests to revision ac12b3e9488edb436f063b11213e954ae62d5a5e
This commit is contained in:
parent
65370f17c9
commit
b56a3b8e69
111 changed files with 3122 additions and 68 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue