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 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 5 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
6 import 'package:path/path.dart' as path; | 6 import 'package:path/path.dart' as path; |
7 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 | 9 |
10 import '../integration_tests.dart'; | 10 import '../integration_tests.dart'; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 List<NavigationTarget> navigationTargets; | 47 List<NavigationTarget> navigationTargets; |
48 List<String> navigationTargetFiles; | 48 List<String> navigationTargetFiles; |
49 onAnalysisNavigation.listen((AnalysisNavigationParams params) { | 49 onAnalysisNavigation.listen((AnalysisNavigationParams params) { |
50 expect(params.file, equals(mainPath)); | 50 expect(params.file, equals(mainPath)); |
51 navigationRegions = params.regions; | 51 navigationRegions = params.regions; |
52 navigationTargets = params.targets; | 52 navigationTargets = params.targets; |
53 navigationTargetFiles = params.files; | 53 navigationTargetFiles = params.files; |
54 }); | 54 }); |
55 sendAnalysisSetAnalysisRoots([projPath], [], | 55 sendAnalysisSetAnalysisRoots([projPath], [], |
56 packageRoots: {projPath: packagesPath}); | 56 packageRoots: {projPath: packagesPath}); |
| 57 sendAnalysisSetPriorityFiles([mainPath]); |
57 return analysisFinished.then((_) { | 58 return analysisFinished.then((_) { |
58 // Verify that fooBarPath was properly resolved by checking that f() | 59 // Verify that fooBarPath was properly resolved by checking that f() |
59 // refers to it. | 60 // refers to it. |
60 bool found = false; | 61 bool found = false; |
61 for (NavigationRegion region in navigationRegions) { | 62 for (NavigationRegion region in navigationRegions) { |
62 String navigationSource = | 63 String navigationSource = |
63 mainText.substring(region.offset, region.offset + region.length); | 64 mainText.substring(region.offset, region.offset + region.length); |
64 if (navigationSource == 'f') { | 65 if (navigationSource == 'f') { |
65 found = true; | 66 found = true; |
66 expect(region.targets, hasLength(1)); | 67 expect(region.targets, hasLength(1)); |
(...skipping 10 matching lines...) Expand all Loading... |
77 } | 78 } |
78 } | 79 } |
79 | 80 |
80 @reflectiveTest | 81 @reflectiveTest |
81 class SetAnalysisRootsTest extends AbstractSetAnalysisRootsTest {} | 82 class SetAnalysisRootsTest extends AbstractSetAnalysisRootsTest {} |
82 | 83 |
83 @reflectiveTest | 84 @reflectiveTest |
84 class SetAnalysisRootsTest_Driver extends AbstractSetAnalysisRootsTest { | 85 class SetAnalysisRootsTest_Driver extends AbstractSetAnalysisRootsTest { |
85 @override | 86 @override |
86 bool get enableNewAnalysisDriver => true; | 87 bool get enableNewAnalysisDriver => true; |
87 | |
88 @failingTest | |
89 test_package_root() { | |
90 // NoSuchMethodError: The getter 'iterator' was called on null. | |
91 return super.test_package_root(); | |
92 } | |
93 } | 88 } |
OLD | NEW |