1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

LibWeb+WebContent: Add WebDriver infrastructure for executing scripts

This cannot be done on the Browser or WebDriver ends, or via the
existing run_javascript() IPC endpoint, as we cannot transfer JS objects
through the IPC boundary (yet), only serialized JSON, so the individual
WebDriver steps around script execution need to run in the WebContent
process.
This commit is contained in:
Linus Groh 2022-11-02 18:02:19 +00:00
parent ce8c34a8c9
commit b572a91a6f
6 changed files with 455 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include <LibGfx/ShareableBitmap.h>
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/WebDriver/ExecuteScript.h>
endpoint WebContentServer
{
@ -46,6 +47,8 @@ endpoint WebContentServer
get_element_text(i32 element_id) => (String text)
get_element_tag_name(i32 element_id) => (String tag_name)
webdriver_execute_script(String body, Vector<String> json_arguments, Optional<u64> timeout, bool async) => (Web::WebDriver::ExecuteScriptResultType result_type, String json_result)
run_javascript(String js_source) =|
dump_layout_tree() => (String dump)