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

Side by Side Diff: pkg/http_server/test/utils.dart

Issue 126453002: pkg/http_server: fix broken test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library utils; 5 library utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 import "package:unittest/unittest.dart"; 10 import "package:unittest/unittest.dart";
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }); 88 });
89 } 89 }
90 90
91 Future _withServer(Future func(HttpServer server)) { 91 Future _withServer(Future func(HttpServer server)) {
92 HttpServer server; 92 HttpServer server;
93 return HttpServer.bind('localhost', 0) 93 return HttpServer.bind('localhost', 0)
94 .then((value) { 94 .then((value) {
95 server = value; 95 server = value;
96 return func(server); 96 return func(server);
97 }) 97 })
98 .whenComplete(server.close); 98 .whenComplete(() => server.close());
99 } 99 }
100 100
101 101
102 const CERTIFICATE = "localhost_cert"; 102 const CERTIFICATE = "localhost_cert";
103 103
104 104
105 void setupSecure() { 105 void setupSecure() {
106 String certificateDatabase = Platform.script.resolve('pkcert').toFilePath(); 106 String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
107 SecureSocket.initialize(database: certificateDatabase, 107 SecureSocket.initialize(database: certificateDatabase,
108 password: 'dartdart'); 108 password: 'dartdart');
109 } 109 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698