aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-09-24 17:48:35 +0200
committerLars Ingebrigtsen2019-09-24 17:48:41 +0200
commitea5c79f657a9e2826073896ea00e6000ccc04a8d (patch)
treea0b3b5d4f427f4d221c8d3bfe97fac38512b8338 /test
parent9dcdb1384df51a568af5ec35c9f0a762d3cf205b (diff)
downloademacs-ea5c79f657a9e2826073896ea00e6000ccc04a8d.tar.gz
emacs-ea5c79f657a9e2826073896ea00e6000ccc04a8d.zip
Allow controlling when to send cookies when retrieving images in shr
* lisp/net/shr.el (shr--use-cookies-p): New function. (shr-tag-img): Use it. (shr-cookie-policy): New variable. (shr-save-contents): Use cookies. * doc/misc/eww.texi (Advanced): Document it.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/shr-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
index dd820e2d9f4..c3be36439e0 100644
--- a/test/lisp/net/shr-tests.el
+++ b/test/lisp/net/shr-tests.el
@@ -53,6 +53,19 @@
53 (unless (equal (car result) (cdr result)) 53 (unless (equal (car result) (cdr result))
54 (should (not (list name (car result) (cdr result)))))))) 54 (should (not (list name (car result) (cdr result))))))))
55 55
56(ert-deftest use-cookies ()
57 (let ((shr-cookie-policy 'same-origin))
58 (should
59 (shr--use-cookies-p "http://images.fsf.org" '("http://www.fsf.org")))
60 (should
61 (shr--use-cookies-p "http://www.fsf.org" '("https://www.fsf.org")))
62 (should
63 (shr--use-cookies-p "http://www.fsf.org" '("https://www.fsf.org")))
64 (should
65 (shr--use-cookies-p "http://www.fsf.org" '("http://fsf.org")))
66 (should-not
67 (shr--use-cookies-p "http://www.gnu.org" '("http://www.fsf.org")))))
68
56(require 'shr) 69(require 'shr)
57 70
58;;; shr-stream-tests.el ends here 71;;; shr-stream-tests.el ends here