From 5a328d7a1eb89d0939fa2d123a3f43b31f75478b Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 15 Feb 2025 16:43:28 +0100 Subject: xhr, event, catom: fix some bugs Event handler functions can be set twice now. --- test/js/click_setter.html | 17 +++++++++++++---- test/js/window.html | 4 ++++ test/net/config.toml | 3 +++ test/net/json | 1 + test/net/run.sh | 2 +- test/net/xhr.html | 16 ++++++++++++++-- 6 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 test/net/json (limited to 'test') diff --git a/test/js/click_setter.html b/test/js/click_setter.html index 125c8490..93db1056 100644 --- a/test/js/click_setter.html +++ b/test/js/click_setter.html @@ -1,13 +1,22 @@ onclick setter/getter
Fail
+
test
diff --git a/test/js/window.html b/test/js/window.html index 06729e0e..a0757627 100644 --- a/test/js/window.html +++ b/test/js/window.html @@ -19,5 +19,9 @@ Image = "test"; HTMLDocument = "test"; assertEquals(Image, "test"); assertEquals(HTMLDocument, "test"); +window.onload = () => "first" +let second = () => "second" +window.onload = second; +assertEquals(second, window.onload); document.getElementById("x").textContent = "Success"; diff --git a/test/net/config.toml b/test/net/config.toml index 5d4cd517..3b0a6eba 100644 --- a/test/net/config.toml +++ b/test/net/config.toml @@ -1,3 +1,6 @@ +[start] +headless = true + [buffer] scripting = true cookie = true diff --git a/test/net/json b/test/net/json new file mode 100644 index 00000000..2cf2366b --- /dev/null +++ b/test/net/json @@ -0,0 +1 @@ +{"test": "hi world"} diff --git a/test/net/run.sh b/test/net/run.sh index 0f9bba8f..dd3798df 100755 --- a/test/net/run.sh +++ b/test/net/run.sh @@ -7,7 +7,7 @@ fi failed=0 for h in *.html *.http do printf '%s\r' "$h" - if ! "$CHA" -dC config.toml "http://localhost:$1/$h" | diff all.expected - + if ! "$CHA" -C config.toml "http://localhost:$1/$h" | diff all.expected - then failed=$(($failed+1)) printf 'FAIL: %s\n' "$h" fi diff --git a/test/net/xhr.html b/test/net/xhr.html index 5ab70601..1d7f0d64 100644 --- a/test/net/xhr.html +++ b/test/net/xhr.html @@ -5,8 +5,9 @@ -- cgit