OLD | NEW |
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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 var manager = _browserManagers[platform]; | 367 var manager = _browserManagers[platform]; |
368 if (manager != null) return Result.release(manager); | 368 if (manager != null) return Result.release(manager); |
369 | 369 |
370 var completer = new Completer.sync(); | 370 var completer = new Completer.sync(); |
371 var path = _webSocketHandler.create(webSocketHandler(completer.complete)); | 371 var path = _webSocketHandler.create(webSocketHandler(completer.complete)); |
372 var webSocketUrl = url.replace(scheme: 'ws').resolve(path); | 372 var webSocketUrl = url.replace(scheme: 'ws').resolve(path); |
373 var hostUrl = (_config.pubServeUrl == null ? url : _config.pubServeUrl) | 373 var hostUrl = (_config.pubServeUrl == null ? url : _config.pubServeUrl) |
374 .resolve('packages/test/src/runner/browser/static/index.html') | 374 .resolve('packages/test/src/runner/browser/static/index.html') |
375 .replace(queryParameters: {'managerUrl': webSocketUrl.toString()}); | 375 .replace(queryParameters: {'managerUrl': webSocketUrl.toString()}); |
376 | 376 |
377 var future = BrowserManager.start(platform, hostUrl, completer.future); | 377 var future = BrowserManager.start(platform, hostUrl, completer.future, |
| 378 debug: _config.pauseAfterLoad); |
378 | 379 |
379 // Capture errors and release them later to avoid Zone issues. This call to | 380 // Capture errors and release them later to avoid Zone issues. This call to |
380 // [_browserManagerFor] is running in a different [LoadSuite] than future | 381 // [_browserManagerFor] is running in a different [LoadSuite] than future |
381 // calls, which means they're also running in different error zones so | 382 // calls, which means they're also running in different error zones so |
382 // errors can't be freely passed between them. Storing the error or value as | 383 // errors can't be freely passed between them. Storing the error or value as |
383 // an explicit [Result] fixes that. | 384 // an explicit [Result] fixes that. |
384 _browserManagers[platform] = Result.capture(future); | 385 _browserManagers[platform] = Result.capture(future); |
385 | 386 |
386 return future; | 387 return future; |
387 } | 388 } |
(...skipping 17 matching lines...) Expand all Loading... |
405 await Future.wait(futures); | 406 await Future.wait(futures); |
406 | 407 |
407 if (_config.pubServeUrl == null) { | 408 if (_config.pubServeUrl == null) { |
408 new Directory(_compiledDir).deleteSync(recursive: true); | 409 new Directory(_compiledDir).deleteSync(recursive: true); |
409 } else { | 410 } else { |
410 _http.close(); | 411 _http.close(); |
411 } | 412 } |
412 }); | 413 }); |
413 } | 414 } |
414 } | 415 } |
OLD | NEW |