~alcinnz/amphiarao

9414d297f39e6fe6733d0307b975a994b1896f6f — Adrian Cochrane 3 years ago 86bfb71
Add noops for window (re)sizing, resorting to throwing errors.
1 files changed, 9 insertions(+), 1 deletions(-)

M src/Webdriver.hs
M src/Webdriver.hs => src/Webdriver.hs +9 -1
@@ 45,7 45,11 @@ serveSession sessions = WD.withSession fail (\uuid session -> msum [
            getWindowHandle uuid,
            delSession sessions uuid, -- Closing the only window closes the session.
            switchWindowHandle uuid,
            dir "handles" $ getWindowHandles uuid
            dir "handles" $ getWindowHandles uuid,
            dir "rect" $ unsupportedOp,
            dir "maximize" $ unsupportedOp,
            dir "minimize" $ unsupportedOp,
            dir "fullscreen" $ unsupportedOp
        ],
        dir "frame" $ msum [noSuchFrame, dir "parent" $ ok $ toResponse ()] -- Noops
    ]) sessions


@@ 153,3 157,7 @@ noSuchFrame = do
    method POST
    nullDir
    errJSON 404 "no such frame" "Rhapsode doesn't support frames"

unsupportedOp = do
    nullDir
    errJSON 400 "unsupported operation" "Windowsize is meaningless to Rhapsode"