| 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.firefox; | 5 library test.runner.browser.firefox; |
| 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; | 10 import 'package:path/path.dart' as p; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 withTempDir((dir) { | 58 withTempDir((dir) { |
| 59 _dir = dir; | 59 _dir = dir; |
| 60 | 60 |
| 61 new File(p.join(dir, 'prefs.js')).writeAsStringSync(_preferences); | 61 new File(p.join(dir, 'prefs.js')).writeAsStringSync(_preferences); |
| 62 | 62 |
| 63 return Process.start(executable, [ | 63 return Process.start(executable, [ |
| 64 "--profile", | 64 "--profile", |
| 65 "$_dir", | 65 "$_dir", |
| 66 url.toString(), | 66 url.toString(), |
| 67 "--no-remote" | 67 "--no-remote" |
| 68 ]).then((process) { | 68 ], environment: { |
| 69 "MOZ_CRASHREPORTER_DISABLE": "1" |
| 70 }).then((process) { |
| 69 _process = process; | 71 _process = process; |
| 70 _onProcessStartedCompleter.complete(); | 72 _onProcessStartedCompleter.complete(); |
| 71 | 73 |
| 72 // TODO(nweiz): the browser's standard output is almost always useless | 74 // TODO(nweiz): the browser's standard output is almost always useless |
| 73 // noise, but we should allow the user to opt in to seeing it. | 75 // noise, but we should allow the user to opt in to seeing it. |
| 74 return _process.exitCode; | 76 return _process.exitCode; |
| 75 }); | 77 }); |
| 76 }).then((exitCode) { | 78 }).then((exitCode) { |
| 77 if (exitCode != 0) throw "Firefox failed with exit code $exitCode."; | 79 if (exitCode != 0) throw "Firefox failed with exit code $exitCode."; |
| 78 }).then(_onExitCompleter.complete) | 80 }).then(_onExitCompleter.complete) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 106 | 108 |
| 107 var path = p.join(prefix, suffix); | 109 var path = p.join(prefix, suffix); |
| 108 if (new File(p.join(prefix, suffix)).existsSync()) return path; | 110 if (new File(p.join(prefix, suffix)).existsSync()) return path; |
| 109 } | 111 } |
| 110 | 112 |
| 111 // Fall back on looking it up on the path. This probably won't work, but at | 113 // Fall back on looking it up on the path. This probably won't work, but at |
| 112 // least it will fail with a useful error message. | 114 // least it will fail with a useful error message. |
| 113 return "firefox.exe"; | 115 return "firefox.exe"; |
| 114 } | 116 } |
| 115 } | 117 } |
| OLD | NEW |