OLD | NEW |
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.domain.analysis.hover; | 5 library test.domain.analysis.hover; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
11 | 11 |
12 import '../analysis_abstract.dart'; | 12 import '../analysis_abstract.dart'; |
13 import '../reflective_tests.dart'; | 13 import '../reflective_tests.dart'; |
14 | 14 |
15 | 15 |
16 main() { | 16 main() { |
17 groupSep = ' | '; | 17 groupSep = ' | '; |
18 runReflectiveTests(AnalysisHoverTest); | 18 runReflectiveTests(AnalysisHoverTest); |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 @ReflectiveTestCase() | 22 @reflectiveTest |
23 class AnalysisHoverTest extends AbstractAnalysisTest { | 23 class AnalysisHoverTest extends AbstractAnalysisTest { |
24 Future<HoverInformation> prepareHover(String search) { | 24 Future<HoverInformation> prepareHover(String search) { |
25 int offset = findOffset(search); | 25 int offset = findOffset(search); |
26 return prepareHoverAt(offset); | 26 return prepareHoverAt(offset); |
27 } | 27 } |
28 | 28 |
29 Future<HoverInformation> prepareHoverAt(int offset) { | 29 Future<HoverInformation> prepareHoverAt(int offset) { |
30 return waitForTasksFinished().then((_) { | 30 return waitForTasksFinished().then((_) { |
31 Request request = | 31 Request request = |
32 new AnalysisGetHoverParams(testFile, offset).toRequest('0'); | 32 new AnalysisGetHoverParams(testFile, offset).toRequest('0'); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 library my.library; | 303 library my.library; |
304 main() { | 304 main() { |
305 // nothing | 305 // nothing |
306 } | 306 } |
307 '''); | 307 '''); |
308 return prepareHover('nothing').then((HoverInformation hover) { | 308 return prepareHover('nothing').then((HoverInformation hover) { |
309 expect(hover, isNull); | 309 expect(hover, isNull); |
310 }); | 310 }); |
311 } | 311 } |
312 } | 312 } |
OLD | NEW |