OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:async/async.dart'; | 9 import 'package:async/async.dart'; |
10 import 'package:http_multi_server/http_multi_server.dart'; | 10 import 'package:http_multi_server/http_multi_server.dart'; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return new BrowserPlatform._(server, config, root: root); | 42 return new BrowserPlatform._(server, config, root: root); |
43 } | 43 } |
44 | 44 |
45 /// The underlying server. | 45 /// The underlying server. |
46 final shelf.Server _server; | 46 final shelf.Server _server; |
47 | 47 |
48 /// A randomly-generated secret. | 48 /// A randomly-generated secret. |
49 /// | 49 /// |
50 /// This is used to ensure that other users on the same system can't snoop | 50 /// This is used to ensure that other users on the same system can't snoop |
51 /// on data being served through this server. | 51 /// on data being served through this server. |
52 final _secret = randomBase64(24, urlSafe: true); | 52 final _secret = Uri.encodeComponent(randomBase64(24)); |
53 | 53 |
54 /// The URL for this server. | 54 /// The URL for this server. |
55 Uri get url => _server.url.resolve(_secret + "/"); | 55 Uri get url => _server.url.resolve(_secret + "/"); |
56 | 56 |
57 /// The test runner configuration. | 57 /// The test runner configuration. |
58 Configuration _config; | 58 Configuration _config; |
59 | 59 |
60 /// A [OneOffHandler] for servicing WebSocket connections for | 60 /// A [OneOffHandler] for servicing WebSocket connections for |
61 /// [BrowserManager]s. | 61 /// [BrowserManager]s. |
62 /// | 62 /// |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 await Future.wait(futures); | 422 await Future.wait(futures); |
423 | 423 |
424 if (_config.pubServeUrl == null) { | 424 if (_config.pubServeUrl == null) { |
425 new Directory(_compiledDir).deleteSync(recursive: true); | 425 new Directory(_compiledDir).deleteSync(recursive: true); |
426 } else { | 426 } else { |
427 _http.close(); | 427 _http.close(); |
428 } | 428 } |
429 }); | 429 }); |
430 final _closeMemo = new AsyncMemoizer(); | 430 final _closeMemo = new AsyncMemoizer(); |
431 } | 431 } |
OLD | NEW |