fune/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py
ziransun 0037895a8d Bug 1645985 [wpt PR 24164] - Python 3: Port tests in html/semantics/scripting-1, a=testonly
Automatic update from web-platform-tests
Python 3: Port tests in html/semantics/scripting-1 (#24164)

* Python 3: Port tests in html/semantics/scripting-1

* Change type of "type" to unicode

* Convert item type before passing to urlencode()
--

wpt-commits: b6a67998c6c2827319726af3bea65e572b5a125a
wpt-pr: 24164
2020-07-03 09:38:21 +00:00

13 lines
344 B
Python

import time
def main(request, response):
response.headers.append(b"Content-Type", b"text/javascript")
try:
script_id = int(request.GET.first(b"id"))
delay = int(request.GET.first(b"sec"))
except:
response.set_error(400, u"Invalid parameter")
time.sleep(int(delay))
return u"log('%s')" % script_id