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

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

Issue 580623002: add element to completion suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 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 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.context.directory.manager; 5 library test.context.directory.manager;
6 6
7 import 'package:analysis_server/src/context_manager.dart'; 7 import 'package:analysis_server/src/context_manager.dart';
8 import 'reflective_tests.dart'; 8 import 'reflective_tests.dart';
9 import 'package:analyzer/file_system/file_system.dart'; 9 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/file_system/memory_file_system.dart'; 10 import 'package:analyzer/file_system/memory_file_system.dart';
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // pubspec.yaml files. 99 // pubspec.yaml files.
100 String subdir1Path = posix.join(projPath, 'subdir1'); 100 String subdir1Path = posix.join(projPath, 'subdir1');
101 String subdir2Path = posix.join(projPath, 'subdir2'); 101 String subdir2Path = posix.join(projPath, 'subdir2');
102 String pubspec1Path = posix.join(subdir1Path, 'pubspec.yaml'); 102 String pubspec1Path = posix.join(subdir1Path, 'pubspec.yaml');
103 String pubspec2Path = posix.join(subdir2Path, 'pubspec.yaml'); 103 String pubspec2Path = posix.join(subdir2Path, 'pubspec.yaml');
104 resourceProvider.newFile(pubspec1Path, 'pubspec'); 104 resourceProvider.newFile(pubspec1Path, 'pubspec');
105 resourceProvider.newFile(pubspec2Path, 'pubspec'); 105 resourceProvider.newFile(pubspec2Path, 'pubspec');
106 manager.setRoots(<String>[projPath], <String>[]); 106 manager.setRoots(<String>[projPath], <String>[]);
107 return pumpEventQueue().then((_) { 107 return pumpEventQueue().then((_) {
108 expect(manager.currentContextPaths.toSet(), 108 expect(manager.currentContextPaths.toSet(),
109 [projPath, subdir1Path, subdir2Path].toSet()); 109 [subdir1Path, subdir2Path, projPath].toSet());
110 manager.now++; 110 manager.now++;
111 manager.refresh(); 111 manager.refresh();
112 return pumpEventQueue().then((_) { 112 return pumpEventQueue().then((_) {
113 expect(manager.currentContextPaths.toSet(), 113 expect(manager.currentContextPaths.toSet(),
114 [projPath, subdir1Path, subdir2Path].toSet()); 114 [subdir1Path, subdir2Path, projPath].toSet());
115 expect(manager.currentContextTimestamps[projPath], manager.now); 115 expect(manager.currentContextTimestamps[projPath], manager.now);
116 expect(manager.currentContextTimestamps[subdir1Path], manager.now); 116 expect(manager.currentContextTimestamps[subdir1Path], manager.now);
117 expect(manager.currentContextTimestamps[subdir2Path], manager.now); 117 expect(manager.currentContextTimestamps[subdir2Path], manager.now);
118 }); 118 });
119 }); 119 });
120 } 120 }
121 121
122 void test_setRoots_addFolderWithDartFile() { 122 void test_setRoots_addFolderWithDartFile() {
123 String filePath = posix.join(projPath, 'foo.dart'); 123 String filePath = posix.join(projPath, 'foo.dart');
124 resourceProvider.newFile(filePath, 'contents'); 124 resourceProvider.newFile(filePath, 'contents');
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 currentContextFilePaths.remove(path); 748 currentContextFilePaths.remove(path);
749 currentContextPackageMaps.remove(path); 749 currentContextPackageMaps.remove(path);
750 } 750 }
751 751
752 @override 752 @override
753 void updateContextPackageMap(Folder contextFolder, Map<String, 753 void updateContextPackageMap(Folder contextFolder, Map<String,
754 List<Folder>> packageMap) { 754 List<Folder>> packageMap) {
755 currentContextPackageMaps[contextFolder.path] = packageMap; 755 currentContextPackageMaps[contextFolder.path] = packageMap;
756 } 756 }
757 } 757 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698