Commit Graph

12831 Commits

Author SHA1 Message Date
Michael Drake
34dec2b5d4 Merge branch 'tlsa/duktape2' 2017-03-23 14:57:43 +00:00
Michael Drake
c98fc7999a Duktape: Prevent clang static analysis.
Restore 336326af3a for 2.0.2 import.
2017-03-23 14:56:32 +00:00
Michael Drake
5d39972b9f Duktape 2.X: duk_error now returns a duk_ret_t
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_error-duk_error_va-duk_throw-duk_fatal-have-a-return-value

This also changes Console.bnd to return on error, rather than ignoring it.
2017-03-23 14:56:32 +00:00
Michael Drake
ff8e5c99a0 Duktape 2.x: duk_safe_call callbacks now have a void ptr user data param.
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_safe_call-userdata
2017-03-23 14:56:32 +00:00
Michael Drake
736bbbed71 Duktape 2.X: Update to Duktape 2.0.2.
Note that DUK_OPT_XXX feature selection has been removed.

This means we can't use `DUK_OPT_HAVE_CUSTOM_H`, so we need another
way to tell duktape about our custom header.

This means assembling our own duktape distribution with a
duktape "tools/configure.py" invocation.

Instructions for updating duktape have been added to NetSurf's
`Docs/` directory.

See:
https://github.com/svaarala/duktape/blob/master/doc/release-notes-v2-0.rst#duk_opt_xxx-feature-option-support-removed
2017-03-23 14:56:32 +00:00
Michael Drake
6bfc8ba547 HTML content handler: Don't let aborted contents get stuck in LOADING.
Previously, aborted HTML fetches left the content in LOADING state,
and the hlcache clean code does not clean contents in the LOADING
state.  They, and their child contents ended up stuck in the
cache forever.
2017-03-23 14:31:38 +00:00
Michael Drake
0747e0ed53 HTML object fetch handler: Remove bogus parent content state assertion. 2017-03-23 14:31:22 +00:00
Michael Drake
be77f764e2 Improve content logging with content IDs (pointer values).
This makes it easier to track a content by its ID through a log.
2017-03-23 14:23:57 +00:00
Vincent Sanders
c512b2f054 Add heap fault injection generator into tests
This builds a dynamic library which can cause heap allocation (malloc)
faliures after a specified number of calls. This is useful to allow
tesing of memory failure allocation paths within netsurf test suites.

