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

Unified Diff: pkg/analysis_server/test/mocks.dart

Issue 198083004: (TBR) simplify check for valid SDK directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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: pkg/analysis_server/test/mocks.dart
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 23684f1b5a3bfd8343f431f28819a7b89ec1ed77..d9cfbcc8b070c38f9b88167e8029db31b026b0bc 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -13,17 +13,19 @@ import 'package:analysis_server/src/protocol.dart';
import 'package:unittest/matcher.dart';
/**
- * Answer the path the the SDK relative to the currently running script
- * or throw an exception if it cannot be found.
+ * Answer the absolute path the the SDK relative to the currently running
+ * script or throw an exception if it cannot be found.
*/
String get sdkPath {
Uri sdkUri = Platform.script.resolve('../../../sdk/');
- // Verify that the internal library file exists
- Uri libFileUri = sdkUri.resolve('lib/_internal/libraries.dart');
- if (!new File.fromUri(libFileUri).existsSync()) {
- throw 'Expected Dart SDK at ${sdkUri.path}';
+
+ // Verify the directory exists
+ Directory sdkDir = new Directory.fromUri(sdkUri);
+ if (!sdkDir.existsSync()) {
+ throw 'Specified Dart SDK does not exist: $sdkDir';
}
- return sdkUri.path;
+
+ return sdkDir.path;
}
/**
« 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