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

Side by Side Diff: tests/standalone/io/http_headers_test.dart

Issue 1564913002: HeaderValues: Handle all parameters without values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | no next file » | 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 library dart.io; 5 library dart.io;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "dart:async"; 8 import "dart:async";
9 import "dart:collection"; 9 import "dart:collection";
10 import "dart:convert"; 10 import "dart:convert";
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 "filename": "genome.jpeg", 289 "filename": "genome.jpeg",
290 "modification-date": "Wed, 12 February 1997 16:29:51 -0500" 290 "modification-date": "Wed, 12 February 1997 16:29:51 -0500"
291 }; 291 };
292 check(headerValue, "attachment", parameters); 292 check(headerValue, "attachment", parameters);
293 headerValue = new HeaderValue("attachment", parameters); 293 headerValue = new HeaderValue("attachment", parameters);
294 check(headerValue, "attachment", parameters); 294 check(headerValue, "attachment", parameters);
295 headerValue = HeaderValue.parse( 295 headerValue = HeaderValue.parse(
296 " attachment ;filename=genome.jpeg ;" 296 " attachment ;filename=genome.jpeg ;"
297 "modification-date = \"Wed, 12 February 1997 16:29:51 -0500\"" ); 297 "modification-date = \"Wed, 12 February 1997 16:29:51 -0500\"" );
298 check(headerValue, "attachment", parameters); 298 check(headerValue, "attachment", parameters);
299 headerValue = HeaderValue.parse("xxx; aaa; bbb; ccc");
300 check(headerValue, "xxx", {"aaa": null, "bbb": null, "ccc": null});
299 } 301 }
300 302
301 void testContentType() { 303 void testContentType() {
302 void check(ContentType contentType, 304 void check(ContentType contentType,
303 String primaryType, 305 String primaryType,
304 String subType, 306 String subType,
305 [Map parameters]) { 307 [Map parameters]) {
306 Expect.equals(primaryType, contentType.primaryType); 308 Expect.equals(primaryType, contentType.primaryType);
307 Expect.equals(subType, contentType.subType); 309 Expect.equals(subType, contentType.subType);
308 Expect.equals("$primaryType/$subType", contentType.value); 310 Expect.equals("$primaryType/$subType", contentType.value);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 testHeaderValue(); 571 testHeaderValue();
570 testContentType(); 572 testContentType();
571 testContentTypeCache(); 573 testContentTypeCache();
572 testCookie(); 574 testCookie();
573 testInvalidCookie(); 575 testInvalidCookie();
574 testHeaderLists(); 576 testHeaderLists();
575 testInvalidFieldName(); 577 testInvalidFieldName();
576 testInvalidFieldValue(); 578 testInvalidFieldValue();
577 testClear(); 579 testClear();
578 } 580 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698