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

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

Issue 60503002: Add browser path options to testing scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move default browser paths to utils.dart Created 7 years, 1 month 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 | « tools/testing/dart/test_suite.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698