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

Side by Side Diff: pkg/analysis_server/test/analysis/set_priority_files_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 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 library test.analysis.set_priority_files; 5 library test.analysis.set_priority_files;
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/domain_analysis.dart'; 8 import 'package:analysis_server/src/domain_analysis.dart';
9 import 'package:analyzer/src/generated/engine.dart' 9 import 'package:analyzer/src/generated/engine.dart'
10 show InternalAnalysisContext; 10 show InternalAnalysisContext;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 test_fileInSdk() async { 53 test_fileInSdk() async {
54 addTestFile(''); 54 addTestFile('');
55 await server.onAnalysisComplete; 55 await server.onAnalysisComplete;
56 // set priority files 56 // set priority files
57 String filePath = '/lib/convert/convert.dart'; 57 String filePath = '/lib/convert/convert.dart';
58 Response response = await _setPriorityFile(filePath); 58 Response response = await _setPriorityFile(filePath);
59 expect(response, isResponseSuccess('0')); 59 expect(response, isResponseSuccess('0'));
60 // verify 60 // verify
61 InternalAnalysisContext sdkContext = server.defaultSdk.context; 61 InternalAnalysisContext sdkContext = server.findSdk().context;
62 List<Source> prioritySources = sdkContext.prioritySources; 62 List<Source> prioritySources = sdkContext.prioritySources;
63 expect(prioritySources, hasLength(1)); 63 expect(prioritySources, hasLength(1));
64 expect(prioritySources.first.fullName, filePath); 64 expect(prioritySources.first.fullName, filePath);
65 } 65 }
66 66
67 test_fileNotInAnalysisRoot() async { 67 test_fileNotInAnalysisRoot() async {
68 String path = '/other/file.dart'; 68 String path = '/other/file.dart';
69 addFile(path, ''); 69 addFile(path, '');
70 Response response = await _setPriorityFile(path); 70 Response response = await _setPriorityFile(path);
71 expect(response.error, isNotNull); 71 expect(response.error, isNotNull);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 expect(response.error, isNotNull); 123 expect(response.error, isNotNull);
124 expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES); 124 expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
125 } 125 }
126 126
127 _setPriorityFile(String file) async { 127 _setPriorityFile(String file) async {
128 Request request = 128 Request request =
129 new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0'); 129 new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0');
130 return await serverChannel.sendRequest(request); 130 return await serverChannel.sendRequest(request);
131 } 131 }
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698