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

Side by Side Diff: services/dart/dart_apptests/io_http_apptests.dart

Issue 1132063007: Rationalize Dart mojo and sky package structure (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library io_http_apptests; 5 library io_http_apptests;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:mojo.io'; 9 import 'dart:mojo.io';
10 10
11 import 'package:apptest/apptest.dart'; 11 import 'package:apptest/apptest.dart';
12 import 'package:mojo/public/dart/application.dart'; 12 import 'package:mojo/application.dart';
13 import 'package:mojo/public/dart/bindings.dart'; 13 import 'package:mojo/bindings.dart';
14 import 'package:mojo/public/dart/core.dart'; 14 import 'package:mojo/core.dart';
15 15
16 tests(Application application, String url) { 16 tests(Application application, String url) {
17 group('Http Apptests', () { 17 group('Http Apptests', () {
18 // Bind server to a random port. 18 // Bind server to a random port.
19 test('Http Server Bind', () async { 19 test('Http Server Bind', () async {
20 var server = await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 0); 20 var server = await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 0);
21 expect(server, isNotNull); 21 expect(server, isNotNull);
22 expect(server.port, greaterThan(1024)); 22 expect(server.port, greaterThan(1024));
23 await server.close(); 23 await server.close();
24 }); 24 });
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 expect(response, isNotNull); 63 expect(response, isNotNull);
64 expect(response.statusCode, equals(HttpStatus.OK)); 64 expect(response.statusCode, equals(HttpStatus.OK));
65 // Reduce to a single list. 65 // Reduce to a single list.
66 var payload = await response.reduce((p, e) => p..addAll(e)); 66 var payload = await response.reduce((p, e) => p..addAll(e));
67 // Verify payload is correct. 67 // Verify payload is correct.
68 expect('contents of bar.txt', equals(UTF8.decode(payload))); 68 expect('contents of bar.txt', equals(UTF8.decode(payload)));
69 await server.close(); 69 await server.close();
70 }); 70 });
71 }); 71 });
72 } 72 }
OLDNEW
« no previous file with comments | « services/dart/dart_apptests/echo_apptests.dart ('k') | services/dart/dart_apptests/io_internet_address_apptests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698