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

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

Issue 15992002: Ignore harmless paths in the http_server.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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: tools/testing/dart/http_server.dart
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index fe781204639d361c2b8deeb7d6a4d44c7f577beb..986bd53d007d78728b548365a10d54e96f4e0f4d 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -89,6 +89,16 @@ main() {
* test framework, such as dealing with package-root.
*/
class TestingServers {
+ static final _HARMLESS_REQUEST_PATH_ENDINGS = [
+ "/apple-touch-icon.png",
+ "/apple-touch-icon-precomposed.png",
+ "/favicon.ico",
+ "/foo",
+ "/bar",
+ "/NonExistingFile",
+ "/hahaURL",
+ ];
+
List _serverList = [];
Path _buildDirectory = null;
final bool useContentSecurityPolicy;
@@ -349,10 +359,12 @@ class TestingServers {
}
void _sendNotFound(HttpRequest request, HttpResponse response) {
- // NOTE: Since some tests deliberately try to access non-existent files.
- // We might want to remove this warning (otherwise it will show
- // up in the debug.log every time).
- if (request.uri.path != "/favicon.ico") {
+ bool isHarmlessPath(String path) {
+ return _HARMLESS_REQUEST_PATH_ENDINGS.any((ending) {
+ return path.endsWith(ending);
+ });
+ }
+ if (!isHarmlessPath(request.uri.path)) {
DebugLogger.warning('HttpServer: could not find file for request path: '
'"${request.uri.path}"');
}
« 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