Commit Graph

1733 Commits (master)

Author SHA1 Message Date
Vitaliy Filippov 2c0316f07d always use fontconfig 2015-02-15 12:57:28 +03:00
Vitaliy Filippov cef6c84e00 Make qphantom platform plugin static and adjust build scripts 2015-02-15 12:39:07 +03:00
Vitaliy Filippov f37c7e29e0 Remove QT source and make phantomjs compile with unmodified QT, fix binary encoding of web response 2015-02-07 01:48:33 +03:00
Ariya Hidayat d3cd0599c8 Issue #12897: README is updated with 2.0 info. 2015-01-31 21:13:44 -08:00
Ariya Hidayat a2912c216d Set version from `2.0.0-development` to `2.0.0`.
2015-01-23 18:19:52 -08:00
Ariya Hidayat 0352ddb502 Version 2.0.0: initial cut at the ChangeLog.
2015-01-23 17:00:59 -08:00
Paul Millar 05d7e3e77d remove hardcoded "PhantomJS is launching GhostDriver..." message
Apart from being undesirable that debugging messages are always
written to stdout, the information is redundant as a similar message
is logged at debug level.
2015-01-09 07:41:48 -08:00
Andrey Plotnikov cf246eb853 Cast maxDiskCacheSize to qint64 to allow disk cache be more than 2Gb.
2014-12-18 09:16:38 -08:00
Jacek Migdal 806da21e2b Fix passing date as argument to page.evaluate().
2014-12-11 20:43:46 -08:00
Jacek Migdal 32d20b4aa7 Port more tests from webpage-spec.
2014-12-11 20:38:35 -08:00
Jacek Migdal 0bf14a3d0c Don't rely on JSON.parse() for page.evaluate().
2014-12-10 22:53:53 -08:00
Jacek Migdal 3b8282cb2e Port the tests from webpage-spec.js
Callback, clip-rect, confirm, object, prompt, scroll-position,
viewport-size and window.
2014-12-07 16:59:11 -08:00
Zack Weinberg 50ae50e871 Add a command-line option --local-urls={true,false}
The default is 'true'.  When set 'false', file: and qrc: URLs are
treated as invalid (unknown scheme) rather than opening local files,
as requested in issue #12752.

In order to test this, I added a mechanism to test/
allowing individual tests to be annotated with command-line
options to pass to phantomjs or the script.
2014-11-21 15:51:35 +00:00
Vitaly Slobodin a65a487d99 Fix invalid directory path for Windows.
2014-11-16 17:02:26 -08:00
Vitaly Slobodin 12870d90ad Fix JPG image rendering.
To pass QString as a const char* we should call <QString>.toLocal8Bit().constData().
2014-11-14 08:22:52 -08:00
Ariya Hidayat eddb0db1d2 Port the tests for mousedown, mouseup, and mousemove events.
2014-10-10 06:40:42 -07:00
Ariya Hidayat 619225b1da Port the tests of keyup, keydown, and keypress events.
2014-10-09 07:16:59 -07:00
Ariya Hidayat ce66f290c3 Port the test of web page's zoom factor.
2014-10-08 06:51:16 -07:00
Ariya Hidayat 2cbb695490 Port the tests of the web page's setContent().
2014-10-02 22:31:49 -07:00
Ariya Hidayat bad1fee468 README: Note on PhantomJS 2.
2014-10-01 20:17:07 -07:00
Ariya Hidayat b68d9467a7 Port the tests of the cookiejar module.
2014-09-30 22:00:53 -07:00
Ariya Hidayat a5f0ff7433 Port the test for console.log multiple arguments.
2014-09-29 21:29:44 -07:00
Ariya Hidayat 7e8986cd3e Port test tests of CJK codecs.
2014-09-28 22:39:20 -07:00
Ariya Hidayat 7bcb9a8725 Add a test to demonstrate the problem with JSON-ification.
2014-09-27 13:22:12 -07:00
Ariya Hidayat 5768b705a0 Implement clearMemoryCache() on a web page to clear the cache.
Unfortunately, due to Qt and WebKit limitation, this is technically
clearing all the cache used by every web page instance. It is the
best we can have right now.
2014-09-25 07:09:33 -07:00
Ariya Hidayat 105bcb32a9 Fix the mismatch of test files and their contents.
2014-09-24 21:49:26 -07:00
Ariya Hidayat 51d5835942 System#os.version workaround for new(er) OS X versions.
In case Qt doesn't provide the information yet, deduce it from the OS
kernel version (e.g. 14.x.y for OS 10.10 Yosemite).
2014-09-23 07:51:36 -07:00
Ariya Hidayat 72c53b5476 System#os.version should know OS 10.9 Mavericks.
2014-09-22 20:46:51 -07:00
Ariya Hidayat 639e09bd3a Provide OS kernel version in system.os.
This is available via the new property called `release`. A very simple
example to demonstrate it:

  var system = require('system');
  console.log('Kernel release', system.os.release);

which will print (on OS X 10.7.5 Lion):

  Kernel release 11.4.2
2014-09-21 23:47:57 -07:00
Ariya Hidayat 7c61f8857d Port the tests of web page properties and functions.
2014-09-18 23:17:21 -07:00
Ariya Hidayat b36da277e9 Port the user agent test.
2014-09-17 21:57:42 -07:00
Ariya Hidayat 9c7753189f Speed-up the tests by reducing some time-outs.
Running all tests should finish in 22 seconds instead of 41 seconds.
2014-09-16 20:43:10 -07:00
Zack Weinberg 4d4aa42c94 Set SO_REUSEADDR on the test server's listening port.
This means you don't have to wait 30 seconds in between invocations of

