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

Unified Diff: pkg/http/test/client_test.dart

Issue 261763002: Rip out the last dart:io dependency from pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 8 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 | « pkg/http/lib/src/multipart_file.dart ('k') | pkg/http/test/html/client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/client_test.dart
diff --git a/pkg/http/test/client_test.dart b/pkg/http/test/client_test.dart
deleted file mode 100644
index 6f397fa5fee89f2a74ea857be895eb563c263ff6..0000000000000000000000000000000000000000
--- a/pkg/http/test/client_test.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library client_test;
-
-import 'dart:io';
-
-import 'package:http/http.dart' as http;
-import 'package:unittest/unittest.dart';
-
-import 'utils.dart';
-
-void main() {
- tearDown(stopServer);
-
- test('#send a StreamedRequest', () {
- expect(startServer().then((_) {
- var client = new http.Client();
- var request = new http.StreamedRequest("POST", serverUrl);
- request.headers[HttpHeaders.CONTENT_TYPE] =
- 'application/json; charset=utf-8';
- request.headers[HttpHeaders.USER_AGENT] = 'Dart';
-
- expect(client.send(request).then((response) {
- expect(response.request, equals(request));
- expect(response.statusCode, equals(200));
- expect(response.headers['single'], equals('value'));
- // dart:io internally normalizes outgoing headers so that they never
- // have multiple headers with the same name, so there's no way to test
- // whether we handle that case correctly.
-
- return response.stream.bytesToString();
- }).whenComplete(client.close), completion(parse(equals({
- 'method': 'POST',
- 'path': '/',
- 'headers': {
- 'content-type': ['application/json; charset=utf-8'],
- 'accept-encoding': ['gzip'],
- 'user-agent': ['Dart'],
- 'transfer-encoding': ['chunked']
- },
- 'body': '{"hello": "world"}'
- }))));
-
- request.sink.add('{"hello": "world"}'.codeUnits);
- request.sink.close();
- }), completes);
- });
-
- test('#send with an invalid URL', () {
- expect(startServer().then((_) {
- var client = new http.Client();
- var url = Uri.parse('http://http.invalid');
- var request = new http.StreamedRequest("POST", url);
- request.headers[HttpHeaders.CONTENT_TYPE] =
- 'application/json; charset=utf-8';
-
- expect(client.send(request), throwsSocketException);
-
- request.sink.add('{"hello": "world"}'.codeUnits);
- request.sink.close();
- }), completes);
- });
-}
« no previous file with comments | « pkg/http/lib/src/multipart_file.dart ('k') | pkg/http/test/html/client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698