File tree 3 files changed +19
-20
lines changed
3 files changed +19
-20
lines changed Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
2
import 'dart:io' ;
3
3
4
+ import 'package:flutter/widgets.dart' ;
4
5
import 'package:flutter_test/flutter_test.dart' ;
5
6
7
+ /// Set [debugNetworkImageHttpClientProvider] to return a constant image.
8
+ ///
9
+ /// Returns the [FakeImageHttpClient] that handles the requests.
10
+ ///
11
+ /// The caller must set [debugNetworkImageHttpClientProvider] back to null
12
+ /// before the end of the test.
13
+ // TODO(upstream) simplify callers by using addTearDown: https://github.com/flutter/flutter/issues/123189
14
+ // See also: https://github.com/flutter/flutter/issues/121917
15
+ FakeImageHttpClient prepareBoringImageHttpClient () {
16
+ final httpClient = FakeImageHttpClient ();
17
+ debugNetworkImageHttpClientProvider = () => httpClient;
18
+ httpClient.request.response
19
+ ..statusCode = HttpStatus .ok
20
+ ..content = kSolidBlueAvatar;
21
+ return httpClient;
22
+ }
23
+
6
24
class FakeImageHttpClient extends Fake implements HttpClient {
7
25
final FakeImageHttpClientRequest request = FakeImageHttpClientRequest ();
8
26
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import '../api/fake_api.dart';
14
14
import '../example_data.dart' as eg;
15
15
import '../model/binding.dart' ;
16
16
import '../model/test_store.dart' ;
17
- import 'content_test .dart' ;
17
+ import '../test_images .dart' ;
18
18
19
19
/// Simulates loading a [MessageListPage] and tapping to focus the compose input.
20
20
///
Original file line number Diff line number Diff line change 1
- import 'dart:io' ;
2
-
3
1
import 'package:checks/checks.dart' ;
4
2
import 'package:flutter/foundation.dart' ;
5
3
import 'package:flutter/material.dart' ;
@@ -27,23 +25,6 @@ import 'dialog_checks.dart';
27
25
import 'message_list_checks.dart' ;
28
26
import 'page_checks.dart' ;
29
27
30
- /// Set [debugNetworkImageHttpClientProvider] to return a constant image.
31
- ///
32
- /// Returns the [FakeImageHttpClient] that handles the requests.
33
- ///
34
- /// The caller must set [debugNetworkImageHttpClientProvider] back to null
35
- /// before the end of the test.
36
- // TODO(upstream) simplify callers by using addTearDown: https://github.com/flutter/flutter/issues/123189
37
- // See also: https://github.com/flutter/flutter/issues/121917
38
- FakeImageHttpClient prepareBoringImageHttpClient () {
39
- final httpClient = FakeImageHttpClient ();
40
- debugNetworkImageHttpClientProvider = () => httpClient;
41
- httpClient.request.response
42
- ..statusCode = HttpStatus .ok
43
- ..content = kSolidBlueAvatar;
44
- return httpClient;
45
- }
46
-
47
28
void main () {
48
29
// For testing a new content feature:
49
30
//
You can’t perform that action at this time.
0 commit comments