Skip to content

Commit 35eec4d

Browse files
Fix tests
1 parent 07620b8 commit 35eec4d

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

editor/src/application.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ impl Editor {
2828
dispatcher: Dispatcher::with_executor(executor),
2929
};
3030

31-
futures::executor::block_on(async {
32-
editor.replace_application_io(PlatformApplicationIo::new().await).await;
33-
});
34-
3531
(editor, runtime)
3632
}
3733

editor/src/messages/resource/resource_message_handler.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl Resources for ResourcesHandle {
1414
}
1515
}
1616

17-
#[derive(Default, ExtractField)]
17+
#[derive(ExtractField)]
1818
pub struct ResourceMessageHandler {
1919
storage: Option<Arc<RwLock<Box<dyn ResourceStorage>>>>,
2020
}
@@ -48,6 +48,20 @@ impl std::fmt::Debug for ResourceMessageHandler {
4848
}
4949
}
5050

51+
impl Default for ResourceMessageHandler {
52+
#[cfg(not(test))]
53+
fn default() -> Self {
54+
Self { storage: None }
55+
}
56+
57+
#[cfg(test)]
58+
fn default() -> Self {
59+
Self {
60+
storage: Some(Arc::new(RwLock::new(Box::new(graph_craft::application_io::HashMapResourceStorage::new())))),
61+
}
62+
}
63+
}
64+
5165
#[derive(ExtractField)]
5266
pub struct ResourceMessageContext {}
5367

editor/src/node_graph_executor/runtime.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ impl NodeRuntime {
134134
editor_preferences: Box::new(EditorPreferences::default()),
135135
node_graph_message_sender: Box::new(InternalNodeGraphUpdateSender(sender)),
136136

137+
#[cfg(not(test))]
137138
application_io: None,
139+
140+
#[cfg(test)]
141+
application_io: Some(PlatformApplicationIo::default().into()),
138142
}
139143
.into(),
140144

0 commit comments

Comments
 (0)