Also, if the test server fails to bind its port, print the actual
OS-level error message rather than guessing what the problem is.

issue #12439
2014-09-16 21:00:52 +00:00
Zack Weinberg 3d4f89b41e Bug fixes to test-server Python response hook support.
* correctly fake a package to hold all the response-hook modules
* use StringIO correctly in the response hooks
* prevent .py(c) files in test/www/ from being accessed directly
* prevent test/www/__init__ from being treated as a response hook
* add a test case that makes sure the existing hooks _can_ return 200 OK

(issue #12439; buggy commit 4d60e94)
2014-09-16 20:56:27 +00:00
Ariya Hidayat 2e8f0e8f68 Minor test runner clean-up.
Unused imports are removed.
Ensure that the correct reference is used.
2014-09-15 21:38:36 -07:00
Zack Weinberg 767494dc35 Add support for selective test execution.
If there are any positional arguments to test/, they are matched
(verbatim, not as regular expressions) against each test's name.  Only those
tests whose names contain at least one of the positional arguments will be
run.  Thus, for instance, you can run just the webpage tests with

    ./test/ module/webpage

or one specific test with

    ./test/ exact/name/of/test.js

or the basics and standards tests with

    ./test/ basics standards

If no tests at all match, will print "ALL TESTS SKIPPED" and
exit unsuccessfully.

Ongoing work on issue #12439.
2014-09-15 16:21:25 +00:00
Zack Weinberg 4d60e9450d Support Python scripts in test/www/.
Rather than add all the special URLs we'll ever want to,
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/ does, then test/www/ 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.
2014-09-15 16:21:17 +00:00
Zack Weinberg 2b2d52e343 Improvements to logic in FileHandler.translate_path.
We already have 'base_path' as a global variable, so use that (or rather,
a new derivative of that) instead of inspect.getfile(inspect.currentframe()).

Rather than splitting the path and then iterating over every component
trying to figure out if it's "special", take advantage of the fact that
posixpath.normpath() will reliably produce a path with all ../ and bare-/
components at the very beginning.  Preserve the distinction between paths
with and without a trailing /, as SimpleHTTPRequestHandler expects.

So that paths containing unusual (e.g. non-ASCII, non-UTF-8) segments can
safely be tested, unquote and then requote the entire path.  This means
that the *bytes* corresponding to the ASCII characters

  0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz -_./

are guaranteed to be unquoted, and all other *bytes* are guaranteed to be
%-quoted.  (Note especially that *whether or not* the tests are being run
on Windows, \ in the original URL will be represented as %5C, and will
*not* be treated as a pathname separator.)

So that the tests behave consistently whether or not the OS has a case-
sensitive filesystem, after the above transformation, lowercase the entire

Ongoing work on issue #12439.
2014-09-15 16:21:04 +00:00
Zack Weinberg 1adbbe4830 Support globs in
This means that there is no longer a need to add every individual test
to the list; only new *directories* have to be mentioned.  New tests
can be added just by dropping .js files into appropriate directories.

Tests which are not meant to be run by default now live in tests/manual/.
Currently there is one such test, tests/manual/standards/ecma-test262.js,
which downloads and runs the ECMAScript conformance suite.

Ongoing work on issue #12439.
2014-09-15 16:17:27 +00:00
Ariya Hidayat 83f4baf8c6 Port the test to check for plugin non-existence.
2014-09-14 09:35:41 -05:00
Ariya Hidayat f85238322e Port the test to change the encoded URL of network request.
2014-09-13 20:00:21 -05:00
Ariya Hidayat 3b972fbfbb Port the test to change the URL of network request.
2014-09-12 23:29:40 -05:00
Ariya Hidayat dca6f77a36 Port the test for onRepaintRequested handler.
2014-09-11 09:57:07 -07:00
Ariya Hidayat d52df7a1cf Port the test to abort network request.
2014-09-11 09:57:03 -07:00
Ariya Hidayat f95ef19fcb Port the test to check for resource received upon error.
2014-09-10 21:29:07 -07:00
Ariya Hidayat f29b76bb7f Port the test for resource request error handling.
2014-09-09 23:08:16 -07:00
Ariya Hidayat 804f61bcf5 Speed-up the tests: default auto-exit timeout is set to 1 second.
This reduces the total test duration from 72 seconds to 54 seconds.
2014-09-08 08:04:06 -07:00
Ariya Hidayat f20835735c Port custom headers testing of web page.
The HTTP server launched by the test runner has a new endpoint called
/echo. This simply echoes back some information (current on the made
request, in the future it will be expanded to further information)
formatted as JSON. This echo system facilitates easy testing for request
header manipulation feature.
2014-09-07 21:13:59 -07:00
Ariya Hidayat 2c10f6095b Port loading tests of web page.
2014-09-06 22:58:02 -07:00
Ariya Hidayat 784a06c3a7 The test runner also launches an HTTP server.
The server runs on port 9180 and serves the content from test/www
directory. Any tests can use this base URL to load test content and
to exercise certain PhantomJS API.
2014-09-05 21:31:38 -07:00