Skip to content

Commit cfff32d

Browse files
authored
Add package:http requests to network integration test (#9016)
1 parent 6419298 commit cfff32d

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

packages/devtools_app/integration_test/test/live_connection/network_screen_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ void main() {
5757
_expectInRequestTable('DELETE');
5858
await helper.clear();
5959

60+
// Instruct the app to make a GET request via the 'http' package.
61+
await helper.triggerRequest('packageHttp/get/');
62+
_expectInRequestTable('GET');
63+
await helper.clear();
64+
65+
// Instruct the app to make a POST request via the 'http' package.
66+
await helper.triggerRequest('packageHttp/post/');
67+
_expectInRequestTable('POST');
68+
await helper.clear();
69+
6070
// Instruct the app to make a GET request via Dio.
6171
await helper.triggerRequest('dio/get/');
6272
_expectInRequestTable('GET');
@@ -79,6 +89,10 @@ final class _NetworkScreenHelper {
7989
// Press the 'Clear' button between tests.
8090
await _tester.tap(find.text('Clear'));
8191
await _tester.pump(safePumpDuration);
92+
expect(
93+
screenControllers.lookup<NetworkController>().requests.value,
94+
isEmpty,
95+
);
8296
}
8397

8498
Future<void> triggerRequest(String path) async {

packages/devtools_app/test/test_infra/fixtures/networking_app/bin/main.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ Future<io.HttpServer> _bindControlServer(io.HttpServer testServer) async {
7474
return server;
7575
}
7676

77-
// TODO WebSocket
78-
// TODO package:http - BrowserClient - https://pub.dev/documentation/http/latest/browser_client/BrowserClient-class.html
79-
// TODO cupertino_http - https://pub.dev/packages/cupertino_http
80-
// TODO cronet_http - https://pub.dev/packages/cronet_http
81-
// TDOO fetch_client? https://pub.dev/packages/fetch_client
77+
// TODO(https://github.com/flutter/devtools/issues/8223): Test support for
78+
// WebSockets.
79+
// TODO(https://github.com/flutter/devtools/issues/4829): Test support for the
80+
// cupertino_http package and the cronet_http package.
8281

8382
class _HttpClient {
8483
_HttpClient(int testServerPort)

0 commit comments

Comments
 (0)