1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-09-11 12:55:33 +03:00
Commit Graph

7 Commits

Author SHA1 Message Date
Zack Weinberg
c5db190f39 Test directory reorganization.
The `certs`, `fixtures`, `node_modules`, and `www` directories, and
`testharness.js`, are moved into a new `lib` directory to reduce
clutter; the long-term plan is that all other subdirectories will
contain tests.  (Right now, we still have `ghostdriver-tests` as an
exception.)  Adjust `writing-tests.md`, `run-tests.py`, `testharness.js`,
and a couple of tests accordingly.

Also fix a bug in `run-tests.py` where ERROR conditions that happened
before the first test were not being reported accurately.
2016-02-03 10:16:03 -05:00
Luke Street
e4191335a4 Crash fix: Switch to top frame when current frame is destroyed.
Originally pull request #12109.
Fixes issues #10947 #11103 #11984 #13551 and probably more.

The test case is a composite of test cases provided by
Luke Street (#12109) and kramsee (#13551).
2015-12-22 19:04:24 -05:00
Zack Weinberg
f69d44b829 Don't hardwire listening ports for the test HTTP(S) servers.
Instead, run-tests.py asks the kernel to assign a random unused port
number for each, and then sets environment variables TEST_HTTP_BASE
and TEST_HTTPS_BASE to the base URLs of each server.  In tests that
use testharness.js, these are exposed as global variables with the
same name; tests that don't use the harness will need to pick them out
of require('system').env if they need them.  (Currently there are no
such tests.)

Part of issue #13478 (test suite overhaul).
2015-10-20 17:11:36 -04:00
Zack Weinberg
9eb781f82d Reformat all individual tests' output as TAP.
This enables run-tests.py to parse it and produce structured,
pretty output.  A couple of latent failures were exposed and
marked expected (having to do with control passing beyond
phantom.exit()).

TAP: http://testanything.org/tap-specification.html

Part of issue #13478 (test suite overhaul).
2015-10-20 17:11:36 -04:00
Zack Weinberg
5a266e48dc Convert non-webpage tests to the new format.
This covers fs-spec-*.js, require/require_spec.js, module_spec.js,
webkit-spec.js, and webserver-spec.js.  Also, incorporate
set/690-ttf-crash/ as a regression test (it wasn't being run
automatically).

Part of issue #13478 (test suite overhaul).
2015-10-20 17:10:47 -04:00
Zack Weinberg
2121b56d5b Replace assert.js with a new test harness based on W3C testharness.js.
The principal value of this test harness is its support for asynchronous
tests -- that is, tests where you have to wait for a callback to happen
before you can continue testing.  This applies to every test in our
testsuite that uses WebPage.open(), and some others as well.  With this
harness, the test suite is significantly faster and can be made race-free.

The API is not exactly the same as W3C testharness.js -- important
differences include: test execution is serialized within a file; "file is
test" mode has been removed, as we do not need it and it adds significant
complexity; several additional assertions have been added; the ability to
mark tests as expected to fail, or as to be skipped entirely, has been added.

New-style tests can opt out of testharness.js with a "no-harness"
directive at the top of the file; this is necessary for a small number
of tests (e.g. basics/exit.js) that test functionality the harness
reserves for its own use.

All existing new-style tests have been converted to testharness.js; some
groups of tests have been consolidated into fewer files.  The naming
convention for tests in regression/ is clarified.

Part of issue #13478 (test suite overhaul).
2015-10-20 17:10:46 -04:00
Zack Weinberg
1e7829db97 Fix crash on exit if pages have been closed (#12482)
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.
2014-08-20 14:38:45 -04:00