| 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 library browser; | 4 library browser; |
| 5 | 5 |
| 6 import "dart:async"; | 6 import "dart:async"; |
| 7 import "dart:core"; | 7 import "dart:core"; |
| 8 import "dart:io"; | 8 import "dart:io"; |
| 9 | 9 |
| 10 import 'android.dart'; | 10 import 'android.dart'; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } else if (name == 'safari') { | 63 } else if (name == 'safari') { |
| 64 return new Safari(); | 64 return new Safari(); |
| 65 } else { | 65 } else { |
| 66 throw "Non supported browser"; | 66 throw "Non supported browser"; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 static const List<String> SUPPORTED_BROWSERS = | 70 static const List<String> SUPPORTED_BROWSERS = |
| 71 const ['safari', 'ff', 'firefox', 'chrome']; | 71 const ['safari', 'ff', 'firefox', 'chrome']; |
| 72 | 72 |
| 73 # TODO(kustermann): add standard support for chrome on android | 73 // TODO(kustermann): add standard support for chrome on android |
| 74 static bool supportedBrowser(String name) { | 74 static bool supportedBrowser(String name) { |
| 75 return SUPPORTED_BROWSERS.contains(name); | 75 return SUPPORTED_BROWSERS.contains(name); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void _logEvent(String event) { | 78 void _logEvent(String event) { |
| 79 String toLog = "$this ($id) - ${new DateTime.now()}: $event \n"; | 79 String toLog = "$this ($id) - ${new DateTime.now()}: $event \n"; |
| 80 if (debugPrint) print("usageLog: $toLog"); | 80 if (debugPrint) print("usageLog: $toLog"); |
| 81 if (logger != null) logger(toLog); | 81 if (logger != null) logger(toLog); |
| 82 _usageLog.write(toLog); | 82 _usageLog.write(toLog); |
| 83 } | 83 } |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 </script> | 941 </script> |
| 942 </head> | 942 </head> |
| 943 <body> | 943 <body> |
| 944 Dart test driver, number of tests: <div id="number"></div> | 944 Dart test driver, number of tests: <div id="number"></div> |
| 945 </body> | 945 </body> |
| 946 </html> | 946 </html> |
| 947 """; | 947 """; |
| 948 return driverContent; | 948 return driverContent; |
| 949 } | 949 } |
| 950 } | 950 } |
| OLD | NEW |