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

Unified Diff: packages/intl/test/data_directory.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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: packages/intl/test/data_directory.dart
diff --git a/packages/intl/test/data_directory.dart b/packages/intl/test/data_directory.dart
index 70aa385cfbb7c3518b1bdcba4be4dd76d3882435..72e33c68082d4d0b581b85f7485292c6dd2c79c2 100644
--- a/packages/intl/test/data_directory.dart
+++ b/packages/intl/test/data_directory.dart
@@ -2,15 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/**
- * A utility function for test and tools that compensates (at least for very
- * simple cases) for file-dependent programs being run from different
- * directories. The important cases are
- * - running in the directory that contains the test itself, i.e.
- * test/ or a sub-directory.
- * - running in root of this package, which is where the editor and bots will
- * run things by default
- */
+/// A utility function for test and tools that compensates (at least for very
+/// simple cases) for file-dependent programs being run from different
+/// directories. The important cases are
+/// - running in the directory that contains the test itself, i.e.
+/// test/ or a sub-directory.
+/// - running in root of this package, which is where the editor and bots will
+/// run things by default
library data_directory;
import "dart:io";
@@ -29,7 +27,12 @@ bool _isIntlRoot(String dir) {
}
String get intlDirectory {
- var dir = path.fromUri(Platform.script);
+ var dir;
+ if (Platform.script.scheme == 'file') {
+ dir = path.fromUri(Platform.script);
+ } else {
+ dir = Directory.current.absolute.path;
+ }
var root = path.rootPrefix(dir);
while (dir != root) {
« no previous file with comments | « packages/intl/test/compact_number_test_data.dart ('k') | packages/intl/test/date_time_format_file_even_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698