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

Unified Diff: tests/standalone/io/http_parser_test.dart

Issue 10449020: Support using the HEAD request in the HTTP library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « tests/standalone/io/http_head_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_parser_test.dart
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index 7dd726b682c9053641598c290118be945045aea2..3310e8c54952fd12eedf11bb3b72877e539a8e65 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.dart
@@ -297,29 +297,21 @@ class HttpParserTest {
static void testParseRequest() {
String request;
Map headers;
- request = "GET / HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "GET", "/");
-
- request = "POST / HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "POST", "/");
-
- request = "GET /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "GET", "/index.html");
-
- request = "POST /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "POST", "/index.html");
-
- request = "H /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "H", "/index.html");
-
- request = "HT /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "HT", "/index.html");
-
- request = "HTT /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "HTT", "/index.html");
-
- request = "HTTP /index.html HTTP/1.1\r\n\r\n";
- _testParseRequest(request, "HTTP", "/index.html");
+ var methods = [
+ // RFC 2616 methods.
+ "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT",
+ // WebDAV methods from RFC 4918.
+ "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK",
+ // WebDAV methods from RFC 5323.
+ "SEARCH",
+ // Methods with HTTP prefix.
+ "H", "HT", "HTT", "HTTP", "HX", "HTX", "HTTX", "HTTPX"];
+ methods.forEach((method) {
+ request = "$method / HTTP/1.1\r\n\r\n";
+ _testParseRequest(request, method, "/");
+ request = "$method /index.html HTTP/1.1\r\n\r\n";
+ _testParseRequest(request, method, "/index.html");
+ });
request = "GET / HTTP/1.0\r\n\r\n";
_testParseRequest(request, "GET", "/", expectedVersion: "1.0", connectionClose: true);
« no previous file with comments | « tests/standalone/io/http_head_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698