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

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

Issue 217143002: pkg/http_server: fixes for unittest deprecations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « pkg/http_server/pubspec.yaml ('k') | 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import "package:http_server/http_server.dart"; 8 import "package:http_server/http_server.dart";
9 import 'package:path/path.dart' as pathos; 9 import 'package:path/path.dart' as pathos;
10 import "package:unittest/unittest.dart"; 10 import "package:unittest/unittest.dart";
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 .then((result) { 186 .then((result) {
187 expect(result, 'index file'); 187 expect(result, 'index file');
188 }); 188 });
189 }); 189 });
190 190
191 testVirtualDir('index-2', (dir) { 191 testVirtualDir('index-2', (dir) {
192 new Directory('${dir.path}/dir').createSync(); 192 new Directory('${dir.path}/dir').createSync();
193 var virDir = new VirtualDirectory(dir.path); 193 var virDir = new VirtualDirectory(dir.path);
194 virDir.allowDirectoryListing = true; 194 virDir.allowDirectoryListing = true;
195 195
196 virDir.directoryHandler = protectAsync2((dir2, request) { 196 virDir.directoryHandler = (dir2, request) {
197 fail('not expected'); 197 fail('not expected');
198 }); 198 };
199 199
200 return getStatusCodeForVirtDir(virDir, '/dir', followRedirects: false) 200 return getStatusCodeForVirtDir(virDir, '/dir', followRedirects: false)
201 .then((result) { 201 .then((result) {
202 expect(result, 301); 202 expect(result, 301);
203 }); 203 });
204 }); 204 });
205 205
206 testVirtualDir('index-3', (dir) { 206 testVirtualDir('index-3', (dir) {
207 new File('${dir.path}/dir/index.html') 207 new File('${dir.path}/dir/index.html')
208 ..createSync(recursive: true) 208 ..createSync(recursive: true)
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 return virDir.serveFile(new File('${d.path}/file'), request); 530 return virDir.serveFile(new File('${d.path}/file'), request);
531 }; 531 };
532 532
533 return getAsString(virDir, '/') 533 return getAsString(virDir, '/')
534 .then((result) { 534 .then((result) {
535 expect(result, 'file contents'); 535 expect(result, 'file contents');
536 }); 536 });
537 }); 537 });
538 }); 538 });
539 } 539 }
OLDNEW
« no previous file with comments | « pkg/http_server/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698