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

Unified Diff: pkg/analyzer/test/src/context/abstract_context.dart

Issue 1838453002: Use shared MockSdk instances in resynthesize tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/analyzer/test/src/context/abstract_context.dart
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
index b0b7a01e321746b13216495c227d9e64de1f7559..be85eff96d447c1e3e1db1bdd20c973cc4532701 100644
--- a/pkg/analyzer/test/src/context/abstract_context.dart
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -45,9 +45,12 @@ Element findChildElement(Element root, String name, [ElementKind kind]) {
typedef void _ElementVisitorFunction(Element element);
class AbstractContextTest {
+ static final MockSdk SHARED_MOCK_SDK = new MockSdk();
+ static final MockSdk SHARED_STRONG_MOCK_SDK = new MockSdk();
+
MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
- DartSdk sdk = new MockSdk();
+ DartSdk sdk;
SourceFactory sourceFactory;
AnalysisContextImpl context;
AnalysisCache analysisCache;
@@ -120,6 +123,8 @@ class AbstractContextTest {
return new AnalysisContextImpl();
}
+ DartSdk createDartSdk() => new MockSdk();
Brian Wilkerson 2016/03/28 16:58:03 It seems strange to create a new SDK when we have
scheglov 2016/03/28 17:03:35 My intention is to test SDK analysis from scratch
+
Source newSource(String path, [String content = '']) {
File file = resourceProvider.newFile(path, content);
return file.createSource();
@@ -135,6 +140,7 @@ class AbstractContextTest {
}
void prepareAnalysisContext([AnalysisOptions options]) {
+ sdk = createDartSdk();
sdkResolver = new DartUriResolver(sdk);
resourceResolver = new ResourceUriResolver(resourceProvider);
sourceFactory =
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_strong_test.dart » ('j') | pkg/analyzer/test/src/task/dart_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698