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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 23679006: Add support for firefox on windows to the browser controller (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 27192)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -455,12 +455,6 @@
}
class Firefox extends Browser {
- /**
- * The binary used to run firefox - changing this can be nececcary for
- * testing or using non standard firefox installation.
- */
- static const String binary = "firefox";
-
static const String enablePopUp =
'user_pref("dom.disable_open_during_load", false);';
static const String disableDefaultCheck =
@@ -477,9 +471,21 @@
randomFile.close();
}
+ // This is extracted to a function since we may need to support several
+ // locations.
+ String _getWindowsBinary() {
+ return "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
+ }
+ String _getBinary() {
kustermann 2013/09/06 08:48:49 Why not make it static and do static const String
ricow1 2013/09/06 08:52:34 Sure
+ if (Platform.isWindows) return _getWindowsBinary();
+ if (Platform.isLinux) return 'firefox';
+ }
+
+
Future<bool> start(String url) {
_logEvent("Starting firefox browser on: $url");
+ var binary = _getBinary();
// Get the version and log that.
return Process.run(binary, ["--version"]).then((var versionResult) {
if (versionResult.exitCode != 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698