Chromium Code Reviews| Index: pkg/analysis_server/test/integration/search/find_member_references_test.dart |
| diff --git a/pkg/analysis_server/test/integration/search/find_member_references_test.dart b/pkg/analysis_server/test/integration/search/find_member_references_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..84a12946da9d1977294b2d832c7056ef0a31a016 |
| --- /dev/null |
| +++ b/pkg/analysis_server/test/integration/search/find_member_references_test.dart |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| +import 'package:test/test.dart'; |
| +import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| + |
| +import '../integration_tests.dart'; |
| + |
| +main() { |
| + defineReflectiveSuite(() { |
| + defineReflectiveTests(FindMemberReferencesTest); |
| + }); |
| +} |
| + |
| +@reflectiveTest |
| +class FindMemberReferencesTest extends AbstractAnalysisServerIntegrationTest { |
| + String pathname; |
| + |
| + @failingTest |
| + test_findMemberReferences() async { |
| + // TODO(devoncarew): This fails with both the old and new driver, and |
| + // doesn't seem referenced by IntelliJ. |
| + |
| + String text = r''' |
| +String qux() => 'qux'; |
| + |
| +class Foo { |
| + int bar() => 1; |
| + 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,
|
| +} |
| +'''; |
| + |
| + pathname = sourcePath('foo.dart'); |
| + writeFile(pathname, text); |
| + standardAnalysisSetup(); |
| + await analysisFinished; |
| + |
| + SearchFindMemberReferencesResult referencesResult = |
| + await sendSearchFindMemberReferences('bar'); |
| + expect(referencesResult.id, isNotNull); |
| + |
| + SearchResultsParams searchParams = await onSearchResults.first; |
| + expect(searchParams.id, referencesResult.id); |
| + expect(searchParams.isLast, true); |
| + expect(searchParams.results, isNotEmpty); |
| + |
| + SearchResult result = searchParams.results.first; |
| + expect(result.location.file, pathname); |
| + expect(result.isPotential, false); |
| + expect(result.kind.name, SearchResultKind.DECLARATION.name); |
| + expect(result.path.first.name, 'bar'); |
| + } |
| + |
| + @override |
| + bool get enableNewAnalysisDriver => true; |
| +} |