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

Side by Side Diff: pkg/analysis_server/test/mocks.dart

Issue 191103002: Add back previously removed tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/analysis_server/test/domain_server_test.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 mocks; 5 library mocks;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analysis_server/src/channel.dart';
11 import 'package:analysis_server/src/protocol.dart';
12
10 /** 13 /**
11 * A mock [WebSocket] for testing. 14 * A mock [WebSocket] for testing.
12 */ 15 */
13 class MockSocket<T> implements WebSocket { 16 class MockSocket<T> implements WebSocket {
14 17
15 StreamController controller = new StreamController(); 18 StreamController controller = new StreamController();
16 MockSocket twin; 19 MockSocket twin;
17 Stream stream; 20 Stream stream;
18 21
19 factory MockSocket.pair() { 22 factory MockSocket.pair() {
(...skipping 19 matching lines...) Expand all
39 42
40 StreamSubscription<T> listen(void onData(T event), 43 StreamSubscription<T> listen(void onData(T event),
41 { Function onError, void onDone(), bool cancelOnError}) => 44 { Function onError, void onDone(), bool cancelOnError}) =>
42 stream.listen(onData, onError: onError, onDone: onDone, 45 stream.listen(onData, onError: onError, onDone: onDone,
43 cancelOnError: cancelOnError); 46 cancelOnError: cancelOnError);
44 47
45 Stream<T> where(bool test(T)) => stream.where(test); 48 Stream<T> where(bool test(T)) => stream.where(test);
46 49
47 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 50 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
48 } 51 }
52
53 /**
54 * A mock [ServerCommunicationChannel] channel that does nothing.
55 */
56 class MockServerChannel implements ServerCommunicationChannel {
57 @override
58 void listen(void onRequest(Request request), {void onError(), void onDone()}) {
59 }
60
61 @override
62 void sendNotification(Notification notification) {
63 }
64
65 @override
66 void sendResponse(Response response) {
67 }
68 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/domain_server_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698