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

Side by Side Diff: lib/src/runner/browser/server.dart

Issue 1053443002: Rename the package to "test". (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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
« no previous file with comments | « lib/src/runner/browser/iframe_test.dart ('k') | lib/src/runner/browser/static/host.dart » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 unittest.runner.browser.server; 5 library test.runner.browser.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
11 import 'package:path/path.dart' as p; 11 import 'package:path/path.dart' as p;
12 import 'package:shelf/shelf.dart' as shelf; 12 import 'package:shelf/shelf.dart' as shelf;
13 import 'package:shelf/shelf_io.dart' as shelf_io; 13 import 'package:shelf/shelf_io.dart' as shelf_io;
14 import 'package:shelf_static/shelf_static.dart'; 14 import 'package:shelf_static/shelf_static.dart';
15 import 'package:shelf_web_socket/shelf_web_socket.dart'; 15 import 'package:shelf_web_socket/shelf_web_socket.dart';
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 _browser.onExit.catchError((error, stackTrace) { 85 _browser.onExit.catchError((error, stackTrace) {
86 if (_browserManagerCompleter.isCompleted) return; 86 if (_browserManagerCompleter.isCompleted) return;
87 _browserManagerCompleter.completeError(error, stackTrace); 87 _browserManagerCompleter.completeError(error, stackTrace);
88 }); 88 });
89 } 89 }
90 return _browserManagerCompleter.future; 90 return _browserManagerCompleter.future;
91 } 91 }
92 Completer<BrowserManager> _browserManagerCompleter; 92 Completer<BrowserManager> _browserManagerCompleter;
93 93
94 BrowserServer._(this._packageRoot, bool color) 94 BrowserServer._(this._packageRoot, bool color)
95 : _compiledDir = Directory.systemTemp.createTempSync('unittest_').path, 95 : _compiledDir = Directory.systemTemp.createTempSync('test_').path,
96 _compilers = new CompilerPool(color: color); 96 _compilers = new CompilerPool(color: color);
97 97
98 /// Starts the underlying server. 98 /// Starts the underlying server.
99 Future _load() { 99 Future _load() {
100 var staticPath = p.join(libDir(packageRoot: _packageRoot), 100 var staticPath = p.join(libDir(packageRoot: _packageRoot),
101 'src/runner/browser/static'); 101 'src/runner/browser/static');
102 var cascade = new shelf.Cascade() 102 var cascade = new shelf.Cascade()
103 .add(_webSocketHandler.handler) 103 .add(_webSocketHandler.handler)
104 .add(createStaticHandler(staticPath, defaultDocument: 'index.html')) 104 .add(createStaticHandler(staticPath, defaultDocument: 'index.html'))
105 .add(createStaticHandler(_compiledDir, defaultDocument: 'index.html')); 105 .add(createStaticHandler(_compiledDir, defaultDocument: 'index.html'));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 /// Returns a [Future] that completes once the server is closed and its 154 /// Returns a [Future] that completes once the server is closed and its
155 /// resources have been fully released. 155 /// resources have been fully released.
156 Future close() { 156 Future close() {
157 new Directory(_compiledDir).deleteSync(recursive: true); 157 new Directory(_compiledDir).deleteSync(recursive: true);
158 return _server.close().then((_) { 158 return _server.close().then((_) {
159 if (_browserManagerCompleter == null) return null; 159 if (_browserManagerCompleter == null) return null;
160 return _browserManager.then((_) => _browser.close()); 160 return _browserManager.then((_) => _browser.close());
161 }); 161 });
162 } 162 }
163 } 163 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/iframe_test.dart ('k') | lib/src/runner/browser/static/host.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698