diff options
| author | shipmints | 2025-04-04 13:25:55 -0400 |
|---|---|---|
| committer | Juri Linkov | 2025-04-05 21:41:04 +0300 |
| commit | 5fc1bd879e41e79601cff27db175d2ad22eafb66 (patch) | |
| tree | 4ee610c6a6eeb1706010ce626e3ebdc22402a4c7 | |
| parent | 54b485ced60448bd4d546593b35ae0fb34ead552 (diff) | |
| download | emacs-5fc1bd879e41e79601cff27db175d2ad22eafb66.tar.gz emacs-5fc1bd879e41e79601cff27db175d2ad22eafb66.zip | |
Add tab-bar test for "effectively dedicated window" (bug#71386)
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
New test for 'delete-frame' for effectively-dedicated windows.
| -rw-r--r-- | test/lisp/tab-bar-tests.el | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/lisp/tab-bar-tests.el b/test/lisp/tab-bar-tests.el index c0e12cf159c..a26d15ce977 100644 --- a/test/lisp/tab-bar-tests.el +++ b/test/lisp/tab-bar-tests.el | |||
| @@ -134,7 +134,7 @@ | |||
| 134 | ;; Clean up the tab afterwards | 134 | ;; Clean up the tab afterwards |
| 135 | (tab-close)) | 135 | (tab-close)) |
| 136 | 136 | ||
| 137 | ;; 3. Don't delete the frame with dedicated window | 137 | ;; 3.1. Don't delete the frame with dedicated window |
| 138 | ;; from the second tab (bug#71386) | 138 | ;; from the second tab (bug#71386) |
| 139 | (with-selected-frame (make-frame frame-params) | 139 | (with-selected-frame (make-frame frame-params) |
| 140 | (switch-to-buffer (generate-new-buffer "test1")) | 140 | (switch-to-buffer (generate-new-buffer "test1")) |
| @@ -150,8 +150,25 @@ | |||
| 150 | (kill-buffer) | 150 | (kill-buffer) |
| 151 | (should (eq (length (frame-list)) 1))) | 151 | (should (eq (length (frame-list)) 1))) |
| 152 | 152 | ||
| 153 | ;; Clean up tabs afterwards | 153 | ;; 3.2. Don't delete the frame with an effectively-dedicated window |
| 154 | (tab-bar-tabs-set nil))) | 154 | ;; from the second tab (bug#71386) |
| 155 | (with-selected-frame (make-frame frame-params) | ||
| 156 | (let ((switch-to-prev-buffer-skip #'always) | ||
| 157 | (kill-buffer-quit-windows nil)) | ||
| 158 | (switch-to-buffer (generate-new-buffer "test1")) | ||
| 159 | (tab-bar-new-tab) | ||
| 160 | (switch-to-buffer (generate-new-buffer "test2")) | ||
| 161 | ;; This makes the window effectively dedicated. | ||
| 162 | (set-window-prev-buffers nil nil) | ||
| 163 | ;; Killing the buffer should close the tab, leave one open tab, | ||
| 164 | ;; and not delete the frame. | ||
| 165 | (kill-buffer) | ||
| 166 | (should (eq (length (tab-bar-tabs)) 1)) | ||
| 167 | (should (eq (length (frame-list)) 2)) | ||
| 168 | (delete-frame)))) | ||
| 169 | |||
| 170 | ;; Clean up tabs afterwards | ||
| 171 | (tab-bar-tabs-set nil)) | ||
| 155 | 172 | ||
| 156 | (provide 'tab-bar-tests) | 173 | (provide 'tab-bar-tests) |
| 157 | ;;; tab-bar-tests.el ends here | 174 | ;;; tab-bar-tests.el ends here |