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

Side by Side Diff: test/runner/browser/code_server.dart

Issue 1664433002: Support shelf 0.7.0. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 10 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
« no previous file with comments | « test/runner/browser/chrome_test.dart ('k') | test/runner/browser/content_shell_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io';
7 6
7 import 'package:http_parser/http_parser.dart';
8 import 'package:shelf/shelf.dart' as shelf; 8 import 'package:shelf/shelf.dart' as shelf;
9 import 'package:shelf_web_socket/shelf_web_socket.dart'; 9 import 'package:shelf_web_socket/shelf_web_socket.dart';
10 import 'package:scheduled_test/scheduled_server.dart'; 10 import 'package:scheduled_test/scheduled_server.dart';
11 11
12 /// A class that schedules a server to serve Dart and/or JS code and receive 12 /// A class that schedules a server to serve Dart and/or JS code and receive
13 /// WebSocket connections. 13 /// WebSocket connections.
14 /// 14 ///
15 /// This uses [ScheduledServer] under the hood, and has similar semantics: its 15 /// This uses [ScheduledServer] under the hood, and has similar semantics: its
16 /// `handle*` methods all schedule a handler that must be hit before the 16 /// `handle*` methods all schedule a handler that must be hit before the
17 /// schedule will continue. 17 /// schedule will continue.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }); 72 });
73 73
74 _server.handle("GET", "/index.js", (_) { 74 _server.handle("GET", "/index.js", (_) {
75 return new shelf.Response.ok(javaScript, 75 return new shelf.Response.ok(javaScript,
76 headers: {'content-type': 'application/javascript'}); 76 headers: {'content-type': 'application/javascript'});
77 }); 77 });
78 } 78 }
79 79
80 /// Handles a WebSocket connection to the root of the server, and returns a 80 /// Handles a WebSocket connection to the root of the server, and returns a
81 /// future that will complete to the WebSocket. 81 /// future that will complete to the WebSocket.
82 Future<WebSocket> handleWebSocket() { 82 Future<WebSocketChannel> handleWebSocket() {
83 var completer = new Completer(); 83 var completer = new Completer();
84 _server.handle("GET", "/", webSocketHandler(completer.complete)); 84 _server.handle("GET", "/", webSocketHandler(completer.complete));
85 return completer.future; 85 return completer.future;
86 } 86 }
87 } 87 }
OLDNEW
« no previous file with comments | « test/runner/browser/chrome_test.dart ('k') | test/runner/browser/content_shell_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698