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

Side by Side Diff: tests/standalone/io/http_cookie_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_detach_socket_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 8
9 void testCookies() { 9 void testCookies() {
10 var cookies = [{'abc': 'def'}, 10 var cookies = [{'abc': 'def'},
(...skipping 24 matching lines...) Expand all
35 cookies[i].forEach((k, v) { 35 cookies[i].forEach((k, v) {
36 request.cookies.add(new Cookie(k, v)); 36 request.cookies.add(new Cookie(k, v));
37 }); 37 });
38 return request.close(); 38 return request.close();
39 }) 39 })
40 .then((response) { 40 .then((response) {
41 // Expect the same cookies back. 41 // Expect the same cookies back.
42 var cookiesMap = {}; 42 var cookiesMap = {};
43 response.cookies.forEach((c) => cookiesMap[c.name] = c.value); 43 response.cookies.forEach((c) => cookiesMap[c.name] = c.value);
44 Expect.mapEquals(cookies[i], cookiesMap); 44 Expect.mapEquals(cookies[i], cookiesMap);
45 response.cookies.forEach((c) => Expect.isTrue(c.httpOnly));
45 response.listen( 46 response.listen(
46 (d) {}, 47 (d) {},
47 onDone: () { 48 onDone: () {
48 if (++count == cookies.length) { 49 if (++count == cookies.length) {
49 client.close(); 50 client.close();
50 server.close(); 51 server.close();
51 } 52 }
52 }); 53 });
53 }) 54 })
54 .catchError((e, trace) { 55 .catchError((e, trace) {
55 String msg = "Unexpected error $e"; 56 String msg = "Unexpected error $e";
56 if (trace != null) msg += "\nStackTrace: $trace"; 57 if (trace != null) msg += "\nStackTrace: $trace";
57 Expect.fail(msg); 58 Expect.fail(msg);
58 }); 59 });
59 } 60 }
60 }); 61 });
61 } 62 }
62 63
63 void main() { 64 void main() {
64 testCookies(); 65 testCookies();
65 } 66 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_detach_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698