An example test for core strings test has been added which
incrementaly fails alloctions allowing all error paths in
initialisation to be exercised.
2017-03-22 08:56:24 +00:00
Chris Young
3df40959e3 Allow for more varied notification backmsgs 2017-03-21 18:42:41 +00:00
Vincent Sanders
7706ba5beb fix mime sniff test with comment tag 2017-03-20 23:39:15 +00:00
Vincent Sanders
399d19ce25 extend mime sniff coverage with bad mp4 tests 2017-03-20 23:21:26 +00:00
Chris Young
cd39367ef4 Try to avoid extraneous progress notifications 2017-03-20 20:53:39 +00:00
Chris Young
ee88653dc0 Enable displaying download progress within a notification.
Requires Enhancer Pack (Ringhio 53.65+)
Defaults to 0 (off) as there is currently no check to see if this version is installed.
This is currently potentially dangerous to toggle whilst a download is in progress, so cannot be changed through the GUI.
2017-03-20 20:35:40 +00:00
Vincent Sanders
3c94073590 extend mime sniffing tests to cover rss and atom feed detection 2017-03-20 16:24:44 +00:00
Vincent Sanders
4eb7c5497e extend mime sniffing test coverage to most of current implementation 2017-03-20 15:27:08 +00:00
Vincent Sanders
e1779b426a add mime sniffing test cases for more header content types 2017-03-20 14:49:03 +00:00
Vincent Sanders
85e7bdf047 extend mime sniffing test coverage 2017-03-20 12:22:22 +00:00
Vincent Sanders
f39d78dc2e mimimal mime sniffing test 2017-03-20 00:48:11 +00:00
Vincent Sanders
0866314d96 reduce hlcache handle api usage in mimesniff 2017-03-19 22:29:23 +00:00
Vincent Sanders
93e2b4855b make mimesniffing use core strings 2017-03-19 15:00:21 +00:00
Vincent Sanders
6fb654d356 rework corestring implementation
This removes special casing for some strings and importantly the
multiple huge lists of variables in code.
2017-03-19 14:27:05 +00:00
Vincent Sanders
eb5e5ff486 add test to messages buffer lookup api 2017-03-14 23:23:46 +00:00
Vincent Sanders
5395c2b98e free resources in messages test 2017-03-14 23:12:02 +00:00
Vincent Sanders
925c69f16a add additional string handling tests 2017-03-14 23:07:26 +00:00
Vincent Sanders
0e8ab04051 extend human readable size tests to cover buffer cycling 2017-03-14 13:49:23 +00:00
Vincent Sanders
f7c0ea5156 have more comprehensive separate test case for snstrjoin 2017-03-14 13:37:34 +00:00
Vincent Sanders
3d33157a86 add utility string handling 2017-03-14 11:59:04 +00:00
Vincent Sanders
fcc1a1e4c2 improve numerical ipv6 urldb prefix search test coverage 2017-03-13 23:52:56 +00:00
Vincent Sanders
2406acfeb3 fix urldb numerical v6 address handling 2017-03-13 23:44:06 +00:00
Vincent Sanders
089179a5b1 iterate urldb v6 numerical adresses as well as ipv4 2017-03-13 22:23:50 +00:00
Vincent Sanders
6eff2522c8 add urldb tests for content type setting 2017-03-13 22:04:38 +00:00
Vincent Sanders
27aa56cbf6 make the urldb content type setting API return an error 2017-03-13 21:55:39 +00:00
Vincent Sanders
d55d7f3e1e add urldb tests for urls which cannot be found 2017-03-13 21:53:42 +00:00
Vincent Sanders
ce6c0b9026 add persistance flag tests to urldb 2017-03-13 21:20:47 +00:00
Vincent Sanders
92b5f114ba make urldb persistance setting API return an error 2017-03-13 21:19:59 +00:00
Vincent Sanders
9a004753d2 extend the session addition test with all the urls from the add/set/get test 2017-03-13 20:07:56 +00:00
Vincent Sanders
44ad580a75 extend urldb tests with url creation, setting and getting operations 2017-03-13 16:44:30 +00:00
Vincent Sanders
5078bffad7 change urldb_set_title API to return an error status 2017-03-13 16:38:24 +00:00
Vincent Sanders
363c32c07a extend nsurl component API test case 2017-03-10 11:36:02 +00:00
Vincent Sanders
fc1be0144c extend nsurl parent API tests 2017-03-10 11:06:51 +00:00
Vincent Sanders
510efac384 add nsurl get_utf8 test case 2017-03-10 10:22:17 +00:00
Vincent Sanders
b307fa4311 nsurl tests were not exercising unicode 2017-03-10 09:02:42 +00:00
Vincent Sanders
01d7392a6a replace tmpnam with something more suitable for the test files 2017-03-09 22:11:55 +00:00
Vincent Sanders
ae8623a0a2 fix compilation warnings in urldb test 2017-03-09 13:22:37 +00:00
Vincent Sanders
5ebec85282 actually check the generated database files against reference test data 2017-03-08 22:22:54 +00:00
Vincent Sanders
0da0dcc342 remove urldb_add_host and path from public API
The urldb_add_host and urldb_add_path API were only public for the
urldb test code which was calling them incorrectly in any case as the
url bloom filters were not updated so serialising and adding data to
entries was inconsistent.

This also changes the tests to use the urldb_add_url API which is less
buggy and results in a smaller, cleaner urldb API.
2017-03-08 13:27:00 +00:00
Vincent Sanders
b78887c7c8 make update data api return an result 2017-03-08 13:13:21 +00:00
Vincent Sanders
670110b171 use robust handling of time_t value (de)serialisation
The previous implementation was wrong on systems where time_t was not
an int type. This changes urldb to use the portable implementation
netsurf has available.
2017-03-08 10:54:17 +00:00
Vincent Sanders
4076cc64d2 Change url entry expiry timestamps in test database to far future 2017-03-08 10:10:55 +00:00