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

Side by Side Diff: pkg/analysis_server/test/domain_diagnostic_test.dart

Issue 1625273003: Don't add sources to DartSdk contexts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/mock_sdk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.domain.diagnostic; 5 library test.domain.diagnostic;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/analysis_server.dart'; 8 import 'package:analysis_server/src/analysis_server.dart';
9 import 'package:analysis_server/src/domain_diagnostic.dart'; 9 import 'package:analysis_server/src/domain_diagnostic.dart';
10 import 'package:analysis_server/src/plugin/server_plugin.dart'; 10 import 'package:analysis_server/src/plugin/server_plugin.dart';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 resourceProvider.newFile('/project/pubspec.yaml', 'name: project'); 64 resourceProvider.newFile('/project/pubspec.yaml', 'name: project');
65 resourceProvider.newFile(file, 'main() {}'); 65 resourceProvider.newFile(file, 'main() {}');
66 66
67 server.setAnalysisRoots('0', ['/project/'], [], {}); 67 server.setAnalysisRoots('0', ['/project/'], [], {});
68 68
69 await server.onAnalysisComplete; 69 await server.onAnalysisComplete;
70 70
71 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); 71 var request = new DiagnosticGetDiagnosticsParams().toRequest('0');
72 var response = handler.handleRequest(request); 72 var response = handler.handleRequest(request);
73 73
74 int fileCount = MockSdk.LIBRARIES.length + 1 /* test.dart */; 74 int fileCount = 1 /* test.dart */;
75 75
76 var json = response.toJson()[Response.RESULT]; 76 var json = response.toJson()[Response.RESULT];
77 expect(json['contexts'], hasLength(1)); 77 expect(json['contexts'], hasLength(1));
78 var context = json['contexts'][0]; 78 var context = json['contexts'][0];
79 expect(context['name'], '/project'); 79 expect(context['name'], '/project');
80 expect(context['explicitFileCount'], fileCount); 80 expect(context['explicitFileCount'], fileCount);
81 expect(context['implicitFileCount'], 0); 81 // dart:core dart:async dart:math dart:_internal
82 expect(context['implicitFileCount'], 4);
82 expect(context['workItemQueueLength'], isNotNull); 83 expect(context['workItemQueueLength'], isNotNull);
83 }); 84 });
84 85
85 test('getDiagnostics - (no root)', () async { 86 test('getDiagnostics - (no root)', () async {
86 var request = new DiagnosticGetDiagnosticsParams().toRequest('0'); 87 var request = new DiagnosticGetDiagnosticsParams().toRequest('0');
87 var response = handler.handleRequest(request); 88 var response = handler.handleRequest(request);
88 var json = response.toJson()[Response.RESULT]; 89 var json = response.toJson()[Response.RESULT];
89 expect(json['contexts'], hasLength(0)); 90 expect(json['contexts'], hasLength(0));
90 }); 91 });
91 }); 92 });
92 } 93 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698