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

Side by Side Diff: utils/tests/testrunner/http_client_tests/http_client_test.dart

Issue 2976313002: Delete old tests that aren't used and/or useful any more. (Closed)
Patch Set: Resurrect dummy_compiler_test and recursive_import_test. Created 3 years, 5 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library testrunner_test;
6
7 import 'dart:async';
8 import 'dart:io';
9 import 'package:unittest/unittest.dart';
10
11 main() {
12 var get = (String what, int code, String text) {
13 var c = new Completer();
14 HttpClient client = new HttpClient();
15 client
16 .getUrl(Uri.parse("http://127.0.0.1:3456/$what"))
17 .then((HttpClientRequest request) {
18 // Prepare the request then call close on it to send it.
19 return request.close();
20 }).then((HttpClientResponse response) {
21 // Process the response.
22 expect(response.statusCode, code);
23 var sb = new StringBuffer();
24 response.transform(UTF8.decoder).listen((data) {
25 sb.write(data);
26 }, onDone: () {
27 expect(sb.toString(), text);
28 c.complete();
29 });
30 });
31 return c.future;
32 };
33 test('test1', () {
34 return get('test.txt', 200, "Hello world!\n");
35 });
36 test('test2', () {
37 return get('fail.txt', 404, "");
38 });
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698