File tree 1 file changed +22
-1
lines changed
packages/path_provider/path_provider_android/test
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,27 @@ class _Api implements TestPathProviderApi {
37
37
String ? getTemporaryPath () => kTemporaryPath;
38
38
}
39
39
40
+ class _ApiNull implements TestPathProviderApi {
41
+ @override
42
+ String ? getApplicationDocumentsPath () => null ;
43
+
44
+ @override
45
+ String ? getApplicationSupportPath () => null ;
46
+
47
+ @override
48
+ List <String ?> getExternalCachePaths () => < String > [];
49
+
50
+ @override
51
+ String ? getExternalStoragePath () => null ;
52
+
53
+ @override
54
+ List <String ?> getExternalStoragePaths (messages.StorageDirectory directory) =>
55
+ < String > [];
56
+
57
+ @override
58
+ String ? getTemporaryPath () => null ;
59
+ }
60
+
40
61
void main () {
41
62
TestWidgetsFlutterBinding .ensureInitialized ();
42
63
@@ -94,8 +115,8 @@ void main() {
94
115
expect (path, kExternalStoragePaths);
95
116
});
96
117
97
- //TODO: override externalStoragePaths as empty
98
118
test ('getDownloadsPath null' , () async {
119
+ TestPathProviderApi .setup (_ApiNull ());
99
120
final String ? path = await pathProvider.getDownloadsPath ();
100
121
expect (path, null );
101
122
});
You can’t perform that action at this time.
0 commit comments