Get tests green
This commit is contained in:
@@ -752,19 +752,16 @@ impl AppContext {
|
||||
self.globals_by_type.insert(global_type, Box::new(global));
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
/// Clear all stored globals. Does not notify global observers.
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn clear_globals(&mut self) {
|
||||
dbg!(core::panic::Location::caller());
|
||||
//todo!(notify globals?)
|
||||
self.globals_by_type.drain();
|
||||
}
|
||||
|
||||
/// Set the value of the global of the given type.
|
||||
#[track_caller]
|
||||
/// Remove the global of the given type from the app context. Does not notify global observers.
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn remove_global<G: Any>(&mut self) -> G {
|
||||
dbg!(core::panic::Location::caller());
|
||||
let global_type = TypeId::of::<G>();
|
||||
//todo!(notify globals?)
|
||||
*self
|
||||
.globals_by_type
|
||||
.remove(&global_type)
|
||||
|
||||
@@ -98,6 +98,7 @@ impl BackgroundExecutor {
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
#[track_caller]
|
||||
pub fn block_test<R>(&self, future: impl Future<Output = R>) -> R {
|
||||
self.block_internal(false, future)
|
||||
}
|
||||
@@ -106,6 +107,7 @@ impl BackgroundExecutor {
|
||||
self.block_internal(true, future)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub(crate) fn block_internal<R>(
|
||||
&self,
|
||||
background_only: bool,
|
||||
|
||||
Reference in New Issue
Block a user