| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 randomFile.close(); | 255 randomFile.close(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 Future<bool> start(String url) { | 258 Future<bool> start(String url) { |
| 259 _logEvent("Starting Safari browser on: $url"); | 259 _logEvent("Starting Safari browser on: $url"); |
| 260 // Get the version and log that. | 260 // Get the version and log that. |
| 261 return allowPopUps().then((success) { | 261 return allowPopUps().then((success) { |
| 262 if (!success) { | 262 if (!success) { |
| 263 return new Future.immediate(false); | 263 return new Future.immediate(false); |
| 264 } | 264 } |
| 265 return .getVersion().then((version) { | 265 return getVersion().then((version) { |
| 266 _logEvent("Got version: $version"); | 266 _logEvent("Got version: $version"); |
| 267 var args = ["'$url'"]; | 267 var args = ["'$url'"]; |
| 268 return new Directory('').createTemp().then((userDir) { | 268 return new Directory('').createTemp().then((userDir) { |
| 269 _cleanup = () { userDir.delete(recursive: true); }; | 269 _cleanup = () { userDir.delete(recursive: true); }; |
| 270 _createLaunchHTML(userDir.path, url); | 270 _createLaunchHTML(userDir.path, url); |
| 271 var args = ["${userDir.path}/launch.html"]; | 271 var args = ["${userDir.path}/launch.html"]; |
| 272 return startBrowser(binary, args); | 272 return startBrowser(binary, args); |
| 273 }); | 273 }); |
| 274 }).catchError((e) { | 274 }).catchError((e) { |
| 275 _logEvent("Running $binary --version failed with $e"); | 275 _logEvent("Running $binary --version failed with $e"); |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 </script> | 930 </script> |
| 931 </head> | 931 </head> |
| 932 <body> | 932 <body> |
| 933 Dart test driver, number of tests: <div id="number"></div> | 933 Dart test driver, number of tests: <div id="number"></div> |
| 934 </body> | 934 </body> |
| 935 </html> | 935 </html> |
| 936 """; | 936 """; |
| 937 return driverContent; | 937 return driverContent; |
| 938 } | 938 } |
| 939 } | 939 } |
| OLD | NEW |