File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,14 +24,10 @@ impl Editor {
2424 graphene_std:: uuid:: set_uuid_seed ( 0 ) ;
2525
2626 let ( runtime, executor) = crate :: node_graph_executor:: NodeGraphExecutor :: new_with_local_runtime ( ) ;
27- let mut editor = Self {
27+ let editor = Self {
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
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ impl Resources for ResourcesHandle {
1414 }
1515}
1616
17- #[ derive( Default , ExtractField ) ]
17+ #[ derive( ExtractField ) ]
1818pub 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 ) ]
5266pub struct ResourceMessageContext { }
5367
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments