diff --git a/crates/gpui/src/app/test_context.rs b/crates/gpui/src/app/test_context.rs index 394ff3163536035391b2b6d607fc745dd794dd5f..9b982f9a1ca3c14b99dfc93e938aafe4e2f75cff 100644 --- a/crates/gpui/src/app/test_context.rs +++ b/crates/gpui/src/app/test_context.rs @@ -296,20 +296,6 @@ impl TestAppContext { &self.text_system } - /// Simulates writing credentials to the platform keychain. - pub fn write_credentials(&self, url: &str, username: &str, password: &[u8]) { - let _ = self - .test_platform - .write_credentials(url, username, password); - } - - /// Simulates reading credentials from the platform keychain. - pub fn read_credentials(&self, url: &str) -> Option<(String, Vec)> { - smol::block_on(self.test_platform.read_credentials(url)) - .ok() - .flatten() - } - /// Simulates writing to the platform clipboard pub fn write_to_clipboard(&self, item: ClipboardItem) { self.test_platform.write_to_clipboard(item) diff --git a/crates/gpui/src/platform/test/platform.rs b/crates/gpui/src/platform/test/platform.rs index 9677747bac943e6bb8ca370d479f7de7c9b00bee..dfada364667989792325e02f8530e6c91bdf4716 100644 --- a/crates/gpui/src/platform/test/platform.rs +++ b/crates/gpui/src/platform/test/platform.rs @@ -6,7 +6,7 @@ use crate::{ TestDisplay, TestWindow, WindowAppearance, WindowParams, size, }; use anyhow::Result; -use collections::{HashMap, VecDeque}; +use collections::VecDeque; use futures::channel::oneshot; use parking_lot::Mutex; use std::{ @@ -32,7 +32,6 @@ pub(crate) struct TestPlatform { current_clipboard_item: Mutex>, #[cfg(any(target_os = "linux", target_os = "freebsd"))] current_primary_item: Mutex>, - credentials: Mutex)>>, pub(crate) prompts: RefCell, screen_capture_sources: RefCell>, pub opened_url: RefCell>, @@ -118,7 +117,6 @@ impl TestPlatform { current_clipboard_item: Mutex::new(None), #[cfg(any(target_os = "linux", target_os = "freebsd"))] current_primary_item: Mutex::new(None), - credentials: Mutex::new(HashMap::default()), weak: weak.clone(), opened_url: Default::default(), #[cfg(target_os = "windows")] @@ -418,20 +416,15 @@ impl Platform for TestPlatform { self.current_clipboard_item.lock().clone() } - fn write_credentials(&self, url: &str, username: &str, password: &[u8]) -> Task> { - self.credentials - .lock() - .insert(url.to_string(), (username.to_string(), password.to_vec())); + fn write_credentials(&self, _url: &str, _username: &str, _password: &[u8]) -> Task> { Task::ready(Ok(())) } - fn read_credentials(&self, url: &str) -> Task)>>> { - let result = self.credentials.lock().get(url).cloned(); - Task::ready(Ok(result)) + fn read_credentials(&self, _url: &str) -> Task)>>> { + Task::ready(Ok(None)) } - fn delete_credentials(&self, url: &str) -> Task> { - self.credentials.lock().remove(url); + fn delete_credentials(&self, _url: &str) -> Task> { Task::ready(Ok(())) }