| 1 | = pywebsocket: a WebSocket server for layout tests = |
| 2 | |
| 3 | == For Developers who want to use WebSocket in their layout tests == |
| 4 | pywebsocket is automatically launched via new-run-webkit-tests, or run-webkit-tests. These script check if layout tests which are going to be run require WebSocket server, then launch pywebsocket automatically. |
| 5 | This script just check the path of tests. If your test contains 'websocket' in its path, pywebsocket will be launched. |
| 6 | E.g., |
| 7 | - LayoutTests/http/tests/websocket |
| 8 | - LayoutTests/http/tests/inspector/websocket. |
| 9 | |
| 10 | == Where and Why == |
| 11 | Originally, pywebsocket is automatically installed by webkitpy's autoinstall, when you need it to run a layout test at runtime. |
| 12 | But after [http://trac.webkit.org/changeset/116668 r116668], it is checked in WebKit repository directly. |
| 13 | This is because an autoinstall bug which is already fixed (See, [http://code.google.com/p/chromium/issues/detail?id=80739 chromium issue 80739]), so we can use autoinstall again now. |
| 14 | But, we continue to check it in WebKit repository directly because it's more stable for buildbots. |
| 15 | |
| 16 | == How to manage(update) pywebsocket in WebKit == |
| 17 | Here is a basic process to update. |
| 18 | |
| 19 | 1) Remove old files. |
| 20 | {{{ |
| 21 | $ cd WebKit/Tools/Scripts/webkitpy/thirdparty |
| 22 | $ rm -rf mod_pywebsocket |
| 23 | }}} |
| 24 | |
| 25 | 2) Import newly released revision. |
| 26 | {{{ |
| 27 | $ tar zxf mod_pywebsocket-''version''.tar.gz |
| 28 | $ mv pywebsocket-''version''/src/mod_pywebsocket . |
| 29 | $ mv pywebsocket-''version''/src/COPYING mod_pywebsocket |
| 30 | $ rm -rf pywebsocket-''version'' |
| 31 | $ git status # Check if there is untracked new files, and handle it if needed. |
| 32 | }}} |
| 33 | |
| 34 | 3) Register to local repository. |
| 35 | {{{ |
| 36 | $ git commit -a -m "import pywebsocket-''version''" |
| 37 | }}} |
| 38 | |
| 39 | 4) Run tests. (You should run after submitting to local repos. because running tests generators garbages like *.pyc) |
| 40 | {{{ |
| 41 | $ cd ../../../.. |
| 42 | $ ./Tools/Scripts/test-webkitpy # I expect they don't depend on pywebsocket for now, but it will finish in short time, so I recommend to run it. |
| 43 | $ ./Tools/Scripts/new-run-webkit-websocketserver --server=start |
| 44 | $ ./Tools/Scripts/new-run-webkit-websocketserver --server=stop |
| 45 | $ ./Tools/Scripts/run-webkit-websocketserver # This script use new-run-webkit-websocketserver internally, so this might be redundant. |
| 46 | }}} |
| 47 | |
| 48 | 5) Request review and submit the change in the WebKit way. |
| 49 | You may want to include following description in ChangeLog |
| 50 | - pywebsocket version (or revision) to import |
| 51 | - new features' description (or URL to GoogleCode's download page containing that) |
| 52 | |
| 53 | '''Don't forget to copy COPYING in 2).''' |
| 54 | |
| 55 | == Note == |
| 56 | Chromium port has another pywebsocket checkout at src/third_party/pywebsocket via DEPS mechanism. This is for testing chromium specific features. Versions of both pywebsocket will be slightly different. |