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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1295463003: Add _sdkext support back to analysis server (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: pkg/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index c810386b6b35c8fed3c84f24cdfa1a8da21857d1..41a16073813b2c9e2a03332a388b02b0de3cf118 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -344,6 +344,42 @@ analyzer:
expect(contexts[1].name, equals('/my/proj/lib'));
}
+ test_sdk_ext_packagespec() async {
Paul Berry 2015/08/13 17:12:07 This test verifies correct behavior of your change
Cutch 2015/08/13 19:24:17 Done.
+ // Create files.
+ String libPath = newFolder([projPath, LIB_NAME]);
+ newFile([libPath, 'main.dart']);
+ newFile([libPath, 'nope.dart']);
+ String sdkExtPath = newFolder([projPath, 'sdk_ext']);
+ newFile([sdkExtPath, 'entry.dart']);
+ String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
+ newFile([sdkExtSrcPath, 'part.dart']);
+ // Setup sdk extension mapping.
+ newFile(
+ [libPath, '_sdkext'],
+ r'''
+{
+ "dart:foobar": "../sdk_ext/entry.dart"
+}
+''');
+ // Setup .packages file
+ newFile(
+ [projPath, '.packages'],
+ r'''
+test_pack:lib/
+''');
+ // Setup context.
+ manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+ // Confirm that one context was created.
+ var contexts =
+ manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
+ expect(contexts, isNotNull);
+ expect(contexts.length, equals(1));
+ var context = contexts[0];
+ var source = context.sourceFactory.forUri('dart:foobar');
+ expect(source.fullName, equals('/my/proj/sdk_ext/entry.dart'));
+ }
+
+
test_refresh_folder_with_packagespec() {
// create a context with a .packages file
String packagespecFile = posix.join(projPath, '.packages');

Powered by Google App Engine
This is Rietveld 408576698