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

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: Change switch statement and chained if statements to map lookups 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..661cd638032f0307dc6bcacef6bc99c4b399da2b 100644
--- a/tools/testing/dart/utils.dart
+++ b/tools/testing/dart/utils.dart
@@ -126,16 +126,47 @@ 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();
+ final browserLocations = const {
+ 'firefox': const {
+ 'windows': 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
+ 'linux': 'firefox',
+ 'macos': '/Applications/Firefox.app/Contents/MacOS/firefox'
+ },
+ 'chrome': const {
+ 'windows':
+ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
+ 'macos':
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
+ 'linux': 'google-chrome'
+ },
+ 'dartium': const {
+ 'windows': 'client\\tests\\dartium\\chrome.exe',
+ 'macos': 'client/tests/dartium/Chromium.app/Contents/MacOS/Chromium',
+ 'linux': 'client/tests/dartium/chrome'
+ },
+ 'safari': const {
+ 'macos': '/Applications/Safari.app/Contents/MacOS/Safari'
+ },
+ 'ie9': const {
+ 'windows': 'C:\\Program Files\\Internet Explorer\\iexplore.exe'
+ },
+ 'ie10': const {
+ 'windows': 'C:\\Program Files\\Internet Explorer\\iexplore.exe'
+ }};
+
+ assert(browserLocations[browserName] != null);
+ location = browserLocations[browserName][Platform.operatingSystem];
+ if (location != null) {
+ return location;
+ } else {
+ throw '$browserName not supported on ${Platform.operatingSystem}';
}
- 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