| 
									
										
										
										
											2022-11-02 18:02:19 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2023-04-20 17:41:32 +01:00
										 |  |  |  * Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org> | 
					
						
							| 
									
										
										
										
											2024-11-02 14:29:37 -04:00
										 |  |  |  * Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org> | 
					
						
							| 
									
										
										
										
											2022-11-02 18:02:19 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/Forward.h>
 | 
					
						
							|  |  |  | #include <LibJS/Forward.h>
 | 
					
						
							| 
									
										
										
										
											2024-09-13 07:42:24 -04:00
										 |  |  | #include <LibJS/Heap/HeapFunction.h>
 | 
					
						
							| 
									
										
										
										
											2024-11-02 14:29:37 -04:00
										 |  |  | #include <LibJS/Runtime/Promise.h>
 | 
					
						
							| 
									
										
										
										
											2022-11-02 18:02:19 +00:00
										 |  |  | #include <LibJS/Runtime/Value.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::WebDriver { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-02 14:29:37 -04:00
										 |  |  | struct ExecutionResult { | 
					
						
							|  |  |  |     JS::Promise::State state { JS::Promise::State::Pending }; | 
					
						
							|  |  |  |     JS::Value value {}; | 
					
						
							| 
									
										
										
										
											2022-11-02 18:02:19 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-02 14:29:37 -04:00
										 |  |  | using OnScriptComplete = JS::HeapFunction<void(ExecutionResult)>; | 
					
						
							| 
									
										
										
										
											2024-09-13 07:42:24 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-14 08:04:15 -04:00
										 |  |  | void execute_script(HTML::BrowsingContext const&, ByteString body, JS::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, JS::NonnullGCPtr<OnScriptComplete> on_complete); | 
					
						
							|  |  |  | void execute_async_script(HTML::BrowsingContext const&, ByteString body, JS::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, JS::NonnullGCPtr<OnScriptComplete> on_complete); | 
					
						
							| 
									
										
										
										
											2022-11-02 18:02:19 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |