53 lines
1.7 KiB
Scheme
53 lines
1.7 KiB
Scheme
(import (chicken string))
|
|
(import r7rs
|
|
test
|
|
(chicken base)
|
|
(chicken string)
|
|
(chicken process)
|
|
(chicken gc)
|
|
alist-lib ;;Handling alists from JSON objects
|
|
base64 ;;decoding screenshot data
|
|
coops ;;Object system
|
|
http-client ;;API interaction
|
|
intarweb ;;Supporting HTTP functionality
|
|
medea ;;JSON handling
|
|
srfi-34 ;;Exception Handling
|
|
srfi-35 ;;Exception Types
|
|
uri-common ;;Supporting HTTP functionality
|
|
)
|
|
|
|
;; [[file:../raft.org::*Dependencies][Dependencies:5]]
|
|
(include-relative "../raft-impl.scm")
|
|
;; Dependencies:5 ends here
|
|
|
|
|
|
|
|
;; #+name: raft-session-test
|
|
|
|
;; [[file:../raft.org::raft-session-test][raft-session-test]]
|
|
(test-group "session"
|
|
(let ((browser (make-Raft <Gecko>)))
|
|
(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)))
|
|
;; raft-session-test ends here
|
|
|
|
|
|
|
|
;; #+name: raft-url-test
|
|
|
|
;; [[file:../raft.org::raft-url-test][raft-url-test]]
|
|
(test-group "url"
|
|
(let ((browser (make-Raft <Gecko>)))
|
|
(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)))
|
|
;; raft-url-test ends here
|
|
|
|
;; [[file:../raft.org::*About This Egg][About This Egg:2]]
|
|
(test-exit)
|
|
;; About This Egg:2 ends here
|