adjust the online check syntax frame/tab leak test case
so that it waits until online check syntax actually finishes (otherwise, there actually is a leak; the link is broken when the message comes back from the other place)
This commit is contained in:
parent
789ab0d9f0
commit
117fde6857
|
@ -937,6 +937,7 @@
|
||||||
;; colors : (or/c #f (listof string?) 'parens)
|
;; colors : (or/c #f (listof string?) 'parens)
|
||||||
(define colors #f)
|
(define colors #f)
|
||||||
(define tooltip-labels #f)
|
(define tooltip-labels #f)
|
||||||
|
(define/public (get-online-expansion-colors) colors)
|
||||||
|
|
||||||
(super-new)
|
(super-new)
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ This test checks:
|
||||||
|#
|
|#
|
||||||
|
|
||||||
(require "private/drracket-test-util.rkt"
|
(require "private/drracket-test-util.rkt"
|
||||||
|
drracket/private/local-member-names
|
||||||
racket/gui/base
|
racket/gui/base
|
||||||
framework)
|
framework)
|
||||||
|
|
||||||
|
@ -35,13 +36,20 @@ This test checks:
|
||||||
(λ ()
|
(λ ()
|
||||||
(check-menus (wait-for-drracket-frame))
|
(check-menus (wait-for-drracket-frame))
|
||||||
|
|
||||||
(try-to-find-leak "online compilation disabled:")
|
(try-to-find-leak "online compilation disabled:" void)
|
||||||
|
|
||||||
(preferences:set 'drracket:online-compilation-default-on #t)
|
(preferences:set 'drracket:online-compilation-default-on #t)
|
||||||
|
|
||||||
(try-to-find-leak "online compilation enabled:")))))
|
(try-to-find-leak "online compilation enabled:" wait-for-online-compilation-to-finish)))))
|
||||||
|
|
||||||
(define (try-to-find-leak online-compilation-string)
|
(define (wait-for-online-compilation-to-finish frame)
|
||||||
|
(let loop ([i 0])
|
||||||
|
(define current-colors (send frame get-online-expansion-colors))
|
||||||
|
(unless (equal? current-colors '("forestgreen"))
|
||||||
|
(sleep 1)
|
||||||
|
(loop (+ i 1)))))
|
||||||
|
|
||||||
|
(define (try-to-find-leak online-compilation-string extra-waiting)
|
||||||
(define drs-frame1 (wait-for-drracket-frame))
|
(define drs-frame1 (wait-for-drracket-frame))
|
||||||
(sync (system-idle-evt))
|
(sync (system-idle-evt))
|
||||||
|
|
||||||
|
@ -63,8 +71,9 @@ This test checks:
|
||||||
|
|
||||||
(queue-callback/res
|
(queue-callback/res
|
||||||
(λ () (send (send (send (weak-box-value drs-frame2b) get-current-tab) get-defs) load-file
|
(λ () (send (send (send (weak-box-value drs-frame2b) get-current-tab) get-defs) load-file
|
||||||
(collection-file-path "unit.rkt" "drracket" "private"))))
|
(collection-file-path "rep.rkt" "drracket" "private"))))
|
||||||
(sleep 2)
|
(sleep 2)
|
||||||
|
(extra-waiting (weak-box-value drs-frame2b))
|
||||||
(sync (system-idle-evt))
|
(sync (system-idle-evt))
|
||||||
|
|
||||||
(test:menu-select "File" (if (eq? (system-type) 'unix) "Close" "Close Window"))
|
(test:menu-select "File" (if (eq? (system-type) 'unix) "Close" "Close Window"))
|
||||||
|
@ -74,9 +83,9 @@ This test checks:
|
||||||
(cond
|
(cond
|
||||||
[(zero? n)
|
[(zero? n)
|
||||||
(when (weak-box-value drs-tabb)
|
(when (weak-box-value drs-tabb)
|
||||||
(eprintf "~a frame leak!\n" online-compilation-string))
|
|
||||||
(when (weak-box-value drs-frame2b)
|
|
||||||
(eprintf "~a tab leak!\n" online-compilation-string))
|
(eprintf "~a tab leak!\n" online-compilation-string))
|
||||||
|
(when (weak-box-value drs-frame2b)
|
||||||
|
(eprintf "~a frame leak!\n" online-compilation-string))
|
||||||
(when (weak-box-value tab-nsb)
|
(when (weak-box-value tab-nsb)
|
||||||
(eprintf "~a tab namespace leak!\n" online-compilation-string))
|
(eprintf "~a tab namespace leak!\n" online-compilation-string))
|
||||||
(when (weak-box-value frame2-nsb)
|
(when (weak-box-value frame2-nsb)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user