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.
https://github.com/ariya/phantomjs/issues/12439
The use of phantom.scriptName has been deprecated since System#args was
introduce (version 1.5, March 2012). Any old scripts need to migrate to
System#args.
https://github.com/ariya/phantomjs/issues/12529
The use of phantom.args has been deprecated (see commit 545a3f7)
since a long time ago (version 1.5, March 2012). Any old scripts
need to switch to use System#args instead.
https://github.com/ariya/phantomjs/issues/12527
New option --ssl-ciphers takes a colon-separated list of OpenSSL
cipher names and sets the client cipher list to exactly that list.
The default for this option is arranged to match Chromium 35, which
has had its cipher selection optimized for the modern Web
(see https://briansmith.org/browser-ciphersuites-01.html for
rationales). (Newer versions are the same except that they also add
ChaCha20-based ciphersuites, which OpenSSL 1.0.1 hasn't yet picked up.)
* --ssl-protocol= option now accepts 'tlsv1.2', 'tlsv1.1', 'tlsv1.0'
and 'default' as well as the existing 'tlsv1', 'sslv3', and 'any'.
* The default is now none of the above, but rather QSsl::SecureProtocols,
which means "whatever subset of ANY is still considered secure and also
supported by the OpenSSL library in use". (As of this writing, Qt's idea
of "still considered secure" includes everything from SSLv3 on up, which
is technically wrong -- SSLv3 has known breaks -- but we can live with.
Qt currently doesn't have a way to select "TLSv1.0 and up".)
This mostly matters when system sqlite is selected; that has the side
effect of enabling pkg-config which in turn causes QtWebkit to detect
the presence of system GStreamer and/or QtMultimedia and turn video on.
This way, the build is consistent across the board.
The affected libraries are fontconfig, freetype, harfbuzz, libpng, libjpeg,
sqlite, pcre, and zlib.
* On Darwin, by default, fontconfig is disabled and all of the other
libraries are bundled.
* On non-Darwin, by default, fontconfig is enabled and system-provided
freetype, libpng, libjpeg, and zlib are used. Harfbuzz, pcre, and sqlite
continue to be bundled.
* Individual libraries from the above list may now be enabled or disabled
on the build.sh command line with e.g. --freetype=system or
--freetype=bundled.
* The existing --system-qtdeps, --system-qt, --system-qtwebkit options
have been renamed --qtdeps=system, --qt=system, --qtwebkit=system
respectively. New option --qtdeps=bundled forces all available
bundled libraries to be used.
Also:
* Slight adjustments to organization of preconfig.sh.
* Can now disable PulseAudio and ALSA.
* Directly link OpenSSL instead of loading it at runtime.
* Clarify the pkg-config situation (it must be enabled if and only if
sqlite comes from the system).
* If the environment variable PHANTOMJS_DISABLE_CRASH_DUMPS
is set to any value, do not initialize Breakpad.
* On Mac and Linux, if the environment variable TMPDIR is set,
put the crash dumps there instead of in /tmp.
* On Windows, %TEMP% was already being honored, but streamline
the code for that.
* Move the code that initializes Breakpad, and the code to print
the crash messages, to their own module (src/crashdump.{h,cpp})
and RAII class (CrashHandler).
* Better wording of the crash message, particularly in the case where
Breakpad failed to write a minidump file; update URL of crash-reporting
guide.
* Generally less repetitive code. (Still way too many #ifdefs.)
By implementing a dummy platform native interface (for now, it may be
extended in the near future), QPlatformPrinterSupportPlugin will avoid
the path of loading the printer support plugin
(QCocoaPrinterSupportPlugin on OS X).
Related upstream bug (QCocoaPrinterSupportPlugin problem with static build):
https://bugreports.qt-project.org/browse/QTBUG-33109https://github.com/ariya/phantomjs/issues/12500
This Python script serves as a master test runner. It will run each test
script with a fresh instance of PhantomJS. The exit code of each script
determines its success or failure.
The existing tests (run-tests.js) are wrapped as one of the test
scripts. This permits a gradual migration to the new test system.
https://github.com/ariya/phantomjs/issues/12439
This is to reduce maintenance burden. A GIF representation of a web
page can be produced by converting its PNG capture. There are numerous
third-party tools which can do the job better (optimized palette,
minimized loss, etc).
https://github.com/ariya/phantomjs/issues/12480
To prevent unintended macro expansion, don't use the name
stdout/stdin/stderr in the native System object. Those properties are
achieved by shadowing it in the module interface (JavaScript side).
https://github.com/ariya/phantomjs/issues/12496
It cannot, nor should it, be selected on windows machines. There, we
stick to the Windows QPA which is required to get a lot of things up
and running, like an eventloop, socket integration etc. pp.
There was code in the phantom QPA to make it compile, but it never
actually worked since a lot of things where missing (such as
instantiating QWindowsContext among others).
https://github.com/ariya/phantomjs/issues/12494
Regression from #12431: the loop to clear all surviving pages
neglects to check for entries in `m_pages` which have already
been closed, fully destructed, and therefore replaced by NULL
pointers.
This code:
console.log("Hello World!");
phantom.exit();
console.log("Meh, noone should see me!");
currently produces this unexpected output:
Hello World!
Meh, noone should see me!
This patch fixes it to only output the first line, by loading a blank
page on phantom.exit(). Direct deletion of the web page can trigger
crashes, so this is a safe workaround.
https://github.com/ariya/phantomjs/issues/12431
The newer ConsoleReporter is very quiet by default, which is nice, but
this provides a way to get something more like the older one-line-per-test
output.
#12230 (Test suite improvements).
* Anything on the command line after "run-tests.sh" will be understood
as a regular expression (if there is more than one argument, they are
concatenated, with spaces in between) and only the tests whose "full
names" match that regexp will be run. The full name of a test is the
"describe" string plus a space plus the "it" string. Note well that,
unlike the test-runner output, there is no colon in there.
* run-tests.sh and run-tests.js now correctly handle being invoked from
an arbitrary directory; the cwd does not have to be the project root.
* Shell portability fixes for run-tests.sh.
#12230 (Test suite improvements).
The new Jasmine includes a version of this formerly external add-on, but it
is buggy and doesn't print details of failing tests.
#12230 (Test suite improvements).
The newer jasmine-console behavior requires minor adjustments to the
ConsoleReporter we create in run-tests.js. Also, en passant fix for
a bug in the final callback: exiting with status equal to the number
of failed tests does not work, because the _exit() system call takes
only the low eight bits of the value passed. If a test run happened
to have 256 failing tests, the old code would have spuriously exited
successfully. Instead, just exit(1) if any tests fail.
#12230 (Test suite improvements).
Three tests were (potentially) dumping text to console.log during the
run, which they should never do.
Fixing that revealed that one of them, the test for interrupting a
long-running JS script, was not actually testing what it was supposed
to test. Fixing *that* revealed that the long-running-script hook is
broken and does not actually interrupt JS infinite loops; that test
has been temporarily disabled.
#12230 (Test suite improvements).
Two tests were spuriously failing because they tried to load pages on
`github.com` that were no longer structured as expected. Use a local
webserver instead.
#12230 (Test suite improvements).
The PhantomJS QPA hardcoded usage of QFontconfigDatabase on
Unix-not-OSX, causing build failures in "bundle all the libraries" mode.
Use QGenericUnixFontDatabase instead, which is QFontconfigDatabase if
fontconfig is enabled, and QBasicFontDatabase if it isn't. This means
that the bundled-qtdeps build will use only the fonts bundled with Qt,
and won't be able to find them on a machine that doesn't have the source
tree, which is suboptimal, but at least this makes the bundled-qtdeps
build complete successfully again.
Part of issue #12467.
In this mode, system-provided libraries will be used for all of
Qt's dependencies, but Qt and QtWebkit themselves are still the
bundled copies. This mode actually works.
Now that this mode exists, disable fontconfig in the "everything
bundled" mode, because it drags in the system freetype and several
other system libraries. (There is no bundled fontconfig.)
Part of issue #12467.
This is how we arrange for QtWebkit to use QtBase's bundled copy of
sqlite; without it, QtWebkit will attempt to use a system-provided
library instead, and if headers are unavailable, the build will fail.
Part of issue #12467.
As with the system-qtwebkit option, this does not actually work at this
point, but it enables experimentation toward getting it to work.
Part of issue #12467.
* build.sh now handles building qt and qtwebkit.
* preconfig.sh is now only responsible for accumulating arguments
to pass to qt's configure script.
* preconfig.sh doesn't have command line arguments of its own;
anything on its command line will be passed directly to qt's
configure script.
* first pass of adjustments to the qt configure parameters
to try to get a more static build - unfortunately, system
sqlite, libz, libpng, and libexpat are still getting pulled
in somehow (mostly via fontconfig, I think).
Part of issue #12467.
Invoking build.sh with --system-qtwebkit will skip the build of Qt and
QtWebkit and use the qmake in $PATH to build PhantomJS proper.
This doesn't actually *work* at the moment because the bundled
copy of Webkit has patches not yet merged upstream, but it's still
useful to have for testing purposes.
Part of issue #12467.