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

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

Issue 1686613002: Use different SDKs based on option settings (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/analysis_server_test.dart
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 14d9fd68c6c6e72e10ebb89499d3bfb10761df76..e12a691149ff624821b05c0f7d6e1e8b05e34b2e 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -141,7 +141,7 @@ import "../foo/foo.dart";
null,
new ServerPlugin(),
new AnalysisServerOptions(),
- new MockSdk(),
+ () => new MockSdk(),
InstrumentationService.NULL_SERVICE,
rethrowExceptions: true);
processRequiredPlugins();
@@ -152,12 +152,15 @@ import "../foo/foo.dart";
resourceProvider.newFile('/foo/bar.dart', 'library lib;');
server.setAnalysisRoots('0', ['/foo'], [], {});
AnalysisContext context;
- return pumpEventQueue().then((_) {
- context = server.getAnalysisContext('/foo/bar.dart');
- server.setAnalysisRoots('1', [], [], {});
- }).then((_) => pumpEventQueue()).then((_) {
- expect(context.isDisposed, isTrue);
- });
+ return pumpEventQueue()
+ .then((_) {
+ context = server.getAnalysisContext('/foo/bar.dart');
+ server.setAnalysisRoots('1', [], [], {});
+ })
+ .then((_) => pumpEventQueue())
+ .then((_) {
+ expect(context.isDisposed, isTrue);
+ });
}
Future test_contextsChangedEvent() {
@@ -529,8 +532,9 @@ analyzer:
void _assertContextOfFolder(
AnalysisContext context, String expectedFolderPath) {
Folder expectedFolder = resourceProvider.newFolder(expectedFolderPath);
- ContextInfo expectedContextInfo = (server.contextManager
- as ContextManagerImpl).getContextInfoFor(expectedFolder);
+ ContextInfo expectedContextInfo =
+ (server.contextManager as ContextManagerImpl)
+ .getContextInfoFor(expectedFolder);
expect(expectedContextInfo, isNotNull);
expect(context, same(expectedContextInfo.context));
}

Powered by Google App Engine
This is Rietveld 408576698