diff options
author | chengyemao <chengyemao> | 2005-02-15 03:22:10 (GMT) |
---|---|---|
committer | chengyemao <chengyemao> | 2005-02-15 03:22:10 (GMT) |
commit | aee29491b0abebba92b1106ddf35a5724ac0a9e9 (patch) | |
tree | f7879d1d03edccdd9961327c7fbb495a9b5d0730 /tests | |
parent | 6e1a009795f451583308dda6b41c6249b637933c (diff) | |
download | tk-aee29491b0abebba92b1106ddf35a5724ac0a9e9.zip tk-aee29491b0abebba92b1106ddf35a5724ac0a9e9.tar.gz tk-aee29491b0abebba92b1106ddf35a5724ac0a9e9.tar.bz2 |
Modified for the latest embedded/container window implementation for Windows platform
Diffstat (limited to 'tests')
-rw-r--r-- | tests/embed.test | 26 | ||||
-rw-r--r-- | tests/frame.test | 13 | ||||
-rw-r--r-- | tests/wm.test | 32 |
3 files changed, 67 insertions, 4 deletions
diff --git a/tests/embed.test b/tests/embed.test index 88a6a95..6cf4854 100644 --- a/tests/embed.test +++ b/tests/embed.test @@ -4,12 +4,14 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: embed.test,v 1.3 2003/04/01 21:06:22 dgp Exp $ +# RCS: @(#) $Id: embed.test,v 1.4 2005/02/15 03:22:10 chengyemao Exp $ package require tcltest 2.1 eval tcltest::configure $argv tcltest::loadTestedCommands +global tcl_platform + test embed-1.1 {TkpUseWindow procedure, bad window identifier} { deleteWindows list [catch {toplevel .t -use xyz} msg] $msg @@ -28,6 +30,26 @@ test embed-1.3 {CreateFrame procedure, both -use and -container 1} msg] $msg } {1 {A window cannot have both the -use and the -container option set.}} +if {$tcl_platform(platform) == "windows"} { + +# testing window embedding for Windows platform + +test embed-1.4 {TkpUseWindow procedure, -container must be set} { + deleteWindows + toplevel .container + list [catch {toplevel .embd -use [winfo id .container]} err] $err +} {1 {the window to use is not a Tk container}} + +test embed-1.5 {TkpUseWindow procedure, -container must be set} { + deleteWindows + frame .container + list [catch {toplevel .embd -use [winfo id .container]} err] $err +} {1 {the window to use is not a Tk container}} + +} else { + +# testing window embedding for other platforms + test embed-1.4 {TkpUseWindow procedure, -container must be set} { deleteWindows toplevel .container @@ -40,9 +62,11 @@ test embed-1.5 {TkpUseWindow procedure, -container must be set} { list [catch {toplevel .embd -use [winfo id .container]} err] $err } {1 {window ".container" doesn't have -container option set}} +} # FIXME: test cases common to unixEmbed.test and macEmbed.test should # be moved here. cleanupTests return + diff --git a/tests/frame.test b/tests/frame.test index f43655f..d7a6b7c 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: frame.test,v 1.14 2004/06/24 12:45:43 dkf Exp $ +# RCS: @(#) $Id: frame.test,v 1.15 2005/02/15 03:22:10 chengyemao Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -159,12 +159,22 @@ test frame-2.4 {toplevel configuration options} { list [catch {toplevel .t -width 200 -height 100 -colormap bogus} msg] $msg } {1 {bad window path name "bogus"}} set default "[winfo visual .] [winfo depth .]" +if {$tcl_platform(platform) == "windows"} { +test frame-2.5 {toplevel configuration options} { + catch {destroy .t} + toplevel .t -width 200 -height 100 + wm geometry .t +0+0 + list [catch {.t configure -use 0x44022} msg] $msg [.t configure -use] +} {1 {window "0x44022" doesn't exist} {-use use Use {} {}}} +} else { test frame-2.5 {toplevel configuration options} { catch {destroy .t} toplevel .t -width 200 -height 100 wm geometry .t +0+0 list [catch {.t configure -use 0x44022} msg] $msg [.t configure -use] } {1 {can't modify -use option after widget is created} {-use use Use {} {}}} +} + test frame-2.6 {toplevel configuration options} { catch {destroy .t} toplevel .t -width 200 -height 100 -visual default @@ -905,3 +915,4 @@ rename colorsFree {} # cleanup cleanupTests return + diff --git a/tests/wm.test b/tests/wm.test index a9d9c64..a214581 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: wm.test,v 1.32 2005/02/09 10:19:31 dkf Exp $ +# RCS: @(#) $Id: wm.test,v 1.33 2005/02/15 03:22:10 chengyemao Exp $ # This file tests window manager interactions that work across # platforms. Window manager tests that only work on a specific @@ -229,6 +229,19 @@ test wm-deiconify-1.4 {usage} -setup { } -returnCodes error -cleanup { destroy .icon } -result {can't deiconify .icon: it is an icon for .t} +if {$tcl_platform(platform) == "windows"} { +# test embedded window for Windows +test wm-deiconify-1.5 {usage} -setup { + destroy .embed +} -body { + frame .t.f -container 1 + toplevel .embed -use [winfo id .t.f] + wm deiconify .embed +} -returnCodes error -cleanup { + destroy .t.f .embed +} -result {can't deiconify .embed: the container does not support the request} +} else { +# test embedded window for other platforms test wm-deiconify-1.5 {usage} -setup { destroy .embed } -body { @@ -238,6 +251,7 @@ test wm-deiconify-1.5 {usage} -setup { } -returnCodes error -cleanup { destroy .t.f .embed } -result {can't deiconify .embed: it is an embedded window} +} test wm-deiconify-2.1 {a window that has never been mapped\ should not be mapped by a call to deiconify} { @@ -468,6 +482,19 @@ test wm-iconify-2.3 {Misc errors} -setup { } -returnCodes error -cleanup { destroy .t2 } -result {can't iconify .t2: it is an icon for .t} +if {$tcl_platform(platform) == "windows"} { +# test embedded window for Windows +test wm-iconify-2.4 {Misc errors} -setup { + destroy .t2 +} -body { + frame .t.f -container 1 + toplevel .t2 -use [winfo id .t.f] + wm iconify .t2 +} -returnCodes error -cleanup { + destroy .t2 .r.f +} -result {can't iconify .t2: the container does not support the request} +} else { +# test embedded window for other platforms test wm-iconify-2.4 {Misc errors} -setup { destroy .t2 } -body { @@ -477,7 +504,7 @@ test wm-iconify-2.4 {Misc errors} -setup { } -returnCodes error -cleanup { destroy .t2 .r.f } -result {can't iconify .t2: it is an embedded window} - +} test wm-iconify-3.1 {} -setup { destroy .t2 } -body { @@ -1715,3 +1742,4 @@ test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} -constraints al deleteWindows cleanupTests return + |