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

Unified Diff: editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java

Issue 672003002: Add package root setting to analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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: editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java
diff --git a/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java b/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java
index 177b5ed7f7871941ccefda1eaae278607fe03dfa..d543e8e21377c0e2a70d0b4de54030b52c448fdf 100644
--- a/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java
+++ b/editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java
@@ -15,6 +15,7 @@ package com.google.dart.server.internal.remote;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.dart.server.CreateContextConsumer;
import com.google.dart.server.FindElementReferencesConsumer;
@@ -644,7 +645,8 @@ public class RemoteAnalysisServerImplTest extends AbstractRemoteServerTest {
public void test_analysis_setAnalysisRoots() throws Exception {
server.analysis_setAnalysisRoots(
ImmutableList.of("/fileA.dart", "/fileB.dart"),
- ImmutableList.of("/fileC.dart", "/fileD.dart"));
+ ImmutableList.of("/fileC.dart", "/fileD.dart"),
+ null);
List<JsonObject> requests = requestSink.getRequests();
JsonElement expected = parseJson(//
"{",
@@ -659,7 +661,7 @@ public class RemoteAnalysisServerImplTest extends AbstractRemoteServerTest {
}
public void test_analysis_setAnalysisRoots_emptyLists() throws Exception {
- server.analysis_setAnalysisRoots(new ArrayList<String>(0), new ArrayList<String>(0));
+ server.analysis_setAnalysisRoots(new ArrayList<String>(0), new ArrayList<String>(0), null);
List<JsonObject> requests = requestSink.getRequests();
JsonElement expected = parseJson(//
"{",
@@ -674,7 +676,7 @@ public class RemoteAnalysisServerImplTest extends AbstractRemoteServerTest {
}
public void test_analysis_setAnalysisRoots_nullLists() throws Exception {
- server.analysis_setAnalysisRoots(null, null);
+ server.analysis_setAnalysisRoots(null, null, null);
List<JsonObject> requests = requestSink.getRequests();
JsonElement expected = parseJson(//
"{",
@@ -688,6 +690,28 @@ public class RemoteAnalysisServerImplTest extends AbstractRemoteServerTest {
assertTrue(requests.contains(expected));
}
+ public void test_analysis_setAnalysisRoots_packageRoots() throws Exception {
+ server.analysis_setAnalysisRoots(
+ null,
+ null,
+ ImmutableMap.of("/path1", "/path2", "/path3", "/path4"));
+ List<JsonObject> requests = requestSink.getRequests();
+ JsonElement expected = parseJson(//
+ "{",
+ " 'id': '0',",
+ " 'method': 'analysis.setAnalysisRoots',",
+ " 'params': {",
+ " 'included': [],",
+ " 'excluded': [],",
+ " 'packageRoots': {",
+ " '/path1': '/path2',",
+ " '/path3': '/path4'",
+ " }",
+ " }",
+ "}");
+ assertTrue(requests.contains(expected));
+ }
+
public void test_analysis_setPriorityFiles() throws Exception {
server.analysis_setPriorityFiles(ImmutableList.of("/fileA.dart", "/fileB.dart"));
List<JsonObject> requests = requestSink.getRequests();

Powered by Google App Engine
This is Rietveld 408576698