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

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

Issue 23054008: Remove the Path class from dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed first round of review comments 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 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 import "package:path/path.dart";
10 10
11 Future<int> getStatusCode(int port, 11 Future<int> getStatusCode(int port,
12 String path, 12 String path,
13 {String host, 13 {String host,
14 bool secure: false, 14 bool secure: false,
15 DateTime ifModifiedSince, 15 DateTime ifModifiedSince,
16 bool rawPath: false}) { 16 bool rawPath: false}) {
17 var uri; 17 var uri;
18 if (rawPath) { 18 if (rawPath) {
19 uri = new Uri(scheme: secure ? 'https' : 'http', 19 uri = new Uri(scheme: secure ? 'https' : 'http',
(...skipping 30 matching lines...) Expand all
50 return new HttpClient().get('localhost', port, path) 50 return new HttpClient().get('localhost', port, path)
51 .then((request) => request.close()) 51 .then((request) => request.close())
52 .then((response) => StringDecoder.decode(response)); 52 .then((response) => StringDecoder.decode(response));
53 } 53 }
54 54
55 55
56 const CERTIFICATE = "localhost_cert"; 56 const CERTIFICATE = "localhost_cert";
57 57
58 58
59 setupSecure() { 59 setupSecure() {
60 Path scriptDir = new Path(new Options().script).directoryPath; 60 String scriptDir = dirname(new Options().script);
61 Path certificateDatabase = scriptDir.append('pkcert'); 61 String certificateDatabase = join(scriptDir, 'pkcert');
62 SecureSocket.initialize(database: certificateDatabase.toNativePath(), 62 SecureSocket.initialize(database: certificateDatabase,
63 password: 'dartdart'); 63 password: 'dartdart');
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698