| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 /** | 417 /** |
| 418 * The binary used to run firefox - changing this can be nececcary for | 418 * The binary used to run firefox - changing this can be nececcary for |
| 419 * testing or using non standard firefox installation. | 419 * testing or using non standard firefox installation. |
| 420 */ | 420 */ |
| 421 static const String binary = "firefox"; | 421 static const String binary = "firefox"; |
| 422 | 422 |
| 423 static const String enablePopUp = | 423 static const String enablePopUp = |
| 424 'user_pref("dom.disable_open_during_load", false);'; | 424 'user_pref("dom.disable_open_during_load", false);'; |
| 425 static const String disableDefaultCheck = | 425 static const String disableDefaultCheck = |
| 426 'user_pref("browser.shell.checkDefaultBrowser", false);'; | 426 'user_pref("browser.shell.checkDefaultBrowser", false);'; |
| 427 static const String disableScriptTimeLimit = |
| 428 'user_pref("dom.max_script_run_time", 0);'; |
| 427 | 429 |
| 428 Future _createPreferenceFile(var path) { | 430 Future _createPreferenceFile(var path) { |
| 429 var file = new File("${path.toString()}/user.js"); | 431 var file = new File("${path.toString()}/user.js"); |
| 430 var randomFile = file.openSync(mode: FileMode.WRITE); | 432 var randomFile = file.openSync(mode: FileMode.WRITE); |
| 431 randomFile.writeStringSync(enablePopUp); | 433 randomFile.writeStringSync(enablePopUp); |
| 432 randomFile.writeStringSync(disableDefaultCheck); | 434 randomFile.writeStringSync(disableDefaultCheck); |
| 435 randomFile.writeStringSync(disableScriptTimeLimit); |
| 433 randomFile.close(); | 436 randomFile.close(); |
| 434 } | 437 } |
| 435 | 438 |
| 436 | 439 |
| 437 Future<bool> start(String url) { | 440 Future<bool> start(String url) { |
| 438 _logEvent("Starting firefox browser on: $url"); | 441 _logEvent("Starting firefox browser on: $url"); |
| 439 // Get the version and log that. | 442 // Get the version and log that. |
| 440 return Process.run(binary, ["--version"]).then((var versionResult) { | 443 return Process.run(binary, ["--version"]).then((var versionResult) { |
| 441 if (versionResult.exitCode != 0) { | 444 if (versionResult.exitCode != 0) { |
| 442 _logEvent("Failed to firefox get version"); | 445 _logEvent("Failed to firefox get version"); |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 </head> | 1049 </head> |
| 1047 <body onload="startTesting()"> | 1050 <body onload="startTesting()"> |
| 1048 Dart test driver, number of tests: <div id="number"></div> | 1051 Dart test driver, number of tests: <div id="number"></div> |
| 1049 <iframe id="embedded_iframe"></iframe> | 1052 <iframe id="embedded_iframe"></iframe> |
| 1050 </body> | 1053 </body> |
| 1051 </html> | 1054 </html> |
| 1052 """; | 1055 """; |
| 1053 return driverContent; | 1056 return driverContent; |
| 1054 } | 1057 } |
| 1055 } | 1058 } |
| OLD | NEW |