more adjustment of the drracket test suites to avoid using os-given focus information

also increase the timeout of the io.rkt test
This commit is contained in:
Robby Findler 2011-09-05 14:12:09 -05:00
parent 14e62f6caf
commit cda12b39ed
9 changed files with 20 additions and 23 deletions

View File

@ -1432,7 +1432,7 @@ path/s is either such a string or a list of them.
"collects/tests/drracket/example-tool.rkt" drdr:command-line (gracket "-t" *) "collects/tests/drracket/example-tool.rkt" drdr:command-line (gracket "-t" *)
"collects/tests/drracket/get-defs-test.rkt" drdr:command-line (gracket *) "collects/tests/drracket/get-defs-test.rkt" drdr:command-line (gracket *)
"collects/tests/drracket/hangman.rkt" responsible (robby matthias) drdr:command-line (gracket *) "collects/tests/drracket/hangman.rkt" responsible (robby matthias) drdr:command-line (gracket *)
"collects/tests/drracket/io.rkt" drdr:command-line (gracket *) "collects/tests/drracket/io.rkt" drdr:command-line (gracket *) drdr:timeout 500
"collects/tests/drracket/language-test.rkt" responsible (robby matthias) drdr:command-line (gracket *) drdr:timeout 600 "collects/tests/drracket/language-test.rkt" responsible (robby matthias) drdr:command-line (gracket *) drdr:timeout 600
"collects/tests/drracket/leaky-frame.rkt" drdr:command-line (gracket *) "collects/tests/drracket/leaky-frame.rkt" drdr:command-line (gracket *)
"collects/tests/drracket/memory-log.rkt" drdr:command-line (gracket *) "collects/tests/drracket/memory-log.rkt" drdr:command-line (gracket *)

View File

