1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

WebDriver: Extract repeated "check for window or return error" code

If `TRY()` doesn't solve your problems, you're not using enough of it.
This commit is contained in:
Sam Atkins 2022-10-20 14:17:23 +01:00 committed by Linus Groh
parent 851bece9fc
commit 607767fd10
2 changed files with 36 additions and 61 deletions

View file

@ -33,7 +33,8 @@ public:
i32 id;
};
Optional<Window*> current_window() { return m_windows.get(m_current_window_handle); }
ErrorOr<Window*, WebDriverError> current_window();
ErrorOr<void, WebDriverError> check_for_open_top_level_browsing_context_or_return_error();
String const& current_window_handle() { return m_current_window_handle; }
ErrorOr<void> start();