feat(reload): reload the active tab with Cmd/Ctrl+R

This commit is contained in:
2026-07-10 16:55:25 -04:00
parent a12b8c8bd8
commit c5890058db
16 changed files with 147 additions and 5 deletions
@@ -53,6 +53,21 @@ fn recover_crashed_tab_marks_tab_ready() -> Result<(), Box<dyn Error>> {
Ok(())
}
#[test]
fn reload_active_tab_recovers_a_crashed_tab() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
let tab_id = core.open_tab(UrlText::parse("https://example.com/reload")?);
core.crash_active_tab()?;
assert_eq!(core.active_tab()?.state(), &TabState::Crashed);
let reloaded = core.reload_active_tab()?;
assert_eq!(reloaded, tab_id);
assert_eq!(core.active_tab()?.state(), &TabState::Ready);
assert_eq!(core.active_tab()?.url().as_str(), "https://example.com/reload");
Ok(())
}
#[test]
fn crash_tab_command_marks_active_tab_crashed() -> Result<(), Box<dyn Error>> {
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;