summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorMoustafa Raafat <MoustafaRaafat2@gmail.com>2022-10-15 18:15:38 +0100
committerLinus Groh <mail@linusgroh.de>2022-10-15 21:01:59 +0200
commit91326568565795702fadb50585550a3413e86428 (patch)
treed1d2c10d82a270a45617855a29e62eabd15197b3 /Userland/Applications
parent443ffab9dc01ac74fab1d681921a301f07643a1a (diff)
downloadserenity-91326568565795702fadb50585550a3413e86428.zip
WebDriver: Implement POST /session/{id}/back endpoint
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Browser/WebDriverConnection.cpp7
-rw-r--r--Userland/Applications/Browser/WebDriverConnection.h1
-rw-r--r--Userland/Applications/Browser/WebDriverSessionClient.ipc1
3 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/WebDriverConnection.cpp b/Userland/Applications/Browser/WebDriverConnection.cpp
index 37854ff0db..67b4eb2514 100644
--- a/Userland/Applications/Browser/WebDriverConnection.cpp
+++ b/Userland/Applications/Browser/WebDriverConnection.cpp
@@ -53,4 +53,11 @@ void WebDriverConnection::refresh()
browser_window->active_tab().reload();
}
+void WebDriverConnection::back()
+{
+ dbgln("WebDriverConnection: back");
+ if (auto browser_window = m_browser_window.strong_ref())
+ browser_window->active_tab().go_back();
+}
+
}
diff --git a/Userland/Applications/Browser/WebDriverConnection.h b/Userland/Applications/Browser/WebDriverConnection.h
index 0ba9bb7c79..5815012b8a 100644
--- a/Userland/Applications/Browser/WebDriverConnection.h
+++ b/Userland/Applications/Browser/WebDriverConnection.h
@@ -40,6 +40,7 @@ public:
virtual void set_url(AK::URL const& url) override;
virtual Messages::WebDriverSessionClient::GetTitleResponse get_title() override;
virtual void refresh() override;
+ virtual void back() override;
private:
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<BrowserWindow> browser_window);
diff --git a/Userland/Applications/Browser/WebDriverSessionClient.ipc b/Userland/Applications/Browser/WebDriverSessionClient.ipc
index e8644394a1..3d5b56d64d 100644
--- a/Userland/Applications/Browser/WebDriverSessionClient.ipc
+++ b/Userland/Applications/Browser/WebDriverSessionClient.ipc
@@ -7,4 +7,5 @@ endpoint WebDriverSessionClient {
set_url(URL url) =|
get_title() => (String title)
refresh() =|
+ back() =|
}