diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-10-17 15:25:29 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-10-17 15:25:29 (GMT) |
commit | a62a72569befa24bccfc2ef198be80f3cb1e94e9 (patch) | |
tree | 5b80188ca040ec1942d235792ffc4905cd2ecf27 /tkhtml1/tests/html2.test | |
parent | 9967eb08e8dd098ffec7e70fa72549e5f7dc1e42 (diff) | |
parent | 333069975324629e46636ca439dc7edb838449a3 (diff) | |
download | blt-a62a72569befa24bccfc2ef198be80f3cb1e94e9.zip blt-a62a72569befa24bccfc2ef198be80f3cb1e94e9.tar.gz blt-a62a72569befa24bccfc2ef198be80f3cb1e94e9.tar.bz2 |
Merge commit '333069975324629e46636ca439dc7edb838449a3' as 'tkhtml1'
Diffstat (limited to 'tkhtml1/tests/html2.test')
-rw-r--r-- | tkhtml1/tests/html2.test | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/tkhtml1/tests/html2.test b/tkhtml1/tests/html2.test new file mode 100644 index 0000000..79f42a9 --- /dev/null +++ b/tkhtml1/tests/html2.test @@ -0,0 +1,100 @@ +# +# Test script for the Tk HTML widget +# +wm withdraw . +if {[lsearch [namespace children] ::tcltest] == -1} { + source [file dirname $argv0]/engine.tcl + namespace import ::tcltest::* + cd [file dirname $argv0] +} + + +# in image to use for all GIFs. +# +image create photo nogifsm -data { + R0lGODdhEAAQAPEAAACQkADQ0PgAAAAAACwAAAAAEAAQAAACNISPacHtD4IQz80QJ60as25d + 3idKZdR0IIOm2ta0Lhw/Lz2S1JqvK8ozbTKlEIVYceWSjwIAO/// +} + +# A callback to handle image requests +# +proc ImageCmd {args} { + set fn [lindex $args 0] + if {[catch {image create photo -file $fn} img]} { + set img nogifsm + } + return $img +} + +# Free all images +# +proc FreeImages {} { + foreach img [image names] { + image delete $img + } +} + +# Create the HTML widget to use for all testing. +# +set h [tkhtml_test_widget] +$h config -imagecommand ImageCmd + +::tcltest::test html-2.1 { + A snapshot of Slashdot on Jan 29, 2000. +} { + set file page1/index.html + $h clear + set f [open $file r] + $h config -base $file + $h parse [read $f [file size $file]] + close $f + set r [::tcltest::user-result] + $h clear + FreeImages + return $r +} {2 pass} + +::tcltest::test html-2.2 { + A snapshot of a page from the Scriptics website on Jan 29, 2000. +} { + set file page2/index.html + $h clear + set f [open $file r] + $h config -base $file + $h parse [read $f [file size $file]] + close $f + set r [::tcltest::user-result] + $h clear + FreeImages + return $r +} {2 pass} + +::tcltest::test html-2.3 { + A snapshot of freshmeat on Jan 29, 2000 +} { + set file page4/index.html + $h clear + set f [open $file r] + $h config -base $file + $h parse [read $f [file size $file]] + close $f + set r [::tcltest::user-result] + $h clear + FreeImages + return $r +} {2 pass} + +::tcltest::test html-2.4 { + A slide show about mktclapp +} { + set file page3/index.html + $h clear + set f [open $file r] + $h config -base $file + $h parse [read $f [file size $file]] + close $f + set r [::tcltest::user-result] + $h clear + FreeImages + return $r +} {2 pass} |