devtools
40b2a264 - Add an integration test for the Network screen (#9003)

Commit
281 days ago
Add an integration test for the Network screen (#9003) There's a lot to this change! I wanted precise control over when the "test app" makes requests, and what kind, etc. I've added a capability for a Dart test app to print out what port it's "control server" is listening to, very similar to how it prints out the URL for DevTools to connect to. The "control server" is a basic HTTP server, that can be controlled with very simple requests. In this case, when the server sees a request to '/get/', it calls a dart:io HttpClient to send an HTTP GET request. A request to '/post/' directs the HttpClient to send an HTTP POST request, etc. For the network screen tests to see complete requests, there is a second HTTP server that responds to the test requests. So some changes are made to TestDartCliApp to support the "control port". This int is then passed to the integration test in the 'test args' (see the changes to integration_test/test_infra/run/run_test.dart). OK, then the test itself: This test is simple for now. The following types of requests are validated: * dart:io HttpClient GET * dart:io HttpClient POST * dart:io HttpClient PUT * dart:io HttpClient DELETE * Dio GET * Dio POST There are some TODOs for other requests we want to validate. Work towards #7554.
Author
Parents
Loading