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 |
26 test_waitForResponses_empty_noTimeout() async { | 32 test_waitForResponses_empty_noTimeout() async { |
27 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); | 33 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); |
28 Map<PluginInfo, Future<plugin.Response>> futures = | 34 Map<PluginInfo, Future<plugin.Response>> futures = |
29 <PluginInfo, Future<plugin.Response>>{}; | 35 <PluginInfo, Future<plugin.Response>>{}; |
30 List<plugin.Response> responses = await handler.waitForResponses(futures); | 36 List<plugin.Response> responses = await handler.waitForResponses(futures); |
31 expect(responses, isEmpty); | 37 expect(responses, isEmpty); |
32 } | 38 } |
33 | 39 |
34 test_waitForResponses_empty_timeout() async { | 40 test_waitForResponses_empty_timeout() async { |
35 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); | 41 AbstractRequestHandler handler = new TestAbstractRequestHandler(server); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 102 |
97 class TestAbstractRequestHandler extends AbstractRequestHandler { | 103 class TestAbstractRequestHandler extends AbstractRequestHandler { |
98 TestAbstractRequestHandler(server) : super(server); | 104 TestAbstractRequestHandler(server) : super(server); |
99 | 105 |
100 @override | 106 @override |
101 Response handleRequest(Request request) { | 107 Response handleRequest(Request request) { |
102 fail('Unexpected invocation of handleRequest'); | 108 fail('Unexpected invocation of handleRequest'); |
103 return null; | 109 return null; |
104 } | 110 } |
105 } | 111 } |
OLD | NEW |