netsurf: branch master updated. release/3.9-576-gcbc28d2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/cbc28d2c9879afea534c5...
...commit http://git.netsurf-browser.org/netsurf.git/commit/cbc28d2c9879afea534c5f4...
...tree http://git.netsurf-browser.org/netsurf.git/tree/cbc28d2c9879afea534c5f48c...
The branch, master has been updated
via cbc28d2c9879afea534c5f48cc1fe1d251d2b114 (commit)
from 6b0cb5479faf311d274b1fba23e445f18c0d57a8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cbc28d2c9879afea534...
commit cbc28d2c9879afea534c5f48cc1fe1d251d2b114
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
html: Also close js thread on html_stop()
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 871a5e8..f2b898d 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1642,6 +1642,10 @@ static void html_stop(struct content *c)
/* Still loading; simply flag that we've been aborted
* html_convert/html_finish_conversion will do the rest */
htmlc->aborted = true;
+ if (htmlc->jsthread != NULL) {
+ /* Close the JS thread to cancel out any callbacks */
+ js_closethread(htmlc->jsthread);
+ }
break;
case CONTENT_STATUS_READY:
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/html.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 871a5e8..f2b898d 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1642,6 +1642,10 @@ static void html_stop(struct content *c)
/* Still loading; simply flag that we've been aborted
* html_convert/html_finish_conversion will do the rest */
htmlc->aborted = true;
+ if (htmlc->jsthread != NULL) {
+ /* Close the JS thread to cancel out any callbacks */
+ js_closethread(htmlc->jsthread);
+ }
break;
case CONTENT_STATUS_READY:
--
NetSurf Browser
2 years, 11 months
netsurf: branch master updated. release/3.9-575-g6b0cb54
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6b0cb5479faf311d274b1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6b0cb5479faf311d274b1fb...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6b0cb5479faf311d274b1fba2...
The branch, master has been updated
via 6b0cb5479faf311d274b1fba23e445f18c0d57a8 (commit)
via 51dc59ecc946490e51350401caf970b3d373b20a (commit)
from 1053bcd3c1bf402654645f34252db51a781b5af2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6b0cb5479faf311d274...
commit 6b0cb5479faf311d274b1fba23e445f18c0d57a8
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix source object backing store documentation
fix formatting
add section on version 2 layout
diff --git a/docs/source-object-backing-store.md b/docs/source-object-backing-store.md
index 0fb3614..4fb6620 100644
--- a/docs/source-object-backing-store.md
+++ b/docs/source-object-backing-store.md
@@ -1,26 +1,36 @@
Source Object (low level) cache backing store
=============================================
-Introduction
-------------
+[TOC]
-The source object cache provides a system to extend the life of source
-objects (HTML files, images etc.) after they are no longer immediately
-being used.
+# Introduction
-Only fetch types where we have well defined rules on caching are
-considered, in practice this limits us to HTTP(S). The section in
-RFC2616 [1] on caching specifies these rules.
+The source object (referred to as low level in the code) content cache
+provides a unified API for the rest of the browser to retrieve objects
+(HTML files, images etc.) from a URL.
+
+The cache initialy always fufuls these requsts by using the fetcher
+system to retrive data according to the URL scheme (network for HTTP,
+disc for file etc.) and storing the result in memory.
+
+The cache also provides a system to extend the life of source objects
+in memory when they are no longer immediately being used. Only fetch
+types where there are well defined rules on caching are considered, in
+practice this limits the cache to URLS with HTTP(S) schemes. The
+section in RFC2616 [1] on caching specifies these rules.
To further extend the objects lifetime they can be pushed into a
backing store where the objects are available for reuse less quickly
-than from RAM but faster than retrieving from the network again.
+than from memory but faster than retrieving from the network again.
The backing store implementation provides a key:value infrastructure
with a simple store, retrieve and invalidate interface.
-Generic filesystem backing store
---------------------------------
+The key is the object URL which by definition is unique for a source
+object. The value is the source object data *and* the associated
+metadata
+
+# Generic filesystem backing store
Although the backing store interface is fully pluggable a generic
implementation based on storing objects on the filesystem in a
@@ -34,13 +44,45 @@ As the backing store only holds cache data one should not expect a
great deal of effort to be expended converting formats (i.e. the cache
may simply be discarded).
-Layout version 1.1
-------------------
+## Layout version 2.02
+
+The version 2 layout stores cache entries in a hash map thus only uses
+memory proportional to the number of entries present removing the need
+for large fixed size indexes.
+
+The object identifier is generated from nsurl_hash() and data entries
+are stored in either a fixed size disc blocks or in separate files on disc.
+
+The file path if stored on disc must conform to the limitations of all
+the filesystems the cache can be placed upon.
+
+From http://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits the relevant subset is:
+ - path elements no longer than 8 characters
+ - acceptable characters are A-Z, 0-9
+ - short total path lengths (255 or less)
+ - no more than 77 entries per directory (6bits worth)
+
+The short total path lengths mean the encoding must represent as much
+data as possible in the least number of characters.
+
+To achieve all these goals we use RFC4648 base32 encoding which packs
+five bits into each character of the filename. By splitting the 32bit
+identifier using six bits per directory level only five levels of
+directory are required with a maximum of 64 entries per
+directory. This requires a total path length of 22 bytes (including
+directory separators) BA/BB/BC/BD/BE/ABCDEFG
+
+Files that are under 8KiB in size are stored in "small block files"
+these are pre allocated 8 Megabyte files on disc in which remove the
+need to have many, many small files stored on disc at the expensie of
+a some amount of wasted space for files that are smaller than the 8K
+block size.
-An object has an identifier value generated from the URL (NetSurf
-backing stores uses the URL as the unique key). The value used is
-obtained using nsurl_hash() which is currently a 32 bit FNV so is
-directly usable.
+## Layout version 1.1
+
+An object has an identifier value generated from the URL (the unique
+key). The value used is obtained using nsurl_hash() which is currently
+a 32 bit FNV so is directly usable.
This identifier is adequate to ensure the collision rate for the
hashed URL values (a collision for every 2^16 URLs added) is
@@ -83,26 +125,23 @@ resulting in the data being stored in a file path of
An address of 0x00040001 encodes to BAAB and a file path of
"/store/prefix/m/B/A/A/BAABAAA"
-Version 1.0
------------
+## Layout Version 1.0
-The version 1 layout was identical to the 1.1 except base64url
+The version 1.0 layout was identical to the 1.1 except base64url
encoding was used, this proved problematic as some systems filesystems
were case insensitive so upper and lower case letters collided.
There is no upgrade provision from the previous version simply delete
the cache directory.
-Control files
-~~~~~~~~~~~~~
+## Control files
+
+### control
-control
-+++++++
A control file is used to hold a list of values describing how the
other files in the backing store should be used.
-entries
-+++++++
+### entries
this file contains a table of entries describing the files held on the
filesystem.
@@ -110,26 +149,18 @@ filesystem.
Each control file table entry is 28 bytes and consists of
- signed 64 bit value for last use time
-
- 32bit full url hash allowing for index reconstruction and
additional collision detection. Also the possibility of increasing
the ADDRESS_LENGTH although this would require renaming all the
existing files in the cache and is not currently implemented.
-
- unsigned 32bit length for data
-
- unsigned 32bit length for metadata
-
- unsigned 16bit value for number of times used.
-
- unsigned 16bit value for flags
-
- unsigned 16bit value for data block index (unused)
-
- unsigned 16bit value for metatdata block index (unused)
-Address to entry index
-~~~~~~~~~~~~~~~~~~~~~~
+### Address to entry index
An entry index is held in RAM that allows looking up the address to
map to an entry in the control file.
@@ -137,14 +168,13 @@ map to an entry in the control file.
The index is the only data structure whose size is directly dependant
on the length of the hash specifically:
-(2 ^ (ADDRESS_BITS - 3)) * ENTRY_BITS) in bytes
+ (2 ^ (ADDRESS_BITS - 3)) * ENTRY_BITS) in bytes
where ADDRESS_BITS is how long the address is in bits and ENTRY_BITS
is how many entries the control file (and hence the while
cache) may hold.
-RISCOS values
-+++++++++++++
+## RISCOS values
By limiting the ENTRY_BITS size to 14 (16,384 entries) the entries
list is limited to 448kilobytes.
@@ -159,8 +189,7 @@ address) to happen roughly for every 2 ^ (ADDRESS_BITS / 2) = 2 ^ 9 =
512 objects stored. This roughly translates to a cache miss due to
collision every ten pages navigated to.
-Larger systems
-++++++++++++++
+## Larger systems
In general ENTRY_BITS set to 16 as this limits the store to 65536
objects which given the average size of an object at 8 kilobytes
@@ -170,11 +199,9 @@ For larger systems e.g. those using GTK frontend we would most likely
select ADDRESS_BITS as 22 resulting in a collision every 2048 objects
but the index using some 8 Megabytes
-Typical values
---------------
+## Typical values
-Example 1
-~~~~~~~~~
+### Example 1
For a store with 1034 objects generated from a random navigation of
pages linked from the about:welcome page.
@@ -185,8 +212,7 @@ majority of the storage is used to hold the URLs and headers.
Data total size is 9180475 bytes a mean of 8879 bytes 1648726 in the
largest 10 entries which if excluded gives 7355 bytes average size
-Example 2
-~~~~~~~~~
+### Example 2
355 pages navigated in 80 minutes from about:welcome page and a
handful of additional sites (google image search and reddit)
@@ -201,4 +227,4 @@ with one single 5,000,811 byte gif
data totals without gif is 28,127,020 mean 13,945
-[1] http://tools.ietf.org/html/rfc2616#section-13
\ No newline at end of file
+[1] http://tools.ietf.org/html/rfc2616#section-13
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=51dc59ecc946490e513...
commit 51dc59ecc946490e51350401caf970b3d373b20a
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove unused constants
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 458866c..7c10498 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -55,16 +55,13 @@
#include "content/backing_store.h"
-/** Default number of bits of the ident to use in index hash */
-#define DEFAULT_IDENT_SIZE 20
-
-/** Default number of bits to use for an entry index. */
-#define DEFAULT_ENTRY_SIZE 16
-
/** Backing store file format version */
#define CONTROL_VERSION 202
-/** Number of milliseconds after a update before control data maintenance is performed */
+/**
+ * Number of milliseconds after a update before control data
+ * maintenance is performed
+ */
#define CONTROL_MAINT_TIME 10000
/** Filename of serialised entries */
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 11 ++--
docs/source-object-backing-store.md | 120 +++++++++++++++++++++--------------
2 files changed, 77 insertions(+), 54 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 458866c..7c10498 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -55,16 +55,13 @@
#include "content/backing_store.h"
-/** Default number of bits of the ident to use in index hash */
-#define DEFAULT_IDENT_SIZE 20
-
-/** Default number of bits to use for an entry index. */
-#define DEFAULT_ENTRY_SIZE 16
-
/** Backing store file format version */
#define CONTROL_VERSION 202
-/** Number of milliseconds after a update before control data maintenance is performed */
+/**
+ * Number of milliseconds after a update before control data
+ * maintenance is performed
+ */
#define CONTROL_MAINT_TIME 10000
/** Filename of serialised entries */
diff --git a/docs/source-object-backing-store.md b/docs/source-object-backing-store.md
index 0fb3614..4fb6620 100644
--- a/docs/source-object-backing-store.md
+++ b/docs/source-object-backing-store.md
@@ -1,26 +1,36 @@
Source Object (low level) cache backing store
=============================================
-Introduction
-------------
+[TOC]
-The source object cache provides a system to extend the life of source
-objects (HTML files, images etc.) after they are no longer immediately
-being used.
+# Introduction
-Only fetch types where we have well defined rules on caching are
-considered, in practice this limits us to HTTP(S). The section in
-RFC2616 [1] on caching specifies these rules.
+The source object (referred to as low level in the code) content cache
+provides a unified API for the rest of the browser to retrieve objects
+(HTML files, images etc.) from a URL.
+
+The cache initialy always fufuls these requsts by using the fetcher
+system to retrive data according to the URL scheme (network for HTTP,
+disc for file etc.) and storing the result in memory.
+
+The cache also provides a system to extend the life of source objects
+in memory when they are no longer immediately being used. Only fetch
+types where there are well defined rules on caching are considered, in
+practice this limits the cache to URLS with HTTP(S) schemes. The
+section in RFC2616 [1] on caching specifies these rules.
To further extend the objects lifetime they can be pushed into a
backing store where the objects are available for reuse less quickly
-than from RAM but faster than retrieving from the network again.
+than from memory but faster than retrieving from the network again.
The backing store implementation provides a key:value infrastructure
with a simple store, retrieve and invalidate interface.
-Generic filesystem backing store
---------------------------------
+The key is the object URL which by definition is unique for a source
+object. The value is the source object data *and* the associated
+metadata
+
+# Generic filesystem backing store
Although the backing store interface is fully pluggable a generic
implementation based on storing objects on the filesystem in a
@@ -34,13 +44,45 @@ As the backing store only holds cache data one should not expect a
great deal of effort to be expended converting formats (i.e. the cache
may simply be discarded).
-Layout version 1.1
-------------------
+## Layout version 2.02
+
+The version 2 layout stores cache entries in a hash map thus only uses
+memory proportional to the number of entries present removing the need
+for large fixed size indexes.
+
+The object identifier is generated from nsurl_hash() and data entries
+are stored in either a fixed size disc blocks or in separate files on disc.
+
+The file path if stored on disc must conform to the limitations of all
+the filesystems the cache can be placed upon.
+
+From http://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits the relevant subset is:
+ - path elements no longer than 8 characters
+ - acceptable characters are A-Z, 0-9
+ - short total path lengths (255 or less)
+ - no more than 77 entries per directory (6bits worth)
+
+The short total path lengths mean the encoding must represent as much
+data as possible in the least number of characters.
+
+To achieve all these goals we use RFC4648 base32 encoding which packs
+five bits into each character of the filename. By splitting the 32bit
+identifier using six bits per directory level only five levels of
+directory are required with a maximum of 64 entries per
+directory. This requires a total path length of 22 bytes (including
+directory separators) BA/BB/BC/BD/BE/ABCDEFG
+
+Files that are under 8KiB in size are stored in "small block files"
+these are pre allocated 8 Megabyte files on disc in which remove the
+need to have many, many small files stored on disc at the expensie of
+a some amount of wasted space for files that are smaller than the 8K
+block size.
-An object has an identifier value generated from the URL (NetSurf
-backing stores uses the URL as the unique key). The value used is
-obtained using nsurl_hash() which is currently a 32 bit FNV so is
-directly usable.
+## Layout version 1.1
+
+An object has an identifier value generated from the URL (the unique
+key). The value used is obtained using nsurl_hash() which is currently
+a 32 bit FNV so is directly usable.
This identifier is adequate to ensure the collision rate for the
hashed URL values (a collision for every 2^16 URLs added) is
@@ -83,26 +125,23 @@ resulting in the data being stored in a file path of
An address of 0x00040001 encodes to BAAB and a file path of
"/store/prefix/m/B/A/A/BAABAAA"
-Version 1.0
------------
+## Layout Version 1.0
-The version 1 layout was identical to the 1.1 except base64url
+The version 1.0 layout was identical to the 1.1 except base64url
encoding was used, this proved problematic as some systems filesystems
were case insensitive so upper and lower case letters collided.
There is no upgrade provision from the previous version simply delete
the cache directory.
-Control files
-~~~~~~~~~~~~~
+## Control files
+
+### control
-control
-+++++++
A control file is used to hold a list of values describing how the
other files in the backing store should be used.
-entries
-+++++++
+### entries
this file contains a table of entries describing the files held on the
filesystem.
@@ -110,26 +149,18 @@ filesystem.
Each control file table entry is 28 bytes and consists of
- signed 64 bit value for last use time
-
- 32bit full url hash allowing for index reconstruction and
additional collision detection. Also the possibility of increasing
the ADDRESS_LENGTH although this would require renaming all the
existing files in the cache and is not currently implemented.
-
- unsigned 32bit length for data
-
- unsigned 32bit length for metadata
-
- unsigned 16bit value for number of times used.
-
- unsigned 16bit value for flags
-
- unsigned 16bit value for data block index (unused)
-
- unsigned 16bit value for metatdata block index (unused)
-Address to entry index
-~~~~~~~~~~~~~~~~~~~~~~
+### Address to entry index
An entry index is held in RAM that allows looking up the address to
map to an entry in the control file.
@@ -137,14 +168,13 @@ map to an entry in the control file.
The index is the only data structure whose size is directly dependant
on the length of the hash specifically:
-(2 ^ (ADDRESS_BITS - 3)) * ENTRY_BITS) in bytes
+ (2 ^ (ADDRESS_BITS - 3)) * ENTRY_BITS) in bytes
where ADDRESS_BITS is how long the address is in bits and ENTRY_BITS
is how many entries the control file (and hence the while
cache) may hold.
-RISCOS values
-+++++++++++++
+## RISCOS values
By limiting the ENTRY_BITS size to 14 (16,384 entries) the entries
list is limited to 448kilobytes.
@@ -159,8 +189,7 @@ address) to happen roughly for every 2 ^ (ADDRESS_BITS / 2) = 2 ^ 9 =
512 objects stored. This roughly translates to a cache miss due to
collision every ten pages navigated to.
-Larger systems
-++++++++++++++
+## Larger systems
In general ENTRY_BITS set to 16 as this limits the store to 65536
objects which given the average size of an object at 8 kilobytes
@@ -170,11 +199,9 @@ For larger systems e.g. those using GTK frontend we would most likely
select ADDRESS_BITS as 22 resulting in a collision every 2048 objects
but the index using some 8 Megabytes
-Typical values
---------------
+## Typical values
-Example 1
-~~~~~~~~~
+### Example 1
For a store with 1034 objects generated from a random navigation of
pages linked from the about:welcome page.
@@ -185,8 +212,7 @@ majority of the storage is used to hold the URLs and headers.
Data total size is 9180475 bytes a mean of 8879 bytes 1648726 in the
largest 10 entries which if excluded gives 7355 bytes average size
-Example 2
-~~~~~~~~~
+### Example 2
355 pages navigated in 80 minutes from about:welcome page and a
handful of additional sites (google image search and reddit)
@@ -201,4 +227,4 @@ with one single 5,000,811 byte gif
data totals without gif is 28,127,020 mean 13,945
-[1] http://tools.ietf.org/html/rfc2616#section-13
\ No newline at end of file
+[1] http://tools.ietf.org/html/rfc2616#section-13
--
NetSurf Browser
2 years, 11 months
netsurf: branch master updated. release/3.9-573-g1053bcd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1053bcd3c1bf402654645...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1053bcd3c1bf402654645f3...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1053bcd3c1bf402654645f342...
The branch, master has been updated
via 1053bcd3c1bf402654645f34252db51a781b5af2 (commit)
from 34508fc3cdd73ddb7a9532e434af4a561404507f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1053bcd3c1bf4026546...
commit 1053bcd3c1bf402654645f34252db51a781b5af2
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Makefile: Add STMTEXPR detection for wapcaplet
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/Makefile b/Makefile
index f8b5e9c..ae1325f 100644
--- a/Makefile
+++ b/Makefile
@@ -600,6 +600,13 @@ CXXFLAGS += -DNETSURF_BUILTIN_LOG_FILTER=\"$(NETSURF_BUILTIN_LOG_FILTER)\"
CFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
CXXFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
+# Determine if the C compiler supports statement expressions
+# This is needed to permit certain optimisations in our library headers
+ifneq ($(shell $(CC) -dM -E - < /dev/null | grep __GNUC__),)
+CFLAGS += -DSTMTEXPR=1
+CXXFLAGS += -DSTMTEXPR=1
+endif
+
# ----------------------------------------------------------------------------
# General make rules
# ----------------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
Makefile | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Makefile b/Makefile
index f8b5e9c..ae1325f 100644
--- a/Makefile
+++ b/Makefile
@@ -600,6 +600,13 @@ CXXFLAGS += -DNETSURF_BUILTIN_LOG_FILTER=\"$(NETSURF_BUILTIN_LOG_FILTER)\"
CFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
CXXFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
+# Determine if the C compiler supports statement expressions
+# This is needed to permit certain optimisations in our library headers
+ifneq ($(shell $(CC) -dM -E - < /dev/null | grep __GNUC__),)
+CFLAGS += -DSTMTEXPR=1
+CXXFLAGS += -DSTMTEXPR=1
+endif
+
# ----------------------------------------------------------------------------
# General make rules
# ----------------------------------------------------------------------------
--
NetSurf Browser
2 years, 11 months
libdom: branch master updated. release/0.4.0-13-gce5bfc2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libdom.git/shortlog/ce5bfc251e49ac7e5d657b...
...commit http://git.netsurf-browser.org/libdom.git/commit/ce5bfc251e49ac7e5d657b3a...
...tree http://git.netsurf-browser.org/libdom.git/tree/ce5bfc251e49ac7e5d657b3a9b...
The branch, master has been updated
via ce5bfc251e49ac7e5d657b3a9b579c2578698277 (commit)
from 36937ce1ad1417b7ca08b565023dc345b168291d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libdom.git/commit/?id=ce5bfc251e49ac7e5d65...
commit ce5bfc251e49ac7e5d657b3a9b579c2578698277
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Bindings: source is a hubbub_charset_source really
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 2dd116f..a84a951 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -642,7 +642,7 @@ static hubbub_error set_quirks_mode(void *parser, hubbub_quirks_mode mode)
static hubbub_error change_encoding(void *parser, const char *charset)
{
dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser;
- uint32_t source;
+ hubbub_charset_source source;
const char *name;
/* If we have an encoding here, it means we are *certain* */
-----------------------------------------------------------------------
Summary of changes:
bindings/hubbub/parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 2dd116f..a84a951 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -642,7 +642,7 @@ static hubbub_error set_quirks_mode(void *parser, hubbub_quirks_mode mode)
static hubbub_error change_encoding(void *parser, const char *charset)
{
dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser;
- uint32_t source;
+ hubbub_charset_source source;
const char *name;
/* If we have an encoding here, it means we are *certain* */
--
Document Object Model library
2 years, 11 months
libwapcaplet: branch master updated. release/0.4.2-2-g9df4abc
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libwapcaplet.git/shortlog/9df4abc696ec938f...
...commit http://git.netsurf-browser.org/libwapcaplet.git/commit/9df4abc696ec938f18...
...tree http://git.netsurf-browser.org/libwapcaplet.git/tree/9df4abc696ec938f184c...
The branch, master has been updated
via 9df4abc696ec938f184ca8e345c379f9b6499ccc (commit)
from 5b1700a8917065508336c1318414daa6abb7ace2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libwapcaplet.git/commit/?id=9df4abc696ec93...
commit 9df4abc696ec938f184ca8e345c379f9b6499ccc
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
includes: Use new STMTEXPR support
With this new support, we can ensure we don't use statement
expressions unless the toolchain tells us we can.
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/include/libwapcaplet/libwapcaplet.h b/include/libwapcaplet/libwapcaplet.h
index e4c2cc9..57e2e48 100644
--- a/include/libwapcaplet/libwapcaplet.h
+++ b/include/libwapcaplet/libwapcaplet.h
@@ -133,7 +133,17 @@ extern lwc_error lwc_string_tolower(lwc_string *str, lwc_string **ret);
* @note Use this if copying the string and intending both sides to retain
* ownership.
*/
+#if defined(STMTEXPR)
#define lwc_string_ref(str) ({lwc_string *__lwc_s = (str); assert(__lwc_s != NULL); __lwc_s->refcnt++; __lwc_s;})
+#else
+static inline lwc_string *
+lwc_string_ref(lwc_string *str)
+{
+ assert(str != NULL);
+ str->refcnt++;
+ return str;
+}
+#endif
/**
* Release a reference on an lwc_string.
@@ -177,6 +187,21 @@ extern void lwc_string_destroy(lwc_string *str);
((*(ret) = ((str1) == (str2))), lwc_error_ok)
/**
+ * Intern a caseless copy of the passed string.
+ *
+ * @param str The string to intern the caseless copy of.
+ *
+ * @return lwc_error_ok if successful, otherwise the
+ * error code describing the issue.,
+ *
+ * @note This is for "internal" use by the caseless comparison
+ * macro and not for users.
+ */
+extern lwc_error
+lwc__intern_caseless_string(lwc_string *str);
+
+#if defined(STMTEXPR)
+/**
* Check if two interned strings are case-insensitively equal.
*
* @param _str1 The first string in the comparison.
@@ -202,19 +227,37 @@ extern void lwc_string_destroy(lwc_string *str);
__lwc_err; \
})
+#else
/**
- * Intern a caseless copy of the passed string.
- *
- * @param str The string to intern the caseless copy of.
- *
- * @return lwc_error_ok if successful, otherwise the
- * error code describing the issue.,
+ * Check if two interned strings are case-insensitively equal.
*
- * @note This is for "internal" use by the caseless comparison
- * macro and not for users.
- */
-extern lwc_error
-lwc__intern_caseless_string(lwc_string *str);
+ * @param str1 The first string in the comparison.
+ * @param str2 The second string in the comparison.
+ * @param ret A pointer to a boolean to be filled out with the result.
+ * @return Result of operation, if not ok then value pointed to by \a ret will
+ * not be valid.
+ */
+static inline lwc_error
+lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
+{
+ lwc_error err = lwc_error_ok;
+ if (str1->insensitive == NULL) {
+ err = lwc__intern_caseless_string(str1);
+ }
+ if (err == lwc_error_ok && str2->insensitive == NULL) {
+ err = lwc__intern_caseless_string(str2);
+ }
+ if (err == lwc_error_ok)
+ *ret = (str1->insensitive == str2->insensitive);
+ return err;
+}
+#endif
+
+#if defined(STMTEXPR)
+#define lwc__assert_and_expr(str, expr) ({assert(str != NULL); expr;})
+#else
+#define lwc__assert_and_expr(str, expr) (expr)
+#endif
/**
* Retrieve the data pointer for an interned string.
@@ -228,7 +271,7 @@ lwc__intern_caseless_string(lwc_string *str);
* in future. Any code relying on it currently should be
* modified to use ::lwc_string_length if possible.
*/
-#define lwc_string_data(str) ({assert(str != NULL); (const char *)((str)+1);})
+#define lwc_string_data(str) lwc__assert_and_expr(str, (const char *)((str)+1))
/**
* Retrieve the data length for an interned string.
@@ -236,7 +279,7 @@ lwc__intern_caseless_string(lwc_string *str);
* @param str The string to retrieve the length of.
* @return The length of \a str.
*/
-#define lwc_string_length(str) ({assert(str != NULL); (str)->len;})
+#define lwc_string_length(str) lwc__assert_and_expr(str, (str)->len)
/**
* Retrieve (or compute if unavailable) a hash value for the content of the string.
@@ -250,7 +293,7 @@ lwc__intern_caseless_string(lwc_string *str);
* to be stable between invocations of the program. Never use the hash
* value as a way to directly identify the value of the string.
*/
-#define lwc_string_hash_value(str) ({assert(str != NULL); (str)->hash;})
+#define lwc_string_hash_value(str) lwc__assert_and_expr(str, (str)->hash)
/**
* Retrieve a hash value for the caseless content of the string.
-----------------------------------------------------------------------
Summary of changes:
include/libwapcaplet/libwapcaplet.h | 71 ++++++++++++++++++++++++++++-------
1 file changed, 57 insertions(+), 14 deletions(-)
diff --git a/include/libwapcaplet/libwapcaplet.h b/include/libwapcaplet/libwapcaplet.h
index e4c2cc9..57e2e48 100644
--- a/include/libwapcaplet/libwapcaplet.h
+++ b/include/libwapcaplet/libwapcaplet.h
@@ -133,7 +133,17 @@ extern lwc_error lwc_string_tolower(lwc_string *str, lwc_string **ret);
* @note Use this if copying the string and intending both sides to retain
* ownership.
*/
+#if defined(STMTEXPR)
#define lwc_string_ref(str) ({lwc_string *__lwc_s = (str); assert(__lwc_s != NULL); __lwc_s->refcnt++; __lwc_s;})
+#else
+static inline lwc_string *
+lwc_string_ref(lwc_string *str)
+{
+ assert(str != NULL);
+ str->refcnt++;
+ return str;
+}
+#endif
/**
* Release a reference on an lwc_string.
@@ -177,6 +187,21 @@ extern void lwc_string_destroy(lwc_string *str);
((*(ret) = ((str1) == (str2))), lwc_error_ok)
/**
+ * Intern a caseless copy of the passed string.
+ *
+ * @param str The string to intern the caseless copy of.
+ *
+ * @return lwc_error_ok if successful, otherwise the
+ * error code describing the issue.,
+ *
+ * @note This is for "internal" use by the caseless comparison
+ * macro and not for users.
+ */
+extern lwc_error
+lwc__intern_caseless_string(lwc_string *str);
+
+#if defined(STMTEXPR)
+/**
* Check if two interned strings are case-insensitively equal.
*
* @param _str1 The first string in the comparison.
@@ -202,19 +227,37 @@ extern void lwc_string_destroy(lwc_string *str);
__lwc_err; \
})
+#else
/**
- * Intern a caseless copy of the passed string.
- *
- * @param str The string to intern the caseless copy of.
- *
- * @return lwc_error_ok if successful, otherwise the
- * error code describing the issue.,
+ * Check if two interned strings are case-insensitively equal.
*
- * @note This is for "internal" use by the caseless comparison
- * macro and not for users.
- */
-extern lwc_error
-lwc__intern_caseless_string(lwc_string *str);
+ * @param str1 The first string in the comparison.
+ * @param str2 The second string in the comparison.
+ * @param ret A pointer to a boolean to be filled out with the result.
+ * @return Result of operation, if not ok then value pointed to by \a ret will
+ * not be valid.
+ */
+static inline lwc_error
+lwc_string_caseless_isequal(lwc_string *str1, lwc_string *str2, bool *ret)
+{
+ lwc_error err = lwc_error_ok;
+ if (str1->insensitive == NULL) {
+ err = lwc__intern_caseless_string(str1);
+ }
+ if (err == lwc_error_ok && str2->insensitive == NULL) {
+ err = lwc__intern_caseless_string(str2);
+ }
+ if (err == lwc_error_ok)
+ *ret = (str1->insensitive == str2->insensitive);
+ return err;
+}
+#endif
+
+#if defined(STMTEXPR)
+#define lwc__assert_and_expr(str, expr) ({assert(str != NULL); expr;})
+#else
+#define lwc__assert_and_expr(str, expr) (expr)
+#endif
/**
* Retrieve the data pointer for an interned string.
@@ -228,7 +271,7 @@ lwc__intern_caseless_string(lwc_string *str);
* in future. Any code relying on it currently should be
* modified to use ::lwc_string_length if possible.
*/
-#define lwc_string_data(str) ({assert(str != NULL); (const char *)((str)+1);})
+#define lwc_string_data(str) lwc__assert_and_expr(str, (const char *)((str)+1))
/**
* Retrieve the data length for an interned string.
@@ -236,7 +279,7 @@ lwc__intern_caseless_string(lwc_string *str);
* @param str The string to retrieve the length of.
* @return The length of \a str.
*/
-#define lwc_string_length(str) ({assert(str != NULL); (str)->len;})
+#define lwc_string_length(str) lwc__assert_and_expr(str, (str)->len)
/**
* Retrieve (or compute if unavailable) a hash value for the content of the string.
@@ -250,7 +293,7 @@ lwc__intern_caseless_string(lwc_string *str);
* to be stable between invocations of the program. Never use the hash
* value as a way to directly identify the value of the string.
*/
-#define lwc_string_hash_value(str) ({assert(str != NULL); (str)->hash;})
+#define lwc_string_hash_value(str) lwc__assert_and_expr(str, (str)->hash)
/**
* Retrieve a hash value for the caseless content of the string.
--
String internment library
2 years, 11 months
buildsystem: branch master updated. release/1.8-5-g3246c9f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/buildsystem.git/shortlog/3246c9f04267b117b...
...commit http://git.netsurf-browser.org/buildsystem.git/commit/3246c9f04267b117b4f...
...tree http://git.netsurf-browser.org/buildsystem.git/tree/3246c9f04267b117b4f46...
The branch, master has been updated
via 3246c9f04267b117b4f464d9eef39b7ef7a70a7f (commit)
from 1bec35860a7140712eed1c26e57285803e61b557 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/buildsystem.git/commit/?id=3246c9f04267b11...
commit 3246c9f04267b117b4f464d9eef39b7ef7a70a7f
Author: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Commit: Daniel Silverstone <dsilvers(a)digital-scurf.org>
Makefiles: Add -DSTMTEXPR=1 for gcc compatible toolchains
Signed-off-by: Daniel Silverstone <dsilvers(a)digital-scurf.org>
diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 2a11a5b..50f8a82 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -26,7 +26,7 @@ LDSHR = -shared -Wl,-soname,$(SONAME)
ARFLG := cru
# Definitions of various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for sanitize target
ifeq ($(MAKECMDGOALS),sanitize)
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index 7d70bc1..b5119ac 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -25,7 +25,7 @@ LDSHR = -shared -Wl,-soname,$(SONAME)
ARFLG := cru
# Definitions for various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for coverage target
ifeq ($(MAKECMDGOALS),coverage)
diff --git a/makefiles/Makefile.open64 b/makefiles/Makefile.open64
index b58569c..142474a 100644
--- a/makefiles/Makefile.open64
+++ b/makefiles/Makefile.open64
@@ -27,7 +27,7 @@ LDFLAGS := $(LDFLAGS) -ipa
ARFLG := cru
# Definitions for various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for coverage target
ifeq ($(MAKECMDGOALS),coverage)
-----------------------------------------------------------------------
Summary of changes:
makefiles/Makefile.clang | 2 +-
makefiles/Makefile.gcc | 2 +-
makefiles/Makefile.open64 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 2a11a5b..50f8a82 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -26,7 +26,7 @@ LDSHR = -shared -Wl,-soname,$(SONAME)
ARFLG := cru
# Definitions of various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for sanitize target
ifeq ($(MAKECMDGOALS),sanitize)
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index 7d70bc1..b5119ac 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -25,7 +25,7 @@ LDSHR = -shared -Wl,-soname,$(SONAME)
ARFLG := cru
# Definitions for various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for coverage target
ifeq ($(MAKECMDGOALS),coverage)
diff --git a/makefiles/Makefile.open64 b/makefiles/Makefile.open64
index b58569c..142474a 100644
--- a/makefiles/Makefile.open64
+++ b/makefiles/Makefile.open64
@@ -27,7 +27,7 @@ LDFLAGS := $(LDFLAGS) -ipa
ARFLG := cru
# Definitions for various attributes
-CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
+CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))" -DSTMTEXPR=1
# Extensions for coverage target
ifeq ($(MAKECMDGOALS),coverage)
--
NetSurf Project build system
2 years, 11 months
netsurf: branch master updated. release/3.9-572-g34508fc
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/34508fc3cdd73ddb7a953...
...commit http://git.netsurf-browser.org/netsurf.git/commit/34508fc3cdd73ddb7a9532e...
...tree http://git.netsurf-browser.org/netsurf.git/tree/34508fc3cdd73ddb7a9532e43...
The branch, master has been updated
via 34508fc3cdd73ddb7a9532e434af4a561404507f (commit)
via 959c561eb3d69e336e1d2342d230a7c87aec9493 (commit)
from 06b709f71a7e1ac2bb2b17d99bd155e4a993963d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=34508fc3cdd73ddb7a9...
commit 34508fc3cdd73ddb7a9532e434af4a561404507f
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
For some reason atari mkdir_all operation was using the wrong path separator
diff --git a/frontends/atari/file.c b/frontends/atari/file.c
index 235d824..81b67e8 100644
--- a/frontends/atari/file.c
+++ b/frontends/atari/file.c
@@ -234,7 +234,7 @@ static nserror atari_mkdir_all(const char *fname)
dname = strdup(fname);
- sep = strrchr(dname, '/');
+ sep = strrchr(dname, '\\');
if (sep == NULL) {
/* no directory separator path is just filename so its ok */
free(dname);
@@ -251,13 +251,13 @@ static nserror atari_mkdir_all(const char *fname)
}
return NSERROR_NOT_DIRECTORY;
}
- *sep = '/'; /* restore separator */
+ *sep = '\\'; /* restore separator */
sep = dname;
- while (*sep == '/') {
+ while (*sep == '\\') {
sep++;
}
- while ((sep = strchr(sep, '/')) != NULL) {
+ while ((sep = strchr(sep, '\\')) != NULL) {
*sep = 0;
if (stat(dname, &sb) != 0) {
if (nsmkdir(dname, S_IRWXU) != 0) {
@@ -272,9 +272,9 @@ static nserror atari_mkdir_all(const char *fname)
return NSERROR_NOT_DIRECTORY;
}
}
- *sep = '/'; /* restore separator */
+ *sep = '\\'; /* restore separator */
/* skip directory separators */
- while (*sep == '/') {
+ while (*sep == '\\') {
sep++;
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=959c561eb3d69e336e1...
commit 959c561eb3d69e336e1d2342d230a7c87aec9493
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
unit testing table of contents marker was wrong case
diff --git a/docs/unit-testing.md b/docs/unit-testing.md
index 054c8e5..f7adc82 100644
--- a/docs/unit-testing.md
+++ b/docs/unit-testing.md
@@ -1,7 +1,7 @@
NetSurf Unit Testing
====================
-[toc]
+[TOC]
# Overview
-----------------------------------------------------------------------
Summary of changes:
docs/unit-testing.md | 2 +-
frontends/atari/file.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/unit-testing.md b/docs/unit-testing.md
index 054c8e5..f7adc82 100644
--- a/docs/unit-testing.md
+++ b/docs/unit-testing.md
@@ -1,7 +1,7 @@
NetSurf Unit Testing
====================
-[toc]
+[TOC]
# Overview
diff --git a/frontends/atari/file.c b/frontends/atari/file.c
index 235d824..81b67e8 100644
--- a/frontends/atari/file.c
+++ b/frontends/atari/file.c
@@ -234,7 +234,7 @@ static nserror atari_mkdir_all(const char *fname)
dname = strdup(fname);
- sep = strrchr(dname, '/');
+ sep = strrchr(dname, '\\');
if (sep == NULL) {
/* no directory separator path is just filename so its ok */
free(dname);
@@ -251,13 +251,13 @@ static nserror atari_mkdir_all(const char *fname)
}
return NSERROR_NOT_DIRECTORY;
}
- *sep = '/'; /* restore separator */
+ *sep = '\\'; /* restore separator */
sep = dname;
- while (*sep == '/') {
+ while (*sep == '\\') {
sep++;
}
- while ((sep = strchr(sep, '/')) != NULL) {
+ while ((sep = strchr(sep, '\\')) != NULL) {
*sep = 0;
if (stat(dname, &sb) != 0) {
if (nsmkdir(dname, S_IRWXU) != 0) {
@@ -272,9 +272,9 @@ static nserror atari_mkdir_all(const char *fname)
return NSERROR_NOT_DIRECTORY;
}
}
- *sep = '/'; /* restore separator */
+ *sep = '\\'; /* restore separator */
/* skip directory separators */
- while (*sep == '/') {
+ while (*sep == '\\') {
sep++;
}
}
--
NetSurf Browser
2 years, 12 months
netsurf-test: branch master updated. ea2f3b60383166c576c446d092b3a98eb114feb7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-test.git/shortlog/ea2f3b60383166c5...
...commit http://git.netsurf-browser.org/netsurf-test.git/commit/ea2f3b60383166c576...
...tree http://git.netsurf-browser.org/netsurf-test.git/tree/ea2f3b60383166c576c4...
The branch, master has been updated
via ea2f3b60383166c576c446d092b3a98eb114feb7 (commit)
from f3ec99cee86cb5ee8057d2cf1971ea44d2de2bb8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-test.git/commit/?id=ea2f3b60383166...
commit ea2f3b60383166c576c446d092b3a98eb114feb7
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
test about scheme
diff --git a/monkey-test/about-scheme.yaml b/monkey-test/about-scheme.yaml
new file mode 100644
index 0000000..c1db719
--- /dev/null
+++ b/monkey-test/about-scheme.yaml
@@ -0,0 +1,173 @@
+title: about scheme
+group: no-networking
+steps:
+- action: launch
+ language: en
+- action: window-new
+ tag: win1
+# ensure 404 behaviour
+- action: navigate
+ window: win1
+ url: about:does-not-exist
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: "Unknown page: about:does-not-exist"
+# check about:credits
+- action: navigate
+ window: win1
+ url: about:credits
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Credits
+ - bitmap-count: 1
+# check about:licence
+- action: navigate
+ window: win1
+ url: about:licence
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Licence
+ - bitmap-count: 1
+# check about:license
+- action: navigate
+ window: win1
+ url: about:license
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Licence
+ - bitmap-count: 1
+# check about:welcome
+- action: navigate
+ window: win1
+ url: about:welcome
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Welcome to NetSurf
+ - bitmap-count: 1
+# check about:config
+- action: navigate
+ window: win1
+ url: about:config
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Browser Config
+ - bitmap-count: 1
+# check about:Choices
+- action: navigate
+ window: win1
+ url: about:Choices
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Automatically generated current NetSurf browser Choices
+# check testament
+- action: navigate
+ window: win1
+ url: about:testament
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Automatically generated by NetSurf build system
+# check about
+- action: navigate
+ window: win1
+ url: about:about
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf List of About pages
+ - bitmap-count: 1
+# check logo
+- action: navigate
+ window: win1
+ url: about:logo
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - bitmap-count: 1
+# check imagecache
+- action: navigate
+ window: win1
+ url: about:imagecache
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Browser Image Cache Status
+ - bitmap-count: 1
+# check blank
+- action: navigate
+ window: win1
+ url: about:blank
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+# check certificate
+- action: navigate
+ window: win1
+ url: "about:certificate?cert=MIIHMzCCBhugAwIBAgISBEgH6UXBfQdBlws084Dpg65lMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQDExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTEyMTcwNTMxMzdaFw0yMDAzMTYwNTMxMzdaMB4xHDAaBgNVBAMTE25ldHN1cmYtYnJvd3Nlci5vcmcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDa4ZUDrnoaKKa-RGr6r259vfoLgoAtPwqjJm1cTq6dXZh3IFTgHwCnEh19Yha2iCROO9wDaoxlsBsR13ICnHqx7gq-r5eCLQQYXka2dHCVQ_JtPjDInEd7R_0vCHEfROMbkfXB_6jfVtDjWtqUI-5l5WC9zadB_Aqc0wIrxvdDGvjbbx_AYme5U-djKf6muy3sKPbP3LqMCe3zn6gtMItL8oAjAuW7SEoENdLtRLFUI0qHWpFZS8SZspxlDM9x0ecJhzd_ItNIk4LgIHfdFSHcFIvOFvq0HJs7Up6Ym6Cs2fftqQY527KPNwn926rqfAaUq2eogWb79RnG5TjqprokCXsK8hj6HLrBSeQz3utvYGanQEwF_IfCdC1TyrfXcuu0IbmDattzm5tFrkIrCHAy5BCzofcOvahMTCN4mKIZHeHsZsXVVWb5zSfUKP1EPkWcEkCEtJ_pBIeLJ84IekZh_6VWeXpP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JsWvIjJEubSfZGL-T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ"
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Certificate
+# close down
+- action: window-close
+ window: win1
+- action: quit
+
-----------------------------------------------------------------------
Summary of changes:
monkey-test/about-scheme.yaml | 173 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 173 insertions(+)
create mode 100644 monkey-test/about-scheme.yaml
diff --git a/monkey-test/about-scheme.yaml b/monkey-test/about-scheme.yaml
new file mode 100644
index 0000000..c1db719
--- /dev/null
+++ b/monkey-test/about-scheme.yaml
@@ -0,0 +1,173 @@
+title: about scheme
+group: no-networking
+steps:
+- action: launch
+ language: en
+- action: window-new
+ tag: win1
+# ensure 404 behaviour
+- action: navigate
+ window: win1
+ url: about:does-not-exist
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: "Unknown page: about:does-not-exist"
+# check about:credits
+- action: navigate
+ window: win1
+ url: about:credits
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Credits
+ - bitmap-count: 1
+# check about:licence
+- action: navigate
+ window: win1
+ url: about:licence
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Licence
+ - bitmap-count: 1
+# check about:license
+- action: navigate
+ window: win1
+ url: about:license
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Licence
+ - bitmap-count: 1
+# check about:welcome
+- action: navigate
+ window: win1
+ url: about:welcome
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Welcome to NetSurf
+ - bitmap-count: 1
+# check about:config
+- action: navigate
+ window: win1
+ url: about:config
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Browser Config
+ - bitmap-count: 1
+# check about:Choices
+- action: navigate
+ window: win1
+ url: about:Choices
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Automatically generated current NetSurf browser Choices
+# check testament
+- action: navigate
+ window: win1
+ url: about:testament
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Automatically generated by NetSurf build system
+# check about
+- action: navigate
+ window: win1
+ url: about:about
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf List of About pages
+ - bitmap-count: 1
+# check logo
+- action: navigate
+ window: win1
+ url: about:logo
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - bitmap-count: 1
+# check imagecache
+- action: navigate
+ window: win1
+ url: about:imagecache
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf Browser Image Cache Status
+ - bitmap-count: 1
+# check blank
+- action: navigate
+ window: win1
+ url: about:blank
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+# check certificate
+- action: navigate
+ window: win1
+ url: "about:certificate?cert=MIIHMzCCBhugAwIBAgISBEgH6UXBfQdBlws084Dpg65lMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQDExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTEyMTcwNTMxMzdaFw0yMDAzMTYwNTMxMzdaMB4xHDAaBgNVBAMTE25ldHN1cmYtYnJvd3Nlci5vcmcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDa4ZUDrnoaKKa-RGr6r259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_RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4-U9m5_wAl0CAwEAAaNCMEAwDwYDVR0TAQH_BAUwAwEB_zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62-FLkHX_xBVghYkQMA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or-Dxz9LwwmglSBd49lZRNI-DT69ikugdB_OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX-5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK-rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir_md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL-T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ"
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: Certificate
+# close down
+- action: window-close
+ window: win1
+- action: quit
+
--
NetSurf test cases
2 years, 12 months
netsurf: branch master updated. release/3.9-570-g06b709f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/06b709f71a7e1ac2bb2b1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/06b709f71a7e1ac2bb2b17d...
...tree http://git.netsurf-browser.org/netsurf.git/tree/06b709f71a7e1ac2bb2b17d99...
The branch, master has been updated
via 06b709f71a7e1ac2bb2b17d99bd155e4a993963d (commit)
via 5bc21c0467b2e6c8ed44f72c7ed42c7ebc4ce5ae (commit)
from fa1f1dcd1188ab80803b1ef0773020d1378dbfc4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=06b709f71a7e1ac2bb2...
commit 06b709f71a7e1ac2bb2b17d99bd155e4a993963d
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve unit testing documentation headers and code blocks
diff --git a/docs/unit-testing.md b/docs/unit-testing.md
index 49d82ed..054c8e5 100644
--- a/docs/unit-testing.md
+++ b/docs/unit-testing.md
@@ -1,8 +1,9 @@
NetSurf Unit Testing
====================
-Overview
---------
+[toc]
+
+# Overview
NetSurf has unit tests integrated in the test directory. These tests
use the check unit test framework for C [1].
@@ -13,8 +14,7 @@ programs although the framework does not madate this and some test
programs contain more than one suite.
-Execution
----------
+# Execution
The test programs are executed by using the standard "test" target
from the top level make invocation. The "coverage" target additionally
@@ -25,8 +25,7 @@ The check library must be installed to run the tests and the CI system
automatically executes all enabled tests and generates coverage
reports for each commit.
-Adding tests
-------------
+# Adding tests
The test/Makefile defines each indiviadual test program that should be
built and executed in the TESTS variable.
@@ -39,128 +38,128 @@ Each individual test program requires a main function which creates
one (or more) suites. The suites are added to a test runner and then
executed and the results reported.
-int main(int argc, char **argv)
-{
- int number_failed;
- SRunner *sr;
-
- sr = srunner_create(foo_suite_create());
- //srunner_add_suite(sr, bar_suite_create());
-
- srunner_run_all(sr, CK_ENV);
-
- number_failed = srunner_ntests_failed(sr);
- srunner_free(sr);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+ int main(int argc, char **argv)
+ {
+ int number_failed;
+ SRunner *sr;
+
+ sr = srunner_create(foo_suite_create());
+ //srunner_add_suite(sr, bar_suite_create());
+
+ srunner_run_all(sr, CK_ENV);
+
+ number_failed = srunner_ntests_failed(sr);
+ srunner_free(sr);
+
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
Suite creation is done with a sub function to logically split suite
code into sub modules. Each suite has test cases added to it.
-Suite *foo_suite_create(void)
-{
- Suite *s;
- s = suite_create("foo");
-
- suite_add_tcase(s, baz_case_create());
- suite_add_tcase(s, qux_case_create());
-
- return s;
-}
+ Suite *foo_suite_create(void)
+ {
+ Suite *s;
+ s = suite_create("foo");
+
+ suite_add_tcase(s, baz_case_create());
+ suite_add_tcase(s, qux_case_create());
+
+ return s;
+ }
Test cases include the actual tests to be performed within each case.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_test(tc, xxyz_test);
- tcase_add_test(tc, zzyx_test);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_test(tc, xxyz_test);
+ tcase_add_test(tc, zzyx_test);
+
+ return tc;
+ }
A test case may optionally have a fixture which is code that is
executed before and after each test case. Unchecked fixtures are
executed once before the test process forks for each test whereas
checked fixtures are executed for each and every test.
-static void fixture_setup(void)
-{
-}
-
-static void fixture_teardown(void)
-{
-}
-
-TCase *qux_case_create(void)
-{
- TCase *tc;
-
- /* Matching entry tests */
- tc = tcase_create("Match");
-
- tcase_add_checked_fixture(tc,
- fixture_setup,
- fixture_teardown);
-
- tcase_add_test(tc, zzz_test);
-
- return tc;
-}
+ static void fixture_setup(void)
+ {
+ }
+
+ static void fixture_teardown(void)
+ {
+ }
+
+ TCase *qux_case_create(void)
+ {
+ TCase *tc;
+
+ /* Matching entry tests */
+ tc = tcase_create("Match");
+
+ tcase_add_checked_fixture(tc,
+ fixture_setup,
+ fixture_teardown);
+
+ tcase_add_test(tc, zzz_test);
+
+ return tc;
+ }
Additionally test cases can contain tests executed in a loop. The test
recives a single integer as a parameter named _i which iterates
between values specified in the case setup.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_loop_test(tc, looping_test, 0, 5);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_loop_test(tc, looping_test, 0, 5);
+
+ return tc;
+ }
It is also possible to create tests which will generate a signal. The
most commonly used of these is to check asserts in API calls.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_test_raise_signal(tc, assert_test, 6);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_test_raise_signal(tc, assert_test, 6);
+
+ return tc;
+ }
Actual test code is self contained in a function which uses the
ck_assert macros to test results. The check framework requires each
test to use the START_TEST and END_TEST macros when definig them.
-/**
- * url access leaf test
- */
-START_TEST(nsurl_access_leaf_test)
-{
- nserror err;
- nsurl *res_url;
- const struct test_triplets *tst = &access_tests[_i];
-
- /* not testing create, this should always succeed */
- err = nsurl_create(tst->test1, &res_url);
- ck_assert(err == NSERROR_OK);
-
- ck_assert_str_eq(nsurl_access_leaf(res_url), tst->res);
-
- nsurl_unref(res_url);
-}
-END_TEST
+ /**
+ * url access leaf test
+ */
+ START_TEST(nsurl_access_leaf_test)
+ {
+ nserror err;
+ nsurl *res_url;
+ const struct test_triplets *tst = &access_tests[_i];
+
+ /* not testing create, this should always succeed */
+ err = nsurl_create(tst->test1, &res_url);
+ ck_assert(err == NSERROR_OK);
+
+ ck_assert_str_eq(nsurl_access_leaf(res_url), tst->res);
+
+ nsurl_unref(res_url);
+ }
+ END_TEST
[1] https://libcheck.github.io/check/
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5bc21c0467b2e6c8ed4...
commit 5bc21c0467b2e6c8ed44f72c7ed42c7ebc4ce5ae
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix use of headings in integration test document
diff --git a/docs/integration-testing.md b/docs/integration-testing.md
index defcc17..1191fba 100644
--- a/docs/integration-testing.md
+++ b/docs/integration-testing.md
@@ -1,8 +1,9 @@
NetSurf Integration Testing
===========================
-Overview
---------
+[TOC]
+
+# Overview
The monkey frontend is used to perform complex tests involving
operating the browser as a user might (opening windows, navigating to
@@ -26,8 +27,7 @@ known behaviours such as delays or returning specific content to
extend test capabilities.
-Running a test
---------------
+# Running a test
An individual test can be run using the monkey_driver.py python script
from within the NetSurf repository
@@ -43,8 +43,7 @@ For example to wrap execution under valgrind memory checker
$ ./test/monkey_driver.py -m ./nsmonkey -w 'valgrind -v --track-origins=yes' -t test/monkey-tests/start-stop.yaml
-Running more than one test
---------------------------
+# Running more than one test
Each test is a member of a group and the tests within each group are
run together. Groups are listed within division index files. A group
@@ -88,8 +87,7 @@ group to be executed.
=> Run test: resource-scheme.yaml
PASS
-Test files
-----------
+# Test files
Each test is a individual [YAML](https://en.wikipedia.org/wiki/YAML)
file and consists of associative arrays (key/value pairs), lists and
@@ -114,10 +112,9 @@ then quits it without ever opening a window to browse to a page
- action: quit
-Actions
--------
+# Actions
-### launch
+## launch
Start a browser instance. A test will generally have a single launch
action paired with a quit action.
@@ -145,18 +142,19 @@ The following launch action would start a browser:
* The user options `enable_javascript` and `send_referer` set to false.
* The `LANGUAGE` environment variable set to `en`
- - action: launch
- launch-options:
- - verbose
- environment:
- NETSURFRES: /home/netsurf/resources
- options:
- - enable_javascript=0
- - send_referer=0
- language: en
-
+```
+- action: launch
+ launch-options:
+ - verbose
+ environment:
+ NETSURFRES: /home/netsurf/resources
+ options:
+ - enable_javascript=0
+ - send_referer=0
+ language: en
+```
-### window-new
+## window-new
Open a new browser window. The test may open as many browser windows
as necessary and they are usually paired with a `window-close` action
@@ -175,7 +173,7 @@ referred to with the win1 identifier:
tag: win1
-### window-close
+## window-close
Closes a previously opened window. The window is identified with the
`window` key, the value of this must be a previously created window
@@ -185,7 +183,7 @@ identifier or an assert will occur.
window: win1
-### navigate
+## navigate
Cause a window to start navigating to a new URL.
@@ -215,7 +213,7 @@ navigation in a loop with different values.
repeaturl: urls
-### reload
+## reload
Cause a window to (re)navigate to the current URL
@@ -226,7 +224,7 @@ assert will occur.
- action: reload
window: win1
-### stop
+## stop
Cause a window to immediately stop any navigation.
@@ -237,7 +235,7 @@ assert will occur.
- action: stop
window: win1
-### sleep-ms
+## sleep-ms
Wait for time to pass before continuing to next action.
@@ -280,7 +278,7 @@ action is delaying.
- action: quit
-### block
+## block
Wait for conditions to be met before continuing. This is similar to
the `sleep-ms` action except that it will wait forever for the
@@ -295,7 +293,7 @@ terminate the block.
status: complete
-### repeat
+## repeat
Repeat a set of actions.
@@ -354,7 +352,7 @@ Note that `min` ,`step` and `max` are ignored if there is a `values` key
status: complete
-### timer-start
+## timer-start
Start a timer.
@@ -364,7 +362,7 @@ The identifier for the timer is set with the `timer` key.
timer: timer1
-### timer-restart
+## timer-restart
Re-start a timer
@@ -373,7 +371,8 @@ The identifier for the timer is set with the `timer` key.
- action: timer-restart
timer: timer1
-### timer-stop
+
+## timer-stop
Stop a timer
@@ -383,7 +382,7 @@ The identifier for the timer is set with the `timer` key.
timer: timer1
-### timer-check
+## timer-check
Check a timer meets a condition.
@@ -392,7 +391,7 @@ The identifier for the timer is set with the `timer` key.
The conditional is set with the `condition` key which must be present.
-### plot-check
+## plot-check
Perform a plot of a previously navigated window.
@@ -422,7 +421,7 @@ The checks available are:
- bitmap-count: 1
-### click
+## click
Perform a user mouse click on a specified window.
@@ -449,7 +448,7 @@ not specified is `single`
text: "about:Choices"
-### wait-loading
+## wait-loading
Wait for the navigated page to start loading before moving to the next
action.
@@ -462,7 +461,7 @@ assert will occur.
window: win1
-### add-auth
+## add-auth
Add basic authentication details for a navigation.
@@ -478,7 +477,7 @@ answer the challenge.
password: bar
-### remove-auth
+## remove-auth
Remove a previously added authentication details.
@@ -489,17 +488,17 @@ Remove a previously added authentication details.
password: bar
-### add-cert
+## add-cert
Add certificate error handler for a url.
-### remove-cert
+## remove-cert
Remove certificate error handler for a url.
-### clear-log
+## clear-log
Clear log for a window.
@@ -508,7 +507,7 @@ value of this must be a previously created window identifier or an
assert will occur.
-### wait-log
+## wait-log
Wait for string to appear in log output.
@@ -518,7 +517,7 @@ assert will occur.
The keys `source` `foldable` `level` and `substring` must be specified
-### js-exec
+## js-exec
Execute javascript in a window.
@@ -529,7 +528,7 @@ assert will occur.
The `cmd` key contains the javascript to execute.
-### page-info-state
+## page-info-state
Check the page information status matches an expected value.
@@ -540,6 +539,6 @@ assert will occur.
The value of the `match` key is compared to the windows page
information status and an assert occurs if there is a mismatch.
-### quit
+## quit
This causes a previously launched browser instance to exit cleanly.
-----------------------------------------------------------------------
Summary of changes:
docs/integration-testing.md | 89 ++++++++++---------
docs/unit-testing.md | 199 +++++++++++++++++++++----------------------
2 files changed, 143 insertions(+), 145 deletions(-)
diff --git a/docs/integration-testing.md b/docs/integration-testing.md
index defcc17..1191fba 100644
--- a/docs/integration-testing.md
+++ b/docs/integration-testing.md
@@ -1,8 +1,9 @@
NetSurf Integration Testing
===========================
-Overview
---------
+[TOC]
+
+# Overview
The monkey frontend is used to perform complex tests involving
operating the browser as a user might (opening windows, navigating to
@@ -26,8 +27,7 @@ known behaviours such as delays or returning specific content to
extend test capabilities.
-Running a test
---------------
+# Running a test
An individual test can be run using the monkey_driver.py python script
from within the NetSurf repository
@@ -43,8 +43,7 @@ For example to wrap execution under valgrind memory checker
$ ./test/monkey_driver.py -m ./nsmonkey -w 'valgrind -v --track-origins=yes' -t test/monkey-tests/start-stop.yaml
-Running more than one test
---------------------------
+# Running more than one test
Each test is a member of a group and the tests within each group are
run together. Groups are listed within division index files. A group
@@ -88,8 +87,7 @@ group to be executed.
=> Run test: resource-scheme.yaml
PASS
-Test files
-----------
+# Test files
Each test is a individual [YAML](https://en.wikipedia.org/wiki/YAML)
file and consists of associative arrays (key/value pairs), lists and
@@ -114,10 +112,9 @@ then quits it without ever opening a window to browse to a page
- action: quit
-Actions
--------
+# Actions
-### launch
+## launch
Start a browser instance. A test will generally have a single launch
action paired with a quit action.
@@ -145,18 +142,19 @@ The following launch action would start a browser:
* The user options `enable_javascript` and `send_referer` set to false.
* The `LANGUAGE` environment variable set to `en`
- - action: launch
- launch-options:
- - verbose
- environment:
- NETSURFRES: /home/netsurf/resources
- options:
- - enable_javascript=0
- - send_referer=0
- language: en
-
+```
+- action: launch
+ launch-options:
+ - verbose
+ environment:
+ NETSURFRES: /home/netsurf/resources
+ options:
+ - enable_javascript=0
+ - send_referer=0
+ language: en
+```
-### window-new
+## window-new
Open a new browser window. The test may open as many browser windows
as necessary and they are usually paired with a `window-close` action
@@ -175,7 +173,7 @@ referred to with the win1 identifier:
tag: win1
-### window-close
+## window-close
Closes a previously opened window. The window is identified with the
`window` key, the value of this must be a previously created window
@@ -185,7 +183,7 @@ identifier or an assert will occur.
window: win1
-### navigate
+## navigate
Cause a window to start navigating to a new URL.
@@ -215,7 +213,7 @@ navigation in a loop with different values.
repeaturl: urls
-### reload
+## reload
Cause a window to (re)navigate to the current URL
@@ -226,7 +224,7 @@ assert will occur.
- action: reload
window: win1
-### stop
+## stop
Cause a window to immediately stop any navigation.
@@ -237,7 +235,7 @@ assert will occur.
- action: stop
window: win1
-### sleep-ms
+## sleep-ms
Wait for time to pass before continuing to next action.
@@ -280,7 +278,7 @@ action is delaying.
- action: quit
-### block
+## block
Wait for conditions to be met before continuing. This is similar to
the `sleep-ms` action except that it will wait forever for the
@@ -295,7 +293,7 @@ terminate the block.
status: complete
-### repeat
+## repeat
Repeat a set of actions.
@@ -354,7 +352,7 @@ Note that `min` ,`step` and `max` are ignored if there is a `values` key
status: complete
-### timer-start
+## timer-start
Start a timer.
@@ -364,7 +362,7 @@ The identifier for the timer is set with the `timer` key.
timer: timer1
-### timer-restart
+## timer-restart
Re-start a timer
@@ -373,7 +371,8 @@ The identifier for the timer is set with the `timer` key.
- action: timer-restart
timer: timer1
-### timer-stop
+
+## timer-stop
Stop a timer
@@ -383,7 +382,7 @@ The identifier for the timer is set with the `timer` key.
timer: timer1
-### timer-check
+## timer-check
Check a timer meets a condition.
@@ -392,7 +391,7 @@ The identifier for the timer is set with the `timer` key.
The conditional is set with the `condition` key which must be present.
-### plot-check
+## plot-check
Perform a plot of a previously navigated window.
@@ -422,7 +421,7 @@ The checks available are:
- bitmap-count: 1
-### click
+## click
Perform a user mouse click on a specified window.
@@ -449,7 +448,7 @@ not specified is `single`
text: "about:Choices"
-### wait-loading
+## wait-loading
Wait for the navigated page to start loading before moving to the next
action.
@@ -462,7 +461,7 @@ assert will occur.
window: win1
-### add-auth
+## add-auth
Add basic authentication details for a navigation.
@@ -478,7 +477,7 @@ answer the challenge.
password: bar
-### remove-auth
+## remove-auth
Remove a previously added authentication details.
@@ -489,17 +488,17 @@ Remove a previously added authentication details.
password: bar
-### add-cert
+## add-cert
Add certificate error handler for a url.
-### remove-cert
+## remove-cert
Remove certificate error handler for a url.
-### clear-log
+## clear-log
Clear log for a window.
@@ -508,7 +507,7 @@ value of this must be a previously created window identifier or an
assert will occur.
-### wait-log
+## wait-log
Wait for string to appear in log output.
@@ -518,7 +517,7 @@ assert will occur.
The keys `source` `foldable` `level` and `substring` must be specified
-### js-exec
+## js-exec
Execute javascript in a window.
@@ -529,7 +528,7 @@ assert will occur.
The `cmd` key contains the javascript to execute.
-### page-info-state
+## page-info-state
Check the page information status matches an expected value.
@@ -540,6 +539,6 @@ assert will occur.
The value of the `match` key is compared to the windows page
information status and an assert occurs if there is a mismatch.
-### quit
+## quit
This causes a previously launched browser instance to exit cleanly.
diff --git a/docs/unit-testing.md b/docs/unit-testing.md
index 49d82ed..054c8e5 100644
--- a/docs/unit-testing.md
+++ b/docs/unit-testing.md
@@ -1,8 +1,9 @@
NetSurf Unit Testing
====================
-Overview
---------
+[toc]
+
+# Overview
NetSurf has unit tests integrated in the test directory. These tests
use the check unit test framework for C [1].
@@ -13,8 +14,7 @@ programs although the framework does not madate this and some test
programs contain more than one suite.
-Execution
----------
+# Execution
The test programs are executed by using the standard "test" target
from the top level make invocation. The "coverage" target additionally
@@ -25,8 +25,7 @@ The check library must be installed to run the tests and the CI system
automatically executes all enabled tests and generates coverage
reports for each commit.
-Adding tests
-------------
+# Adding tests
The test/Makefile defines each indiviadual test program that should be
built and executed in the TESTS variable.
@@ -39,128 +38,128 @@ Each individual test program requires a main function which creates
one (or more) suites. The suites are added to a test runner and then
executed and the results reported.
-int main(int argc, char **argv)
-{
- int number_failed;
- SRunner *sr;
-
- sr = srunner_create(foo_suite_create());
- //srunner_add_suite(sr, bar_suite_create());
-
- srunner_run_all(sr, CK_ENV);
-
- number_failed = srunner_ntests_failed(sr);
- srunner_free(sr);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+ int main(int argc, char **argv)
+ {
+ int number_failed;
+ SRunner *sr;
+
+ sr = srunner_create(foo_suite_create());
+ //srunner_add_suite(sr, bar_suite_create());
+
+ srunner_run_all(sr, CK_ENV);
+
+ number_failed = srunner_ntests_failed(sr);
+ srunner_free(sr);
+
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
Suite creation is done with a sub function to logically split suite
code into sub modules. Each suite has test cases added to it.
-Suite *foo_suite_create(void)
-{
- Suite *s;
- s = suite_create("foo");
-
- suite_add_tcase(s, baz_case_create());
- suite_add_tcase(s, qux_case_create());
-
- return s;
-}
+ Suite *foo_suite_create(void)
+ {
+ Suite *s;
+ s = suite_create("foo");
+
+ suite_add_tcase(s, baz_case_create());
+ suite_add_tcase(s, qux_case_create());
+
+ return s;
+ }
Test cases include the actual tests to be performed within each case.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_test(tc, xxyz_test);
- tcase_add_test(tc, zzyx_test);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_test(tc, xxyz_test);
+ tcase_add_test(tc, zzyx_test);
+
+ return tc;
+ }
A test case may optionally have a fixture which is code that is
executed before and after each test case. Unchecked fixtures are
executed once before the test process forks for each test whereas
checked fixtures are executed for each and every test.
-static void fixture_setup(void)
-{
-}
-
-static void fixture_teardown(void)
-{
-}
-
-TCase *qux_case_create(void)
-{
- TCase *tc;
-
- /* Matching entry tests */
- tc = tcase_create("Match");
-
- tcase_add_checked_fixture(tc,
- fixture_setup,
- fixture_teardown);
-
- tcase_add_test(tc, zzz_test);
-
- return tc;
-}
+ static void fixture_setup(void)
+ {
+ }
+
+ static void fixture_teardown(void)
+ {
+ }
+
+ TCase *qux_case_create(void)
+ {
+ TCase *tc;
+
+ /* Matching entry tests */
+ tc = tcase_create("Match");
+
+ tcase_add_checked_fixture(tc,
+ fixture_setup,
+ fixture_teardown);
+
+ tcase_add_test(tc, zzz_test);
+
+ return tc;
+ }
Additionally test cases can contain tests executed in a loop. The test
recives a single integer as a parameter named _i which iterates
between values specified in the case setup.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_loop_test(tc, looping_test, 0, 5);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_loop_test(tc, looping_test, 0, 5);
+
+ return tc;
+ }
It is also possible to create tests which will generate a signal. The
most commonly used of these is to check asserts in API calls.
-TCase *baz_case_create(void)
-{
- TCase *tc;
- tc = tcase_create("Baz");
-
- tcase_add_test_raise_signal(tc, assert_test, 6);
-
- return tc;
-}
+ TCase *baz_case_create(void)
+ {
+ TCase *tc;
+ tc = tcase_create("Baz");
+
+ tcase_add_test_raise_signal(tc, assert_test, 6);
+
+ return tc;
+ }
Actual test code is self contained in a function which uses the
ck_assert macros to test results. The check framework requires each
test to use the START_TEST and END_TEST macros when definig them.
-/**
- * url access leaf test
- */
-START_TEST(nsurl_access_leaf_test)
-{
- nserror err;
- nsurl *res_url;
- const struct test_triplets *tst = &access_tests[_i];
-
- /* not testing create, this should always succeed */
- err = nsurl_create(tst->test1, &res_url);
- ck_assert(err == NSERROR_OK);
-
- ck_assert_str_eq(nsurl_access_leaf(res_url), tst->res);
-
- nsurl_unref(res_url);
-}
-END_TEST
+ /**
+ * url access leaf test
+ */
+ START_TEST(nsurl_access_leaf_test)
+ {
+ nserror err;
+ nsurl *res_url;
+ const struct test_triplets *tst = &access_tests[_i];
+
+ /* not testing create, this should always succeed */
+ err = nsurl_create(tst->test1, &res_url);
+ ck_assert(err == NSERROR_OK);
+
+ ck_assert_str_eq(nsurl_access_leaf(res_url), tst->res);
+
+ nsurl_unref(res_url);
+ }
+ END_TEST
[1] https://libcheck.github.io/check/
--
NetSurf Browser
2 years, 12 months
netsurf: branch master updated. release/3.9-568-gfa1f1dc
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/fa1f1dcd1188ab80803b1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/fa1f1dcd1188ab80803b1ef...
...tree http://git.netsurf-browser.org/netsurf.git/tree/fa1f1dcd1188ab80803b1ef07...
The branch, master has been updated
via fa1f1dcd1188ab80803b1ef0773020d1378dbfc4 (commit)
via 9ec17b011b0b131ef330dc654ebf00135849361e (commit)
via e070f13093a23ea7ac962fffd3d1821ced9894e3 (commit)
via 710818f346a35facadc28cd1f25824d99ca72306 (commit)
via 9cb7d0ab4844cbc79e6d2937306fdb0501af4fef (commit)
via 19dded8cfa7a7772d5a6ece3e5b975c142e85456 (commit)
from 4cbdcc4aae940065d027157c1bce2dbfc7d59c3b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=fa1f1dcd1188ab80803...
commit fa1f1dcd1188ab80803b1ef0773020d1378dbfc4
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix start stop test to set launch options correctly
diff --git a/test/monkey-tests/start-stop-no-js.yaml b/test/monkey-tests/start-stop-no-js.yaml
index 0a681cf..028e08f 100644
--- a/test/monkey-tests/start-stop-no-js.yaml
+++ b/test/monkey-tests/start-stop-no-js.yaml
@@ -1,8 +1,7 @@
title: start and stop browser without JS
-group: basic
+group: initial
steps:
- action: launch
- args:
+ options:
- enable_javascript=0
- action: quit
-
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9ec17b011b0b131ef33...
commit 9ec17b011b0b131ef330dc654ebf00135849361e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Document the integration test setup
diff --git a/docs/development.md b/docs/development.md
index c9268d4..5a8d1aa 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -65,47 +65,9 @@ functions.
# Integration testing
-The monkey frontend is used to perform complex tests involving
-operating the browser as a user might (opening windows, navigating to
-websites and rendering the contents etc.)
-
-A test is written as a set of operations in a yaml file. A test can be
-run using the monkey_driver.py python script
-
- $ ./test/monkey_driver.py -m ./nsmonkey -t test/monkey-tests/start-stop.yaml
-
-There are very few tests within the netsurf repository. The large
-majority of integration tests are held within the
-[netsurf-test](http://source.netsurf-browser.org/netsurf-test.git/)
-repository.
-
-To allow more effective use of these tests additional infrastructure
-has been constructed to allow groupings of tests to be run. This is
-used extensively by the CI system to perform integration testing on
-every commit.
-
-Each test is a member of a group and the tests within each group are
-run together. Groups are listed within division index files. To run
-the integration tests the monkey-see-monkey-do python script is
-used. It downloads the test plan for a division from the netsurf test
-infrastructrure and executes it.
-
- $ ./test/monkey-see-monkey-do
- Fetching tests...
- Parsing tests...
- Running tests...
- Start group: initial
- [ Basic checks that the browser can start and stop ]
- => Run test: start-stop-no-js.yaml
- => Run test: basic-navigation.yaml
- => Run test: start-stop.yaml
- Start group: no-networking
- [ Tests that require no networking ]
- => Run test: resource-scheme.yaml
- Start group: ecmascript
- [ ECMAScript tests ]
- PASS
-
+NetSurf [integration tests](docs/integration-testing.md) use the
+monkey frontend to operate the browser as a whole. These tests open
+windows, navigate to websites and render contents as a user might.
# Documented API
diff --git a/docs/integration-testing.md b/docs/integration-testing.md
new file mode 100644
index 0000000..defcc17
--- /dev/null
+++ b/docs/integration-testing.md
@@ -0,0 +1,545 @@
+NetSurf Integration Testing
+===========================
+
+Overview
+--------
+
+The monkey frontend is used to perform complex tests involving
+operating the browser as a user might (opening windows, navigating to
+websites and rendering the contents etc.)
+
+A test is written as a set of operations in a yaml file. These files
+are parsed and executed by the monkey driver script.
+
+There are very few tests within the NetSurf repository. The large
+majority of integration tests are instead held within the
+[netsurf-test](http://source.netsurf-browser.org/netsurf-test.git/)
+repository.
+
+To allow more effective use of these tests additional infrastructure
+has been constructed to allow groupings of tests to be run. This is
+used extensively by the CI system to perform integration testing on
+every commit.
+
+The infrastructure also provides for special CGI scripts which have
+known behaviours such as delays or returning specific content to
+extend test capabilities.
+
+
+Running a test
+--------------
+
+An individual test can be run using the monkey_driver.py python script
+from within the NetSurf repository
+
+ $ make TARGET=monkey
+ $ ./test/monkey_driver.py -m ./nsmonkey -t test/monkey-tests/start-stop.yaml
+
+The command actually executed can be augmented using the wrapper
+switch, this allows the test to be run under a debugger or profiler.
+
+For example to wrap execution under valgrind memory checker
+
+ $ ./test/monkey_driver.py -m ./nsmonkey -w 'valgrind -v --track-origins=yes' -t test/monkey-tests/start-stop.yaml
+
+
+Running more than one test
+--------------------------
+
+Each test is a member of a group and the tests within each group are
+run together. Groups are listed within division index files. A group
+of tests may occur within more than one division.
+
+To run the integration tests the monkey-see-monkey-do python script is
+used. It downloads the test plan for a division from the NetSurf test
+infrastructure and executes it.
+
+ $ ./test/monkey-see-monkey-do
+ Fetching tests...
+ Parsing tests...
+ Running tests...
+ Start group: initial
+ [ Basic checks that the browser can start and stop ]
+ => Run test: start-stop-no-js.yaml
+ => Run test: basic-navigation.yaml
+ => Run test: start-stop.yaml
+ Start group: no-networking
+ [ Tests that require no networking ]
+ => Run test: resource-scheme.yaml
+ Start group: ecmascript
+ [ ECMAScript tests ]
+ PASS
+
+If no division is specified on the command line the "default" division
+is used. Other divisions are specified with the d switch for example
+to specify the "short-internet" division:
+
+ $ ./test/monkey-see-monkey-do -d short-internet
+
+Additionally the g switch allows the limiting of tests within a single
+group to be executed.
+
+ $ ./test/monkey-see-monkey-do -g no-networking
+ Fetching tests...
+ Parsing tests...
+ Running tests...
+ Start group: no-networking
+ [ Tests that require no networking ]
+ => Run test: resource-scheme.yaml
+ PASS
+
+Test files
+----------
+
+Each test is a individual [YAML](https://en.wikipedia.org/wiki/YAML)
+file and consists of associative arrays (key/value pairs), lists and
+comments.
+
+As a minimum a test must contain an associative array with keys for
+`title`, `group` and `steps`. The `steps` key must contain a list of
+test operations as a value.
+
+Each operation is an associative list and must, as a minimum, contain
+an action key with a suitable value.
+
+A minimal test that simply starts the browser without JavaScript and
+then quits it without ever opening a window to browse to a page
+
+ title: start and stop browser without JS
+ group: initial
+ steps:
+ - action: launch
+ options:
+ - enable_javascript=0
+ - action: quit
+
+
+Actions
+-------
+
+### launch
+
+Start a browser instance. A test will generally have a single launch
+action paired with a quit action.
+
+Additional command line parameters may be set using the `launch-options`
+key the value of which must be a list of command line arguments to be
+passed to the browser (without their leading hyphens)
+
+The environment of the browser can be altered with the `environment` key
+the value is an associative array of environment variables which will
+be added to the browsers environment variables.
+
+User options may be set using the `options` key with a value containing
+a list of options to set. These options allow operation with differing
+user choices to be tested without a separate Choices file.
+
+The `language` key sets the LANGUAGE environment variable which controls
+the browsers user interface language. Note this is distinct from the
+language the browser requests from HTTP servers which is controlled
+with the `accept_language` user option.
+
+The following launch action would start a browser:
+ * Passing `--verbose` on the commandline
+ * The `NETSURFRES` environment variable set to `/home/netsurf/resources`
+ * The user options `enable_javascript` and `send_referer` set to false.
+ * The `LANGUAGE` environment variable set to `en`
+
+ - action: launch
+ launch-options:
+ - verbose
+ environment:
+ NETSURFRES: /home/netsurf/resources
+ options:
+ - enable_javascript=0
+ - send_referer=0
+ language: en
+
+
+### window-new
+
+Open a new browser window. The test may open as many browser windows
+as necessary and they are usually paired with a `window-close` action
+
+The browser must have been previously launched or this action will
+assert the test with a failure.
+
+The `tag` key *must* also be present with a value (unique for all
+window-new actions). The value is used to identify subsequent
+operations in this window.
+
+As an example this will open a new window which can subsequently be
+referred to with the win1 identifier:
+
+ - action: window-new
+ tag: win1
+
+
+### window-close
+
+Closes a previously opened window. The window is identified with the
+`window` key, the value of this must be a previously created window
+identifier or an assert will occur.
+
+ - action: window-close
+ window: win1
+
+
+### navigate
+
+Cause a window to start navigating to a new URL.
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The URL to navigate to navigate to is controlled either by the `url`
+or `repeaturl` key. The `url` value is directly used as the address to
+navigate to.
+
+ - action: navigate
+ window: win1
+ url: about:about
+
+The `repeaturl` value is used as a repeat action identifier allowing
+navigation in a loop with different values.
+
+ - action: repeat
+ values:
+ - https://www.google.com/
+ - https://apple.com/
+ - https://microsoft.com/
+ tag: urls
+ - action: navigate
+ window: win1
+ repeaturl: urls
+
+
+### reload
+
+Cause a window to (re)navigate to the current URL
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: reload
+ window: win1
+
+### stop
+
+Cause a window to immediately stop any navigation.
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: stop
+ window: win1
+
+### sleep-ms
+
+Wait for time to pass before continuing to next action.
+
+The value of the `time` key is either the duration to wait for in
+milliseconds or a `repeat` action identifier.
+
+The optional `conditions` key may contain a list of conditionals used
+to terminate the delay early. If a `repeat` action identifier is in
+use the loop is terminated if a condition is met.
+
+For example to wait 10 seconds:
+
+ - action: sleep-ms
+ time: 10000
+
+if a repeat action identifier is used the delay duration is the
+current iteration value and the delay is timed from when the current
+iteration started.
+
+The `sleep-ms` action here delays by 50 milliseconds more each
+iteration until the window navigation is complete when the `sleep-ms`
+action is delaying.
+
+ - action: repeat
+ min: 0
+ step: 50
+ tag: sleepytimer
+ steps:
+ - action: launch
+ - action: window-new
+ tag: win1
+ - action: navigate
+ window: win1
+ url: about:about
+ - action: sleep-ms
+ time: sleepytimer
+ conditions:
+ - window: win1
+ status: complete
+ - action: quit
+
+
+### block
+
+Wait for conditions to be met before continuing. This is similar to
+the `sleep-ms` action except that it will wait forever for the
+conditions to be met.
+
+The `conditions` key must contain a list of conditionals used to
+terminate the block.
+
+ - action: block
+ conditions:
+ - window: win1
+ status: complete
+
+
+### repeat
+
+Repeat a set of actions.
+
+The identifier of the repeat action is set with the `tag` key and must
+be present and unique among `repeat` action identifiers.
+
+The actions to be repeated are placed in the `steps` list which may
+include any action and behaves just like the top level list.
+
+An iterator context is created for the repeat loop. The iterator can
+either be configured as a numeric value or as a list of values.
+
+The numeric iterator is controlled with the `min` ,`step` and `max`
+keys. All these keys are integer values and their presence is
+optional.
+
+The `min` value is the initial value of the iterator which defaults
+to 0.
+
+The `step` value controls how much the iterator is incremented
+on every loop with default value of 1.
+
+The loop terminates if the `max` value is exceeded. If no `max` value
+is specified the loop is infinite (i.e. no default) but may still be
+terminated by the `sleep-ms` action
+
+ - action: repeat
+ min: 0
+ step: 50
+ max: 100
+ tag: loopvar
+ steps:
+ - action: launch
+ - action: quit
+
+A value iterator has a `values` key containing a list. On each
+iteration of the loop a new value is available and can be used by the
+`navigate` action.
+
+Note that `min` ,`step` and `max` are ignored if there is a `values` key
+
+ - action: repeat
+ values:
+ - https://www.google.com/
+ - https://www.blogger.com/
+ - https://apple.com/
+ - https://microsoft.com/
+ tag: urls
+ steps:
+ - action: navigate
+ window: win1
+ repeaturl: urls
+ - action: block
+ conditions:
+ - window: win1
+ status: complete
+
+
+### timer-start
+
+Start a timer.
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-start
+ timer: timer1
+
+
+### timer-restart
+
+Re-start a timer
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-restart
+ timer: timer1
+
+### timer-stop
+
+Stop a timer
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-stop
+ timer: timer1
+
+
+### timer-check
+
+Check a timer meets a condition.
+
+The identifier for the timer is set with the `timer` key.
+
+The conditional is set with the `condition` key which must be present.
+
+
+### plot-check
+
+Perform a plot of a previously navigated window.
+
+The window to be rendered is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+An optional list of checks may be specified with the `checks` key. If
+any check is not satisfied an assert will occur and the test will
+fail.
+
+The checks available are:
+
+ * The key `text-contains` where the text must occur somewhere in the
+ plotted output.
+ * The key `text-not-contains` where the text must not occur in the
+ plotted output.
+ * The key `bitmap-count` which specifies the number of images that
+ must be present.
+
+
+ - action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf
+ - text-not-contains: Chrome
+ - bitmap-count: 1
+
+
+### click
+
+Perform a user mouse click on a specified window.
+
+The window to be clicked is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The `target` key contains an associative array which is used to select
+the location of the mouse operation in the window. The key `text` can
+be used to select text to be operated upon which matches the first
+occurrence of the text. The key `bitmap` has an integer value to
+select the index of the image to click.
+
+The optional `button` key selects which button is pressed it can take
+the value `left` or `right`. The default if not specified is `left`
+
+The optional `kind` key selects which button operation to be performed
+it can take the value `single`, `double` or `triple`. The default if
+not specified is `single`
+
+ - action: click
+ window: win1
+ target:
+ text: "about:Choices"
+
+
+### wait-loading
+
+Wait for the navigated page to start loading before moving to the next
+action.
+
+The window to be waited upon is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: wait-loading
+ window: win1
+
+
+### add-auth
+
+Add basic authentication details for a navigation.
+
+The keys `url`, `realm`, `username` and `password` must be given. When
+a basic authentication challenge occurs that matches the url and
+realm parameters the associated username and password are returned to
+answer the challenge.
+
+ - action: add-auth
+ url: http://test.netsurf-browser.org/cgi-bin/auth.cgi?user=foo&pass=bar
+ realm: Fake Realm
+ username: foo
+ password: bar
+
+
+### remove-auth
+
+Remove a previously added authentication details.
+
+ - action: remove-auth
+ url: http://test.netsurf-browser.org/cgi-bin/auth.cgi?user=foo&pass=bar
+ realm: Fake Realm
+ username: foo
+ password: bar
+
+
+### add-cert
+
+Add certificate error handler for a url.
+
+
+### remove-cert
+
+Remove certificate error handler for a url.
+
+
+### clear-log
+
+Clear log for a window.
+
+The window to be cleared is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+
+### wait-log
+
+Wait for string to appear in log output.
+
+The window to be waited upon is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The keys `source` `foldable` `level` and `substring` must be specified
+
+### js-exec
+
+Execute javascript in a window.
+
+The window to be execute within is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The `cmd` key contains the javascript to execute.
+
+
+### page-info-state
+
+Check the page information status matches an expected value.
+
+The window to be checked is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The value of the `match` key is compared to the windows page
+information status and an assert occurs if there is a mismatch.
+
+### quit
+
+This causes a previously launched browser instance to exit cleanly.
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e070f13093a23ea7ac9...
commit e070f13093a23ea7ac962fffd3d1821ced9894e3
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
integration test remove remaining windows when browser has been quit
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 62d5766..fe904d3 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -643,6 +643,8 @@ def run_test_step_action_quit(ctx, step):
assert_browser(ctx)
browser = ctx.pop('browser')
assert browser.quit_and_wait()
+ # clean up context as all windows have gone away after browser quit
+ ctx.pop('windows')
STEP_HANDLERS = {
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=710818f346a35facadc...
commit 710818f346a35facadc28cd1f25824d99ca72306
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix integration test repeat "max" handling
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 7a2871d..62d5766 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -374,32 +374,50 @@ def run_test_step_action_repeat(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
tag = step['tag']
assert ctx['repeats'].get(tag) is None
+ # initialise the loop continue conditional
ctx['repeats'][tag] = {"loop": True, }
- if 'min' in step.keys():
- ctx['repeats'][tag]["i"] = step["min"]
- else:
- ctx['repeats'][tag]["i"] = 0
-
- if 'step' in step.keys():
- ctx['repeats'][tag]["step"] = step["step"]
- else:
- ctx['repeats'][tag]["step"] = 1
-
if 'values' in step.keys():
+ # value iterator
ctx['repeats'][tag]['values'] = step["values"]
+ ctx['repeats'][tag]["max"] = len(step["values"])
+ ctx['repeats'][tag]["i"] = 0
+ ctx['repeats'][tag]["step"] = 1
else:
+ # numeric iterator
ctx['repeats'][tag]['values'] = None
+ if 'min' in step.keys():
+ ctx['repeats'][tag]["i"] = step["min"]
+ else:
+ ctx['repeats'][tag]["i"] = 0
+
+ if 'step' in step.keys():
+ ctx['repeats'][tag]["step"] = step["step"]
+ else:
+ ctx['repeats'][tag]["step"] = 1
+
+ if 'max' in step.keys():
+ ctx['repeats'][tag]["max"] = step["max"]
+ else:
+ ctx['repeats'][tag]["max"] = None
+
while ctx['repeats'][tag]["loop"]:
ctx['repeats'][tag]["start"] = time.time()
ctx["depth"] += 1
+
+ # run through steps for this iteration
for stp in step["steps"]:
run_test_step(ctx, stp)
+
+ # increment iterator
ctx['repeats'][tag]["i"] += ctx['repeats'][tag]["step"]
- if ctx['repeats'][tag]['values'] is not None:
- if ctx['repeats'][tag]["i"] >= len(ctx['repeats'][tag]['values']):
+
+ # check for end condition
+ if ctx['repeats'][tag]["max"] is not None:
+ if ctx['repeats'][tag]["i"] >= ctx['repeats'][tag]["max"]:
ctx['repeats'][tag]["loop"] = False
+
ctx["depth"] -= 1
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9cb7d0ab4844cbc79e6...
commit 9cb7d0ab4844cbc79e6d2937306fdb0501af4fef
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
make conditionals optional in integration test sleep-ms action
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index a0f4f36..7a2871d 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -333,7 +333,7 @@ def run_test_step_action_reload(ctx, step):
def run_test_step_action_sleep_ms(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
- conds = step['conditions']
+ conds = step.get('conditions', {})
sleep_time = step['time']
sleep = 0
have_repeat = False
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=19dded8cfa7a7772d5a...
commit 19dded8cfa7a7772d5a6ece3e5b975c142e85456
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
add ability for monkey farmer to launch browser with environment variables set
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 0a9e29a..a0f4f36 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -22,6 +22,7 @@ runs tests in monkey as defined in a yaml file
# pylint: disable=locally-disabled, missing-docstring
+import os
import sys
import getopt
import time
@@ -232,18 +233,35 @@ def conds_met(ctx, conds):
def run_test_step_action_launch(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
+
+ # ensure browser is not already launched
assert ctx.get('browser') is None
assert ctx.get('windows') is None
+
+ # build command line switches list
monkey_cmd = [ctx["monkey"]]
for option in step.get('launch-options', []):
monkey_cmd.append("--{}".format(option))
print(get_indent(ctx) + " " + "Command line: " + repr(monkey_cmd))
+
+ # build command environment
+ monkey_env = os.environ.copy()
+ for envkey, envvalue in step.get('environment', {}).items():
+ monkey_env[envkey] = envvalue
+ print(get_indent(ctx) + " " + envkey + "=" + envvalue)
+ if 'language' in step.keys():
+ monkey_env['LANGUAGE'] = step['language']
+
+ # create browser object
ctx['browser'] = DriverBrowser(
monkey_cmd=monkey_cmd,
+ monkey_env=monkey_env,
quiet=True,
wrapper=ctx.get("wrapper"))
assert_browser(ctx)
ctx['windows'] = dict()
+
+ # set user options
for option in step.get('options', []):
print(get_indent(ctx) + " " + option)
ctx['browser'].pass_options(option)
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index fbcd748..c246876 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -75,7 +75,7 @@ class MonkeyFarmer(asyncore.dispatcher):
# pylint: disable=locally-disabled, too-many-instance-attributes
- def __init__(self, monkey_cmd, online, quiet=False, *, wrapper=None):
+ def __init__(self, monkey_cmd, monkey_env, online, quiet=False, *, wrapper=None):
(mine, monkeys) = socket.socketpair()
asyncore.dispatcher.__init__(self, sock=mine)
@@ -91,6 +91,7 @@ class MonkeyFarmer(asyncore.dispatcher):
self.monkey = subprocess.Popen(
monkey_cmd,
+ env=monkey_env,
stdin=monkeys,
stdout=monkeys,
stderr=monkeyserr,
@@ -206,9 +207,10 @@ class Browser:
# pylint: disable=locally-disabled, too-many-instance-attributes, dangerous-default-value, invalid-name
- def __init__(self, monkey_cmd=["./nsmonkey"], quiet=False, *, wrapper=None):
+ def __init__(self, monkey_cmd=["./nsmonkey"], monkey_env=None, quiet=False, *, wrapper=None):
self.farmer = MonkeyFarmer(
monkey_cmd=monkey_cmd,
+ monkey_env=monkey_env,
online=self.on_monkey_line,
quiet=quiet,
wrapper=wrapper)
-----------------------------------------------------------------------
Summary of changes:
docs/development.md | 44 +--
docs/integration-testing.md | 545 +++++++++++++++++++++++++++++++
test/monkey-tests/start-stop-no-js.yaml | 5 +-
test/monkey_driver.py | 64 +++-
test/monkeyfarmer.py | 6 +-
5 files changed, 605 insertions(+), 59 deletions(-)
create mode 100644 docs/integration-testing.md
diff --git a/docs/development.md b/docs/development.md
index c9268d4..5a8d1aa 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -65,47 +65,9 @@ functions.
# Integration testing
-The monkey frontend is used to perform complex tests involving
-operating the browser as a user might (opening windows, navigating to
-websites and rendering the contents etc.)
-
-A test is written as a set of operations in a yaml file. A test can be
-run using the monkey_driver.py python script
-
- $ ./test/monkey_driver.py -m ./nsmonkey -t test/monkey-tests/start-stop.yaml
-
-There are very few tests within the netsurf repository. The large
-majority of integration tests are held within the
-[netsurf-test](http://source.netsurf-browser.org/netsurf-test.git/)
-repository.
-
-To allow more effective use of these tests additional infrastructure
-has been constructed to allow groupings of tests to be run. This is
-used extensively by the CI system to perform integration testing on
-every commit.
-
-Each test is a member of a group and the tests within each group are
-run together. Groups are listed within division index files. To run
-the integration tests the monkey-see-monkey-do python script is
-used. It downloads the test plan for a division from the netsurf test
-infrastructrure and executes it.
-
- $ ./test/monkey-see-monkey-do
- Fetching tests...
- Parsing tests...
- Running tests...
- Start group: initial
- [ Basic checks that the browser can start and stop ]
- => Run test: start-stop-no-js.yaml
- => Run test: basic-navigation.yaml
- => Run test: start-stop.yaml
- Start group: no-networking
- [ Tests that require no networking ]
- => Run test: resource-scheme.yaml
- Start group: ecmascript
- [ ECMAScript tests ]
- PASS
-
+NetSurf [integration tests](docs/integration-testing.md) use the
+monkey frontend to operate the browser as a whole. These tests open
+windows, navigate to websites and render contents as a user might.
# Documented API
diff --git a/docs/integration-testing.md b/docs/integration-testing.md
new file mode 100644
index 0000000..defcc17
--- /dev/null
+++ b/docs/integration-testing.md
@@ -0,0 +1,545 @@
+NetSurf Integration Testing
+===========================
+
+Overview
+--------
+
+The monkey frontend is used to perform complex tests involving
+operating the browser as a user might (opening windows, navigating to
+websites and rendering the contents etc.)
+
+A test is written as a set of operations in a yaml file. These files
+are parsed and executed by the monkey driver script.
+
+There are very few tests within the NetSurf repository. The large
+majority of integration tests are instead held within the
+[netsurf-test](http://source.netsurf-browser.org/netsurf-test.git/)
+repository.
+
+To allow more effective use of these tests additional infrastructure
+has been constructed to allow groupings of tests to be run. This is
+used extensively by the CI system to perform integration testing on
+every commit.
+
+The infrastructure also provides for special CGI scripts which have
+known behaviours such as delays or returning specific content to
+extend test capabilities.
+
+
+Running a test
+--------------
+
+An individual test can be run using the monkey_driver.py python script
+from within the NetSurf repository
+
+ $ make TARGET=monkey
+ $ ./test/monkey_driver.py -m ./nsmonkey -t test/monkey-tests/start-stop.yaml
+
+The command actually executed can be augmented using the wrapper
+switch, this allows the test to be run under a debugger or profiler.
+
+For example to wrap execution under valgrind memory checker
+
+ $ ./test/monkey_driver.py -m ./nsmonkey -w 'valgrind -v --track-origins=yes' -t test/monkey-tests/start-stop.yaml
+
+
+Running more than one test
+--------------------------
+
+Each test is a member of a group and the tests within each group are
+run together. Groups are listed within division index files. A group
+of tests may occur within more than one division.
+
+To run the integration tests the monkey-see-monkey-do python script is
+used. It downloads the test plan for a division from the NetSurf test
+infrastructure and executes it.
+
+ $ ./test/monkey-see-monkey-do
+ Fetching tests...
+ Parsing tests...
+ Running tests...
+ Start group: initial
+ [ Basic checks that the browser can start and stop ]
+ => Run test: start-stop-no-js.yaml
+ => Run test: basic-navigation.yaml
+ => Run test: start-stop.yaml
+ Start group: no-networking
+ [ Tests that require no networking ]
+ => Run test: resource-scheme.yaml
+ Start group: ecmascript
+ [ ECMAScript tests ]
+ PASS
+
+If no division is specified on the command line the "default" division
+is used. Other divisions are specified with the d switch for example
+to specify the "short-internet" division:
+
+ $ ./test/monkey-see-monkey-do -d short-internet
+
+Additionally the g switch allows the limiting of tests within a single
+group to be executed.
+
+ $ ./test/monkey-see-monkey-do -g no-networking
+ Fetching tests...
+ Parsing tests...
+ Running tests...
+ Start group: no-networking
+ [ Tests that require no networking ]
+ => Run test: resource-scheme.yaml
+ PASS
+
+Test files
+----------
+
+Each test is a individual [YAML](https://en.wikipedia.org/wiki/YAML)
+file and consists of associative arrays (key/value pairs), lists and
+comments.
+
+As a minimum a test must contain an associative array with keys for
+`title`, `group` and `steps`. The `steps` key must contain a list of
+test operations as a value.
+
+Each operation is an associative list and must, as a minimum, contain
+an action key with a suitable value.
+
+A minimal test that simply starts the browser without JavaScript and
+then quits it without ever opening a window to browse to a page
+
+ title: start and stop browser without JS
+ group: initial
+ steps:
+ - action: launch
+ options:
+ - enable_javascript=0
+ - action: quit
+
+
+Actions
+-------
+
+### launch
+
+Start a browser instance. A test will generally have a single launch
+action paired with a quit action.
+
+Additional command line parameters may be set using the `launch-options`
+key the value of which must be a list of command line arguments to be
+passed to the browser (without their leading hyphens)
+
+The environment of the browser can be altered with the `environment` key
+the value is an associative array of environment variables which will
+be added to the browsers environment variables.
+
+User options may be set using the `options` key with a value containing
+a list of options to set. These options allow operation with differing
+user choices to be tested without a separate Choices file.
+
+The `language` key sets the LANGUAGE environment variable which controls
+the browsers user interface language. Note this is distinct from the
+language the browser requests from HTTP servers which is controlled
+with the `accept_language` user option.
+
+The following launch action would start a browser:
+ * Passing `--verbose` on the commandline
+ * The `NETSURFRES` environment variable set to `/home/netsurf/resources`
+ * The user options `enable_javascript` and `send_referer` set to false.
+ * The `LANGUAGE` environment variable set to `en`
+
+ - action: launch
+ launch-options:
+ - verbose
+ environment:
+ NETSURFRES: /home/netsurf/resources
+ options:
+ - enable_javascript=0
+ - send_referer=0
+ language: en
+
+
+### window-new
+
+Open a new browser window. The test may open as many browser windows
+as necessary and they are usually paired with a `window-close` action
+
+The browser must have been previously launched or this action will
+assert the test with a failure.
+
+The `tag` key *must* also be present with a value (unique for all
+window-new actions). The value is used to identify subsequent
+operations in this window.
+
+As an example this will open a new window which can subsequently be
+referred to with the win1 identifier:
+
+ - action: window-new
+ tag: win1
+
+
+### window-close
+
+Closes a previously opened window. The window is identified with the
+`window` key, the value of this must be a previously created window
+identifier or an assert will occur.
+
+ - action: window-close
+ window: win1
+
+
+### navigate
+
+Cause a window to start navigating to a new URL.
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The URL to navigate to navigate to is controlled either by the `url`
+or `repeaturl` key. The `url` value is directly used as the address to
+navigate to.
+
+ - action: navigate
+ window: win1
+ url: about:about
+
+The `repeaturl` value is used as a repeat action identifier allowing
+navigation in a loop with different values.
+
+ - action: repeat
+ values:
+ - https://www.google.com/
+ - https://apple.com/
+ - https://microsoft.com/
+ tag: urls
+ - action: navigate
+ window: win1
+ repeaturl: urls
+
+
+### reload
+
+Cause a window to (re)navigate to the current URL
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: reload
+ window: win1
+
+### stop
+
+Cause a window to immediately stop any navigation.
+
+The window to be navigated is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: stop
+ window: win1
+
+### sleep-ms
+
+Wait for time to pass before continuing to next action.
+
+The value of the `time` key is either the duration to wait for in
+milliseconds or a `repeat` action identifier.
+
+The optional `conditions` key may contain a list of conditionals used
+to terminate the delay early. If a `repeat` action identifier is in
+use the loop is terminated if a condition is met.
+
+For example to wait 10 seconds:
+
+ - action: sleep-ms
+ time: 10000
+
+if a repeat action identifier is used the delay duration is the
+current iteration value and the delay is timed from when the current
+iteration started.
+
+The `sleep-ms` action here delays by 50 milliseconds more each
+iteration until the window navigation is complete when the `sleep-ms`
+action is delaying.
+
+ - action: repeat
+ min: 0
+ step: 50
+ tag: sleepytimer
+ steps:
+ - action: launch
+ - action: window-new
+ tag: win1
+ - action: navigate
+ window: win1
+ url: about:about
+ - action: sleep-ms
+ time: sleepytimer
+ conditions:
+ - window: win1
+ status: complete
+ - action: quit
+
+
+### block
+
+Wait for conditions to be met before continuing. This is similar to
+the `sleep-ms` action except that it will wait forever for the
+conditions to be met.
+
+The `conditions` key must contain a list of conditionals used to
+terminate the block.
+
+ - action: block
+ conditions:
+ - window: win1
+ status: complete
+
+
+### repeat
+
+Repeat a set of actions.
+
+The identifier of the repeat action is set with the `tag` key and must
+be present and unique among `repeat` action identifiers.
+
+The actions to be repeated are placed in the `steps` list which may
+include any action and behaves just like the top level list.
+
+An iterator context is created for the repeat loop. The iterator can
+either be configured as a numeric value or as a list of values.
+
+The numeric iterator is controlled with the `min` ,`step` and `max`
+keys. All these keys are integer values and their presence is
+optional.
+
+The `min` value is the initial value of the iterator which defaults
+to 0.
+
+The `step` value controls how much the iterator is incremented
+on every loop with default value of 1.
+
+The loop terminates if the `max` value is exceeded. If no `max` value
+is specified the loop is infinite (i.e. no default) but may still be
+terminated by the `sleep-ms` action
+
+ - action: repeat
+ min: 0
+ step: 50
+ max: 100
+ tag: loopvar
+ steps:
+ - action: launch
+ - action: quit
+
+A value iterator has a `values` key containing a list. On each
+iteration of the loop a new value is available and can be used by the
+`navigate` action.
+
+Note that `min` ,`step` and `max` are ignored if there is a `values` key
+
+ - action: repeat
+ values:
+ - https://www.google.com/
+ - https://www.blogger.com/
+ - https://apple.com/
+ - https://microsoft.com/
+ tag: urls
+ steps:
+ - action: navigate
+ window: win1
+ repeaturl: urls
+ - action: block
+ conditions:
+ - window: win1
+ status: complete
+
+
+### timer-start
+
+Start a timer.
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-start
+ timer: timer1
+
+
+### timer-restart
+
+Re-start a timer
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-restart
+ timer: timer1
+
+### timer-stop
+
+Stop a timer
+
+The identifier for the timer is set with the `timer` key.
+
+ - action: timer-stop
+ timer: timer1
+
+
+### timer-check
+
+Check a timer meets a condition.
+
+The identifier for the timer is set with the `timer` key.
+
+The conditional is set with the `condition` key which must be present.
+
+
+### plot-check
+
+Perform a plot of a previously navigated window.
+
+The window to be rendered is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+An optional list of checks may be specified with the `checks` key. If
+any check is not satisfied an assert will occur and the test will
+fail.
+
+The checks available are:
+
+ * The key `text-contains` where the text must occur somewhere in the
+ plotted output.
+ * The key `text-not-contains` where the text must not occur in the
+ plotted output.
+ * The key `bitmap-count` which specifies the number of images that
+ must be present.
+
+
+ - action: plot-check
+ window: win1
+ checks:
+ - text-contains: NetSurf
+ - text-not-contains: Chrome
+ - bitmap-count: 1
+
+
+### click
+
+Perform a user mouse click on a specified window.
+
+The window to be clicked is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The `target` key contains an associative array which is used to select
+the location of the mouse operation in the window. The key `text` can
+be used to select text to be operated upon which matches the first
+occurrence of the text. The key `bitmap` has an integer value to
+select the index of the image to click.
+
+The optional `button` key selects which button is pressed it can take
+the value `left` or `right`. The default if not specified is `left`
+
+The optional `kind` key selects which button operation to be performed
+it can take the value `single`, `double` or `triple`. The default if
+not specified is `single`
+
+ - action: click
+ window: win1
+ target:
+ text: "about:Choices"
+
+
+### wait-loading
+
+Wait for the navigated page to start loading before moving to the next
+action.
+
+The window to be waited upon is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+ - action: wait-loading
+ window: win1
+
+
+### add-auth
+
+Add basic authentication details for a navigation.
+
+The keys `url`, `realm`, `username` and `password` must be given. When
+a basic authentication challenge occurs that matches the url and
+realm parameters the associated username and password are returned to
+answer the challenge.
+
+ - action: add-auth
+ url: http://test.netsurf-browser.org/cgi-bin/auth.cgi?user=foo&pass=bar
+ realm: Fake Realm
+ username: foo
+ password: bar
+
+
+### remove-auth
+
+Remove a previously added authentication details.
+
+ - action: remove-auth
+ url: http://test.netsurf-browser.org/cgi-bin/auth.cgi?user=foo&pass=bar
+ realm: Fake Realm
+ username: foo
+ password: bar
+
+
+### add-cert
+
+Add certificate error handler for a url.
+
+
+### remove-cert
+
+Remove certificate error handler for a url.
+
+
+### clear-log
+
+Clear log for a window.
+
+The window to be cleared is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+
+### wait-log
+
+Wait for string to appear in log output.
+
+The window to be waited upon is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The keys `source` `foldable` `level` and `substring` must be specified
+
+### js-exec
+
+Execute javascript in a window.
+
+The window to be execute within is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The `cmd` key contains the javascript to execute.
+
+
+### page-info-state
+
+Check the page information status matches an expected value.
+
+The window to be checked is identified with the `window` key, the
+value of this must be a previously created window identifier or an
+assert will occur.
+
+The value of the `match` key is compared to the windows page
+information status and an assert occurs if there is a mismatch.
+
+### quit
+
+This causes a previously launched browser instance to exit cleanly.
diff --git a/test/monkey-tests/start-stop-no-js.yaml b/test/monkey-tests/start-stop-no-js.yaml
index 0a681cf..028e08f 100644
--- a/test/monkey-tests/start-stop-no-js.yaml
+++ b/test/monkey-tests/start-stop-no-js.yaml
@@ -1,8 +1,7 @@
title: start and stop browser without JS
-group: basic
+group: initial
steps:
- action: launch
- args:
+ options:
- enable_javascript=0
- action: quit
-
diff --git a/test/monkey_driver.py b/test/monkey_driver.py
index 0a9e29a..fe904d3 100755
--- a/test/monkey_driver.py
+++ b/test/monkey_driver.py
@@ -22,6 +22,7 @@ runs tests in monkey as defined in a yaml file
# pylint: disable=locally-disabled, missing-docstring
+import os
import sys
import getopt
import time
@@ -232,18 +233,35 @@ def conds_met(ctx, conds):
def run_test_step_action_launch(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
+
+ # ensure browser is not already launched
assert ctx.get('browser') is None
assert ctx.get('windows') is None
+
+ # build command line switches list
monkey_cmd = [ctx["monkey"]]
for option in step.get('launch-options', []):
monkey_cmd.append("--{}".format(option))
print(get_indent(ctx) + " " + "Command line: " + repr(monkey_cmd))
+
+ # build command environment
+ monkey_env = os.environ.copy()
+ for envkey, envvalue in step.get('environment', {}).items():
+ monkey_env[envkey] = envvalue
+ print(get_indent(ctx) + " " + envkey + "=" + envvalue)
+ if 'language' in step.keys():
+ monkey_env['LANGUAGE'] = step['language']
+
+ # create browser object
ctx['browser'] = DriverBrowser(
monkey_cmd=monkey_cmd,
+ monkey_env=monkey_env,
quiet=True,
wrapper=ctx.get("wrapper"))
assert_browser(ctx)
ctx['windows'] = dict()
+
+ # set user options
for option in step.get('options', []):
print(get_indent(ctx) + " " + option)
ctx['browser'].pass_options(option)
@@ -315,7 +333,7 @@ def run_test_step_action_reload(ctx, step):
def run_test_step_action_sleep_ms(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
- conds = step['conditions']
+ conds = step.get('conditions', {})
sleep_time = step['time']
sleep = 0
have_repeat = False
@@ -356,32 +374,50 @@ def run_test_step_action_repeat(ctx, step):
print(get_indent(ctx) + "Action: " + step["action"])
tag = step['tag']
assert ctx['repeats'].get(tag) is None
+ # initialise the loop continue conditional
ctx['repeats'][tag] = {"loop": True, }
- if 'min' in step.keys():
- ctx['repeats'][tag]["i"] = step["min"]
- else:
- ctx['repeats'][tag]["i"] = 0
-
- if 'step' in step.keys():
- ctx['repeats'][tag]["step"] = step["step"]
- else:
- ctx['repeats'][tag]["step"] = 1
-
if 'values' in step.keys():
+ # value iterator
ctx['repeats'][tag]['values'] = step["values"]
+ ctx['repeats'][tag]["max"] = len(step["values"])
+ ctx['repeats'][tag]["i"] = 0
+ ctx['repeats'][tag]["step"] = 1
else:
+ # numeric iterator
ctx['repeats'][tag]['values'] = None
+ if 'min' in step.keys():
+ ctx['repeats'][tag]["i"] = step["min"]
+ else:
+ ctx['repeats'][tag]["i"] = 0
+
+ if 'step' in step.keys():
+ ctx['repeats'][tag]["step"] = step["step"]
+ else:
+ ctx['repeats'][tag]["step"] = 1
+
+ if 'max' in step.keys():
+ ctx['repeats'][tag]["max"] = step["max"]
+ else:
+ ctx['repeats'][tag]["max"] = None
+
while ctx['repeats'][tag]["loop"]:
ctx['repeats'][tag]["start"] = time.time()
ctx["depth"] += 1
+
+ # run through steps for this iteration
for stp in step["steps"]:
run_test_step(ctx, stp)
+
+ # increment iterator
ctx['repeats'][tag]["i"] += ctx['repeats'][tag]["step"]
- if ctx['repeats'][tag]['values'] is not None:
- if ctx['repeats'][tag]["i"] >= len(ctx['repeats'][tag]['values']):
+
+ # check for end condition
+ if ctx['repeats'][tag]["max"] is not None:
+ if ctx['repeats'][tag]["i"] >= ctx['repeats'][tag]["max"]:
ctx['repeats'][tag]["loop"] = False
+
ctx["depth"] -= 1
@@ -607,6 +643,8 @@ def run_test_step_action_quit(ctx, step):
assert_browser(ctx)
browser = ctx.pop('browser')
assert browser.quit_and_wait()
+ # clean up context as all windows have gone away after browser quit
+ ctx.pop('windows')
STEP_HANDLERS = {
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index fbcd748..c246876 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -75,7 +75,7 @@ class MonkeyFarmer(asyncore.dispatcher):
# pylint: disable=locally-disabled, too-many-instance-attributes
- def __init__(self, monkey_cmd, online, quiet=False, *, wrapper=None):
+ def __init__(self, monkey_cmd, monkey_env, online, quiet=False, *, wrapper=None):
(mine, monkeys) = socket.socketpair()
asyncore.dispatcher.__init__(self, sock=mine)
@@ -91,6 +91,7 @@ class MonkeyFarmer(asyncore.dispatcher):
self.monkey = subprocess.Popen(
monkey_cmd,
+ env=monkey_env,
stdin=monkeys,
stdout=monkeys,
stderr=monkeyserr,
@@ -206,9 +207,10 @@ class Browser:
# pylint: disable=locally-disabled, too-many-instance-attributes, dangerous-default-value, invalid-name
- def __init__(self, monkey_cmd=["./nsmonkey"], quiet=False, *, wrapper=None):
+ def __init__(self, monkey_cmd=["./nsmonkey"], monkey_env=None, quiet=False, *, wrapper=None):
self.farmer = MonkeyFarmer(
monkey_cmd=monkey_cmd,
+ monkey_env=monkey_env,
online=self.on_monkey_line,
quiet=quiet,
wrapper=wrapper)
--
NetSurf Browser
2 years, 12 months