aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJim Porter2025-07-04 16:23:45 -0700
committerJim Porter2025-07-06 17:26:45 -0700
commitd3c75a3d2de6aa2609b1afef0ae2d1a6e833e9bc (patch)
treea07f3703f36a3242ae62e551c93160b79010bf07 /test
parentb93d49a3787085407a9dd57d678d0fc552878fcc (diff)
downloademacs-d3c75a3d2de6aa2609b1afef0ae2d1a6e833e9bc.tar.gz
emacs-d3c75a3d2de6aa2609b1afef0ae2d1a6e833e9bc.zip
Show "readable" status in the EWW mode line
* lisp/net/eww.el (eww-display-html): Check whether a readable form of the document exists; if not, don't set ':readable' to t. (eww-readable): Check whether a readable form of the document exists; if not, warn the user and don't add to history. (eww-readable-dom): Return nil if no readable form exists. (eww-mode): Check the ':readable' property of 'eww-data' to show "readable" state in the mode line. * test/lisp/net/eww-tests.el (eww-test/readable/default-readable/non-readable-page): New test (bug#78958).
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/eww-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/net/eww-tests.el b/test/lisp/net/eww-tests.el
index e9cfde4243a..fdb82ac628b 100644
--- a/test/lisp/net/eww-tests.el
+++ b/test/lisp/net/eww-tests.el
@@ -260,5 +260,18 @@ This sets `eww-before-browse-history-function' to
260 (should (length= base-tags 1)) 260 (should (length= base-tags 1))
261 (should (equal (dom-attr (car base-tags) 'href) "/foo/")))))) 261 (should (equal (dom-attr (car base-tags) 'href) "/foo/"))))))
262 262
263(ert-deftest eww-test/readable/default-readable/non-readable-page ()
264 "Test that EWW handles readable-by-default correctly for non-readable pages."
265 (skip-unless (libxml-available-p))
266 (eww-test--with-mock-retrieve
267 (let* ((eww-test--response-function
268 (lambda (_url)
269 (concat "Content-Type: text/html\n\n"
270 "<html><body><h1>Hello</h1></body></html>")))
271 (eww-readable-urls '("://example\\.invalid/")))
272 (eww "example.invalid")
273 ;; Make sure EWW doesn't use "readable" mode here.
274 (should-not (plist-get eww-data :readable)))))
275
263(provide 'eww-tests) 276(provide 'eww-tests)
264;; eww-tests.el ends here 277;; eww-tests.el ends here