Chromium Code Reviews| 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"; |
|
kustermann
2013/08/06 13:58:45
Is that path the same on our bots?
ricow1
2013/08/13 06:42:43
Yes, and filed: dartbug.com/12409
|
| + |
| + 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"); |
|
kustermann
2013/08/06 13:58:45
use 'findString' instead of "REG_SZ"
ricow1
2013/08/13 06:42:43
Done.
|
| + if (index > 0) { |
| + return result.stdout.substring(index + findString.length).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'; |
| @@ -804,7 +844,7 @@ |
| DebugLogger.info("Handling request to: ${request.uri.path}"); |
| if (request.uri.path.startsWith(reportPath)) { |
| var browserId = request.uri.path.substring(reportPath.length + 1); |
| - var testId = |
| + var testId = |
| int.parse(request.uri.queryParameters["id"].split("=")[1]); |
| handleReport(request, browserId, testId); |
| // handleReport will asynchroniously fetch the data and will handle |
| @@ -822,6 +862,10 @@ |
| 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"); |
|
kustermann
2013/08/06 13:58:45
Why do we need Pragma,Expires in addition to Cache
ricow1
2013/08/13 06:42:43
That is only if we want to support 1.0 clients. I
|
| + request.response.headers.set("Expires", "0"); |
| request.response.write(textResponse); |
| request.listen((_) {}, onDone: request.response.close); |
| request.response.done.then((_) { |