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

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

Issue 2286923002: Convert analysis server over to use ContextBuilder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: address comment, fix bugs, clean-up Created 4 years, 4 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/domain_analysis_test.dart
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 45ca634ee4d932024384b498b3665165d4b3f361..1a7671e69b731e8f2fdcbd309cb263a783814a41 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -41,6 +41,7 @@ main() {
ExtensionManager manager = new ExtensionManager();
ServerPlugin serverPlugin = new ServerPlugin();
manager.processPlugins([serverPlugin]);
+ MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
server = new AnalysisServer(
serverChannel,
resourceProvider,
@@ -48,7 +49,7 @@ main() {
null,
serverPlugin,
new AnalysisServerOptions(),
- new DartSdkManager('', false, (_) => new MockSdk()),
+ new DartSdkManager('/', false, (_) => sdk),
InstrumentationService.NULL_SERVICE);
handler = new AnalysisDomainHandler(server);
});
@@ -250,7 +251,9 @@ testUpdateContent() {
return helper.onAnalysisComplete.then((_) {
Request request = new Request('0', ANALYSIS_UPDATE_CONTENT, {
'files': {
- helper.testFile: {TYPE: 'foo',}
+ helper.testFile: {
+ TYPE: 'foo',
+ }
}
});
Response response = helper.handler.handleRequest(request);
@@ -425,9 +428,8 @@ f(A a) {
library lib_a;
class A {}
''');
- packageMapProvider.packageMap['pkgA'] = [
- resourceProvider.getResource('/packages/pkgA')
- ];
+ resourceProvider.newFile(
+ '/project/.packages', 'pkgA:file:///packages/pkgA');
addTestFile('''
import 'package:pkgA/libA.dart';
main(A a) {
@@ -468,6 +470,7 @@ class AnalysisTestHelper {
ExtensionManager manager = new ExtensionManager();
ServerPlugin serverPlugin = new ServerPlugin();
manager.processPlugins([serverPlugin]);
+ MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
server = new AnalysisServer(
serverChannel,
resourceProvider,
@@ -475,7 +478,7 @@ class AnalysisTestHelper {
null,
serverPlugin,
new AnalysisServerOptions(),
- new DartSdkManager('', false, (_) => new MockSdk()),
+ new DartSdkManager('/', false, (_) => sdk),
InstrumentationService.NULL_SERVICE);
handler = new AnalysisDomainHandler(server);
// listen for notifications
@@ -704,9 +707,8 @@ class SetSubscriptionsTest extends AbstractAnalysisTest {
library lib_a;
class A {}
''');
- packageMapProvider.packageMap = {
- 'pkgA': [(resourceProvider.newFolder('/packages/pkgA/lib'))]
- };
+ resourceProvider.newFile(
+ '/project/.packages', 'pkgA:file:///packages/pkgA/lib');
//
addTestFile('''
import 'package:pkgA/libA.dart';
@@ -774,9 +776,7 @@ main() {
library lib_a;
class A {}
''');
- packageMapProvider.packageMap = {
- 'pkgA': [(resourceProvider.newFolder('/packages/pkgA/lib'))]
- };
+ resourceProvider.newFile('/project/.packages', 'pkgA:/packages/pkgA/lib');
//
addTestFile('// no "pkgA" reference');
createProject();
« no previous file with comments | « pkg/analysis_server/test/context_manager_test.dart ('k') | pkg/analysis_server/test/domain_diagnostic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698