@@ -3299,24 +3299,29 @@ indented the same amount."
3299
3299
'around 'markdown-create-fake-eww )
3300
3300
(ad-activate #'markdown-live-preview-window-eww )))))
3301
3301
3302
+ (defun markdown-test/live-preview-wait ()
3303
+ (unless markdown-live-preview-current-buffer-sync-async
3304
+ (sit-for (* markdown-live-preview-idle-delay 10 ))
3305
+ (accept-process-output )))
3306
+
3302
3307
(defun markdown-test/live-preview-exports ()
3303
3308
(markdown-test-temp-file " inline.text"
3304
3309
(unless (require 'eww nil t )
3305
3310
(should-error (markdown-live-preview-mode )))
3306
3311
(let ((markdown-live-preview-idle-delay .01 ))
3307
3312
(markdown-temp-eww
3308
3313
(markdown-live-preview-mode )
3309
- (sit-for (* markdown-live-preview-idle-delay 3 ))
3310
- (accept-process-output )
3314
+ (markdown-test/live-preview-wait)
3311
3315
(should (buffer-live-p markdown-live-preview-view-buffer))
3312
3316
(should (eq (current-buffer )
3313
3317
(with-current-buffer markdown-live-preview-view-buffer
3314
3318
markdown-live-preview-source-buffer)))
3315
3319
(kill-buffer markdown-live-preview-view-buffer)
3316
3320
(should (null markdown-live-preview-view-buffer))
3317
- (markdown-live-preview-async-export)
3318
- (sit-for (* markdown-live-preview-idle-delay 3 ))
3319
- (accept-process-output )
3321
+ (if markdown-live-preview-current-buffer-sync-async
3322
+ (markdown-live-preview-sync-export)
3323
+ (markdown-live-preview-async-export)
3324
+ (markdown-test/live-preview-wait))
3320
3325
(should (buffer-live-p markdown-live-preview-view-buffer))))))
3321
3326
3322
3327
(ert-deftest test-markdown-ext/live-preview-exports-sync ()
@@ -3333,22 +3338,19 @@ indented the same amount."
3333
3338
(let ((markdown-live-preview-delete-export 'delete-on-destroy ))
3334
3339
(markdown-test-temp-file " inline.text"
3335
3340
(markdown-live-preview-mode )
3336
- (sit-for (* markdown-live-preview-idle-delay 3 ))
3337
- (accept-process-output )
3341
+ (markdown-test/live-preview-wait)
3338
3342
(setq file-output (markdown-export-file-name)))
3339
3343
(should-not (file-exists-p file-output)))
3340
3344
(let ((markdown-live-preview-delete-export 'delete-on-export ))
3341
3345
(markdown-test-temp-file " inline.text"
3342
3346
(markdown-live-preview-mode )
3343
- (sit-for (* markdown-live-preview-idle-delay 3 ))
3344
- (accept-process-output )
3347
+ (markdown-test/live-preview-wait)
3345
3348
(setq file-output (markdown-export-file-name))
3346
3349
(should-not (file-exists-p file-output))))
3347
3350
(unwind-protect
3348
3351
(markdown-test-temp-file " inline.text"
3349
3352
(markdown-live-preview-mode )
3350
- (sit-for (* markdown-live-preview-idle-delay 3 ))
3351
- (accept-process-output )
3353
+ (markdown-test/live-preview-wait)
3352
3354
(setq file-output (markdown-export-file-name))
3353
3355
(setq markdown-live-preview-delete-export nil )
3354
3356
(should (file-exists-p file-output)))
0 commit comments