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

Side by Side Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core_test/src/com/google/dart/tools/debug/core/dartium/BreakpointManagerTest.java

Issue 128093002: Version 1.1.0-dev.5.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, the Dart project authors. 2 * Copyright (c) 2013, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
11 * or implied. See the License for the specific language governing permissions a nd limitations under 11 * or implied. See the License for the specific language governing permissions a nd limitations under
12 * the License. 12 * the License.
13 */ 13 */
14 14
15 package com.google.dart.tools.debug.core.dartium; 15 package com.google.dart.tools.debug.core.dartium;
16 16
17 import com.google.dart.engine.source.ExplicitPackageUriResolver; 17 import com.google.dart.engine.source.ExplicitPackageUriResolver;
18 import com.google.dart.engine.source.ExplicitPackageUriResolverTest; 18 import com.google.dart.engine.source.ExplicitPackageUriResolverTest;
19 import com.google.dart.tools.core.DartCore; 19 import com.google.dart.tools.core.DartCore;
20 20
21 import static com.google.dart.engine.utilities.io.FileUtilities2.createFile;
22
21 import junit.framework.TestCase; 23 import junit.framework.TestCase;
22 24
23 import org.eclipse.core.resources.IFile; 25 import org.eclipse.core.resources.IFile;
24 26
25 import java.io.File; 27 import java.io.File;
26 28
27 public class BreakpointManagerTest extends TestCase { 29 public class BreakpointManagerTest extends TestCase {
28 30
29 private final class MockBreakpointManager extends BreakpointManager { 31 private final class MockBreakpointManager extends BreakpointManager {
30 32
31 public MockBreakpointManager() { 33 public MockBreakpointManager() {
32 super(null); 34 super(null);
33 } 35 }
34 36
35 @Override 37 @Override
36 protected String resolvePathToPackage(IFile resource, String filePath) { 38 protected String resolvePathToPackage(IFile resource, String filePath) {
37 String packages = "{\"packages\":{\"unittest\": [\"/dart/unittest/lib\"]," 39 String packages = "{\"packages\":{\"unittest\": [\"/dart/unittest/lib\"],"
38 + "\"foo.bar.baz\": [\"/src/foo/bar/baz/lib\", \"/gen/foo/bar/baz\"]}} "; 40 + "\"foo.bar.baz\": [\"/src/foo/bar/baz/lib\", \"/gen/foo/bar/baz\"]}} ";
39 ExplicitPackageUriResolver resolver = new ExplicitPackageUriResolverTest.M ockExplicitPackageUriResolver( 41 ExplicitPackageUriResolver resolver = new ExplicitPackageUriResolverTest.M ockExplicitPackageUriResolver(
40 new File("root"), 42 new File("root"),
41 packages); 43 packages);
42 return resolver.resolvePathToPackage(filePath); 44 return resolver.resolvePathToPackage(filePath);
43 } 45 }
44 46
45 } 47 }
46 48
47 public void test_getPackagePath() { 49 public void test_getPackagePath() {
48 if (!DartCore.isWindows()) { 50 if (!DartCore.isWindows()) {
51 MockBreakpointManager manager = new MockBreakpointManager();
49 String path = manager.getPackagePath( 52 String path = manager.getPackagePath(
50 createFile("/baz/lib/myLib.dart").getAbsolutePath(), 53 createFile("/baz/lib/myLib.dart").getAbsolutePath(),
51 null); 54 null);
52 assertNotNull(path); 55 assertNotNull(path);
53 assertEquals("foo.bar.baz/myLib.dart", path); 56 assertEquals("foo.bar.baz/myLib.dart", path);
54 path = manager.getPackagePath(createFile("/baz/src/myLib.dart").getAbsolut ePath(), null); 57 path = manager.getPackagePath(createFile("/baz/src/myLib.dart").getAbsolut ePath(), null);
55 assertNull(path); 58 assertNull(path);
56 path = manager.getPackagePath( 59 path = manager.getPackagePath(
57 createFile("/bar/baz/lib/util/util.dart").getAbsolutePath(), 60 createFile("/bar/baz/lib/util/util.dart").getAbsolutePath(),
58 null); 61 null);
59 assertNotNull(path); 62 assertNotNull(path);
60 assertEquals("foo.bar.baz/util/util.dart", path); 63 assertEquals("foo.bar.baz/util/util.dart", path);
61 } 64 }
62 } 65 }
63 66
64 } 67 }
OLDNEW
« no previous file with comments | « no previous file | dart/pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698