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

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

Issue 790363006: Upgrade unittest to be able to use isNotEmpty. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/integration/analysis/update_content_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 test.socket.server; 5 library test.socket.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 expect(channel.notificationsReceived[0].event, SERVER_CONNECTED); 88 expect(channel.notificationsReceived[0].event, SERVER_CONNECTED);
89 _MockRequestHandler handler = new _MockRequestHandler(false); 89 _MockRequestHandler handler = new _MockRequestHandler(false);
90 server.analysisServer.handlers = [handler]; 90 server.analysisServer.handlers = [handler];
91 var request = new ServerGetVersionParams().toRequest('0'); 91 var request = new ServerGetVersionParams().toRequest('0');
92 return channel.sendRequest(request).then((Response response) { 92 return channel.sendRequest(request).then((Response response) {
93 expect(response.id, equals('0')); 93 expect(response.id, equals('0'));
94 expect(response.error, isNotNull); 94 expect(response.error, isNotNull);
95 expect(response.error.code, equals(RequestErrorCode.SERVER_ERROR)); 95 expect(response.error.code, equals(RequestErrorCode.SERVER_ERROR));
96 expect(response.error.message, equals('mock request exception')); 96 expect(response.error.message, equals('mock request exception'));
97 expect(response.error.stackTrace, isNotNull); 97 expect(response.error.stackTrace, isNotNull);
98 expect(response.error.stackTrace, isNot(isEmpty)); 98 expect(response.error.stackTrace, isNotEmpty);
99 channel.expectMsgCount(responseCount: 1, notificationCount: 1); 99 channel.expectMsgCount(responseCount: 1, notificationCount: 1);
100 }); 100 });
101 } 101 }
102 102
103 static Future requestHandler_futureException() { 103 static Future requestHandler_futureException() {
104 SocketServer server = new SocketServer( 104 SocketServer server = new SocketServer(
105 new AnalysisServerOptions(), 105 new AnalysisServerOptions(),
106 DirectoryBasedDartSdk.defaultSdk, 106 DirectoryBasedDartSdk.defaultSdk,
107 InstrumentationService.NULL_SERVICE); 107 InstrumentationService.NULL_SERVICE);
108 MockServerChannel channel = new MockServerChannel(); 108 MockServerChannel channel = new MockServerChannel();
(...skipping 21 matching lines...) Expand all
130 new Future(throwException); 130 new Future(throwException);
131 return new Response(request.id); 131 return new Response(request.id);
132 } 132 }
133 throw 'mock request exception'; 133 throw 'mock request exception';
134 } 134 }
135 135
136 void throwException() { 136 void throwException() {
137 throw 'mock future exception'; 137 throw 'mock future exception';
138 } 138 }
139 } 139 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/integration/analysis/update_content_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698