Gitweb links:
...log
http://git.netsurf-browser.org/netsurf-test.git/shortlog/228eacf83d469994e4c4250a27d55f9a213234ed
...commit
http://git.netsurf-browser.org/netsurf-test.git/commit/228eacf83d469994e4c4250a27d55f9a213234ed
...tree
http://git.netsurf-browser.org/netsurf-test.git/tree/228eacf83d469994e4c4250a27d55f9a213234ed
The branch, master has been updated
via 228eacf83d469994e4c4250a27d55f9a213234ed (commit)
from 0ef3f41fb2b198df5be34a7c3b462b56f655a875 (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=228eacf83d469994e4c4250a27d55f9a213234ed
commit 228eacf83d469994e4c4250a27d55f9a213234ed
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
add initial ecmascript tests
diff --git a/html/ecmascript-isfinite.html b/html/ecmascript-isfinite.html
new file mode 100644
index 0000000..6941c5d
--- /dev/null
+++ b/html/ecmascript-isfinite.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>test ecmascript Number.isFinite()</title>
+</head>
+<body>
+<h1>test ecmascript Number.isFinite()</h1>
+
+<noscript><p>Javascript is disabled</p></noscript>
+<script>
+ function div(x) {
+ if (Number.isFinite(1000 / x)) {
+ return 'NO';
+ }
+
+ return 'YES';
+ }
+ function gdiv(x) {
+ if (isFinite(1000 / x)) {
+ return 'NO';
+ }
+
+ return 'YES';
+ }
+ document.write("<p>");
+ try {
+ document.write(div(0), div(1));
+ document.write(gdiv(0), gdiv(1));
+ } catch (e) {
+ document.write(e);
+ }
+ document.write("</p>");
+
+</script>
+
+</body>
+</html>
diff --git a/html/ecmascript-isinteger.html b/html/ecmascript-isinteger.html
new file mode 100644
index 0000000..0ca417f
--- /dev/null
+++ b/html/ecmascript-isinteger.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>test ecmascript Number.isInteger()</title>
+</head>
+<body>
+<h1>test ecmascript Number.isInteger()</h1>
+
+<noscript><p>Javascript is disabled</p></noscript>
+<script>
+ function fits(x, y) {
+ if (Number.isInteger(y / x)) {
+ return 'YES';
+ }
+ return 'NO';
+ }
+ function gfits(x, y) {
+ if (isInteger(y / x)) {
+ return 'YES';
+ }
+ return 'NO';
+ }
+
+ document.write("<p>");
+ try {
+ document.write(fits(5, 10), fits(5, 11));
+ document.write(gfits(5, 10), gfits(5, 11));
+ } catch (e) {
+ document.write(e);
+ }
+ document.write("</p>");
+
+</script>
+
+</body>
+</html>
diff --git a/monkey-test/ecmascript.yaml b/monkey-test/ecmascript.yaml
new file mode 100644
index 0000000..a08c9ce
--- /dev/null
+++ b/monkey-test/ecmascript.yaml
@@ -0,0 +1,38 @@
+title: Test ecmascript behaviour
+group: ecmascript
+steps:
+- action: launch
+ language: en
+- action: window-new
+ tag: win1
+
+# ensure isfinite works and is in both number and global context
+- action: navigate
+ window: win1
+ url: http://test.netsurf-browser.org/html/ecmascript-isfinite.html
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: "YESNOYESNO"
+
+# ensure isinteger works and is only in number context and not global
+- action: navigate
+ window: win1
+ url: http://test.netsurf-browser.org/html/ecmascript-isinteger.html
+- action: block
+ conditions:
+ - window: win1
+ status: complete
+- action: plot-check
+ window: win1
+ checks:
+ - text-contains: "YESNOReferenceError"
+
+- action: window-close
+ window: win1
+- action: quit
+
diff --git a/monkey-test/index.yaml b/monkey-test/index.yaml
index df10dbc..f23d69c 100644
--- a/monkey-test/index.yaml
+++ b/monkey-test/index.yaml
@@ -13,5 +13,8 @@
- group: https
description: Test HTTPS handling
+- group: ecmascript
+ description: ECMAScript tests
+
- group: popular-sites
description: Navigate popular web sites
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
html/ecmascript-isfinite.html | 37 ++++++++++++++++++++
html/ecmascript-isinteger.html | 36 +++++++++++++++++++
.../{resource-scheme.yaml => ecmascript.yaml} | 18 ++++++----
monkey-test/index.yaml | 3 ++
4 files changed, 87 insertions(+), 7 deletions(-)
create mode 100644 html/ecmascript-isfinite.html
create mode 100644 html/ecmascript-isinteger.html
copy monkey-test/{resource-scheme.yaml => ecmascript.yaml} (51%)
diff --git a/html/ecmascript-isfinite.html b/html/ecmascript-isfinite.html
new file mode 100644
index 0000000..6941c5d
--- /dev/null
+++ b/html/ecmascript-isfinite.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>test ecmascript Number.isFinite()</title>
+</head>
+<body>
+<h1>test ecmascript Number.isFinite()</h1>
+
+<noscript><p>Javascript is disabled</p></noscript>
+<script>
+ function div(x) {
+ if (Number.isFinite(1000 / x)) {
+ return 'NO';
+ }
+
+ return 'YES';
+ }
+ function gdiv(x) {
+ if (isFinite(1000 / x)) {
+ return 'NO';
+ }
+
+ return 'YES';
+ }
+ document.write("<p>");
+ try {
+ document.write(div(0), div(1));
+ document.write(gdiv(0), gdiv(1));
+ } catch (e) {
+ document.write(e);
+ }
+ document.write("</p>");
+
+</script>
+
+</body>
+</html>
diff --git a/html/ecmascript-isinteger.html b/html/ecmascript-isinteger.html
new file mode 100644
index 0000000..0ca417f
--- /dev/null
+++ b/html/ecmascript-isinteger.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>test ecmascript Number.isInteger()</title>
+</head>
+<body>
+<h1>test ecmascript Number.isInteger()</h1>
+
+<noscript><p>Javascript is disabled</p></noscript>
+<script>
+ function fits(x, y) {
+ if (Number.isInteger(y / x)) {
+ return 'YES';
+ }
+ return 'NO';
+ }
+ function gfits(x, y) {
+ if (isInteger(y / x)) {
+ return 'YES';
+ }
+ return 'NO';
+ }
+
+ document.write("<p>");
+ try {
+ document.write(fits(5, 10), fits(5, 11));
+ document.write(gfits(5, 10), gfits(5, 11));
+ } catch (e) {
+ document.write(e);
+ }
+ document.write("</p>");
+
+</script>
+
+</body>
+</html>
diff --git a/monkey-test/resource-scheme.yaml b/monkey-test/ecmascript.yaml
similarity index 51%
copy from monkey-test/resource-scheme.yaml
copy to monkey-test/ecmascript.yaml
index ca5ed2a..a08c9ce 100644
--- a/monkey-test/resource-scheme.yaml
+++ b/monkey-test/ecmascript.yaml
@@ -1,13 +1,15 @@
-title: resource scheme
-group: no-networking
+title: Test ecmascript behaviour
+group: ecmascript
steps:
- action: launch
language: en
- action: window-new
tag: win1
+
+# ensure isfinite works and is in both number and global context
- action: navigate
window: win1
- url: resource:does-not-exist
+ url: http://test.netsurf-browser.org/html/ecmascript-isfinite.html
- action: block
conditions:
- window: win1
@@ -15,11 +17,12 @@ steps:
- action: plot-check
window: win1
checks:
- - text-contains: Not found
- - text-contains: Error 404
+ - text-contains: "YESNOYESNO"
+
+# ensure isinteger works and is only in number context and not global
- action: navigate
window: win1
- url: resource:netsurf.png
+ url: http://test.netsurf-browser.org/html/ecmascript-isinteger.html
- action: block
conditions:
- window: win1
@@ -27,7 +30,8 @@ steps:
- action: plot-check
window: win1
checks:
- - bitmap-count: 1
+ - text-contains: "YESNOReferenceError"
+
- action: window-close
window: win1
- action: quit
diff --git a/monkey-test/index.yaml b/monkey-test/index.yaml
index df10dbc..f23d69c 100644
--- a/monkey-test/index.yaml
+++ b/monkey-test/index.yaml
@@ -13,5 +13,8 @@
- group: https
description: Test HTTPS handling
+- group: ecmascript
+ description: ECMAScript tests
+
- group: popular-sites
description: Navigate popular web sites
\ No newline at end of file
--
NetSurf test cases
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org