Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -470,22 +470,18 @@ void FirebaseStoragePlugin::ReferenceList(
const InternalStorageReference& reference,
const InternalListOptions& options,
std::function<void(ErrorOr<InternalListResult> reply)> result) {
// C++ doesn't support list yet
flutter::EncodableList items = flutter::EncodableList();
flutter::EncodableList prefixs = flutter::EncodableList();
InternalListResult pigeon_result = InternalListResult(items, prefixs);
result(pigeon_result);
result(FlutterError(
"unimplemented",
"Listing files is not supported by the Firebase C++ SDK on Windows."));
}

void FirebaseStoragePlugin::ReferenceListAll(
const InternalStorageFirebaseApp& app,
const InternalStorageReference& reference,
std::function<void(ErrorOr<InternalListResult> reply)> result) {
// C++ doesn't support listAll yet
flutter::EncodableList items = flutter::EncodableList();
flutter::EncodableList prefixs = flutter::EncodableList();
InternalListResult pigeon_result = InternalListResult(items, prefixs);
result(pigeon_result);
result(FlutterError(
"unimplemented",
"Listing files is not supported by the Firebase C++ SDK on Windows."));
}

void FirebaseStoragePlugin::ReferenceGetData(
Expand Down
22 changes: 22 additions & 0 deletions tests/integration_test/firebase_storage/reference_e2e.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,28 @@ void setupReferenceTests() {
skip: defaultTargetPlatform == TargetPlatform.windows,
);

test(
'list operations report that they are unsupported on Windows',
() async {
final Reference ref = storage.ref('flutter-tests/list');
final unsupportedError = isA<FirebaseException>()
.having((error) => error.code, 'code', 'unimplemented')
.having(
(error) => error.message,
'message',
'Listing files is not supported by the Firebase C++ SDK on '
'Windows.',
);

await expectLater(
ref.list(const ListOptions(maxResults: 25)),
throwsA(unsupportedError),
);
await expectLater(ref.listAll(), throwsA(unsupportedError));
},
skip: defaultTargetPlatform != TargetPlatform.windows,
);

test(
'listAll',
() async {
Expand Down
Loading