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

Side by Side Diff: pkg/http/test/client_test.dart

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 9 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 | « pkg/http/lib/src/utils.dart ('k') | pkg/http/test/mock_client_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 library client_test; 5 library client_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 23 matching lines...) Expand all
34 }).whenComplete(client.close), completion(parse(equals({ 34 }).whenComplete(client.close), completion(parse(equals({
35 'method': 'POST', 35 'method': 'POST',
36 'path': '/', 36 'path': '/',
37 'headers': { 37 'headers': {
38 'content-type': ['application/json; charset=utf-8'], 38 'content-type': ['application/json; charset=utf-8'],
39 'transfer-encoding': ['chunked'] 39 'transfer-encoding': ['chunked']
40 }, 40 },
41 'body': '{"hello": "world"}' 41 'body': '{"hello": "world"}'
42 })))); 42 }))));
43 43
44 request.sink.add('{"hello": "world"}'.charCodes); 44 request.sink.add('{"hello": "world"}'.codeUnits);
45 request.sink.close(); 45 request.sink.close();
46 }), completes); 46 }), completes);
47 }); 47 });
48 48
49 test('#send with an invalid URL', () { 49 test('#send with an invalid URL', () {
50 expect(startServer().then((_) { 50 expect(startServer().then((_) {
51 var client = new http.Client(); 51 var client = new http.Client();
52 var url = Uri.parse('http://http.invalid'); 52 var url = Uri.parse('http://http.invalid');
53 var request = new http.StreamedRequest("POST", url); 53 var request = new http.StreamedRequest("POST", url);
54 request.headers[HttpHeaders.CONTENT_TYPE] = 54 request.headers[HttpHeaders.CONTENT_TYPE] =
55 'application/json; charset=utf-8'; 55 'application/json; charset=utf-8';
56 56
57 expect(client.send(request), throwsSocketIOException); 57 expect(client.send(request), throwsSocketIOException);
58 58
59 request.sink.add('{"hello": "world"}'.charCodes); 59 request.sink.add('{"hello": "world"}'.codeUnits);
60 request.sink.close(); 60 request.sink.close();
61 }), completes); 61 }), completes);
62 }); 62 });
63 } 63 }
OLDNEW
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/http/test/mock_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698