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

Side by Side Diff: tools/testing/dart/browser_test.dart

Issue 11645057: Don't use relativeTo() since it barfs on some arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of test_suite; 5 part of test_suite;
6 6
7 String getHtmlContents(String title, 7 String getHtmlContents(String title,
8 Path controllerScript, 8 Path controllerScript,
9 Path dartJsScript, 9 Path dartJsScript,
10 String scriptType, 10 String scriptType,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 String wrapDartTestInLibrary(Path test) => 51 String wrapDartTestInLibrary(Path test) =>
52 """ 52 """
53 library libraryWrapper; 53 library libraryWrapper;
54 part '$test'; 54 part '$test';
55 """; 55 """;
56 56
57 String dartTestWrapper(Path dartHome, Path library) { 57 String dartTestWrapper(Path dartHome, Path library) {
58 // Tests inside "pkg" import unittest using "package:". All others use a 58 // Tests inside "pkg" import unittest using "package:". All others use a
59 // relative path. The imports need to agree, so use a matching form here. 59 // relative path. The imports need to agree, so use a matching form here.
60 var unitTest = dartHome.append("pkg/unittest/lib").toString(); 60 var unitTest = dartHome.append("pkg/unittest/lib").toString();
61 if (library.relativeTo(dartHome).segments().contains("pkg")) { 61
62 // TODO(rnystrom): Looking in the entire path here is wrong. It should only
63 // consider the relative path within dartHome. Unfortunately,
64 // Path.relativeTo() does not handle cases where library is already a relative
65 // path, and Path.isAbsolute does not work on Windows.
66 if (library.segments().contains("pkg")) {
62 unitTest = 'package:unittest'; 67 unitTest = 'package:unittest';
63 } 68 }
64 69
65 return """ 70 return """
66 library test; 71 library test;
67 72
68 import '$unitTest/unittest.dart' as unittest; 73 import '$unitTest/unittest.dart' as unittest;
69 import '$unitTest/html_config.dart' as config; 74 import '$unitTest/html_config.dart' as config;
70 import '${library}' as Test; 75 import '${library}' as Test;
71 76
72 main() { 77 main() {
73 config.useHtmlConfiguration(); 78 config.useHtmlConfiguration();
74 unittest.group('', Test.main); 79 unittest.group('', Test.main);
75 } 80 }
76 """; 81 """;
77 } 82 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698