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

Side by Side Diff: pkg/analysis_server/test/analysis_server_test.dart

Issue 1462693002: Report error for ignored priority file. Ignore subscription for ignored files. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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.analysis_server; 5 library test.analysis_server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 return false; 450 return false;
451 }), isTrue); 451 }), isTrue);
452 // the last notification should indicate that analysis is complete 452 // the last notification should indicate that analysis is complete
453 Notification notification = notifications[notifications.length - 1]; 453 Notification notification = notifications[notifications.length - 1];
454 var params = new ServerStatusParams.fromNotification(notification); 454 var params = new ServerStatusParams.fromNotification(notification);
455 expect(params.analysis.isAnalyzing, isFalse); 455 expect(params.analysis.isAnalyzing, isFalse);
456 }); 456 });
457 } 457 }
458 458
459 test_setAnalysisSubscriptions_fileInIgnoredFolder() async {
460 String path = '/project/samples/sample.dart';
461 resourceProvider.newFile(path, '');
462 resourceProvider.newFile(
463 '/project/.analysis_options',
464 r'''
465 analyzer:
466 exclude:
467 - 'samples/**'
468 ''');
469 server.setAnalysisRoots('0', ['/project'], [], {});
470 server.setAnalysisSubscriptions(<AnalysisService, Set<String>>{
471 AnalysisService.NAVIGATION: new Set<String>.from([path])
472 });
473 // the file is excluded, so no navigation notification
474 await server.onAnalysisComplete;
475 expect(channel.notificationsReceived.any((notification) {
476 return notification.event == ANALYSIS_NAVIGATION;
477 }), isFalse);
478 }
479
459 Future test_shutdown() { 480 Future test_shutdown() {
460 server.handlers = [new ServerDomainHandler(server)]; 481 server.handlers = [new ServerDomainHandler(server)];
461 var request = new Request('my28', SERVER_SHUTDOWN); 482 var request = new Request('my28', SERVER_SHUTDOWN);
462 return channel.sendRequest(request).then((Response response) { 483 return channel.sendRequest(request).then((Response response) {
463 expect(response.id, equals('my28')); 484 expect(response.id, equals('my28'));
464 expect(response.error, isNull); 485 expect(response.error, isNull);
465 }); 486 });
466 } 487 }
467 488
468 Future test_unknownRequest() { 489 Future test_unknownRequest() {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 _MockServerOperation(this.context); 556 _MockServerOperation(this.context);
536 557
537 @override 558 @override
538 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS; 559 ServerOperationPriority get priority => ServerOperationPriority.ANALYSIS;
539 560
540 @override 561 @override
541 void perform(AnalysisServer server) { 562 void perform(AnalysisServer server) {
542 isComplete = true; 563 isComplete = true;
543 } 564 }
544 } 565 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698