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

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

Issue 874373003: Library dependencies server API updates (to pass package maps). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
===================================================================
--- editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java (revision 43141)
+++ editor/tools/plugins/com.google.dart.server_test/src/com/google/dart/server/internal/remote/RemoteAnalysisServerImplTest.java (working copy)
@@ -413,11 +413,13 @@
public void test_analysis_getLibraryDependencies() throws Exception {
final String[][] libraries = {{null}};
+ final List<Map<String, String>> packageMap = Lists.newArrayList();
final RequestError[] requestErrorArray = {null};
server.analysis_getLibraryDependencies(new GetLibraryDependenciesConsumer() {
@Override
- public void computedDependencies(String[] libs) {
+ public void computedDependencies(String[] libs, Map<String, String> packages) {
libraries[0] = libs;
+ packageMap.add(packages);
}
@Override
@@ -438,27 +440,36 @@
"{",
" 'id': '0',",
" 'result': {",
+ " 'packageMap': {",
+ " 'pack_c' : '/a/b/',",
+ " 'pack_f' : '/d/e/',",
+ " 'pack_i' : '/g/h/'",
+ " },",
" 'libraries': [",
" '/a/b/c.dart',",
" '/d/e/f.dart',",
" '/g/h/i.dart'",
- " ]",
- " }",
+ " ]",
+ " }",
"}");
responseStream.waitForEmpty();
server.test_waitForWorkerComplete();
assertNull(requestErrorArray[0]);
assertThat(libraries[0]).hasSize(3);
+ assertThat(packageMap).hasSize(1);
+ assertThat(packageMap.get(0).entrySet()).hasSize(3);
}
public void test_analysis_getLibraryDependenciess_error() throws Exception {
- final String[][] directories = {null};
+ final String[][] libraries = {null};
+ final List<Map<String, String>> packageMap = Lists.newArrayList();
final RequestError[] requestErrorArray = {null};
server.analysis_getLibraryDependencies(new GetLibraryDependenciesConsumer() {
@Override
- public void computedDependencies(String[] dirs) {
- directories[0] = dirs;
+ public void computedDependencies(String[] libs, Map<String, String> packages) {
+ libraries[0] = libs;
+ packageMap.add(packages);
}
@Override
@@ -488,7 +499,8 @@
responseStream.waitForEmpty();
server.test_waitForWorkerComplete();
- assertNull(directories[0]);
+ assertNull(libraries[0]);
+ assertThat(packageMap).isEmpty();
assertNotNull(requestErrorArray[0]);
RequestError requestError = requestErrorArray[0];
assertEquals("CONTENT_MODIFIED", requestError.getCode());

Powered by Google App Engine
This is Rietveld 408576698