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

Side by Side Diff: pkg/scheduled_test/lib/scheduled_server.dart

Issue 22284003: pkg: analysis aided cleanup (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/path/pubspec.yaml ('k') | pkg/scheduled_test/lib/scheduled_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library scheduled_test.scheduled_server; 5 library scheduled_test.scheduled_server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:io'; 9 import 'dart:io';
10 10
11 import 'scheduled_test.dart'; 11 import 'scheduled_test.dart';
12 import 'src/utils.dart';
13 import 'src/scheduled_server/handler.dart'; 12 import 'src/scheduled_server/handler.dart';
14 import 'src/scheduled_server/safe_http_server.dart'; 13 import 'src/scheduled_server/safe_http_server.dart';
15 14
16 typedef Future ScheduledHandler(HttpRequest request); 15 typedef Future ScheduledHandler(HttpRequest request);
17 16
18 /// A class representing an [HttpServer] that's scheduled to run in the course 17 /// A class representing an [HttpServer] that's scheduled to run in the course
19 /// of the test. This class allows the server's request handling to be scheduled 18 /// of the test. This class allows the server's request handling to be scheduled
20 /// synchronously. 19 /// synchronously.
21 /// 20 ///
22 /// The server expects requests to be received in the order [handle] is called, 21 /// The server expects requests to be received in the order [handle] is called,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 "when no more requests were expected."; 95 "when no more requests were expected.";
97 } 96 }
98 return _handlers.removeFirst().fn(request); 97 return _handlers.removeFirst().fn(request);
99 }).catchError((e) { 98 }).catchError((e) {
100 // Close the server so that we don't leave a dangling request. 99 // Close the server so that we don't leave a dangling request.
101 _server.then((s) => s.close()); 100 _server.then((s) => s.close());
102 throw e; 101 throw e;
103 }), 'receiving ${request.method} ${request.uri}'); 102 }), 'receiving ${request.method} ${request.uri}');
104 } 103 }
105 } 104 }
OLDNEW
« no previous file with comments | « pkg/path/pubspec.yaml ('k') | pkg/scheduled_test/lib/scheduled_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698