Skip to content

Commit

Permalink
Add basic custom scheme test.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Mar 4, 2024
1 parent 1399f7c commit 01a85a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nyxt.asd
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
:components ((:file "renderer-package")
(:file "renderer-offline/set-url")
(:file "renderer-offline/execute-command-eval")
(:file "renderer-offline/nyxt-url-security")
(:file "renderer-offline/custom-schemes")
(:file "renderer-offline/search-buffer")
;; See https://github.com/atlas-engineer/nyxt/issues/3172
;; (:file "renderer-online/set-url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@

(in-package :nyxt/tests/renderer)

(nyxt:define-internal-scheme "test"
(lambda (url)
(declare (ignore url))
(spinneret:with-html-string (:p "pass"))))

(define-test register-custom-scheme ()
(let ((ready-channel (nyxt::make-channel 1)))
(nyxt:start :no-config t :no-auto-config t :headless t
:socket "/tmp/nyxt-test.socket" :profile "test")
(with-current-buffer (nyxt:make-buffer-focus :url "test:test")
(hooks:once-on (nyxt:buffer-loaded-hook (current-buffer)) (buffer)
(calispel:! ready-channel t))
(calispel:? ready-channel)
(sleep 1)
(assert-equal "pass"
(nyxt:ps-eval (ps:chain (nyxt/ps:qs document "p") inner-text))))
(nyxt:quit)))

(nyxt:define-internal-scheme "iframe-embed"
(lambda (url)
(declare (ignore url))
Expand Down

0 comments on commit 01a85a5

Please sign in to comment.