File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
flutter_cache_manager/test Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
import 'dart:io' ;
2
+ import 'dart:math' ;
2
3
import 'dart:typed_data' ;
3
4
import 'dart:ui' ;
4
5
@@ -99,6 +100,22 @@ void main() {
99
100
expect (result, isNotNull);
100
101
config.verifyDownloadCall ();
101
102
});
103
+
104
+ test ('Downloads should give progress' , () async {
105
+ var config = await setupConfig (cacheKey: 'resized_w100_h150_$fileUrl ' );
106
+ var cacheManager = TestCacheManager (config);
107
+ var results = await cacheManager
108
+ .getImageFile (
109
+ fileUrl,
110
+ maxWidth: 100 ,
111
+ maxHeight: 80 ,
112
+ withProgress: true ,
113
+ )
114
+ .toList ();
115
+ var progress = results.whereType <DownloadProgress >().toList ();
116
+ config.verifyDownloadCall ();
117
+ expect (progress, isNotEmpty);
118
+ });
102
119
});
103
120
}
104
121
You can’t perform that action at this time.
0 commit comments