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

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

Issue 1055243005: Detect an old PhantomJS and emit a nice error. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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/phantom_js.dart ('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) 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 test.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
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 /// Returns the [BrowserManager] for [platform], which should be a browser. 324 /// Returns the [BrowserManager] for [platform], which should be a browser.
325 /// 325 ///
326 /// If no browser manager is running yet, starts one. 326 /// If no browser manager is running yet, starts one.
327 Future<BrowserManager> _browserManagerFor(TestPlatform platform) { 327 Future<BrowserManager> _browserManagerFor(TestPlatform platform) {
328 var manager = _browserManagers[platform]; 328 var manager = _browserManagers[platform];
329 if (manager != null) return manager; 329 if (manager != null) return manager;
330 330
331 var completer = new Completer(); 331 var completer = new Completer();
332 _browserManagers[platform] = completer.future; 332
333 // Swallow errors, since they're already being surfaced through the return
334 // value and [browser.onError].
335 _browserManagers[platform] = completer.future.catchError((_) {});
333 var path = _webSocketHandler.create(webSocketHandler((webSocket) { 336 var path = _webSocketHandler.create(webSocketHandler((webSocket) {
334 completer.complete(new BrowserManager(webSocket)); 337 completer.complete(new BrowserManager(webSocket));
335 })); 338 }));
336 339
337 var webSocketUrl = url.replace(scheme: 'ws').resolve(path); 340 var webSocketUrl = url.replace(scheme: 'ws').resolve(path);
338 341
339 var hostUrl = (_pubServeUrl == null ? url : _pubServeUrl) 342 var hostUrl = (_pubServeUrl == null ? url : _pubServeUrl)
340 .resolve('packages/test/src/runner/browser/static/index.html'); 343 .resolve('packages/test/src/runner/browser/static/index.html');
341 344
342 var browser = _newBrowser(hostUrl.replace(queryParameters: { 345 var browser = _newBrowser(hostUrl.replace(queryParameters: {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (_pubServeUrl == null) { 391 if (_pubServeUrl == null) {
389 new Directory(_compiledDir).deleteSync(recursive: true); 392 new Directory(_compiledDir).deleteSync(recursive: true);
390 } else { 393 } else {
391 _http.close(); 394 _http.close();
392 } 395 }
393 396
394 _closeCompleter.complete(); 397 _closeCompleter.complete();
395 }).catchError(_closeCompleter.completeError); 398 }).catchError(_closeCompleter.completeError);
396 } 399 }
397 } 400 }
OLDNEW
« no previous file with comments | « lib/src/runner/browser/phantom_js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698