Chromium Code Reviews| 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:convert" show LineSplitter, UTF8; | 7 import "dart:convert" show LineSplitter, UTF8; |
| 8 import "dart:core"; | 8 import "dart:core"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 /** Print everything (stdout, stderr, usageLog) whenever we add to it */ | 42 /** Print everything (stdout, stderr, usageLog) whenever we add to it */ |
| 43 bool debugPrint = false; | 43 bool debugPrint = false; |
| 44 | 44 |
| 45 // This future returns when the process exits. It is also the return value | 45 // This future returns when the process exits. It is also the return value |
| 46 // of close() | 46 // of close() |
| 47 Future done; | 47 Future done; |
| 48 | 48 |
| 49 Browser(); | 49 Browser(); |
| 50 | 50 |
| 51 factory Browser.byName(String name) { | 51 factory Browser.byName(String name, [String binaryLocation]) { |
|
kustermann
2013/09/03 07:20:24
unused variable!
ricow1
2013/09/03 07:27:23
Not meant for this cl
| |
| 52 if (name == 'ff' || name == 'firefox') { | 52 if (name == 'ff' || name == 'firefox') { |
| 53 return new Firefox(); | 53 return new Firefox(); |
| 54 } else if (name == 'chrome') { | 54 } else if (name == 'chrome') { |
| 55 return new Chrome(); | 55 return new Chrome(); |
| 56 } else if (name == 'safari') { | 56 } else if (name == 'safari') { |
| 57 return new Safari(); | 57 return new Safari(); |
| 58 } else if (name.startsWith('ie')) { | 58 } else if (name.startsWith('ie')) { |
| 59 return new IE(); | 59 return new IE(); |
| 60 } else { | 60 } else { |
| 61 throw "Non supported browser"; | 61 throw "Non supported browser"; |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 } | 452 } |
| 453 | 453 |
| 454 String toString() => "chromeOnAndroid"; | 454 String toString() => "chromeOnAndroid"; |
| 455 } | 455 } |
| 456 | 456 |
| 457 class Firefox extends Browser { | 457 class Firefox extends Browser { |
| 458 /** | 458 /** |
| 459 * The binary used to run firefox - changing this can be nececcary for | 459 * The binary used to run firefox - changing this can be nececcary for |
| 460 * testing or using non standard firefox installation. | 460 * testing or using non standard firefox installation. |
| 461 */ | 461 */ |
| 462 static const String binary = "firefox"; | 462 static const String _binary = "firefox"; |
|
kustermann
2013/09/03 07:20:24
This doesn't work. looking at line 484, you still
ricow1
2013/09/03 07:27:23
Sure, again unrelated
| |
| 463 | 463 |
| 464 static const String enablePopUp = | 464 static const String enablePopUp = |
| 465 'user_pref("dom.disable_open_during_load", false);'; | 465 'user_pref("dom.disable_open_during_load", false);'; |
| 466 static const String disableDefaultCheck = | 466 static const String disableDefaultCheck = |
| 467 'user_pref("browser.shell.checkDefaultBrowser", false);'; | 467 'user_pref("browser.shell.checkDefaultBrowser", false);'; |
| 468 static const String disableScriptTimeLimit = | 468 static const String disableScriptTimeLimit = |
| 469 'user_pref("dom.max_script_run_time", 0);'; | 469 'user_pref("dom.max_script_run_time", 0);'; |
| 470 | 470 |
| 471 Future _createPreferenceFile(var path) { | 471 Future _createPreferenceFile(var path) { |
| 472 var file = new File("${path.toString()}/user.js"); | 472 var file = new File("${path.toString()}/user.js"); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1048 function getNextTask() { | 1048 function getNextTask() { |
| 1049 // Until we have the next task we set the current_id to a specific | 1049 // Until we have the next task we set the current_id to a specific |
| 1050 // negative value. | 1050 // negative value. |
| 1051 contactBrowserController( | 1051 contactBrowserController( |
| 1052 'GET', '$nextTestPath/$browserId', newTaskHandler, "", false); | 1052 'GET', '$nextTestPath/$browserId', newTaskHandler, "", false); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 function run(url) { | 1055 function run(url) { |
| 1056 number_of_tests++; | 1056 number_of_tests++; |
| 1057 document.getElementById('number').innerHTML = number_of_tests; | 1057 document.getElementById('number').innerHTML = number_of_tests; |
| 1058 document.getElementById('currently_executing').innerHTML = url; | |
|
kustermann
2013/09/03 07:20:24
There's actually no need to query it again and aga
ricow1
2013/09/03 07:27:23
Done.
| |
| 1058 if (use_iframe) { | 1059 if (use_iframe) { |
| 1059 embedded_iframe.src = url; | 1060 embedded_iframe.src = url; |
| 1060 } else { | 1061 } else { |
| 1061 if (testing_window == undefined) { | 1062 if (testing_window == undefined) { |
| 1062 testing_window = window.open(url); | 1063 testing_window = window.open(url); |
| 1063 } else { | 1064 } else { |
| 1064 testing_window.location = url; | 1065 testing_window.location = url; |
| 1065 } | 1066 } |
| 1066 } | 1067 } |
| 1067 } | 1068 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1122 | 1123 |
| 1123 window.addEventListener('message', messageHandler, false); | 1124 window.addEventListener('message', messageHandler, false); |
| 1124 waitForDone = false; | 1125 waitForDone = false; |
| 1125 | 1126 |
| 1126 getNextTask(); | 1127 getNextTask(); |
| 1127 } | 1128 } |
| 1128 | 1129 |
| 1129 </script> | 1130 </script> |
| 1130 </head> | 1131 </head> |
| 1131 <body onload="startTesting()"> | 1132 <body onload="startTesting()"> |
| 1132 Dart test driver, number of tests: <div id="number"></div> | 1133 Dart test driver, number of tests: <div id="number"></div><br> |
| 1134 Currently executing: <div id="currently_executing"></div> | |
| 1133 <iframe id="embedded_iframe"></iframe> | 1135 <iframe id="embedded_iframe"></iframe> |
| 1134 </body> | 1136 </body> |
| 1135 </html> | 1137 </html> |
| 1136 """; | 1138 """; |
| 1137 return driverContent; | 1139 return driverContent; |
| 1138 } | 1140 } |
| 1139 } | 1141 } |
| OLD | NEW |