summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2024-03-18 16:52:34 -0700
committerJim Porter <jporterbugs@gmail.com>2024-03-23 10:17:06 -0700
commit4b0f5cdb01fbd05c8184a89fa8543eb5600fb4f8 (patch)
tree26a5e302417cf3dcd972a51994e77c1745d237dc /test
parent72972118e6f5831f200108cd7b80bf86538c265e (diff)
downloademacs-4b0f5cdb01fbd05c8184a89fa8543eb5600fb4f8.tar.gz
Add 'eww-readable-urls'
* lisp/net/eww.el (eww-readable-urls): New option. (eww-default-readable-p): New function... (eww-display-html): ... use it. * test/lisp/net/eww-tests.el (eww-test/readable/default-readable): New test. * doc/misc/eww.texi (Basics): Document 'eww-readable-urls'. * etc/NEWS: Announce this change (bug#68254).
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/eww-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/net/eww-tests.el b/test/lisp/net/eww-tests.el
index a09e0a4f279..b83435e0bd9 100644
--- a/test/lisp/net/eww-tests.el
+++ b/test/lisp/net/eww-tests.el
@@ -231,5 +231,17 @@ This sets `eww-before-browse-history-function' to
"This is an uninteresting sentence."
(buffer-substring-no-properties (point-min) (point-max)))))))
+(ert-deftest eww-test/readable/default-readable ()
+ "Test that EWW displays readable parts of pages by default when applicable."
+ (eww-test--with-mock-retrieve
+ (let* ((eww-test--response-function
+ (lambda (_url)
+ (concat "Content-Type: text/html\n\n"
+ "<html><body>Hello there</body></html>")))
+ (eww-readable-urls '("://example\\.invalid/")))
+ (eww "example.invalid")
+ ;; Make sure EWW uses "readable" mode.
+ (should (plist-get eww-data :readable)))))
+
(provide 'eww-tests)
;; eww-tests.el ends here