| 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 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"; | |
| 10 import "package:unittest/unittest.dart"; | 9 import "package:unittest/unittest.dart"; |
| 11 | 10 |
| 12 import 'utils.dart'; | 11 import 'utils.dart'; |
| 13 | 12 |
| 14 | 13 |
| 15 void main() { | 14 void main() { |
| 16 group('serve-root', () { | 15 group('serve-root', () { |
| 17 test('dir-exists', () { | 16 test('dir-exists', () { |
| 18 expect(HttpServer.bind('localhost', 0).then((server) { | 17 expect(HttpServer.bind('localhost', 0).then((server) { |
| 19 var dir = Directory.systemTemp.createTempSync('http_server_virtual_'); | 18 var dir = Directory.systemTemp.createTempSync('http_server_virtual_'); |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 return getAsString(server.port, '/') | 686 return getAsString(server.port, '/') |
| 688 .whenComplete(() { | 687 .whenComplete(() { |
| 689 server.close(); | 688 server.close(); |
| 690 dir.deleteSync(recursive: true); | 689 dir.deleteSync(recursive: true); |
| 691 }); | 690 }); |
| 692 }), completion(equals('file contents'))); | 691 }), completion(equals('file contents'))); |
| 693 }); | 692 }); |
| 694 }); | 693 }); |
| 695 } | 694 } |
| 696 | 695 |
| OLD | NEW |