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

Unified Diff: dart/pkg/http_base/test/http_base_io_test.dart

Issue 495533003: Remove obsolete http_base package (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « dart/pkg/http_base/test/http_base_html_test.dart ('k') | dart/pkg/http_base/test/http_base_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/http_base/test/http_base_io_test.dart
diff --git a/dart/pkg/http_base/test/http_base_io_test.dart b/dart/pkg/http_base/test/http_base_io_test.dart
deleted file mode 100644
index 5df2ea0e9cc5c47cc920261a6f3a324dbf147265..0000000000000000000000000000000000000000
--- a/dart/pkg/http_base/test/http_base_io_test.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-library http_base.http_base_io_test;
-
-import 'dart:async';
-import 'dart:io';
-import 'dart:convert';
-
-import 'package:http_base/http_base_io.dart';
-import 'package:unittest/unittest.dart';
-
-main() {
- test('io-client', () {
- HttpServer.bind('127.0.0.1', 0).then(expectAsync((HttpServer server) {
- server.first.then(expectAsync((request) {
- expect(request.method, equals('POST'));
- expect(request.headers.value('foo'), equals('bar'));
-
- return request.fold([], (buf, data) => buf..addAll(data)).then((data) {
- request
- ..response.statusCode = 201
- ..response.headers.set('foo', ['foo', 'bar'])
- ..response.add(data)
- ..response.close();
- });
- })).whenComplete(() => server.close());
-
- var client = new Client();
- var uri = Uri.parse('http://127.0.0.1:${server.port}/');
- var headers = new HeadersImpl({'foo' : 'bar'});
- var body = (new StreamController()
- ..add(UTF8.encode('my-data'))
- ..close()).stream;
-
- var request = new RequestImpl('POST', uri, headers: headers, body: body);
- client(request).then(expectAsync((response) {
- expect(response.statusCode, equals(201));
- // NOTE: dart:io joins multiple values with ", ".
- expect(response.headers['foo'], equals('foo, bar'));
- expect(response.headers.getMultiple('foo').toList(),
- equals(['foo','bar']));
-
- response.read()
- .transform(UTF8.decoder).join('').then(expectAsync((data) {
- expect(data, equals('my-data'));
- }));
- }));
- }));
- });
-}
« no previous file with comments | « dart/pkg/http_base/test/http_base_html_test.dart ('k') | dart/pkg/http_base/test/http_base_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698