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

Unified Diff: pkg/analysis_server/test/services/completion/dart/optype_test.dart

Issue 2653683004: Stop using SDK summary bundle. Analyze dart:xxx as any other libraries. (Closed)
Patch Set: Restore optional SDK bundle. Created 3 years, 11 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/services/completion/dart/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/optype_test.dart b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
index f2851739bc30721e1cfb53c8bca0e629e6d0e8b0..17cf6c41ab707ace27e56021e5caddf9b4d06679 100644
--- a/pkg/analysis_server/test/services/completion/dart/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
@@ -8,13 +8,15 @@ import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
import 'package:analysis_server/src/services/completion/dart/optype.dart';
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
-import '../../../abstract_context.dart';
+import '../../../mock_sdk.dart';
main() {
defineReflectiveSuite(() {
@@ -27,6 +29,9 @@ class OpTypeTest {
OpType visitor;
void addTestSource(String content, {bool resolved: false}) {
+ MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+ DartSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+
int offset = content.indexOf('^');
expect(offset, isNot(equals(-1)), reason: 'missing ^');
int nextOffset = content.indexOf('^', offset + 1);
@@ -34,8 +39,7 @@ class OpTypeTest {
content = content.substring(0, offset) + content.substring(offset + 1);
Source source = new _TestSource('/completionTest.dart');
AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
- context.sourceFactory =
- new SourceFactory([AbstractContextTest.SDK_RESOLVER]);
+ context.sourceFactory = new SourceFactory([new DartUriResolver(sdk)]);
context.setContents(source, content);
CompilationUnit unit = resolved
? context.resolveCompilationUnit2(source, source)

Powered by Google App Engine
This is Rietveld 408576698