| 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.content_shell; | 5 library test.runner.browser.content_shell; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:path/path.dart' as p; | |
| 11 | |
| 12 import '../../util/io.dart'; | |
| 13 import 'browser.dart'; | 10 import 'browser.dart'; |
| 14 | 11 |
| 15 /// A class for running an instance of the Dartium content shell. | 12 /// A class for running an instance of the Dartium content shell. |
| 16 /// | 13 /// |
| 17 /// Most of the communication with the browser is expected to happen via HTTP, | 14 /// Most of the communication with the browser is expected to happen via HTTP, |
| 18 /// so this exposes a bare-bones API. The browser starts as soon as the class is | 15 /// so this exposes a bare-bones API. The browser starts as soon as the class is |
| 19 /// constructed, and is killed when [close] is called. | 16 /// constructed, and is killed when [close] is called. |
| 20 /// | 17 /// |
| 21 /// Any errors starting or running the process are reported through [onExit]. | 18 /// Any errors starting or running the process are reported through [onExit]. |
| 22 class ContentShell implements Browser { | 19 class ContentShell implements Browser { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 _onProcessStarted.then((_) => _process.kill()); | 55 _onProcessStarted.then((_) => _process.kill()); |
| 59 | 56 |
| 60 // Swallow exceptions. The user should explicitly use [onExit] for these. | 57 // Swallow exceptions. The user should explicitly use [onExit] for these. |
| 61 return onExit.catchError((_) {}); | 58 return onExit.catchError((_) {}); |
| 62 } | 59 } |
| 63 | 60 |
| 64 /// Return the default executable for the current operating system. | 61 /// Return the default executable for the current operating system. |
| 65 String _defaultExecutable() => | 62 String _defaultExecutable() => |
| 66 Platform.isWindows ? "content_shell.exe" : "content_shell"; | 63 Platform.isWindows ? "content_shell.exe" : "content_shell"; |
| 67 } | 64 } |
| OLD | NEW |