Index: dart/tests/try/web/web_compiler_test_case.dart |
diff --git a/dart/tests/try/web/web_compiler_test_case.dart b/dart/tests/try/web/web_compiler_test_case.dart |
index 60dd8b9889f76e4930e3504b1541118f8887f9b1..baaff003cccac6defd348bd0242444b96cc5173d 100644 |
--- a/dart/tests/try/web/web_compiler_test_case.dart |
+++ b/dart/tests/try/web/web_compiler_test_case.dart |
@@ -81,6 +81,8 @@ class WebInputProvider { |
final Map<Uri, Future> cachedSources = new Map<Uri, Future>(); |
+ static final Map<String, Future> cachedRequests = new Map<String, Future>(); |
+ |
WebInputProvider( |
this.source, this.mainUri, this.libraryRoot, this.packageRoot); |
@@ -88,12 +90,16 @@ class WebInputProvider { |
return cachedSources.putIfAbsent(uri, () { |
if (uri == mainUri) return new Future.value(source); |
if (uri.scheme == WEB_SCHEME) { |
- return HttpRequest.getString('/root_dart${uri.path}'); |
+ return cachedHttpRequest('/root_dart${uri.path}'); |
} else { |
- return HttpRequest.getString('$uri'); |
+ return cachedHttpRequest('$uri'); |
} |
}); |
} |
+ |
+ static Future cachedHttpRequest(String uri) { |
+ return cachedRequests.putIfAbsent(uri, () => HttpRequest.getString(uri)); |
+ } |
} |
/// Output provider which collect output in [output]. |