summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/log.py
blob: 6803bb3e405e520f56c70b23ec17a909f9ae7cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import time

def main(request, response):
    response.headers.append("Content-Type", "text/javascript")
    try:
        script_id = int(request.GET.first("id"))
        delay = int(request.GET.first("sec"))
    except:
        response.set_error(400, "Invalid parameter")

    time.sleep(int(delay))

    return "log('%s')" % script_id