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

Unified Diff: test/runner/browser/chrome_test.dart

Issue 1053923002: Fix chrome_test for shelf 0.6.0. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/browser/chrome_test.dart
diff --git a/test/runner/browser/chrome_test.dart b/test/runner/browser/chrome_test.dart
index 764bdd9899cab8314bc46f9b0a4b5b015b6a2a10..25b86b32e9282b0fb4e0b743e4bdbda22935751b 100644
--- a/test/runner/browser/chrome_test.dart
+++ b/test/runner/browser/chrome_test.dart
@@ -21,7 +21,13 @@ void main() {
var javaScript;
var servePage = (request) {
- if (request.url.path == "/") {
+ var path = request.url.path;
+
+ // We support both shelf 0.5.x and 0.6.x. The former has a leading "/"
+ // here, the latter does not.
+ if (path.startsWith("/")) path = path.substring(1);
+
+ if (path.isEmpty) {
return new shelf.Response.ok("""
<!doctype html>
<html>
@@ -30,7 +36,7 @@ void main() {
</head>
</html>
""", headers: {'content-type': 'text/html'});
- } else if (request.url.path == "/index.js") {
+ } else if (path == "index.js") {
return new shelf.Response.ok(javaScript,
headers: {'content-type': 'application/javascript'});
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698