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

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

Issue 17589012: Add error-page support in VirtualDirectory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
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:io'; 8 import 'dart:io';
9 9
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 31
32 Future<HttpHeaders> getHeaders(int port, String path) { 32 Future<HttpHeaders> getHeaders(int port, String path) {
33 return new HttpClient().get('localhost', port, path) 33 return new HttpClient().get('localhost', port, path)
34 .then((request) => request.close()) 34 .then((request) => request.close())
35 .then((response) => response.drain().then( 35 .then((response) => response.drain().then(
36 (_) => response.headers)); 36 (_) => response.headers));
37 } 37 }
38 38
39 39
40 Future<String> getAsString(int port, String path) {
41 return new HttpClient().get('localhost', port, path)
42 .then((request) => request.close())
43 .then((response) => StringDecoder.decode(response));
44 }
45
46
40 const CERTIFICATE = "localhost_cert"; 47 const CERTIFICATE = "localhost_cert";
41 48
42 49
43 setupSecure() { 50 setupSecure() {
44 Path scriptDir = new Path(new Options().script).directoryPath; 51 Path scriptDir = new Path(new Options().script).directoryPath;
45 Path certificateDatabase = scriptDir.append('pkcert'); 52 Path certificateDatabase = scriptDir.append('pkcert');
46 SecureSocket.initialize(database: certificateDatabase.toNativePath(), 53 SecureSocket.initialize(database: certificateDatabase.toNativePath(),
47 password: 'dartdart'); 54 password: 'dartdart');
48 } 55 }
OLDNEW
« no previous file with comments | « pkg/http_server/lib/src/virtual_directory.dart ('k') | pkg/http_server/test/virtual_directory_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698