Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1521)

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 22420002: Add support for ie in the browser controller (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tools/test.dart ('K') | « tools/test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 25812)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -54,6 +54,8 @@
return new Chrome();
} else if (name == 'safari') {
return new Safari();
+ } else if (name.startsWith('ie')) {
+ return new IE();
} else {
throw "Non supported browser";
}
@@ -347,6 +349,44 @@
String toString() => "Chrome";
}
+class IE extends Browser {
+
+ static const String binary =
+ "c:\\Program Files\\Internet Explorer\\iexplore.exe";
+
+ Future<String> getVersion() {
+ var args = ["query",
+ "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Internet Explorer",
+ "/v",
+ "version"];
+ return Process.run("reg", args).then((result) {
+ if (result.exitCode == 0) {
+ // The string we get back looks like this:
+ // HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer
+ // version REG_SZ 9.0.8112.16421
+ var findString = "REG_SZ";
+ var index = result.stdout.indexOf("REG_SZ") + findString.length;
+ if (index > 0) {
+ return result.stdout.substring(index).trim();
+ }
+ }
+ return "Could not get the version of internet explorer";
+ });
+ }
+
+
+ Future<bool> start(String url) {
+ _logEvent("Starting ie browser on: $url");
+ // Get the version and log that.
+ return getVersion().then((version) {
+ _logEvent("Got version: $version");
+ return startBrowser(binary, [url]);
+ });
+ }
+ String toString() => "IE";
+}
+
+
class AndroidChrome extends Browser {
static const String viewAction = 'android.intent.action.VIEW';
static const String mainAction = 'android.intent.action.MAIN';
@@ -822,6 +862,9 @@
DebugLogger.info("Handling non standard request to: "
"${request.uri.path}");
}
+ request.response.headers.set("Cache-Control", "no-cache, no-store, must-revalidate");
+ request.response.headers.set("Pragma", "no-cache");
+ request.response.headers.set("Expires", "0");
request.response.write(textResponse);
request.listen((_) {}, onDone: request.response.close);
request.response.done.then((_) {
@@ -942,6 +985,7 @@
// URL#ID
var split = this.responseText.split('#');
var nextTask = split[0];
+
current_id = split[1];
reportError('Done getting task : ' + elapsed);
did_start = false;
« tools/test.dart ('K') | « tools/test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698