Skip to content

Commit 5273dab

Browse files
[path_provider] Fix integration tests on macOS (flutter#5773)
1 parent a87aad1 commit 5273dab

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/path_provider/path_provider/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Fixes integration test permission issue on recent versions of macOS.
4+
15
## 2.0.10
26

37
* Removes unnecessary imports.

packages/path_provider/path_provider/example/integration_test/path_provider_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,14 @@ void main() {
9292
expect(result, throwsA(isInstanceOf<UnsupportedError>()));
9393
} else {
9494
final Directory? result = await getDownloadsDirectory();
95-
_verifySampleFile(result, 'downloads');
95+
if (Platform.isMacOS) {
96+
// On recent versions of macOS, actually using the downloads directory
97+
// requires a user prompt, so will fail on CI. Instead, just check that
98+
// it returned a path with the expected directory name.
99+
expect(result?.path, endsWith('Downloads'));
100+
} else {
101+
_verifySampleFile(result, 'downloads');
102+
}
96103
}
97104
});
98105
}

0 commit comments

Comments
 (0)