Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'package:analysis_server/plugin/protocol/protocol.dart'; | |
| 6 import 'package:test/test.dart'; | |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | |
| 8 | |
| 9 import '../integration_tests.dart'; | |
| 10 | |
| 11 main() { | |
| 12 defineReflectiveSuite(() { | |
| 13 defineReflectiveTests(FindMemberReferencesTest); | |
| 14 }); | |
| 15 } | |
| 16 | |
| 17 @reflectiveTest | |
| 18 class FindMemberReferencesTest extends AbstractAnalysisServerIntegrationTest { | |
| 19 String pathname; | |
| 20 | |
| 21 @failingTest | |
| 22 test_findMemberReferences() async { | |
| 23 // TODO(devoncarew): This fails with both the old and new driver, and | |
| 24 // doesn't seem referenced by IntelliJ. | |
| 25 | |
| 26 String text = r''' | |
| 27 String qux() => 'qux'; | |
| 28 | |
| 29 class Foo { | |
| 30 int bar() => 1; | |
| 31 baz() => bar() * bar(); | |
|
scheglov
2017/03/13 22:43:18
The reason why it does not work is that we return
devoncarew
2017/03/13 23:08:48
Ah, thanks. Updated to have unresolved references,
| |
| 32 } | |
| 33 '''; | |
| 34 | |
| 35 pathname = sourcePath('foo.dart'); | |
| 36 writeFile(pathname, text); | |
| 37 standardAnalysisSetup(); | |
| 38 await analysisFinished; | |
| 39 | |
| 40 SearchFindMemberReferencesResult referencesResult = | |
| 41 await sendSearchFindMemberReferences('bar'); | |
| 42 expect(referencesResult.id, isNotNull); | |
| 43 | |
| 44 SearchResultsParams searchParams = await onSearchResults.first; | |
| 45 expect(searchParams.id, referencesResult.id); | |
| 46 expect(searchParams.isLast, true); | |
| 47 expect(searchParams.results, isNotEmpty); | |
| 48 | |
| 49 SearchResult result = searchParams.results.first; | |
| 50 expect(result.location.file, pathname); | |
| 51 expect(result.isPotential, false); | |
| 52 expect(result.kind.name, SearchResultKind.DECLARATION.name); | |
| 53 expect(result.path.first.name, 'bar'); | |
| 54 } | |
| 55 | |
| 56 @override | |
| 57 bool get enableNewAnalysisDriver => true; | |
| 58 } | |
| OLD | NEW |