[webkit-dev] mod_pywebsocket for testing Web Socket implementation

Maciej Stachowiak mjs at apple.com
Mon Sep 7 23:24:24 PDT 2009


On Sep 7, 2009, at 10:41 PM, Yuzo Fujishima wrote:

>
>> Building and installing some Apache modules doesn't seem like that  
>> big a
>> deal to me, if it would really make testing more practical.
>
>> However, it seems like using a premade websocket server  
>> implementation
>> would
>> make some forms of testing harder. In particular, it would be more
>> difficult
>> to test what happens in the face of malformed results from the  
>> server,
>> which
>> is a very important part of testing.
>
>> So based on that, it probably makes more sense to do at least some  
>> of the
>> testing and a lower level, so we can easily test invalid server  
>> responses.
>
> Using mod_pywebsocket, we can write a server-side Web Socket handler
> for a URL and put it in a corresponding directory under  
> LayoutTests/...
>
> A handler is a Python script and can send (or not send) arbitrary  
> bytes,
> malformed or not, to the browser.

Sounds like that part will be easy to test, then, though I'm surprised  
that mod_pywebsocket doesn't implement the WebSocket protocol framing.

> A handler is called after Web Socket handshake. There is no way to  
> send
> malformed messages during handshake, as far as mod_pywebsocket is
> functioning properly. We may need a different mechanism here.
>
> How do you test a case where the Web server returns broken HTTP  
> headers,
> for example? Perhaps we can do similar for Web Sockets?

One way is to control the status line and headers is using .asis files.

Regards,
Maciej



More information about the webkit-dev mailing list