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

Unified Diff: pkg/analysis_server/test/analysis/set_priority_files_test.dart

Issue 1289643003: Support for analysis.setPriorityFiles for files in SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/analysis/set_priority_files_test.dart
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bb52a5e728a7afd906b958a7dfd0f90852f57f72
--- /dev/null
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -0,0 +1,62 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.analysis.set_priority_files;
+
+import 'package:analysis_server/src/domain_analysis.dart';
+import 'package:analysis_server/src/protocol.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../analysis_abstract.dart';
+import '../mocks.dart';
+import '../utils.dart';
+
+main() {
+ initializeTestEnvironment();
+ defineReflectiveTests(SetPriorityFilesTest);
+}
+
+@reflectiveTest
+class SetPriorityFilesTest extends AbstractAnalysisTest {
+ @override
+ void setUp() {
+ super.setUp();
+ server.handlers = [new AnalysisDomainHandler(server),];
+ createProject();
+ }
+
+ test_fileDoesNotExist() async {
+ String file = '$projectPath/doesNotExist.dart';
+ Response response = await _setPriorityFile(file);
+ expect(response, isResponseSuccess('0'));
+ }
+
+ test_fileInAnalysisRoot() async {
+ addTestFile('');
+ Response response = await _setPriorityFile(testFile);
+ expect(response, isResponseSuccess('0'));
+ }
+
+ test_fileInSdk() async {
+ addTestFile('');
+ await server.onAnalysisComplete;
+ Response response = await _setPriorityFile('/lib/convert/convert.dart');
+ expect(response, isResponseSuccess('0'));
+ }
+
+ test_fileNotInAnalysisRoot() async {
+ String path = '/other/file.dart';
+ addFile(path, '');
+ Response response = await _setPriorityFile(path);
+ expect(response.error, isNotNull);
+ expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
+ }
+
+ _setPriorityFile(String file) async {
+ Request request =
+ new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0');
+ return await serverChannel.sendRequest(request);
+ }
+}
« no previous file with comments | « pkg/analysis_server/test/analysis/get_navigation_test.dart ('k') | pkg/analysis_server/test/analysis/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698