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

Side by Side Diff: test/server/server_test.dart

Issue 864983002: Fix a couple test timeouts. (Closed) Base URL: git@github.com:dart-lang/json_rpc_2@master
Patch Set: Created 5 years, 11 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/server/batch_test.dart ('k') | test/server/utils.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) 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 json_rpc_2.test.server.server_test; 5 library json_rpc_2.test.server.server_test;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'package:json_rpc_2/error_code.dart' as error_code; 10 import 'package:json_rpc_2/error_code.dart' as error_code;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 })); 82 }));
83 }); 83 });
84 84
85 test("doesn't return a result for a notification", () { 85 test("doesn't return a result for a notification", () {
86 controller.server.registerMethod('foo', (args) => 'result'); 86 controller.server.registerMethod('foo', (args) => 'result');
87 87
88 expect(controller.handleRequest({ 88 expect(controller.handleRequest({
89 'jsonrpc': '2.0', 89 'jsonrpc': '2.0',
90 'method': 'foo', 90 'method': 'foo',
91 'params': {} 91 'params': {}
92 }), completion(isNull)); 92 }), doesNotComplete);
93 }); 93 });
94 94
95 test("includes the error data in the response", () { 95 test("includes the error data in the response", () {
96 controller.server.registerMethod('foo', (params) { 96 controller.server.registerMethod('foo', (params) {
97 throw new json_rpc.RpcException(5, 'Error message.', data: 'data value'); 97 throw new json_rpc.RpcException(5, 'Error message.', data: 'data value');
98 }); 98 });
99 99
100 expectErrorResponse(controller, { 100 expectErrorResponse(controller, {
101 'jsonrpc': '2.0', 101 'jsonrpc': '2.0',
102 'method': 'foo', 102 'method': 'foo',
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 })); 182 }));
183 }); 183 });
184 }); 184 });
185 185
186 test("disallows multiple methods with the same name", () { 186 test("disallows multiple methods with the same name", () {
187 controller.server.registerMethod('foo', () => null); 187 controller.server.registerMethod('foo', () => null);
188 expect(() => controller.server.registerMethod('foo', () => null), 188 expect(() => controller.server.registerMethod('foo', () => null),
189 throwsArgumentError); 189 throwsArgumentError);
190 }); 190 });
191 } 191 }
OLDNEW
« no previous file with comments | « test/server/batch_test.dart ('k') | test/server/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698