summaryrefslogtreecommitdiff
path: root/tests/webkittest.sh
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-11-14 22:57:42 +0000
committerNick White <git@njw.me.uk>2010-11-14 22:57:42 +0000
commit0781d0f5df9aee336e3b6b6de4143c2e2f83e6ad (patch)
tree4f2db59f67c94d62d96dd4335579f4168f95bb8c /tests/webkittest.sh
parentdb7cc104350b8e8915a0f7a26f788f023c7b0fe5 (diff)
Make clear that test is webkit specific
Diffstat (limited to 'tests/webkittest.sh')
-rwxr-xr-xtests/webkittest.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/webkittest.sh b/tests/webkittest.sh
new file mode 100755
index 0000000..d3e8887
--- /dev/null
+++ b/tests/webkittest.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# This test requires surf from http://surf.suckless.org,
+# patched with surfuri_js.patch
+
+test $# -ne 2 && echo usage $0 testhtml expectedoutput && exit 1
+
+testjs=tests/showsimple.js
+htmlloadtime=2
+scriptloadtime=2
+
+surf -x "file://./$1" > testxid 2>testoutput &
+pid=$!
+sleep $htmlloadtime
+xid=`cat testxid`
+xprop -id $xid -f _SURF_GO 8t -set _SURF_GO "javascript:`cat $testjs`"
+sleep $scriptloadtime
+kill $pid
+
+sed 's/^\*\* Message:[^<]*//g' < testoutput > testoutputbody
+
+diff "$2" testoutputbody
+result=$?
+
+rm -f testxid testoutput testoutputbody
+exit $result