Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgs/ok_http: DevTools Networking Support. #1242

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add profile enable/disabled tests
  • Loading branch information
Anikate-De committed Jun 24, 2024
commit 83fdd023c5221c4ab5fb28ef1b6401ea8aac4f09
44 changes: 36 additions & 8 deletions pkgs/ok_http/example/integration_test/client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:http_client_conformance_tests/http_client_conformance_tests.dart';
import 'package:http_profile/http_profile.dart';
import 'package:integration_test/integration_test.dart';
import 'package:ok_http/ok_http.dart';
import 'package:test/test.dart';
Expand All @@ -15,13 +16,40 @@ void main() async {

Future<void> testConformance() async {
group('ok_http client', () {
testAll(
OkHttpClient.new,
canStreamRequestBody: false,
preservesMethodCase: true,
supportsFoldedHeaders: false,
canSendCookieHeaders: true,
canReceiveSetCookieHeaders: true,
);
group('profile enabled', () {
final profile = HttpClientRequestProfile.profilingEnabled;
HttpClientRequestProfile.profilingEnabled = true;

try {
testAll(
OkHttpClient.new,
canStreamRequestBody: false,
preservesMethodCase: true,
supportsFoldedHeaders: false,
canSendCookieHeaders: true,
canReceiveSetCookieHeaders: true,
);
} finally {
HttpClientRequestProfile.profilingEnabled = profile;
}
});

group('profile disabled', () {
final profile = HttpClientRequestProfile.profilingEnabled;
HttpClientRequestProfile.profilingEnabled = false;

try {
testAll(
OkHttpClient.new,
canStreamRequestBody: false,
preservesMethodCase: true,
supportsFoldedHeaders: false,
canSendCookieHeaders: true,
canReceiveSetCookieHeaders: true,
);
} finally {
HttpClientRequestProfile.profilingEnabled = profile;
}
});
});
}
1 change: 1 addition & 0 deletions pkgs/ok_http/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dev_dependencies:
flutter_lints: ^3.0.0
http_client_conformance_tests:
path: ../../http_client_conformance_tests/
http_profile: ^0.1.0
integration_test:
sdk: flutter
test: ^1.23.1
Expand Down