OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 | 6 |
7 import 'package:analysis_server/src/domain_abstract.dart'; | 7 import 'package:analysis_server/src/domain_abstract.dart'; |
8 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 8 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
9 import 'package:analysis_server/src/protocol_server.dart' hide Element; | 9 import 'package:analysis_server/src/protocol_server.dart' hide Element; |
10 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; | 10 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; |
11 import 'package:analyzer_plugin/protocol/protocol_constants.dart' as plugin; | 11 import 'package:analyzer_plugin/protocol/protocol_constants.dart' as plugin; |
12 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; | 12 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
13 import 'package:test/test.dart'; | 13 import 'package:test/test.dart'; |
14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
15 | 15 |
16 import '../analysis_abstract.dart'; | 16 import '../analysis_abstract.dart'; |
17 | 17 |
18 main() { | 18 main() { |
19 defineReflectiveSuite(() { | 19 defineReflectiveSuite(() { |
20 defineReflectiveTests(AbstractRequestHandlerTest); | 20 defineReflectiveTests(AbstractRequestHandlerTest); |
21 }); | 21 }); |
22 } | 22 } |
23 | 23 |
24 @reflectiveTest | 24 @reflectiveTest |
25 class AbstractRequestHandlerTest extends AbstractAnalysisTest { | 25 class AbstractRequestHandlerTest extends AbstractAnalysisTest { |
26 @override | |
27 void setUp() { | |
28 enableNewAnalysisDriver = true; | |
29 super.setUp(); | |
30 } | |
31 | |
32 test_waitForResponses_empty_noTimeout() async { | 26 test_waitForResponses_empty_noTimeout() async { |
33 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); | 27 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); |
34 Map<PluginInfo, Future<plugin.Response>> futures = | 28 Map<PluginInfo, Future<plugin.Response>> futures = |
35 <PluginInfo, Future<plugin.Response>>{}; | 29 <PluginInfo, Future<plugin.Response>>{}; |
36 List<plugin.Response> responses = await handler.waitForResponses(futures); | 30 List<plugin.Response> responses = await handler.waitForResponses(futures); |
37 expect(responses, isEmpty); | 31 expect(responses, isEmpty); |
38 } | 32 } |
39 | 33 |
40 test_waitForResponses_empty_timeout() async { | 34 test_waitForResponses_empty_timeout() async { |
41 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); | 35 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 96 |
103 class TestAbstractRequestHandler extends AbstractRequestHandler { | 97 class TestAbstractRequestHandler extends AbstractRequestHandler { |
104 TestAbstractRequestHandler(server) : super(server); | 98 TestAbstractRequestHandler(server) : super(server); |
105 | 99 |
106 @override | 100 @override |
107 Response handleRequest(Request request) { | 101 Response handleRequest(Request request) { |
108 fail('Unexpected invocation of handleRequest'); | 102 fail('Unexpected invocation of handleRequest'); |
109 return null; | 103 return null; |
110 } | 104 } |
111 } | 105 } |
OLD | NEW |