summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2019-02-13 21:02:34 (GMT)
committerculler <culler>2019-02-13 21:02:34 (GMT)
commit3469df6a780ed8f083665cbfdaca79453da2e982 (patch)
treefd5862570d68acab47ce7de6e5e81a037962ed13 /tests
parentbf53ad5c9a0de20d1a9952aecd213c2d0432ebb3 (diff)
parentfa6377112a54cd65d14f6ed2559ac26b684fdbb8 (diff)
downloadtk-3469df6a780ed8f083665cbfdaca79453da2e982.zip
tk-3469df6a780ed8f083665cbfdaca79453da2e982.tar.gz
tk-3469df6a780ed8f083665cbfdaca79453da2e982.tar.bz2
Fix bug [2249e64bdc]: adjust unixWm tests which expect impossible results on Aqua.
Diffstat (limited to 'tests')
-rw-r--r--tests/text.test15
-rw-r--r--tests/unixWm.test39
2 files changed, 38 insertions, 16 deletions
diff --git a/tests/text.test b/tests/text.test
index 5359407..3314fc9 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -3486,6 +3486,12 @@ test text-14.18 {ConfigureText procedure} -constraints fonts -setup {
# minimum size and it was interfering with the size requested by the -setgrid.
# The "overrideredirect" gets rid of the titlebar so the toplevel can shrink
# to the appropriate size.
+# On macOS, however, there is no way to make the window overlap the menubar.
+if {[tk windowingsystem] == "aqua"} {
+ set minY 23
+} else {
+ set minY 0
+}
test text-14.19 {ConfigureText procedure} -setup {
toplevel .top
text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2
@@ -3493,16 +3499,17 @@ test text-14.19 {ConfigureText procedure} -setup {
.top.t configure -width 20 -height 10 -setgrid 1
wm overrideredirect .top 1
pack .top.t
- wm geometry .top +0+0
+ wm geometry .top +0+$minY
update
wm geometry .top
} -cleanup {
destroy .top
-} -result {20x10+0+0}
+} -result "20x10+0+$minY"
# This test was failing on Windows because the title bar on .t was a certain
# minimum size and it was interfering with the size requested by the -setgrid.
# The "overrideredirect" gets rid of the titlebar so the toplevel can shrink
# to the appropriate size.
+# On macOS we again use minY as a workaround.
test text-14.20 {ConfigureText procedure} -setup {
toplevel .top
text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2
@@ -3510,7 +3517,7 @@ test text-14.20 {ConfigureText procedure} -setup {
.top.t configure -width 20 -height 10 -setgrid 1
wm overrideredirect .top 1
pack .top.t
- wm geometry .top +0+0
+ wm geometry .top +0+$minY
update
set result [wm geometry .top]
wm geometry .top 15x8
@@ -3521,7 +3528,7 @@ test text-14.20 {ConfigureText procedure} -setup {
lappend result [wm geometry .top]
} -cleanup {
destroy .top
-} -result {20x10+0+0 15x8+0+0 15x8+0+0}
+} -result "20x10+0+$minY 15x8+0+$minY 15x8+0+$minY"
test text-15.1 {TextWorldChanged procedure, spacing options} -constraints {
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 826cd72..28c8159 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -40,8 +40,23 @@ proc makeToplevels {} {
}
}
+# On macOS windows are not allowed to overlap the menubar at the top
+# of the screen. So tests which move a window and then check whether
+# it got moved to the requested location should use a y coordinate
+# larger than the height of the menubar (normally 23 pixels).
+
+if {[tk windowingsystem] eq "aqua"} {
+ set Y0 23
+ set Y2 25
+ set Y5 28
+} else {
+ set Y0 0
+ set Y2 2
+ set Y5 5
+}
+
set i 1
-foreach geom {+20+80 +80+20 +0+0} {
+foreach geom "+23+80 +80+23 +0+$Y0" {
destroy .t
test unixWm-1.$i {initial window position} unix {
toplevel .t -width 200 -height 150
@@ -67,7 +82,7 @@ update
scan [wm geom .t] %dx%d+%d+%d width height x y
set xerr [expr 150-$x]
set yerr [expr 150-$y]
-foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
+foreach geom "+20+80 +80+23 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" {
test unixWm-2.$i {moving window while mapped} unix {
wm geom .t $geom
update
@@ -79,7 +94,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
}
set i 1
-foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
+foreach geom "+20+80 +80+23 +0+$Y0 -0-0 +0-0 -0+$Y0 -10-5 -10+$Y5 +10-5" {
test unixWm-3.$i {moving window while iconified} unix {
wm iconify .t
sleep 200
@@ -95,7 +110,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
}
set i 1
-foreach geom {+20+80 +100+40 +0+0} {
+foreach geom "+20+80 +100+40 +0+$Y0" {
test unixWm-4.$i {moving window while withdrawn} unix {
wm withdraw .t
sleep 200
@@ -179,27 +194,27 @@ test unixWm-5.7 {compounded state changes} {unix nonPortable} {
destroy .t
toplevel .t -width 200 -height 100
-wm geom .t +10+10
+wm geom .t +10+23
wm minsize .t 1 1
update
test unixWm-6.1 {size changes} unix {
.t config -width 180 -height 150
update
wm geom .t
-} 180x150+10+10
+} 180x150+10+23
test unixWm-6.2 {size changes} unix {
wm geom .t 250x60
.t config -width 170 -height 140
update
wm geom .t
-} 250x60+10+10
+} 250x60+10+23
test unixWm-6.3 {size changes} unix {
wm geom .t 250x60
.t config -width 170 -height 140
wm geom .t {}
update
wm geom .t
-} 170x140+10+10
+} 170x140+10+23
test unixWm-6.4 {size changes} {unix nonPortable userInteraction} {
wm minsize .t 1 1
update
@@ -1357,14 +1372,14 @@ test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on gr
test unixWm-40.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} unix {
destroy .t
toplevel .t
- wm geometry .t 200x100+0+0
+ wm geometry .t 200x100+0+$Y0
listbox .t.l -height 20 -width 20
pack .t.l -fill both -expand 1
update
.t.l configure -setgrid 1
update
wm geometry .t
-} {20x20+0+0}
+} "20x20+0+$Y0"
test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} unix {
destroy .t
@@ -1559,10 +1574,10 @@ test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} unix {
tkwait visibility .t
wm overrideredirect .t 1
update
- wm geometry .t -30+2
+ wm geometry .t -30+$Y2
update
list [winfo x .t] [winfo y .t]
-} [list [expr [winfo screenwidth .t] - 110] 2]
+} [list [expr [winfo screenwidth .t] - 110] $Y2]
destroy .t
test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix testwrapper} {