Chromium Code Reviews| Index: tools/testing/dart/utils.dart |
| diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart |
| index 65949b7135e3d3cd558e01a7d548e154796a3f82..83144588733c6e12a46e00826ce824647e1f3f0a 100644 |
| --- a/tools/testing/dart/utils.dart |
| +++ b/tools/testing/dart/utils.dart |
| @@ -126,16 +126,57 @@ String decodeUtf8(List<int> bytes) { |
| } |
| class Locations { |
| - static String getDartiumLocation(Map globalConfiguration) { |
| - var dartium = globalConfiguration['dartium']; |
| - if (dartium != null && dartium != '') { |
| - return dartium; |
| + static String getBrowserLocation(String browserName, |
| + Map globalConfiguration) { |
| + var location = globalConfiguration[browserName]; |
| + if (location != null && location != '') { |
| + return location; |
| } |
| - if (Platform.operatingSystem == 'macos') { |
| - return new Path('client/tests/dartium/Chromium.app/Contents/' |
| - 'MacOS/Chromium').toNativePath(); |
| + switch (browserName) { |
|
kustermann
2013/11/06 14:28:01
You could do something like this, to make it a bit
|
| + case 'firefox': |
| + if (Platform.isWindows) { |
| + return "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"; |
| + } else if (Platform.isLinux) { |
| + return 'firefox'; |
| + } else if (Platform.isMacOS) { |
| + return "/Applications/Firefox.app/Contents/MacOS/firefox"; |
| + } else { |
| + throw 'Firefox not supported on ${Platform.operatingSystem}'; |
| + } |
| + break; |
| + case 'chrome': |
| + if (Platform.isWindows) { |
| + return "C:\\Program Files (x86)\\Google\\Chrome" |
| + "\\Application\\chrome.exe"; |
| + } else if (Platform.isMacOS) { |
| + return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; |
| + } else if (Platform.isLinux) { |
| + return 'google-chrome'; |
| + } else { |
| + throw "Chrome is not supported on ${Platform.operatingSystem}"; |
| + } |
| + break; |
| + case 'dartium': |
| + if (Platform.isMacOS) { |
| + return 'client/tests/dartium/Chromium.app/Contents/MacOS/Chromium'; |
| + } else { |
| + return new Uri.file('client/tests/dartium/chrome').toFilePath(); |
| + } |
| + break; |
| + case 'safari': |
| + if (Platform.isMacOS) { |
| + return "/Applications/Safari.app/Contents/MacOS/Safari"; |
| + } else { |
| + throw "Safari browser not supported on ${Platform.operatingSystem}"; |
| + } |
| + break; |
| + case 'ie9': |
| + case 'ie10': |
| + return "C:\\Program Files\\Internet Explorer\\iexplore.exe"; |
| + break; |
| + default: |
| + throw 'Non-supported browser $browserName'; |
| } |
| - return new Path('client/tests/dartium/chrome').toNativePath(); |
| } |
| } |