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

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

Issue 2936123002: Convert more tests (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/protocol/protocol.dart'; 7 import 'package:analysis_server/protocol/protocol.dart';
8 import 'package:analysis_server/protocol/protocol_generated.dart' 8 import 'package:analysis_server/protocol/protocol_generated.dart'
9 hide AnalysisOptions; 9 hide AnalysisOptions;
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 String projectPath; 68 String projectPath;
69 String testFolder; 69 String testFolder;
70 String testFile; 70 String testFile;
71 String testCode; 71 String testCode;
72 72
73 AbstractAnalysisTest(); 73 AbstractAnalysisTest();
74 74
75 AnalysisDomainHandler get analysisHandler => server.handlers 75 AnalysisDomainHandler get analysisHandler => server.handlers
76 .singleWhere((handler) => handler is AnalysisDomainHandler); 76 .singleWhere((handler) => handler is AnalysisDomainHandler);
77 77
78 AnalysisOptions get analysisOptions => enableNewAnalysisDriver 78 AnalysisOptions get analysisOptions => testDiver.analysisOptions;
79 ? testDiver.analysisOptions
80 : testContext.analysisOptions;
81
82 bool get enableNewAnalysisDriver => true;
83
84 AnalysisContext get testContext => server.getAnalysisContext(testFile);
85 79
86 AnalysisDriver get testDiver => server.getAnalysisDriver(testFile); 80 AnalysisDriver get testDiver => server.getAnalysisDriver(testFile);
87 81
88 void addAnalysisSubscription(AnalysisService service, String file) { 82 void addAnalysisSubscription(AnalysisService service, String file) {
89 // add file to subscription 83 // add file to subscription
90 var files = analysisSubscriptions[service]; 84 var files = analysisSubscriptions[service];
91 if (files == null) { 85 if (files == null) {
92 files = <String>[]; 86 files = <String>[];
93 analysisSubscriptions[service] = files; 87 analysisSubscriptions[service] = files;
94 } 88 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // 132 //
139 // Create an SDK in the mock file system. 133 // Create an SDK in the mock file system.
140 // 134 //
141 new MockSdk( 135 new MockSdk(
142 generateSummaryFiles: generateSummaryFiles, 136 generateSummaryFiles: generateSummaryFiles,
143 resourceProvider: resourceProvider); 137 resourceProvider: resourceProvider);
144 // 138 //
145 // Create server 139 // Create server
146 // 140 //
147 AnalysisServerOptions options = new AnalysisServerOptions(); 141 AnalysisServerOptions options = new AnalysisServerOptions();
148 options.enableNewAnalysisDriver = enableNewAnalysisDriver; 142 options.enableNewAnalysisDriver = true;
149 return new AnalysisServer( 143 return new AnalysisServer(
150 serverChannel, 144 serverChannel,
151 resourceProvider, 145 resourceProvider,
152 packageMapProvider, 146 packageMapProvider,
153 index, 147 index,
154 serverPlugin, 148 serverPlugin,
155 options, 149 options,
156 new DartSdkManager(resourceProvider.convertPath('/'), true), 150 new DartSdkManager(resourceProvider.convertPath('/'), true),
157 InstrumentationService.NULL_SERVICE); 151 InstrumentationService.NULL_SERVICE);
158 } 152 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 Future<List<Null>> stopAll() async { 364 Future<List<Null>> stopAll() async {
371 fail('Unexpected invocation of stopAll'); 365 fail('Unexpected invocation of stopAll');
372 return null; 366 return null;
373 } 367 }
374 368
375 @override 369 @override
376 void whitelistEverything() { 370 void whitelistEverything() {
377 fail('Unexpected invocation of whitelistEverything'); 371 fail('Unexpected invocation of whitelistEverything');
378 } 372 }
379 } 373 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/analysis/update_content_test.dart ('k') | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698