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

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

Issue 445933004: Add implementations for Headers, Request, Response and dart:io/dart:html clients to http_base (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/pkg/http_base/pubspec.yaml ('k') | dart/pkg/http_base/test/http_base_io_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_html_test.dart
diff --git a/dart/pkg/http_base/test/http_base_html_test.dart b/dart/pkg/http_base/test/http_base_html_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a1efb7d584d08f68782c80aa2493d1dd517525e9
--- /dev/null
+++ b/dart/pkg/http_base/test/http_base_html_test.dart
@@ -0,0 +1,27 @@
+library http_base.http_base_html_test;
+
+import 'dart:html';
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:http_base/http_base_html.dart';
+import 'package:unittest/unittest.dart';
+
+main() {
+ test('http-client', () {
+ var uri = Uri.parse(window.location.href).resolve('/echo');
+
+ var client = new Client();
+ var body = (new StreamController()
+ ..add(UTF8.encode('my-data'))
+ ..close()).stream;
+ var request = new RequestImpl('POST', uri, body: body);
+ client(request).then(expectAsync((response) {
+ expect(response.statusCode, equals(200));
+ response.read()
+ .transform(UTF8.decoder).join('').then(expectAsync((data) {
+ expect(data, equals('my-data'));
+ }));
+ }));
+ });
+}
« no previous file with comments | « dart/pkg/http_base/pubspec.yaml ('k') | dart/pkg/http_base/test/http_base_io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698