Index: test/testing.dart |
diff --git a/test/testing.dart b/test/testing.dart |
index 6874ed3c0893cbf932fbf5cf1d22f4f865b29849..faa90be4042375360283fe7ac38e3e7eb75d6fa2 100644 |
--- a/test/testing.dart |
+++ b/test/testing.dart |
@@ -28,17 +28,21 @@ import 'package:dev_compiler/src/options.dart'; |
import 'package:dev_compiler/src/utils.dart'; |
/// Shared analysis context used for compilation. |
-final realSdkContext = createAnalysisContextWithSources( |
- new StrongModeOptions(), |
- new SourceResolverOptions( |
- dartSdkPath: getSdkDir().path, |
- customUrlMappings: { |
- 'package:expect/expect.dart': _testCodegenPath('expect.dart'), |
- 'package:async_helper/async_helper.dart': |
- _testCodegenPath('async_helper.dart'), |
- 'package:unittest/unittest.dart': _testCodegenPath('unittest.dart'), |
- 'package:dom/dom.dart': _testCodegenPath('sunflower', 'dom.dart') |
- }))..analysisOptions.cacheSize = 512; |
+final AnalysisContext realSdkContext = () { |
+ var context = createAnalysisContextWithSources( |
+ new StrongModeOptions(), |
+ new SourceResolverOptions( |
+ dartSdkPath: getSdkDir().path, |
+ customUrlMappings: { |
+ 'package:expect/expect.dart': _testCodegenPath('expect.dart'), |
+ 'package:async_helper/async_helper.dart': |
+ _testCodegenPath('async_helper.dart'), |
+ 'package:unittest/unittest.dart': _testCodegenPath('unittest.dart'), |
+ 'package:dom/dom.dart': _testCodegenPath('sunflower', 'dom.dart') |
+ })); |
+ (context.analysisOptions as AnalysisOptionsImpl).cacheSize = 512; |
+ return context; |
+}(); |
String _testCodegenPath(String p1, [String p2]) => |
path.join(testDirectory, 'codegen', p1, p2); |