From cba8e7d8f263c6b5ac456a5f2a626e2e1b06fc63 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 15 Nov 2010 00:24:46 +0000 Subject: Use more reliable test js bug workaround --- TODO | 1 - tests/html/wikireading.html.simple | 2 -- tests/showsimple.js | 4 ---- tests/webkittest.sh | 8 +++++++- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 9e90e7c..7819e56 100644 --- a/TODO +++ b/TODO @@ -3,4 +3,3 @@ add ctrl-alt-r to chromium extension http://code.google.com/chrome/extensions/events.html make tests for chromium and firefox engines https://developer.mozilla.org/en/Automated_testing_tips_and_tricks -find out why alert is needed to allow surf tests to complete diff --git a/tests/html/wikireading.html.simple b/tests/html/wikireading.html.simple index ccd89ef..1aa37d1 100644 --- a/tests/html/wikireading.html.simple +++ b/tests/html/wikireading.html.simple @@ -2,8 +2,6 @@ - -

Slow reading - Wikipedia, the free encyclopedia

From Wikipedia, the free encyclopedia
diff --git a/tests/showsimple.js b/tests/showsimple.js index 86dfbe7..8339956 100644 --- a/tests/showsimple.js +++ b/tests/showsimple.js @@ -1,8 +1,4 @@ (function() { - stag = document.createElement("script"); - stag.src="file://./simplyread.js"; - document.body.appendChild(stag); - window.alert('Click me quick'); // this seems to make simplyread.js register.. simplyread(); console.log(document.body.innerHTML); })(); diff --git a/tests/webkittest.sh b/tests/webkittest.sh index 412474b..71b87f1 100755 --- a/tests/webkittest.sh +++ b/tests/webkittest.sh @@ -8,6 +8,13 @@ test $# -ne 2 && echo usage $0 testhtml expectedoutput && exit 1 testjs=tests/showsimple.js htmlloadtime=2 scriptloadtime=3 +scriptjs=$HOME/.surf/script.js + +touch $scriptjs +test $scriptjs && mv $scriptjs $scriptjs.real +cp simplyread.js $scriptjs + +trap 'rm -f testxid testoutput testoutputbody $scriptjs;mv $scriptjs.real $scriptjs' EXIT surf -x "file://./$1" > testxid 2>testoutput & pid=$! @@ -22,5 +29,4 @@ sed 's/^\*\* Message:[^<]*//g' < testoutput > testoutputbody diff "$2" testoutputbody result=$? -rm -f testxid testoutput testoutputbody exit $result -- cgit v1.2.3