| 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.services.completion.contributor.dart.importuri; | 5 library test.services.completion.contributor.dart.importuri; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 9 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; | 9 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar
t'; |
| 10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 assertNotSuggested('foo/'); | 461 assertNotSuggested('foo/'); |
| 462 assertNotSuggested('foo/bar.dart'); | 462 assertNotSuggested('foo/bar.dart'); |
| 463 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); | 463 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); |
| 464 } | 464 } |
| 465 } | 465 } |
| 466 | 466 |
| 467 @reflectiveTest | 467 @reflectiveTest |
| 468 class UriContributorTest_Driver extends UriContributorTest { | 468 class UriContributorTest_Driver extends UriContributorTest { |
| 469 @override | 469 @override |
| 470 bool get enableNewAnalysisDriver => true; | 470 bool get enableNewAnalysisDriver => true; |
| 471 | |
| 472 @failingTest | |
| 473 @override | |
| 474 test_part_file() { | |
| 475 // NoSuchMethodError: The getter 'uri' was called on null. | |
| 476 // Receiver: null | |
| 477 // Tried calling: uri | |
| 478 // dart:core Object.noS
uchMethod | |
| 479 // package:analyzer/src/summary/resynthesize.dart 233:40 SummaryRes
ynthesizer.getLibraryElement.<fn> | |
| 480 // dart:collection _HashVMBas
e&MapMixin&&_LinkedHashMapMixin.putIfAbsent | |
| 481 // package:analyzer/src/summary/resynthesize.dart 209:36 SummaryRes
ynthesizer.getLibraryElement | |
| 482 // package:analyzer/src/summary/package_bundle_reader.dart 206:27 Resynthesi
zerResultProvider.compute | |
| 483 // package:analyzer/src/context/context.dart 573:52 AnalysisCo
ntextImpl.aboutToComputeResult.<fn> | |
| 484 // package:analyzer/src/generated/utilities_general.dart 189:15 _Performan
ceTagImpl.makeCurrentWhile | |
| 485 // package:analyzer/src/context/context.dart 571:42 AnalysisCo
ntextImpl.aboutToComputeResult | |
| 486 // package:analyzer/src/task/driver.dart 746:21 WorkItem.g
atherInputs | |
| 487 // package:analyzer/src/task/driver.dart 879:17 _WorkOrder
DependencyWalker.getNextInput | |
| 488 // package:analyzer/src/task/driver.dart 414:35 CycleAware
DependencyWalker.getNextStronglyConnectedComponent | |
| 489 // package:analyzer/src/task/driver.dart 845:31 WorkOrder.
moveNext.<fn> | |
| 490 // package:analyzer/src/generated/utilities_general.dart 189:15 _Performan
ceTagImpl.makeCurrentWhile | |
| 491 // package:analyzer/src/task/driver.dart 837:44 WorkOrder.
moveNext | |
| 492 // package:analyzer/src/task/driver.dart 108:30 AnalysisDr
iver.computeResult | |
| 493 // package:analyzer/src/context/context.dart 723:14 AnalysisCo
ntextImpl.computeResult | |
| 494 // package:analyzer/src/context/context.dart 1292:12 AnalysisCo
ntextImpl.resolveCompilationUnit2 | |
| 495 // package:analyzer/src/dart/analysis/driver.dart 656:56 AnalysisDr
iver._computeAnalysisResult.<fn> | |
| 496 // package:analyzer/src/dart/analysis/driver.dart 1427:15 Performanc
eLog.run | |
| 497 // package:analyzer/src/dart/analysis/driver.dart 643:20 AnalysisDr
iver._computeAnalysisResult | |
| 498 // package:analyzer/src/dart/analysis/driver.dart 910:33 AnalysisDr
iver._performWork.<async> | |
| 499 return super.test_part_file(); | |
| 500 } | |
| 501 | |
| 502 @failingTest | |
| 503 @override | |
| 504 test_part_file2() { | |
| 505 // Task failed: BuildCompilationUnitElementTask for source / | |
| 506 // Unexpected exception while performing BuildCompilationUnitElementTask for
source / | |
| 507 // #0 AnalysisTask._safelyPerform (package:analyzer/task/model.dart:333:
7) | |
| 508 // #1 AnalysisTask.perform (package:analyzer/task/model.dart:220:7) | |
| 509 // #2 AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.d
art:284:10) | |
| 510 // #3 AnalysisDriver.computeResult (package:analyzer/src/task/driver.dar
t:109:22) | |
| 511 // #4 AnalysisContextImpl.computeResult (package:analyzer/src/context/co
ntext.dart:723:14) | |
| 512 // #5 AnalysisContextImpl.computeErrors (package:analyzer/src/context/co
ntext.dart:665:12) | |
| 513 // #6 AnalysisDriver._computeAnalysisResult.<anonymous closure> (package
:analyzer/src/dart/analysis/driver.dart:658:54) | |
| 514 // #7 PerformanceLog.run (package:analyzer/src/dart/analysis/driver.dart
:1427:15) | |
| 515 // #8 AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/a
nalysis/driver.dart:643:20) | |
| 516 // #9 AnalysisDriver._performWork.<_performWork_async_body> (package:ana
lyzer/src/dart/analysis/driver.dart:910:33) | |
| 517 // #10 Future.Future.microtask.<anonymous closure> (dart:async/future.dar
t:184) | |
| 518 // #11 _rootRun (dart:async/zone.dart:1146) | |
| 519 // #12 _CustomZone.run (dart:async/zone.dart:1026) | |
| 520 // #13 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 521 // #14 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 522 // #15 _rootRun (dart:async/zone.dart:1150) | |
| 523 // #16 _CustomZone.run (dart:async/zone.dart:1026) | |
| 524 // #17 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 525 // #18 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 526 // #19 _microtaskLoop (dart:async/schedule_microtask.dart:41) | |
| 527 // #20 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) | |
| 528 // #21 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:394) | |
| 529 // #22 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414) | |
| 530 // #23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_pat
ch.dart:148) | |
| 531 // | |
| 532 // Caused by Exception: Unit element not found in summary: file:///proj/compl
etion.dart;file:/// | |
| 533 // #0 SummaryResynthesizer.getElement (package:analyzer/src/summary/resy
nthesize.dart:124:9) | |
| 534 // #1 ResynthesizerResultProvider.compute (package:analyzer/src/summary/
package_bundle_reader.dart:265:53) | |
| 535 // #2 AnalysisContextImpl.aboutToComputeResult.<anonymous closure> (pack
age:analyzer/src/context/context.dart:573:52) | |
| 536 // #3 _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generat
ed/utilities_general.dart:189:15) | |
| 537 // #4 AnalysisContextImpl.aboutToComputeResult (package:analyzer/src/con
text/context.dart:571:42) | |
| 538 // #5 BuildCompilationUnitElementTask.internalPerform (package:analyzer/
src/task/dart.dart:1071:27) | |
| 539 // #6 AnalysisTask._safelyPerform (package:analyzer/task/model.dart:321:
9) | |
| 540 // #7 AnalysisTask.perform (package:analyzer/task/model.dart:220:7) | |
| 541 // #8 AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.d
art:284:10) | |
| 542 // #9 AnalysisDriver.computeResult (package:analyzer/src/task/driver.dar
t:109:22) | |
| 543 // #10 AnalysisContextImpl.computeResult (package:analyzer/src/context/co
ntext.dart:723:14) | |
| 544 // #11 AnalysisContextImpl.computeErrors (package:analyzer/src/context/co
ntext.dart:665:12) | |
| 545 // #12 AnalysisDriver._computeAnalysisResult.<anonymous closure> (package
:analyzer/src/dart/analysis/driver.dart:658:54) | |
| 546 // #13 PerformanceLog.run (package:analyzer/src/dart/analysis/driver.dart
:1427:15) | |
| 547 // #14 AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/a
nalysis/driver.dart:643:20) | |
| 548 // #15 AnalysisDriver._performWork.<_performWork_async_body> (package:ana
lyzer/src/dart/analysis/driver.dart:910:33) | |
| 549 // #16 Future.Future.microtask.<anonymous closure> (dart:async/future.dar
t:184) | |
| 550 // #17 _rootRun (dart:async/zone.dart:1146) | |
| 551 // #18 _CustomZone.run (dart:async/zone.dart:1026) | |
| 552 // #19 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 553 // #20 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 554 // #21 _rootRun (dart:async/zone.dart:1150) | |
| 555 // #22 _CustomZone.run (dart:async/zone.dart:1026) | |
| 556 // #23 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 557 // #24 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 558 // #25 _microtaskLoop (dart:async/schedule_microtask.dart:41) | |
| 559 // #26 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) | |
| 560 // #27 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:394) | |
| 561 // #28 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414) | |
| 562 // #29 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_pat
ch.dart:148) | |
| 563 // return super.test_part_file2(); | |
| 564 fail('Throws background exception.'); | |
| 565 } | |
| 566 | |
| 567 @failingTest | |
| 568 @override | |
| 569 test_part_file_child() { | |
| 570 // expected foo/bar.dart CompletionSuggestionKind.IMPORT null | |
| 571 // found | |
| 572 return super.test_part_file_child(); | |
| 573 } | |
| 574 | |
| 575 @failingTest | |
| 576 @override | |
| 577 test_part_file_parent() { | |
| 578 // expected foo/bar.dart CompletionSuggestionKind.IMPORT null | |
| 579 // found | |
| 580 return super.test_part_file_parent(); | |
| 581 } | |
| 582 } | 471 } |
| 583 | 472 |
| 584 @reflectiveTest | 473 @reflectiveTest |
| 585 class UriContributorWindowsTest extends DartCompletionContributorTest { | 474 class UriContributorWindowsTest extends DartCompletionContributorTest { |
| 586 @override | 475 @override |
| 587 DartCompletionContributor createContributor() { | 476 DartCompletionContributor createContributor() { |
| 588 return new UriContributor(); | 477 return new UriContributor(); |
| 589 } | 478 } |
| 590 | 479 |
| 591 @override | 480 @override |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 assertNotSuggested('foo/'); | 633 assertNotSuggested('foo/'); |
| 745 assertNotSuggested('foo/bar.dart'); | 634 assertNotSuggested('foo/bar.dart'); |
| 746 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); | 635 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); |
| 747 } | 636 } |
| 748 } | 637 } |
| 749 | 638 |
| 750 @reflectiveTest | 639 @reflectiveTest |
| 751 class UriContributorWindowsTest_Driver extends UriContributorWindowsTest { | 640 class UriContributorWindowsTest_Driver extends UriContributorWindowsTest { |
| 752 @override | 641 @override |
| 753 bool get enableNewAnalysisDriver => true; | 642 bool get enableNewAnalysisDriver => true; |
| 754 | |
| 755 @failingTest | |
| 756 @override | |
| 757 test_part_file() { | |
| 758 // NoSuchMethodError: The getter 'uri' was called on null. | |
| 759 // Receiver: null | |
| 760 // Tried calling: uri | |
| 761 // dart:core Object.noS
uchMethod | |
| 762 // package:analyzer/src/summary/resynthesize.dart 233:40 SummaryRes
ynthesizer.getLibraryElement.<fn> | |
| 763 // dart:collection _HashVMBas
e&MapMixin&&_LinkedHashMapMixin.putIfAbsent | |
| 764 // package:analyzer/src/summary/resynthesize.dart 209:36 SummaryRes
ynthesizer.getLibraryElement | |
| 765 // package:analyzer/src/summary/package_bundle_reader.dart 206:27 Resynthesi
zerResultProvider.compute | |
| 766 // package:analyzer/src/context/context.dart 573:52 AnalysisCo
ntextImpl.aboutToComputeResult.<fn> | |
| 767 // package:analyzer/src/generated/utilities_general.dart 189:15 _Performan
ceTagImpl.makeCurrentWhile | |
| 768 // package:analyzer/src/context/context.dart 571:42 AnalysisCo
ntextImpl.aboutToComputeResult | |
| 769 // package:analyzer/src/task/driver.dart 746:21 WorkItem.g
atherInputs | |
| 770 // package:analyzer/src/task/driver.dart 879:17 _WorkOrder
DependencyWalker.getNextInput | |
| 771 // package:analyzer/src/task/driver.dart 414:35 CycleAware
DependencyWalker.getNextStronglyConnectedComponent | |
| 772 // package:analyzer/src/task/driver.dart 845:31 WorkOrder.
moveNext.<fn> | |
| 773 // package:analyzer/src/generated/utilities_general.dart 189:15 _Performan
ceTagImpl.makeCurrentWhile | |
| 774 // package:analyzer/src/task/driver.dart 837:44 WorkOrder.
moveNext | |
| 775 // package:analyzer/src/task/driver.dart 108:30 AnalysisDr
iver.computeResult | |
| 776 // package:analyzer/src/context/context.dart 723:14 AnalysisCo
ntextImpl.computeResult | |
| 777 // package:analyzer/src/context/context.dart 1292:12 AnalysisCo
ntextImpl.resolveCompilationUnit2 | |
| 778 // package:analyzer/src/dart/analysis/driver.dart 656:56 AnalysisDr
iver._computeAnalysisResult.<fn> | |
| 779 // package:analyzer/src/dart/analysis/driver.dart 1427:15 Performanc
eLog.run | |
| 780 // package:analyzer/src/dart/analysis/driver.dart 643:20 AnalysisDr
iver._computeAnalysisResult | |
| 781 // package:analyzer/src/dart/analysis/driver.dart 910:33 AnalysisDr
iver._performWork.<async> | |
| 782 return super.test_part_file(); | |
| 783 } | |
| 784 | |
| 785 @failingTest | |
| 786 @override | |
| 787 test_part_file2() { | |
| 788 // Task failed: BuildCompilationUnitElementTask for source / | |
| 789 // Unexpected exception while performing BuildCompilationUnitElementTask for
source / | |
| 790 // #0 AnalysisTask._safelyPerform (package:analyzer/task/model.dart:333:
7) | |
| 791 // #1 AnalysisTask.perform (package:analyzer/task/model.dart:220:7) | |
| 792 // #2 AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.d
art:284:10) | |
| 793 // #3 AnalysisDriver.computeResult (package:analyzer/src/task/driver.dar
t:109:22) | |
| 794 // #4 AnalysisContextImpl.computeResult (package:analyzer/src/context/co
ntext.dart:723:14) | |
| 795 // #5 AnalysisContextImpl.computeErrors (package:analyzer/src/context/co
ntext.dart:665:12) | |
| 796 // #6 AnalysisDriver._computeAnalysisResult.<anonymous closure> (package
:analyzer/src/dart/analysis/driver.dart:658:54) | |
| 797 // #7 PerformanceLog.run (package:analyzer/src/dart/analysis/driver.dart
:1427:15) | |
| 798 // #8 AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/a
nalysis/driver.dart:643:20) | |
| 799 // #9 AnalysisDriver._performWork.<_performWork_async_body> (package:ana
lyzer/src/dart/analysis/driver.dart:910:33) | |
| 800 // #10 Future.Future.microtask.<anonymous closure> (dart:async/future.dar
t:184) | |
| 801 // #11 _rootRun (dart:async/zone.dart:1146) | |
| 802 // #12 _CustomZone.run (dart:async/zone.dart:1026) | |
| 803 // #13 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 804 // #14 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 805 // #15 _rootRun (dart:async/zone.dart:1150) | |
| 806 // #16 _CustomZone.run (dart:async/zone.dart:1026) | |
| 807 // #17 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 808 // #18 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 809 // #19 _microtaskLoop (dart:async/schedule_microtask.dart:41) | |
| 810 // #20 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) | |
| 811 // #21 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:394) | |
| 812 // #22 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414) | |
| 813 // #23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_pat
ch.dart:148) | |
| 814 // | |
| 815 // Caused by Exception: Unit element not found in summary: file:///proj/compl
etion.dart;file:/// | |
| 816 // #0 SummaryResynthesizer.getElement (package:analyzer/src/summary/resy
nthesize.dart:124:9) | |
| 817 // #1 ResynthesizerResultProvider.compute (package:analyzer/src/summary/
package_bundle_reader.dart:265:53) | |
| 818 // #2 AnalysisContextImpl.aboutToComputeResult.<anonymous closure> (pack
age:analyzer/src/context/context.dart:573:52) | |
| 819 // #3 _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generat
ed/utilities_general.dart:189:15) | |
| 820 // #4 AnalysisContextImpl.aboutToComputeResult (package:analyzer/src/con
text/context.dart:571:42) | |
| 821 // #5 BuildCompilationUnitElementTask.internalPerform (package:analyzer/
src/task/dart.dart:1071:27) | |
| 822 // #6 AnalysisTask._safelyPerform (package:analyzer/task/model.dart:321:
9) | |
| 823 // #7 AnalysisTask.perform (package:analyzer/task/model.dart:220:7) | |
| 824 // #8 AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.d
art:284:10) | |
| 825 // #9 AnalysisDriver.computeResult (package:analyzer/src/task/driver.dar
t:109:22) | |
| 826 // #10 AnalysisContextImpl.computeResult (package:analyzer/src/context/co
ntext.dart:723:14) | |
| 827 // #11 AnalysisContextImpl.computeErrors (package:analyzer/src/context/co
ntext.dart:665:12) | |
| 828 // #12 AnalysisDriver._computeAnalysisResult.<anonymous closure> (package
:analyzer/src/dart/analysis/driver.dart:658:54) | |
| 829 // #13 PerformanceLog.run (package:analyzer/src/dart/analysis/driver.dart
:1427:15) | |
| 830 // #14 AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/a
nalysis/driver.dart:643:20) | |
| 831 // #15 AnalysisDriver._performWork.<_performWork_async_body> (package:ana
lyzer/src/dart/analysis/driver.dart:910:33) | |
| 832 // #16 Future.Future.microtask.<anonymous closure> (dart:async/future.dar
t:184) | |
| 833 // #17 _rootRun (dart:async/zone.dart:1146) | |
| 834 // #18 _CustomZone.run (dart:async/zone.dart:1026) | |
| 835 // #19 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 836 // #20 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 837 // #21 _rootRun (dart:async/zone.dart:1150) | |
| 838 // #22 _CustomZone.run (dart:async/zone.dart:1026) | |
| 839 // #23 _CustomZone.runGuarded (dart:async/zone.dart:924) | |
| 840 // #24 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart
:951) | |
| 841 // #25 _microtaskLoop (dart:async/schedule_microtask.dart:41) | |
| 842 // #26 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) | |
| 843 // #27 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:394) | |
| 844 // #28 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414) | |
| 845 // #29 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_pat
ch.dart:148) | |
| 846 // return super.test_part_file2(); | |
| 847 fail('Throws background exception.'); | |
| 848 } | |
| 849 | |
| 850 @failingTest | |
| 851 @override | |
| 852 test_part_file_child() { | |
| 853 // expected foo/bar.dart CompletionSuggestionKind.IMPORT null | |
| 854 // found | |
| 855 return super.test_part_file_child(); | |
| 856 } | |
| 857 | |
| 858 @failingTest | |
| 859 @override | |
| 860 test_part_file_parent() { | |
| 861 // expected foo/bar.dart CompletionSuggestionKind.IMPORT null | |
| 862 // found | |
| 863 return super.test_part_file_parent(); | |
| 864 } | |
| 865 } | 643 } |
| 866 | 644 |
| 867 class _TestWinResourceProvider extends MemoryResourceProvider { | 645 class _TestWinResourceProvider extends MemoryResourceProvider { |
| 868 @override | 646 @override |
| 869 Context get pathContext => windows; | 647 Context get pathContext => windows; |
| 870 } | 648 } |
| OLD | NEW |