gecko-dev/testing/web-platform/tests/fetch/api/resources/trickle.py
Philip Jägenstedt 012380465d Bug 1463682 [wpt PR 11116] - Run autopep8 on *.py in cors, fetch and xhr, a=testonly
Automatic update from web-platform-testsRun autopep8 on *.py in cors, fetch and xhr (#11116)

```
find cors fetch xhr -name '*.py' | xargs autopep8 --in-place --max-line-length 1000
```

Then manually pick the "good" changes, ignoring some whitespace stuff.
--

wpt-commits: 15b8e55fa2a0fbf0851cb8e0846e0320e319c852
wpt-pr: 11116
2018-06-05 15:14:50 +01:00

14 lines
430 B
Python

import time
def main(request, response):
delay = float(request.GET.first("ms", 500)) / 1E3
count = int(request.GET.first("count", 50))
# Read request body
request.body
time.sleep(delay)
response.headers.set("Content-type", "text/plain")
response.write_status_headers()
time.sleep(delay)
for i in xrange(count):
response.writer.write_content("TEST_TRICKLE\n")
time.sleep(delay)