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

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

Issue 443373003: Make the default HTTP server configuration more secure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed more review comments Created 6 years, 4 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
Index: tests/standalone/io/http_headers_test.dart
diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart
index ad891b153b7afd1b74d3e479ad2666ef95f7e8d6..308795a389b84aa96b401d72e39149f137c526f4 100644
--- a/tests/standalone/io/http_headers_test.dart
+++ b/tests/standalone/io/http_headers_test.dart
@@ -366,67 +366,64 @@ void testCookie() {
Cookie cookie;
cookie = new Cookie(name, value);
- Expect.equals("$name=$value", cookie.toString());
+ Expect.equals("$name=$value; HttpOnly", cookie.toString());
DateTime date = new DateTime.utc(2014, DateTime.JANUARY, 5, 23, 59, 59, 0);
cookie.expires = date;
checkCookie(cookie, "$name=$value"
- "; Expires=Sun, 05 Jan 2014 23:59:59 GMT");
+ "; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
+ "; HttpOnly");
cookie.maxAge = 567;
checkCookie(cookie, "$name=$value"
"; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
- "; Max-Age=567");
+ "; Max-Age=567"
+ "; HttpOnly");
cookie.domain = "example.com";
checkCookie(cookie, "$name=$value"
"; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
"; Max-Age=567"
- "; Domain=example.com");
+ "; Domain=example.com"
+ "; HttpOnly");
cookie.path = "/xxx";
checkCookie(cookie, "$name=$value"
"; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
"; Max-Age=567"
"; Domain=example.com"
- "; Path=/xxx");
+ "; Path=/xxx"
+ "; HttpOnly");
cookie.secure = true;
checkCookie(cookie, "$name=$value"
"; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
"; Max-Age=567"
"; Domain=example.com"
"; Path=/xxx"
- "; Secure");
- cookie.httpOnly = true;
+ "; Secure"
+ "; HttpOnly");
+ cookie.httpOnly = false;
checkCookie(cookie, "$name=$value"
"; Expires=Sun, 05 Jan 2014 23:59:59 GMT"
"; Max-Age=567"
"; Domain=example.com"
"; Path=/xxx"
- "; Secure"
- "; HttpOnly");
+ "; Secure");
cookie.expires = null;
checkCookie(cookie, "$name=$value"
"; Max-Age=567"
"; Domain=example.com"
"; Path=/xxx"
- "; Secure"
- "; HttpOnly");
+ "; Secure");
cookie.maxAge = null;
checkCookie(cookie, "$name=$value"
"; Domain=example.com"
"; Path=/xxx"
- "; Secure"
- "; HttpOnly");
+ "; Secure");
cookie.domain = null;
checkCookie(cookie, "$name=$value"
"; Path=/xxx"
- "; Secure"
- "; HttpOnly");
+ "; Secure");
cookie.path = null;
checkCookie(cookie, "$name=$value"
- "; Secure"
- "; HttpOnly");
+ "; Secure");
cookie.secure = false;
- checkCookie(cookie, "$name=$value"
- "; HttpOnly");
- cookie.httpOnly = false;
checkCookie(cookie, "$name=$value");
}
test("name", "value");
@@ -499,6 +496,17 @@ void testInvalidFieldValue() {
test(new StringBuffer('\x00'), remove: false);
}
+void testClear() {
+ _HttpHeaders headers = new _HttpHeaders("1.1");
+ headers.add("a", "b");
+ headers.contentLength = 7;
+ headers.chunkedTransferEncoding = true;
+ headers.clear();
+ Expect.isNull(headers["a"]);
+ Expect.equals(headers.contentLength, -1);
+ Expect.isFalse(headers.chunkedTransferEncoding);
+}
+
main() {
testMultiValue();
testDate();
@@ -514,4 +522,5 @@ main() {
testHeaderLists();
testInvalidFieldName();
testInvalidFieldValue();
+ testClear();
}
« no previous file with comments | « tests/standalone/io/http_detach_socket_test.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698