https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7bed6bee0d70190e87bd48a71c81a1f6d79e8d97 authored by L. David Baron on 14 April 2018, 11:18:26 UTC
Sync Mozilla tests as of https://hg.mozilla.org/mozilla-central/rev/37b8862d354e0014a72715462dd2102dd5b599cc .
Tip revision: 7bed6be
sleep_10_v13_wsh.py
#!/usr/bin/python

import sys, urllib, time
from mod_pywebsocket import common, msgutil, util

def web_socket_do_extra_handshake(request):
    request.connection.write('x')
    time.sleep(2)
    request.connection.write('x')
    time.sleep(2)
    request.connection.write('x')
    time.sleep(2)
    request.connection.write('x')
    time.sleep(2)
    request.connection.write('x')
    time.sleep(2)
    return

def web_socket_transfer_data(request):
    while True:
        line = msgutil.receive_message(request)
        if line == 'Goodbye':
            return
        request.ws_stream.send_message(line, binary=False)

back to top