@ -1107,10 +1107,10 @@ the settings above should match r5rs
(define (test-setting set-setting setting-name expression result) (define (test-setting set-setting setting-name expression result)
(set-language #f) (set-language #f)
(set-setting) (set-setting)
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(fw:test:button-push "OK") (fw:test:button-push "OK")
(wait-for-new-frame f)) (wait-for-new-frame f))
(let* ([drs (get-top-level-focus-window)] (let* ([drs (test:get-active-top-level-window)]
[interactions (send drs get-interactions-text)]) [interactions (send drs get-interactions-text)])
(clear-definitions drs) (clear-definitions drs)
(type-in-definitions drs expression) (type-in-definitions drs expression)
@ -1124,7 +1124,7 @@ the settings above should match r5rs
(define (test-hash-bang) (define (test-hash-bang)
(let* ([expression "#!/bin/sh\n1"] (let* ([expression "#!/bin/sh\n1"]
[result "1"] [result "1"]
[drs (get-top-level-focus-window)] [drs (test:get-active-top-level-window)]
[interactions (queue-callback (λ () (send drs get-interactions-text)))]) [interactions (queue-callback (λ () (send drs get-interactions-text)))])
(clear-definitions drs) (clear-definitions drs)
(type-in-definitions drs expression) (type-in-definitions drs expression)
@ -1235,7 +1235,7 @@ the settings above should match r5rs
(fw:test:set-check-box! (fw:test:set-check-box!
"Insert newlines in printed values" "Insert newlines in printed values"
pretty?) pretty?)
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(fw:test:button-push "OK") (fw:test:button-push "OK")
(wait-for-new-frame f)))] (wait-for-new-frame f)))]
[shorten [shorten

View File

@ -147,7 +147,7 @@
(set-module-language! #f) (set-module-language! #f)
(test:set-radio-box-item! "Debugging") (test:set-radio-box-item! "Debugging")
(let ([f (queue-callback/res (λ () (get-top-level-focus-window)))]) (let ([f (queue-callback/res (λ () (test:get-active-top-level-window)))])
(test:button-push "OK") (test:button-push "OK")
(wait-for-new-frame f)) (wait-for-new-frame f))
@ -163,7 +163,7 @@
(define (setup-dialog/run proc) (define (setup-dialog/run proc)
(set-module-language! #f) (set-module-language! #f)
(proc) (proc)
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(test:button-push "OK") (test:button-push "OK")
(wait-for-new-frame f)) (wait-for-new-frame f))
(do-execute drs) (do-execute drs)

View File

@ -69,7 +69,7 @@
(send area get-label)])) (send area get-label)]))
(define (g open-dialog) (define (g open-dialog)
(let ((base-window (get-top-level-focus-window))) (let ((base-window (test:get-active-top-level-window)))
(open-dialog) (open-dialog)
(wait-for-different-frame base-window) (wait-for-different-frame base-window)
(let loop ([n numButtonsToPush] (let loop ([n numButtonsToPush]
@ -84,7 +84,7 @@
(when (= 1 (modulo n 10)) (printf "\n")) (when (= 1 (modulo n 10)) (printf "\n"))
(flush-output) (flush-output)
(let ((window (get-top-level-focus-window))) (let ((window (test:get-active-top-level-window)))
(cond (cond
;; Back to base-window is not interesting, Reopen ;; Back to base-window is not interesting, Reopen
[(eq? base-window window) [(eq? base-window window)
@ -92,9 +92,6 @@
(wait-for-different-frame base-window) (wait-for-different-frame base-window)
(loop (- n 1) actions)] (loop (- n 1) actions)]
;; get-top-level-focus-window returns #f may imply window not in current eventspace
;; but it also might just mean we didn't look into subeventspaces(?)
;; or that we need to wait for something to happen in the GUI(?)
[(eq? window #f) [(eq? window #f)
(sleep .1) (sleep .1)
(loop (- n 1) actions)] (loop (- n 1) actions)]
@ -137,7 +134,7 @@
;; the splash screen is in a separate eventspace so wont' show up. ;; the splash screen is in a separate eventspace so wont' show up.
(define (wait-for-first-frame) (define (wait-for-first-frame)
(let loop () (let loop ()
(let ([tlw (get-top-level-focus-window)]) (let ([tlw (test:get-active-top-level-window)])
(cond (cond
[(not tlw) [(not tlw)
(sleep 1/20) (sleep 1/20)
@ -151,7 +148,7 @@
[(zero? n) [(zero? n)
(error 'wait-for-different-frame "never got that new window, only this one: ~s" win)] (error 'wait-for-different-frame "never got that new window, only this one: ~s" win)]
[else [else
(let ([tlw (get-top-level-focus-window)]) (let ([tlw (test:get-active-top-level-window)])
(when (eq? win tlw) (when (eq? win tlw)
(sleep 1/10) (sleep 1/10)
(loop (- n 1))))]))) (loop (- n 1))))])))

View File

@ -1336,7 +1336,7 @@ This produces an ACK message
(begin (begin
(set-language-level! level #f) (set-language-level! level #f)
(test:set-radio-box-item! "No debugging or profiling") (test:set-radio-box-item! "No debugging or profiling")
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(test:button-push "OK") (test:button-push "OK")
(wait-for-new-frame f)))] (wait-for-new-frame f)))]
[(debug) [(debug)
@ -1345,7 +1345,7 @@ This produces an ACK message
(begin (begin
(set-language-level! level #f) (set-language-level! level #f)
(test:set-radio-box-item! "Debugging and profiling") (test:set-radio-box-item! "Debugging and profiling")
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(test:button-push "OK") (test:button-push "OK")
(wait-for-new-frame f)))]) (wait-for-new-frame f)))])

View File

@ -110,7 +110,7 @@
(custodian-shutdown-all cust)))) (custodian-shutdown-all cust))))
(let ([wait-for-kill-window (let ([wait-for-kill-window
(lambda () (lambda ()
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(and f (equal? (send f get-label) (and f (equal? (send f get-label)
"Evaluation Terminated"))))]) "Evaluation Terminated"))))])
(poll-until wait-for-kill-window) (poll-until wait-for-kill-window)

View File

@ -109,11 +109,11 @@
(lambda () (lambda ()
(let ([active (let ([active
(or (or
(get-top-level-focus-window) (test:get-active-top-level-window)
(and (send interactions-text get-user-eventspace) (and (send interactions-text get-user-eventspace)
(parameterize ([current-eventspace (parameterize ([current-eventspace
(send interactions-text get-user-eventspace)]) (send interactions-text get-user-eventspace)])
(get-top-level-focus-window))))]) (test:get-active-top-level-window))))])
(if (and active (not (eq? active drs-frame))) (if (and active (not (eq? active drs-frame)))
active active
#f)))]) #f)))])
@ -198,7 +198,7 @@
(fw:test:menu-select "Language" "Clear All Teachpacks") (fw:test:menu-select "Language" "Clear All Teachpacks")
(fw:test:menu-select "Language" "Add Teachpack...") (fw:test:menu-select "Language" "Add Teachpack...")
(wait-for-new-frame drs-frame) (wait-for-new-frame drs-frame)
(let* ([tp-dialog (get-top-level-focus-window)] (let* ([tp-dialog (test:get-active-top-level-window)]
[choice (find/select-relevant-choice tp-dialog (path->string teachpack))]) [choice (find/select-relevant-choice tp-dialog (path->string teachpack))])
(fw:test:button-push "OK") (fw:test:button-push "OK")
(wait-for-new-frame tp-dialog)) (wait-for-new-frame tp-dialog))

View File

@ -201,10 +201,10 @@
(define (test-setting set-setting setting-name expression result) (define (test-setting set-setting setting-name expression result)
(set-language #f) (set-language #f)
(set-setting) (set-setting)
(let ([f (get-top-level-focus-window)]) (let ([f (test:get-active-top-level-window)])
(fw:test:button-push "OK") (fw:test:button-push "OK")
(wait-for-new-frame f)) (wait-for-new-frame f))
(let* ([drs (get-top-level-focus-window)] (let* ([drs (test:get-active-top-level-window)]
[interactions (send drs get-interactions-text)]) [interactions (send drs get-interactions-text)])
(clear-definitions drs) (clear-definitions drs)
(type-in-definitions drs expression) (type-in-definitions drs expression)

View File

@ -41,7 +41,7 @@
(let loop ([n 10]) (let loop ([n 10])
(when (zero? n) (when (zero? n)
(error 'time-keystrokes "could not find drscheme frame")) (error 'time-keystrokes "could not find drscheme frame"))
(let ([front-frame (get-top-level-focus-window)]) (let ([front-frame (test:get-active-top-level-window)])
(unless (eq? front-frame frame) (unless (eq? front-frame frame)
(sleep 1/10) (sleep 1/10)
(loop (- n 1))))) (loop (- n 1)))))