Skip to content

Commit beaa5d1

Browse files
committed
[red] cover queued filesystem initialization disposal
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent 6aa30d0 commit beaa5d1

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎app/test/unit/file_explorer_controller_test.dart‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,26 @@ void main() {
936936
return (connection: connection, c: c);
937937
}
938938

939+
test(
940+
'dispose before the queued initial load performs no board I/O',
941+
() async {
942+
final _HeldDeviceInfoConnection connection =
943+
_HeldDeviceInfoConnection();
944+
addTearDown(connection.dispose);
945+
final ProviderContainer c = ProviderContainer(
946+
overrides: <Override>[
947+
connectionProvider.overrideWithValue(connection),
948+
],
949+
);
950+
951+
c.listen(fileExplorerProvider, (_, _) {});
952+
c.dispose();
953+
await pumpEventQueue();
954+
955+
expect(connection.deviceInfoRequests, isEmpty);
956+
},
957+
);
958+
939959
test(
940960
'a late prior-session DEVICE_INFO success cannot replace the current root',
941961
() async {

0 commit comments

Comments
 (0)