| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 | 278 |
| 279 class Firefox extends Browser { | 279 class Firefox extends Browser { |
| 280 /** | 280 /** |
| 281 * The binary used to run firefox - changing this can be nececcary for | 281 * The binary used to run firefox - changing this can be nececcary for |
| 282 * testing or using non standard firefox installation. | 282 * testing or using non standard firefox installation. |
| 283 */ | 283 */ |
| 284 const String binary = "firefox"; | 284 const String binary = "firefox"; |
| 285 | 285 |
| 286 const String enablePopUp = | 286 const String enablePopUp = |
| 287 "user_pref(\"dom.disable_open_during_load\", false);"; | 287 'user_pref("dom.disable_open_during_load", false);'; |
| 288 const String disableDefaultCheck = |
| 289 'user_pref("browser.shell.checkDefaultBrowser", false);'; |
| 288 | 290 |
| 289 Future _createPreferenceFile(var path) { | 291 Future _createPreferenceFile(var path) { |
| 290 var file = new File("${path.toString()}/user.js"); | 292 var file = new File("${path.toString()}/user.js"); |
| 291 var randomFile = file.openSync(FileMode.WRITE); | 293 var randomFile = file.openSync(FileMode.WRITE); |
| 292 randomFile.writeStringSync(enablePopUp); | 294 randomFile.writeStringSync(enablePopUp); |
| 295 randomFile.writeStringSync(disableDefaultCheck); |
| 293 randomFile.close(); | 296 randomFile.close(); |
| 294 } | 297 } |
| 295 | 298 |
| 296 | 299 |
| 297 Future<bool> start(String url) { | 300 Future<bool> start(String url) { |
| 298 _logEvent("Starting firefox browser on: $url"); | 301 _logEvent("Starting firefox browser on: $url"); |
| 299 // Get the version and log that. | 302 // Get the version and log that. |
| 300 return Process.run(binary, ["--version"]).then((var versionResult) { | 303 return Process.run(binary, ["--version"]).then((var versionResult) { |
| 301 if (versionResult.exitCode != 0) { | 304 if (versionResult.exitCode != 0) { |
| 302 _logEvent("Failed to firefox get version"); | 305 _logEvent("Failed to firefox get version"); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 </script> | 807 </script> |
| 805 </head> | 808 </head> |
| 806 <body> | 809 <body> |
| 807 Dart test driver, number of tests: <div id="number"></div> | 810 Dart test driver, number of tests: <div id="number"></div> |
| 808 </body> | 811 </body> |
| 809 </html> | 812 </html> |
| 810 """; | 813 """; |
| 811 return driverContent; | 814 return driverContent; |
| 812 } | 815 } |
| 813 } | 816 } |
| OLD | NEW |