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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 10883075: Revert "Changing paths to JS files in generated test HTML files to be relative paths rather than ab… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 1015cfd5b32bc93b911bfc584b2f152d3fed5175..bd8d4bdc156efad1097379c35a3557b9bdcc0a50 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -626,14 +626,12 @@ class StandardTestSuite implements TestSuite {
expectedOutput = txtPath;
content = getHtmlLayoutContents(scriptType, '$filePrefix$scriptPath');
} else {
- final htmlLocation = new Path(htmlPath);
content = getHtmlContents(
filename,
- _relativize(htmlLocation, dartDir.append(
- 'pkg/unittest/test_controller.js')),
- _relativize(htmlLocation, dartDir.append('client/dart.js')),
+ '$filePrefix${dartDir.append("pkg/unittest/test_controller.js")}',
+ '$filePrefix${dartDir.append("client/dart.js")}',
scriptType,
- _relativize(htmlLocation, new Path(scriptPath)));
+ '$filePrefix$scriptPath');
}
htmlTest.writeStringSync(content);
htmlTest.closeSync();
@@ -1027,38 +1025,11 @@ class StandardTestSuite implements TestSuite {
List<List<String>> getVmOptions(Map optionsFromFile) {
bool needsVmOptions =
- Contains(configuration['compiler'],
- const ['none', 'dart2dart', 'dartc']) &&
- Contains(configuration['runtime'],
- const ['none', 'vm', 'drt', 'dartium']);
+ Contains(configuration['compiler'], const ['none', 'dart2dart', 'dartc']) &&
+ Contains(configuration['runtime'], const ['none', 'vm', 'drt', 'dartium']);
if (!needsVmOptions) return [[]];
return optionsFromFile['vmOptions'];
}
-
- String _relativize(Path base, Path path) {
- base = base.canonicalize();
- path = path.canonicalize();
-
- if (!base.isAbsolute || !path.isAbsolute) {
- throw "Only absolute paths are supported.";
- }
- List<String> pathSegments = path.segments();
- List<String> baseSegments = base.segments();
- int common = 0;
- int length = Math.min(pathSegments.length, baseSegments.length);
- while (common < length && pathSegments[common] == baseSegments[common]) {
- common++;
- }
- final sb = new StringBuffer();
- for (int i = common + 1; i < baseSegments.length; i++) {
- sb.add('..${Platform.pathSeparator}');
- }
- for (int i = common; i < pathSegments.length - 1; i++) {
- sb.add('${pathSegments[i]}${Platform.pathSeparator}');
- }
- sb.add('${pathSegments.last()}');
- return sb.toString();
- }
}
« 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