minimal example of using [phantomjs] with [qunit]
$ phantomjs run-qunit.js file://`pwd`/test.html
'waitFor()' finished in 200ms.
Tests completed in 21 milliseconds.
5 tests of 5 passed, 0 failed.
| # | |
| # Get web page screenshot | |
| # | |
| # usage: | |
| # xvfb-run -s "-screen 0 1024x768x24" python getschreenshot.py test.html | |
| # | |
| # libs: | |
| # - pygtk: http://www.pygtk.org/ | |
| # - pywebkitgtk(python-webkit): http://code.google.com/p/pywebkitgtk/ | |
| # - PIL: http://www.pythonware.com/products/pil/ |
| #!/usr/bin/env python | |
| """ | |
| web page screenshot by webkit | |
| command usage: | |
| python webkitscreenshot.py test.html | |
| library usage: | |
| import webkitscreenshot | |
| image = webkitscreenshot.screenshot_vfb("file://test.html") |
| """ | |
| Simple forking echo server built with Python's SocketServer library. A more | |
| Pythonic version of http://gist.github.com/203520, which itself was inspired | |
| by http://tomayko.com/writings/unicorn-is-unix. | |
| """ | |
| import os | |
| import SocketServer | |
| class EchoHandler(SocketServer.StreamRequestHandler): |
| var args = [].slice.call(arguments, 0); |
| package main | |
| import ( | |
| "encoding/base64" | |
| "net/http" | |
| "strings" | |
| ) | |
| type handler func(w http.ResponseWriter, r *http.Request) |