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

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

Issue 148913003: Improve how we handle packages/ HTML imports. This resolves better any valid (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 side-by-side diff with in-line comments
Download patch
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 2a2e80973c17f4e7c7e3b964b5287f530b96c9e5..4c2cfbc314b31defe60228fac1bf7c73263b7c7b 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -826,31 +826,31 @@ class StandardTestSuite extends TestSuite {
}
}
+ static Path _findPubspecYamlFile(Path filePath) {
Siggi Cherem (dart-lang) 2014/01/29 22:15:08 no changes here, I just extracted it and made it p
+ final existsCache = TestUtils.existsCache;
+
+ Path root = TestUtils.dartDir();
+ assert ("$filePath".startsWith("$root"));
+
+ // We start with the parent directory of [filePath] and go up until
+ // the root directory (excluding the root).
+ List<String> segments =
+ filePath.directoryPath.relativeTo(root).segments();
+ while (segments.length > 0) {
+ var pubspecYamlPath =
+ new Path(segments.join('/')).append('pubspec.yaml');
+ if (existsCache.doesFileExist(pubspecYamlPath.toNativePath())) {
+ return root.join(pubspecYamlPath);
+ }
+ segments.removeLast();
+ }
+ return null;
+ }
+
void enqueueTestCaseFromTestInformation(TestInformation info) {
var filePath = info.filePath;
var optionsFromFile = info.optionsFromFile;
- Path findPubspecYamlFile(Path filePath) {
- final existsCache = TestUtils.existsCache;
-
- Path root = TestUtils.dartDir();
- assert ("$filePath".startsWith("$root"));
-
- // We start with the parent directory of [filePath] and go up until
- // the root directory (excluding the root).
- List<String> segments =
- filePath.directoryPath.relativeTo(root).segments();
- while (segments.length > 0) {
- var pubspecYamlPath =
- new Path(segments.join('/')).append('pubspec.yaml');
- if (existsCache.doesFileExist(pubspecYamlPath.toNativePath())) {
- return root.join(pubspecYamlPath);
- }
- segments.removeLast();
- }
- return null;
- }
-
Map buildSpecialPackageRoot(Path pubspecYamlFile) {
var commands = <Command>[];
var packageDir = pubspecYamlFile.directoryPath;
@@ -915,7 +915,7 @@ class StandardTestSuite extends TestSuite {
Path packageRoot;
if (configuration['use_repository_packages'] ||
configuration['use_public_packages']) {
- Path pubspecYamlFile = findPubspecYamlFile(filePath);
+ Path pubspecYamlFile = _findPubspecYamlFile(filePath);
if (pubspecYamlFile != null) {
var result = buildSpecialPackageRoot(pubspecYamlFile);
baseCommands.addAll(result['commands']);
@@ -1238,7 +1238,10 @@ class StandardTestSuite extends TestSuite {
commands.add(_polymerDeployCommand(
customHtmlPath, tempDir, optionsFromFile));
- htmlPath = '$tempDir/test/$nameNoExt.html';
+ Path pubspecYamlFile = _findPubspecYamlFile(filePath);
+ Path homeDir = pubspecYamlFile == null ? dir :
+ pubspecYamlFile.directoryPath;
+ htmlPath = '$tempDir/${dir.relativeTo(homeDir)}/$nameNoExt.html';
dartWrapperFilename = '${htmlPath}_bootstrap.dart';
compiledDartWrapperFilename = '$dartWrapperFilename.js';
} else {
« tools/testing/dart/test_controller.js ('K') | « tools/testing/dart/test_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698