OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // VMOptions= | 5 // VMOptions= |
6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
9 | 9 |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 for (int i = 0; i < connections; i++) { | 359 for (int i = 0; i < connections; i++) { |
360 var completer = new Completer(); | 360 var completer = new Completer(); |
361 futures.add(completer.future); | 361 futures.add(completer.future); |
362 WebSocket.connect('${baseWsUrl}') | 362 WebSocket.connect('${baseWsUrl}') |
363 .then((websocket) { | 363 .then((websocket) { |
364 websocket.listen((_) { websocket.close(); }, | 364 websocket.listen((_) { websocket.close(); }, |
365 onDone: completer.complete); | 365 onDone: completer.complete); |
366 }); | 366 }); |
367 | 367 |
368 futures.add(client.openUrl("GET", new Uri.fromString('${baseHttpUrl}')) | 368 futures.add(client.openUrl("GET", Uri.parse('${baseHttpUrl}')) |
369 .then((request) => request.close()) | 369 .then((request) => request.close()) |
370 .then((response) { | 370 .then((response) { |
371 response.listen((_) { }); | 371 response.listen((_) { }); |
372 Expect.equals(HttpStatus.OK, response.statusCode); | 372 Expect.equals(HttpStatus.OK, response.statusCode); |
373 })); | 373 })); |
374 } | 374 } |
375 | 375 |
376 Future.wait(futures).then((_) { | 376 Future.wait(futures).then((_) { |
377 server.close(); | 377 server.close(); |
378 client.close(); | 378 client.close(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), | 410 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), |
411 password: "dartdart"); | 411 password: "dartdart"); |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 main() { | 415 main() { |
416 new SecurityConfiguration(secure: false).runTests(); | 416 new SecurityConfiguration(secure: false).runTests(); |
417 initializeSSL(); | 417 initializeSSL(); |
418 new SecurityConfiguration(secure: true).runTests(); | 418 new SecurityConfiguration(secure: true).runTests(); |
419 } | 419 } |
OLD | NEW |