Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: tests/standalone/io/secure_unauthorized_test.dart

Issue 23189002: dart:io | Add test for HttpClient requests that never complete their future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add suppressions and issue number in standalone.status. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/secure_unauthorized_client.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/secure_unauthorized_test.dart
diff --git a/tests/standalone/io/secure_bad_certificate_test.dart b/tests/standalone/io/secure_unauthorized_test.dart
similarity index 60%
copy from tests/standalone/io/secure_bad_certificate_test.dart
copy to tests/standalone/io/secure_unauthorized_test.dart
index ccdbf324b9d589dd6b1792bd8c28077e2550179e..a86b95c098cbfc4b4aa7d64d94d1eee570df2abd 100644
--- a/tests/standalone/io/secure_bad_certificate_test.dart
+++ b/tests/standalone/io/secure_unauthorized_test.dart
@@ -2,7 +2,8 @@
// 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.
-// This test verifies that the bad certificate callback works.
+// This test verifies that failing secure connection attempts always complete
+// their returned future.
import "package:expect/expect.dart";
import "package:path/path.dart";
@@ -12,13 +13,10 @@ import "dart:io";
const HOST_NAME = "localhost";
const CERTIFICATE = "localhost_cert";
-
-String certificateDatabase() =>
- join(dirname(new Options().script), 'pkcert');
-
Future<SecureServerSocket> runServer() {
- SecureSocket.initialize(database: certificateDatabase(),
- password: 'dartdart');
+ SecureSocket.initialize(
+ database: join(dirname(new Options().script), 'pkcert'),
+ password: 'dartdart');
return SecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE)
.then((SecureServerSocket server) {
@@ -32,18 +30,18 @@ Future<SecureServerSocket> runServer() {
});
}
-
void main() {
final options = new Options();
var clientScript = join(dirname(options.script),
- 'secure_bad_certificate_client.dart');
+ 'secure_unauthorized_client.dart');
- Future clientProcess(int port, String acceptCertificate) {
+ Future clientProcess(int port) {
return Process.run(options.executable,
- [clientScript, port.toString(), acceptCertificate])
- .then((ProcessResult result) {
- if (result.exitCode != 0) {
- print("Client failed, stdout:");
+ [clientScript, port.toString()])
+ .then((ProcessResult result) {
+ if (result.exitCode != 0 || !result.stdout.contains('SUCCESS')) {
+ print("Client failed");
+ print(" stdout:");
print(result.stdout);
print(" stderr:");
print(result.stderr);
@@ -53,10 +51,7 @@ void main() {
}
runServer().then((server) {
- Future.wait([clientProcess(server.port, 'true'),
- clientProcess(server.port, 'false'),
- clientProcess(server.port, 'fisk'),
- clientProcess(server.port, 'exception')]).then((_) {
+ clientProcess(server.port).then((_) {
server.close();
});
});
« no previous file with comments | « tests/standalone/io/secure_unauthorized_client.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698