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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java

Issue 10809023: changes to SystemLibraryManager to support list of roots (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 5 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.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java (revision 9779)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/SystemLibraryManagerProviderTest.java (working copy)
@@ -18,8 +18,10 @@
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
+import java.util.List;
public abstract class SystemLibraryManagerProviderTest extends TestCase {
@@ -135,9 +137,10 @@
protected void testPackage(String libFileName, String uriString)
throws AssertionError, URISyntaxException {
- File packageRoot = SystemLibraryManagerProvider.getAnyLibraryManager().getPackageRoot();
- SystemLibraryManagerProvider.getAnyLibraryManager()
- .setPackageRoot(new File(System.getProperty("user.home")));
+ List<File> packageRoots = SystemLibraryManagerProvider.getAnyLibraryManager().getPackageRoots();
+ List<File> roots = new ArrayList<File>();
+ roots.add(new File(System.getProperty("user.home")));
+ SystemLibraryManagerProvider.getAnyLibraryManager().setPackageRoots(roots);
final URI fullUri1 = getLibraryManager()
.expandRelativeDartUri(new URI("package", null, "/" + libFileName, null));
@@ -145,6 +148,7 @@
assertEquals("package", fullUri1.getScheme());
assertTrue(fullUri1.getPath(), (fullUri1.getHost() + fullUri1.getPath()).endsWith(libFileName));
+ // TODO(keertip): fix test, this will fail, we now check for file exists
URI translatedUri = getLibraryManager().resolveDartUri(fullUri1);
assertNotNull(translatedUri);
String scheme = translatedUri.getScheme();
@@ -153,7 +157,7 @@
URI shortUri3 = getLibraryManager().getShortUri(translatedUri);
assertEquals(new URI(uriString), shortUri3);
- SystemLibraryManagerProvider.getAnyLibraryManager().setPackageRoot(packageRoot);
+ SystemLibraryManagerProvider.getAnyLibraryManager().setPackageRoots(packageRoots);
}
}

Powered by Google App Engine
This is Rietveld 408576698