Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: pkg/analysis_server/test/plugin/set_analysis_domain_test.dart

Issue 1307143004: Make navigation notification operation Source based, without Dart knowledge. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
diff --git a/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
index 38953fa0ee125eb42fc2e42614466ba2bbdbe294..981045ccc66c77583645d526accc679863e9009c 100644
--- a/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
+++ b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
@@ -37,7 +37,6 @@ main() {
@reflectiveTest
class SetAnalysisDomainTest extends AbstractAnalysisTest {
final Set<String> parsedUnitFiles = new Set<String>();
- bool contributorMayAddRegion = false;
List<NavigationRegion> regions;
List<NavigationTarget> targets;
@@ -53,12 +52,7 @@ class SetAnalysisDomainTest extends AbstractAnalysisTest {
void processNotification(Notification notification) {
if (notification.event == ANALYSIS_NAVIGATION) {
var params = new AnalysisNavigationParams.fromNotification(notification);
- // TODO(scheglov) we check for "params.regions.isNotEmpty" because
- // normal, Dart only, navigation notifications are scheduled as
- // operations, but plugins use "notificationSite.scheduleNavigation"
- // which is not scheduled yet. So, it comes *before* the Dart one, and
- // gets lost.
- if (params.file == testFile && params.regions.isNotEmpty) {
+ if (params.file == testFile) {
regions = params.regions;
targets = params.targets;
targetFiles = params.files;
@@ -101,10 +95,8 @@ class TestNavigationContributor implements NavigationContributor {
@override
void computeNavigation(NavigationHolder holder, AnalysisContext context,
Source source, int offset, int length) {
- if (test.contributorMayAddRegion) {
- holder.addRegion(1, 5, ElementKind.CLASS,
- new Location('/testLocation.dart', 1, 2, 3, 4));
- }
+ holder.addRegion(1, 5, ElementKind.CLASS,
+ new Location('/testLocation.dart', 1, 2, 3, 4));
}
}
@@ -133,14 +125,8 @@ class TestSetAnalysisDomainPlugin implements Plugin {
expect(result.value, isNotNull);
Source source = result.target.source;
test.parsedUnitFiles.add(source.fullName);
- // let the navigation contributor to work
- test.contributorMayAddRegion = true;
- try {
- domain.scheduleNotification(
- result.context, source, AnalysisService.NAVIGATION);
- } finally {
- test.contributorMayAddRegion = false;
- }
+ domain.scheduleNotification(
+ result.context, source, AnalysisService.NAVIGATION);
});
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698