summaryrefslogtreecommitdiffstats
path: root/tests/textWind.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-06-10 20:38:39 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-06-10 20:38:39 (GMT)
commitefa761316fc2b262d02794c9264e4aa3a0edb891 (patch)
treec802db7b59cbf8cf0a39ac36cb7936b33291fd32 /tests/textWind.test
parentda5d38c1bc27246557b52bec1591d172d0ca1b52 (diff)
downloadtk-efa761316fc2b262d02794c9264e4aa3a0edb891.zip
tk-efa761316fc2b262d02794c9264e4aa3a0edb891.tar.gz
tk-efa761316fc2b262d02794c9264e4aa3a0edb891.tar.bz2
Further stabilize textWind-3.* since [e17046c5] did not reach the goal: on macOS, textWind-3.3, -3.4 and -3.5 could still fail. In fact, in the current state of affairs these tests MUST reliably fail on the mac because of the not yet fixed bug [61e0bb8aab]. Achieve this now.
Diffstat (limited to 'tests/textWind.test')
-rw-r--r--tests/textWind.test40
1 files changed, 29 insertions, 11 deletions
diff --git a/tests/textWind.test b/tests/textWind.test
index c4ec601..7581af0 100644
--- a/tests/textWind.test
+++ b/tests/textWind.test
@@ -324,6 +324,22 @@ test textWind-2.25 {TkTextWindowCmd procedure, "names" option} -setup {
} -result {.f .f2 .t.f .t.f2}
+proc waitForMap {w} {
+ set count 0
+ while {$count < 10 && ![winfo ismapped $w]} {
+ updateWidgets
+ incr count
+ after 50
+ }
+}
+proc waitForUnmap {w} {
+ set count 0
+ while {$count < 10 && [winfo ismapped $w]} {
+ updateWidgets
+ incr count
+ after 50
+ }
+}
test textWind-3.1 {EmbWinConfigure procedure} -setup {
destroy .f
} -body {
@@ -340,9 +356,9 @@ test textWind-3.2 {EmbWinConfigure procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.3 -window .f
- updateWidgets ; after 10 ; updateWidgets
+ waitForMap .f
.t window configure 1.3 -window {}
- updateWidgets ; after 10 ; updateWidgets
+ waitForUnmap .f
.t index .f
} -cleanup {
destroy .f
@@ -354,10 +370,10 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.3 -window .f
- updateWidgets ; after 10 ; updateWidgets
+ waitForMap .f
set res [winfo ismapped .f]
.t window configure 1.3 -window {}
- updateWidgets ; after 10 ; updateWidgets
+ waitForUnmap .f
lappend res [winfo ismapped .f] [.t bbox 1.4]
} -cleanup {
destroy .f
@@ -370,9 +386,9 @@ test textWind-3.4 {EmbWinConfigure procedure} -setup {
.t insert 1.0 "Some sample text"
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.3 -window .t.f
- updateWidgets ; after 10 ; updateWidgets
+ waitForMap .t.f
.t window configure 1.3 -window {}
- updateWidgets ; after 10 ; updateWidgets
+ waitForUnmap .t.f
.t index .t.f
} -cleanup {
destroy .t.f
@@ -384,10 +400,10 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup {
.t insert 1.0 "Some sample text"
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.3 -window .t.f
- updateWidgets ; after 10 ; updateWidgets
+ waitForMap .t.f
set res [winfo ismapped .t.f]
.t window configure 1.3 -window {}
- updateWidgets ; after 10 ; updateWidgets
+ waitForUnmap .t.f
lappend res [winfo ismapped .t.f] [.t bbox 1.4]
} -cleanup {
destroy .t.f
@@ -400,9 +416,9 @@ test textWind-3.6 {EmbWinConfigure procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.3
- updateWidgets ; after 10 ; updateWidgets
+ updateWidgets
.t window configure 1.3 -window .f
- updateWidgets ; after 10 ; updateWidgets
+ waitForMap .f
list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4]
} -cleanup {
destroy .f
@@ -461,9 +477,11 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup {
button .t.b -text "Hello!"
.t window create 1.4 -window .t.b
.t window create 1.6 -window .t.b
- updateWidgets
+ waitForMap .t.b
.t index .t.b
} -result {1.6}
+rename waiForMap {}
+rename waiForUnmap {}
.t delete 1.0 end