summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2019-05-24 22:18:09 (GMT)
committerculler <culler>2019-05-24 22:18:09 (GMT)
commit5e138cd11664bd39e85aa81bf4b5018e92bbea71 (patch)
tree4de02252d8d0b3a160331031718f3f58c4388398 /tests
parentd7d83eae87191420088323b96020f5a5f95be4a9 (diff)
parentb98cfeba6e15f940899dd19086f058b20cd2b26a (diff)
downloadtk-5e138cd11664bd39e85aa81bf4b5018e92bbea71.zip
tk-5e138cd11664bd39e85aa81bf4b5018e92bbea71.tar.gz
tk-5e138cd11664bd39e85aa81bf4b5018e92bbea71.tar.bz2
Merge trunk and adjust frame tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/canvImg.test29
-rw-r--r--tests/frame.test46
-rw-r--r--tests/image.test35
3 files changed, 86 insertions, 24 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test
index 84992f2..1b20bf1 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -156,18 +156,25 @@ test canvImg-4.1 {ConfiugreImage procedure} -constraints testImageType -setup {
.c delete all
image delete foo
} -result {{{foo free}} {}}
-test canvImg-4.2 {ConfiugreImage procedure} -constraints testImageType -setup {
+test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
.c delete all
} -body {
- image create test foo -variable x
+ image create test foo -variable x
image create test foo2 -variable y
foo2 changed 0 0 0 0 80 60
.c create image 50 100 -image foo -tags i1 -anchor nw
update
set x {}
set y {}
+ set timer [after 300 {lappend y "timeout"}]
.c itemconfigure i1 -image foo2
+ update idletasks
update
+ # On MacOS we need to wait for the test image display procedure to run.
+ while {"timeout" ni $y && [lindex $y end 1] ne "display"} {
+ vwait y
+ }
+ after cancel timer
list $x $y [.c bbox i1]
} -cleanup {
.c delete all
@@ -720,6 +727,12 @@ test canvImg-9.1 {DisplayImage procedure} -constraints testImageType -setup {
image delete foo
} -result {75 150 105 165}
+if {[tk windowingsystem] == "aqua" && $tcl_platform(osVersion) > 18} {
+ # Aqua >= 10.14 will redraw the entire image.
+ set result_10_1 {{foo display 0 0 30 15}}
+} else {
+ set result_10_1 {{foo display 2 4 6 8}}
+}
test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup {
.c delete all
update
@@ -734,7 +747,7 @@ test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup {
} -cleanup {
.c delete all
image delete foo
-} -result {{foo display 2 4 6 8}}
+} -result $result_10_1
test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
.c delete all
@@ -766,6 +779,12 @@ test canvImg-11.2 {ImageChangedProc procedure} -constraints {
.c delete all
image delete foo
} -result {30 75 70 125}
+if {[tk windowingsystem] == "aqua" && $tcl_platform(osVersion) > 18} {
+ # Aqua >= 10.14 will redraw the entire image.
+ set result_11_3 {{foo2 display 0 0 80 60}}
+} else {
+ set result_11_3 {{foo2 display 0 0 20 40}}
+}
test canvImg-11.3 {ImageChangedProc procedure} -constraints {
testImageType
} -setup {
@@ -773,7 +792,7 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints {
update
} -body {
image create test foo -variable x
- image create test foo2 -variable y
+ image create test foo2 -variable y
foo changed 0 0 0 0 40 50
foo2 changed 0 0 0 0 80 60
@@ -787,7 +806,7 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints {
} -cleanup {
.c delete all
image delete foo foo2
-} -result {{foo2 display 0 0 20 40}}
+} -result $result_11_3
# cleanup
imageFinish
diff --git a/tests/frame.test b/tests/frame.test
index ae6e927..30b2834 100644
--- a/tests/frame.test
+++ b/tests/frame.test
@@ -1583,8 +1583,6 @@ test frame-15.6 {TIP 262: frame background images} -setup {
image create test gorp -variable result
pack [frame .f -width 100 -height 100 -bgimg gorp]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
- update idletasks; update
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1598,7 +1596,13 @@ test frame-15.6a {TIP 262: frame background images (offsets)} -setup {
image create test gorp -variable result
pack [frame .f -width 10 -height 10 -bgimg gorp]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
+ # On MacOS must wait for the test image display procedure to run.
+ set timer [after 300 {lappend result "timedout"}]
+ while {"timedout" ni $result &&
+ "gorp display 10 2 10 10" ni $result} {
+ vwait result
+ }
+ after cancel $timer
update idletasks; update
return [uniq $result]
} -cleanup {
@@ -1613,8 +1617,16 @@ test frame-15.7 {TIP 262: frame background images} -setup {
image create test gorp -variable result
pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
- update idletasks; update
+ # On MacOS must wait for the test image display procedure to run.
+ set timer [after 300 {lappend result "timedout"}]
+ while {"timedout" ni $result &&
+ "gorp display 0 0 20 10" ni $result} {
+ vwait result
+ }
+ after cancel $timer
+ if {[lindex $result end] eq "timedout"} {
+ return [lreplace $result end end]
+ }
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1628,8 +1640,13 @@ test frame-15.7a {TIP 262: frame background images (offsets)} -setup {
image create test gorp -variable result
pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -highlightthick 1]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
- update idletasks; update
+ # On MacOS must wait for the test image display procedure to run.
+ set timer [after 300 {lappend result "timedout"}]
+ while {"timedout" ni $result &&
+ "gorp display 0 0 18 8" ni $result} {
+ vwait result
+ }
+ after cancel $timer
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1643,8 +1660,6 @@ test frame-15.7b {TIP 262: frame background images (offsets)} -setup {
image create test gorp -variable result
pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -bd 2]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
- update idletasks; update
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1658,8 +1673,6 @@ test frame-15.7c {TIP 262: frame background images (offsets)} -setup {
image create test gorp -variable result
pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -bd 2 -highlightthick 1]
update idletasks; update
- raise [winfo parent .f]; # Try to make sure the frame fully repaints
- update idletasks; update
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1744,8 +1757,6 @@ test frame-15.13 {TIP 262: toplevel background images} -setup {
toplevel .t -width 100 -height 100 -bgimg gorp
wm overrideredirect .t 1; # Reduce trouble from window managers
update idletasks; update
- raise .t; # Try to make sure the toplevel fully repaints
- update idletasks; update
return [uniq $result]
} -cleanup {
deleteWindows
@@ -1759,8 +1770,13 @@ test frame-15.14 {TIP 262: toplevel background images} -setup {
toplevel .t -width 50 -height 25 -bgimg gorp -tile 1
wm overrideredirect .t 1; # Reduce trouble from window managers
update idletasks; update
- raise .t; # Try to make sure the toplevel fully repaints
- update idletasks; update
+ # On MacOS must wait for the test image display procedure to run.
+ set timer [after 300 {lappend result "timedout"}]
+ while {"timedout" ni $result &&
+ "gorp display 0 0 20 10" ni $result} {
+ vwait result
+ }
+ after cancel $timer
return [uniq $result]
} -cleanup {
deleteWindows
diff --git a/tests/image.test b/tests/image.test
index 8121ffd..861b086 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -62,8 +62,18 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints {
.c create image 100 150 -image myimage
update
set x {}
+ set timer [after 500 {lappend x "timeout"}]
image create test myimage -variable x
+ update idletasks
update
+ # On MacOS we need to wait for the test image display procedure to run.
+ while {"timeout" ni $x && [lindex $x end 1] ne "display"} {
+ vwait x
+ }
+ after cancel timer
+ if {[lindex $x end] eq "timeout"} {
+ return [lreplace $x end end]
+ }
return $x
} -cleanup {
imageCleanup
@@ -345,7 +355,12 @@ test image-8.1 {Tk_ImageCmd procedure, "inuse" option} -constraints {
catch {destroy .b}
} -result [list 0 1]
-
+if {[tk windowingsystem] == "aqua" && $tcl_platform(osVersion) > 18} {
+ # Aqua >= 10.14 will redraw the entire image in drawRect.
+ set result_9_1 {{foo display 0 0 30 15}}
+} else {
+ set result_9_1 {{foo display 5 6 7 8}}
+}
test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c delete all
imageCleanup
@@ -355,13 +370,26 @@ test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c create image 50 50 -image foo
update
set x {}
+ set timer [after 500 {lappend x "timeout"}]
foo changed 5 6 7 8 30 15
+ update idletasks
update
+ # On MacOS we need to wait for the test image display procedure to run.
+ while {"timeout" ni $x && [lindex $x end 1] ne "display"} {
+ vwait x
+ }
+ after cancel timer
return $x
} -cleanup {
.c delete all
imageCleanup
-} -result {{foo display 5 6 7 8}}
+} -result $result_9_1
+if {[tk windowingsystem] == "aqua" && $tcl_platform(osVersion) > 18} {
+ # Aqua >= 10.14 will redraw the entire image.
+ set result_9_2 {{foo display 0 0 30 15} {foo display 0 0 30 15}}
+} else {
+ set result_9_2 {{foo display 5 6 25 9} {foo display 0 0 12 14}}
+}
test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c delete all
imageCleanup
@@ -378,8 +406,7 @@ test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup {
} -cleanup {
.c delete all
imageCleanup
-} -result {{foo display 5 6 25 9} {foo display 0 0 12 14}}
-
+} -result $result_9_2
test image-10.1 {Tk_GetImage procedure} -setup {
imageCleanup