Fix shell regressions and reset Servo embedding direction
This commit is contained in:
@@ -462,7 +462,7 @@ impl BrowserCore {
|
||||
fn refresh_tab_url_metadata(&mut self, tab_index: usize) -> Result<(), CoreError> {
|
||||
let title = tab_title(self.tabs[tab_index].url());
|
||||
self.tabs[tab_index].set_title(title);
|
||||
if let Some(favicon_key) = self.tabs[tab_index].url().favicon_url() {
|
||||
if let Some(favicon_key) = self.tabs[tab_index].url().favicon_key() {
|
||||
self.tabs[tab_index].set_favicon_key(favicon_key)?;
|
||||
} else {
|
||||
self.tabs[tab_index].clear_favicon_key();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::error::Error;
|
||||
|
||||
use ely_browser_core::{BrowserCore, InitialBrowserConfig};
|
||||
use ely_domain::{CommandIntent, CommandScope, ProfileKind, UrlText};
|
||||
use ely_domain::{CommandIntent, CommandScope, ProfileKind, SearchEngine, UrlText};
|
||||
|
||||
#[test]
|
||||
fn favorite_command_toggles_active_tab() -> Result<(), Box<dyn Error>> {
|
||||
@@ -187,6 +187,22 @@ fn open_sync_status_command_opens_sync_status_page() -> Result<(), Box<dyn Error
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plain_text_command_searches_with_selected_engine() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
|
||||
core.set_search_engine(SearchEngine::Google);
|
||||
core.set_command_query("servo browser");
|
||||
let intent = core.submit_command()?;
|
||||
let active_tab = core.active_tab()?;
|
||||
|
||||
assert_eq!(intent, Some(CommandIntent::Search("servo browser".to_string())));
|
||||
assert_eq!(active_tab.url().host().as_deref(), Some("www.google.com"));
|
||||
assert_eq!(active_tab.url().as_str(), "https://www.google.com/search?q=servo+browser");
|
||||
assert_eq!(core.snapshot()?.command_query, "");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn settings_scoped_search_opens_about_page() -> Result<(), Box<dyn Error>> {
|
||||
let mut core = BrowserCore::new(InitialBrowserConfig::ely_defaults()?)?;
|
||||
|
||||
@@ -61,10 +61,7 @@ fn navigation_replaces_new_tab_metadata_with_url_metadata() -> Result<(), Box<dy
|
||||
|
||||
let active_tab = core.active_tab()?;
|
||||
assert_eq!(active_tab.title(), "example.com");
|
||||
assert_eq!(
|
||||
active_tab.favicon_key(),
|
||||
Some("https://www.google.com/s2/favicons?domain=example.com&sz=64"),
|
||||
);
|
||||
assert_eq!(active_tab.favicon_key(), Some("ely-favicon://example.com"));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -95,10 +92,7 @@ fn history_navigation_refreshes_url_metadata() -> Result<(), Box<dyn Error>> {
|
||||
let active_tab = core.active_tab()?;
|
||||
assert_eq!(active_tab.url().as_str(), "https://example.com/a");
|
||||
assert_eq!(active_tab.title(), "example.com");
|
||||
assert_eq!(
|
||||
active_tab.favicon_key(),
|
||||
Some("https://www.google.com/s2/favicons?domain=example.com&sz=64"),
|
||||
);
|
||||
assert_eq!(active_tab.favicon_key(), Some("ely-favicon://example.com"));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user