2023-11-09 00:21:49 +00:00
|
|
|
(import (chicken string))
|
|
|
|
(import r7rs
|
|
|
|
test
|
|
|
|
(chicken base)
|
|
|
|
(chicken string)
|
|
|
|
(chicken process)
|
|
|
|
(chicken gc)
|
2023-11-24 21:19:20 +00:00
|
|
|
alist-lib ;;Handling alists from JSON objects
|
2023-11-09 00:21:49 +00:00
|
|
|
base64 ;;decoding screenshot data
|
2023-11-24 21:19:20 +00:00
|
|
|
coops ;;Object system
|
2023-11-09 00:21:49 +00:00
|
|
|
http-client ;;API interaction
|
|
|
|
intarweb ;;Supporting HTTP functionality
|
|
|
|
medea ;;JSON handling
|
2023-11-24 21:19:20 +00:00
|
|
|
srfi-34 ;;Exception Handling
|
|
|
|
srfi-35 ;;Exception Types
|
|
|
|
uri-common ;;Supporting HTTP functionality
|
2023-11-09 00:21:49 +00:00
|
|
|
)
|
|
|
|
|
2024-09-16 12:31:48 +00:00
|
|
|
;; [[file:../raft.org::*Dependencies][Dependencies:7]]
|
2023-11-24 21:19:20 +00:00
|
|
|
(include-relative "../raft-impl.scm")
|
2024-09-16 12:31:48 +00:00
|
|
|
;; Dependencies:7 ends here
|
2023-11-09 00:21:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-24 21:19:20 +00:00
|
|
|
;; #+name: raft-session-test
|
2023-11-09 00:21:49 +00:00
|
|
|
|
2023-11-24 21:19:20 +00:00
|
|
|
;; [[file:../raft.org::raft-session-test][raft-session-test]]
|
2023-11-09 00:21:49 +00:00
|
|
|
(test-group "session"
|
2023-11-24 21:19:20 +00:00
|
|
|
(let ((browser (make-Raft <Gecko>)))
|
2023-11-09 00:21:49 +00:00
|
|
|
(test "Initial state" #f (slot-value browser 'session-id))
|
|
|
|
(test-assert "Session id check" (string? (begin (initialize-session browser) (slot-value browser 'session-id))))
|
|
|
|
(test-assert "Session id after termination" (eq? #f (begin (terminate-session browser) (slot-value browser 'session-id))))
|
|
|
|
(terminate browser)))
|
2023-11-24 21:19:20 +00:00
|
|
|
;; raft-session-test ends here
|
2023-11-09 00:21:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-24 21:19:20 +00:00
|
|
|
;; #+name: raft-url-test
|
2023-11-09 00:21:49 +00:00
|
|
|
|
2023-11-24 21:19:20 +00:00
|
|
|
;; [[file:../raft.org::raft-url-test][raft-url-test]]
|
2023-11-09 00:21:49 +00:00
|
|
|
(test-group "url"
|
2023-11-24 21:19:20 +00:00
|
|
|
(let ((browser (make-Raft <Gecko>)))
|
2023-11-09 00:21:49 +00:00
|
|
|
(test "Initial state" #f (slot-value browser 'session-id))
|
|
|
|
(test "Navigating to the first website" "http://info.cern.ch/hypertext/WWW/TheProject.html"
|
|
|
|
(begin (initialize-session browser)
|
|
|
|
(set-url browser "http://info.cern.ch/hypertext/WWW/TheProject.html")
|
|
|
|
(url browser)))
|
|
|
|
(terminate browser)))
|
2023-11-24 21:19:20 +00:00
|
|
|
;; raft-url-test ends here
|
2023-11-09 00:21:50 +00:00
|
|
|
|
2023-11-24 21:19:20 +00:00
|
|
|
;; [[file:../raft.org::*About This Egg][About This Egg:2]]
|
2023-11-09 00:21:50 +00:00
|
|
|
(test-exit)
|
|
|
|
;; About This Egg:2 ends here
|