OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 utils; | 5 library utils; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 | 9 |
10 import 'path.dart'; | 10 import 'path.dart'; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // TODO(kustermann,ricow): As soon we have a debug log we should log | 174 // TODO(kustermann,ricow): As soon we have a debug log we should log |
175 // invalid utf8-encoded input to the log. | 175 // invalid utf8-encoded input to the log. |
176 // Currently invalid bytes will be replaced by a replacement character. | 176 // Currently invalid bytes will be replaced by a replacement character. |
177 String decodeUtf8(List<int> bytes) { | 177 String decodeUtf8(List<int> bytes) { |
178 return UTF8.decode(bytes, allowMalformed: true); | 178 return UTF8.decode(bytes, allowMalformed: true); |
179 } | 179 } |
180 | 180 |
181 class Locations { | 181 class Locations { |
182 static String getBrowserLocation( | 182 static String getBrowserLocation( |
183 String browserName, Map<String, String> globalConfiguration) { | 183 String browserName, Map<String, dynamic> globalConfiguration) { |
184 var location = globalConfiguration[browserName]; | 184 var location = globalConfiguration[browserName] as String; |
185 if (location != null && location != '') { | 185 if (location != null && location != '') { |
186 return location; | 186 return location; |
187 } | 187 } |
188 var browserLocations = { | 188 var browserLocations = { |
189 'firefox': const { | 189 'firefox': const { |
190 'windows': 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe', | 190 'windows': 'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe', |
191 'linux': 'firefox', | 191 'linux': 'firefox', |
192 'macos': '/Applications/Firefox.app/Contents/MacOS/firefox' | 192 'macos': '/Applications/Firefox.app/Contents/MacOS/firefox' |
193 }, | 193 }, |
194 'chrome': const { | 194 'chrome': const { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 class UniqueObject { | 304 class UniqueObject { |
305 static int _nextId = 1; | 305 static int _nextId = 1; |
306 final int _hashCode; | 306 final int _hashCode; |
307 | 307 |
308 int get hashCode => _hashCode; | 308 int get hashCode => _hashCode; |
309 operator ==(Object other) => | 309 operator ==(Object other) => |
310 other is UniqueObject && _hashCode == other._hashCode; | 310 other is UniqueObject && _hashCode == other._hashCode; |
311 | 311 |
312 UniqueObject() : _hashCode = ++_nextId; | 312 UniqueObject() : _hashCode = ++_nextId; |
313 } | 313 } |
OLD | NEW |