mirror of https://github.com/vitalif/phantomjs
4d60e9450d
Rather than add all the special URLs we'll ever want to run-tests.py, the embedded HTTP server now supports scripts in test/www/. If you try to load http://localhost:9180/path and test/www/path doesn't exist but test/www/path.py does, then test/www/path.py is loaded as a module. That module must export one function, handle_request(), which is called to produce the response. handle_request() has the same semantics as SimpleHTTPRequestHandler.send_head(). That is, it takes one argument, the SimpleHTTPRequestHandler object, conventionally named 'req'. It should call the send_response(), send_header(), and end_headers() methods of that object as appropriate. And it should return a readable filelike whose contents are taken as the body of the response. If either module import or handle_request() throws any exception, the HTTP response will be a 500 Internal Server Error with body provided by cgitb. Ongoing work on issue #12439. |
||
---|---|---|
.. | ||
basics | ||
fixtures | ||
ghostdriver-test | ||
lib | ||
manual/standards | ||
module | ||
node_modules | ||
regression | ||
require | ||
set/690-ttf-crash | ||
standards/javascript | ||
webkit-spec | ||
webpage-spec-frames | ||
webpage-spec-renders | ||
www | ||
assert.js | ||
cjk-text-codecs.js | ||
cookiejar-spec.js | ||
dummy.js | ||
fs-spec-01.js | ||
fs-spec-02.js | ||
fs-spec-03.js | ||
fs-spec-04.js | ||
module_spec.js | ||
phantomjs.png | ||
run-tests-ghostdriver.sh | ||
run-tests.js | ||
run-tests.py | ||
run-tests.sh | ||
webkit-spec.js | ||
webpage-spec.js | ||
webserver-spec.js |