summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/canvImg.test4
-rw-r--r--tests/image.test28
2 files changed, 11 insertions, 21 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test
index c28eb5b..28f0375 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -166,9 +166,11 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
update
set x {}
set y {}
+ set timer [after 3000 {set y "timed out"}]
.c itemconfigure i1 -image foo2
update idletasks
- update
+ vwait y
+ after cancel timer
list $x $y [.c bbox i1]
} -cleanup {
.c delete all
diff --git a/tests/image.test b/tests/image.test
index 28adba3..f4bc9e0 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -12,24 +12,6 @@ namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-#
-# This procedure is used to make sure that a test image has
-# actually been displayed from inside the [NSView drawRect] method.
-if {[tk windowingsystem] == "aqua"} {
- proc imageWait {} {
- # Allow the display proc to fail and trigger drawRect.
- update idletasks;
- # Wait a bit for drawRect to actually be run.
- set timeout 0;
- after 200 {set timeout 1};
- vwait timeout
- }
-} else {
- proc imageWait {} {
- update;
- }
-}
-
imageInit
# Canvas used in some tests in the whole file
@@ -80,8 +62,11 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints {
.c create image 100 150 -image myimage
update
set x {}
+ set timer [after 3000 {set x "timed out"}]
image create test myimage -variable x
- imageWait
+ update idletasks
+ vwait x
+ after cancel timer
return $x
} -cleanup {
imageCleanup
@@ -378,8 +363,11 @@ test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c create image 50 50 -image foo
update
set x {}
+ set timer [after 3000 {set x "timed out"}]
foo changed 5 6 7 8 30 15
- imageWait
+ update idletasks
+ vwait x
+ after cancel timer
return $x
} -cleanup {
.c delete all