-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into darwin
- Loading branch information
Showing
20 changed files
with
745 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Health | ||
on: | ||
pull_request: | ||
branches: [ master ] | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
health: | ||
uses: dart-lang/ecosystem/.github/workflows/health.yaml@main | ||
with: | ||
ignore_license: "**.g.dart" | ||
sdk: dev | ||
permissions: | ||
pull-requests: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Comment on the pull request | ||
|
||
on: | ||
# Trigger this workflow after the Health workflow completes. This workflow will have permissions to | ||
# do things like create comments on the PR, even if the original workflow couldn't. | ||
workflow_run: | ||
workflows: | ||
- Health | ||
- Publish | ||
types: | ||
- completed | ||
|
||
jobs: | ||
upload: | ||
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main | ||
permissions: | ||
pull-requests: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.2.3-wip | ||
|
||
* Fixed unintended HTML tags in doc comments. | ||
|
||
## 1.2.2 | ||
|
||
* Require package `web: '>=0.5.0 <2.0.0'`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.1.1-wip | ||
|
||
* Fixed unintended HTML tags in doc comments. | ||
|
||
## 0.1.0 | ||
|
||
* Initial **experimental** release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
pkgs/ok_http/example/integration_test/client_configuration_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:http/http.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:ok_http/ok_http.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void testTimeouts() { | ||
group('timeouts', () { | ||
group('call timeout', () { | ||
late HttpServer server; | ||
|
||
setUp(() async { | ||
server = (await HttpServer.bind('localhost', 0)) | ||
..listen((request) async { | ||
// Add a delay of `n` seconds for URI `http://localhost:port/n` | ||
final delay = int.parse(request.requestedUri.pathSegments.last); | ||
await Future<void>.delayed(Duration(seconds: delay)); | ||
|
||
await request.drain<void>(); | ||
await request.response.close(); | ||
}); | ||
}); | ||
tearDown(() { | ||
server.close(); | ||
}); | ||
|
||
test('exceeded', () { | ||
final client = OkHttpClient( | ||
configuration: const OkHttpClientConfiguration( | ||
callTimeout: Duration(milliseconds: 500), | ||
), | ||
); | ||
expect( | ||
() async { | ||
await client.get(Uri.parse('http://localhost:${server.port}/1')); | ||
}, | ||
throwsA( | ||
isA<ClientException>().having( | ||
(exception) => exception.message, | ||
'message', | ||
startsWith('java.io.InterruptedIOException'), | ||
), | ||
), | ||
); | ||
}); | ||
|
||
test('not exceeded', () async { | ||
final client = OkHttpClient( | ||
configuration: const OkHttpClientConfiguration( | ||
callTimeout: Duration(milliseconds: 1500), | ||
), | ||
); | ||
final response = await client.send( | ||
Request( | ||
'GET', | ||
Uri.http('localhost:${server.port}', '1'), | ||
), | ||
); | ||
|
||
expect(response.statusCode, 200); | ||
expect(response.contentLength, 0); | ||
}); | ||
|
||
test('not set', () async { | ||
final client = OkHttpClient(); | ||
|
||
expect( | ||
() async { | ||
await client.send( | ||
Request( | ||
'GET', | ||
Uri.http('localhost:${server.port}', '11'), | ||
), | ||
); | ||
}, | ||
throwsA( | ||
isA<ClientException>().having( | ||
(exception) => exception.message, | ||
'message', | ||
startsWith('java.net.SocketTimeoutException'), | ||
), | ||
), | ||
); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testTimeouts(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.