summaryrefslogtreecommitdiffstats
path: root/tests/pack.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-11-27 11:32:30 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-11-27 11:32:30 (GMT)
commita27551234375d448f5c75d5f068a651b32b9443b (patch)
treea7ca7d3274ba8f43e52891b01c5aec932055ddef /tests/pack.test
parenta15e86ba8fe09a9d4dacaddb52626a08ec634cfb (diff)
parent1d9db21e6c8179d6b535f3dc448540dcb9a097fb (diff)
downloadtk-a27551234375d448f5c75d5f068a651b32b9443b.zip
tk-a27551234375d448f5c75d5f068a651b32b9443b.tar.gz
tk-a27551234375d448f5c75d5f068a651b32b9443b.tar.bz2
Merge core-8-6-branch. Resolve conflicts.
Diffstat (limited to 'tests/pack.test')
-rw-r--r--tests/pack.test92
1 files changed, 58 insertions, 34 deletions
diff --git a/tests/pack.test b/tests/pack.test
index f85369d..90ac5bd 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1534,73 +1534,97 @@ test pack-17.2 {PackLostContentProc procedure} -setup {
pack info .pack.a
} -returnCodes error -result {window ".pack.a" isn't packed}
-if {[tk windowingsystem] ne "aqua"} {
- proc packUpdate {} {
- update
- }
-} else {
- proc packUpdate {} {
- }
-}
+# Tests pack-18.1.1 and pack-18.2 are constrained with failsOnUbuntu
+# because they are failing in the GitHub CI environment, using Linux Ubuntu.
+# These tests are also constrained with failsOnXQuarz because they fail
+# on macOS when building with clang --disable-aqua (which uses XQuartz)
+# (this is the case both at GitHub CI and on a real Mac).
+# Analysis shows that, on both cases, WaitForMapNotify is giving up on
+# waiting for the MapNotify event that should show up when running
+# 'wm iconify'. The timeout delay (2s) is exceeded without the unmapping
+# having happened. The cause for this is unknown (see comments in WaitForMapNotify).
-test pack-18.1 {unmap content when container unmapped} -constraints {
- tempNotPc failsOnUbuntu failsOnXQuarz
+# Tests pack-18.1.* are constrained because on Windows, when the width/height
+# is configured while the window is unmapped, the changes don't take
+# effect until the window is remapped. This is apparently by design of the
+# OS, and Tk accommodates this behavior (see UpdateGeometryInfo() and
+# ConfigureTopLevel() in tkWinWm.c).
+# pack-18.1.1 checks that, on Linux or macOS, width/height changes are taken
+# into account while the window is unmapped.
+# pack-18.1.2 checks that, on Windows, width/height changes are taken into
+# account on window remapping.
+test pack-18.1.1 {unmap content when container unmapped} -constraints {
+ macOrUnix failsOnUbuntu failsOnXQuarz
} -setup {
- eval destroy [winfo child .pack]
-} -body {
+ destroy {*}[winfo child .pack]
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
-
wm geometry .pack +100+100
-
- # On the PC, when the width/height is configured while the window is
- # unmapped, the changes don't take effect until the window is remapped.
- # Who knows why?
-
- eval destroy [winfo child .pack]
+} -body {
frame .pack.a -width 100 -height 50 -relief raised -bd 2
pack .pack.a
- update idletasks
+ update
set result [winfo ismapped .pack.a]
wm iconify .pack
lappend result [winfo ismapped .pack.a]
.pack.a configure -width 200 -height 75
- update idletasks
- lappend result [winfo width .pack.a ] [winfo height .pack.a] \
- [winfo ismapped .pack.a]
+ update
+ lappend result [winfo width .pack.a] [winfo height .pack.a] \
+ [winfo ismapped .pack.a]
wm deiconify .pack
- packUpdate
+ update
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
+test pack-18.1.2 {unmap content when container unmapped} -constraints {
+ win
+} -setup {
+ destroy {*}[winfo child .pack]
+ # adjust the position of .pack before test to avoid a screen switch
+ # that occurs with window managers that have desktops four times as big
+ # as the screen (screen switch causes scale and other tests to fail).
+ wm geometry .pack +100+100
+} -body {
+ frame .pack.a -width 100 -height 50 -relief raised -bd 2
+ pack .pack.a
+ update
+ set result [winfo ismapped .pack.a]
+ wm iconify .pack
+ lappend result [winfo ismapped .pack.a]
+ .pack.a configure -width 200 -height 75
+ update
+ wm deiconify .pack
+ update
+ lappend result [winfo width .pack.a] [winfo height .pack.a]
+ lappend result [winfo ismapped .pack.a]
+} -result {1 0 200 75 1}
test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
- eval destroy [winfo child .pack]
-} -body {
+ destroy {*}[winfo child .pack]
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
-
wm geometry .pack +100+100
+} -body {
frame .pack.a -relief raised -bd 2
frame .pack.b -width 70 -height 30 -relief sunken -bd 2
pack .pack.a
pack .pack.b -in .pack.a
- update idletasks
+ update
set result [winfo ismapped .pack.b]
wm iconify .pack
lappend result [winfo ismapped .pack.b]
.pack.b configure -width 100 -height 30
- update idletasks
- lappend result [winfo width .pack.b ] [winfo height .pack.b] \
- [winfo ismapped .pack.b]
+ update
+ lappend result [winfo width .pack.b] [winfo height .pack.b] \
+ [winfo ismapped .pack.b]
wm deiconify .pack
- packUpdate
+ update
lappend result [winfo ismapped .pack.b]
} -result {1 0 100 30 0 1}
test pack-19.1 {test respect for internalborder} -setup {
- catch {eval pack forget [pack content .pack]}
+ catch {pack forget {*}[pack content .pack]}
destroy .pack.l .pack.lf
} -body {
wm geometry .pack 200x200
@@ -1618,7 +1642,7 @@ test pack-19.1 {test respect for internalborder} -setup {
destroy .pack.l .pack.lf
} -result {196x188+2+10 177x186+5+7}
test pack-19.2 {test support for minreqsize} -setup {
- catch {eval pack forget [pack content .pack]}
+ catch {pack forget {*}[pack content .pack]}
destroy .pack.l .pack.lf
} -body {
wm geometry .pack {}