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

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

Issue 313753002: Fix for implicit constructor invocation navigation regions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
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.domain.analysis.notification.navigation; 5 library test.domain.analysis.notification.navigation;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
11 import 'package:analysis_server/src/protocol.dart'; 11 import 'package:analysis_server/src/protocol.dart';
12 import 'package:unittest/unittest.dart'; 12 import 'package:unittest/unittest.dart';
13 13
14 import 'analysis_abstract_test.dart'; 14 import 'analysis_abstract_test.dart';
15 import 'reflective_tests.dart'; 15 import 'reflective_tests.dart';
16 16
17 17
18 main() {
19 group('notification.navigation', () {
20 runReflectiveTests(AnalysisNotificationNavigationTest);
21 });
22 }
23
24
18 @ReflectiveTestCase() 25 @ReflectiveTestCase()
19 class AnalysisNotificationNavigationTest extends AbstractAnalysisTest { 26 class AnalysisNotificationNavigationTest extends AbstractAnalysisTest {
20 List<Map<String, Object>> regions; 27 List<Map<String, Object>> regions;
21 Map<String, Object> testRegion; 28 Map<String, Object> testRegion;
22 List<Map<String, Object>> testTargets; 29 List<Map<String, Object>> testTargets;
23 30
24 void processNotification(Notification notification) { 31 void processNotification(Notification notification) {
25 if (notification.event == NOTIFICATION_NAVIGATION) { 32 if (notification.event == NOTIFICATION_NAVIGATION) {
26 String file = notification.getParameter(FILE); 33 String file = notification.getParameter(FILE);
27 if (file == testFile) { 34 if (file == testFile) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 addTestFile(''' 242 addTestFile('''
236 main() { 243 main() {
237 print(vvv); 244 print(vvv);
238 } 245 }
239 '''); 246 ''');
240 return prepareNavigation(() { 247 return prepareNavigation(() {
241 assertNoRegionString('vvv'); 248 assertNoRegionString('vvv');
242 }); 249 });
243 } 250 }
244 251
252 test_instanceCreation_implicit() {
253 addTestFile('''
254 class A {
255 }
256 main() {
257 new A();
258 }
259 ''');
260 return prepareNavigation(() {
261 assertHasRegionString('new A');
262 assertHasTarget('A {');
263 });
264 }
265
245 test_instanceCreation_named() { 266 test_instanceCreation_named() {
246 addTestFile(''' 267 addTestFile('''
247 class A { 268 class A {
248 A.named() {} 269 A.named() {}
249 } 270 }
250 main() { 271 main() {
251 new A.named(); 272 new A.named();
252 } 273 }
253 '''); 274 ''');
254 return prepareNavigation(() { 275 return prepareNavigation(() {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // This Source/File does not exist. 425 // This Source/File does not exist.
405 // addTestFile(''' 426 // addTestFile('''
406 //library lib; 427 //library lib;
407 //part "test_unit.dart"; 428 //part "test_unit.dart";
408 //'''); 429 //''');
409 // return prepareNavigation(() { 430 // return prepareNavigation(() {
410 // assertNoRegionString('part "test_unit.dart"'); 431 // assertNoRegionString('part "test_unit.dart"');
411 // }); 432 // });
412 } 433 }
413 } 434 }
414
415
416 main() {
417 group('notification.navigation', () {
418 runReflectiveTests(AnalysisNotificationNavigationTest);
419 });
420 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/computers.dart ('k') | pkg/analysis_server/test/domain_analysis_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698