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

Side by Side Diff: tests/lib/mirrors/library_uri_io_test.dart

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « tests/compiler/dart2js/unneeded_part_js_test.dart ('k') | tests/standalone/coverage_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Test library uri for a library read as a file. 5 // Test library uri for a library read as a file.
6 6
7 library MirrorsTest; 7 library MirrorsTest;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 import 'dart:io'; 10 import 'dart:io';
11 import '../../../pkg/unittest/lib/unittest.dart'; 11 import '../../../pkg/unittest/lib/unittest.dart';
12 12
13 class Class { 13 class Class {
14 } 14 }
15 15
16 testLibraryUri(var value, Uri expectedUri) { 16 testLibraryUri(var value, Uri expectedUri) {
17 var valueMirror = reflect(value); 17 var valueMirror = reflect(value);
18 ClassMirror valueClass = valueMirror.type; 18 ClassMirror valueClass = valueMirror.type;
19 LibraryMirror valueLibrary = valueClass.owner; 19 LibraryMirror valueLibrary = valueClass.owner;
20 expect(valueLibrary.uri, equals(expectedUri)); 20 expect(valueLibrary.uri, equals(expectedUri));
21 } 21 }
22 22
23 main() { 23 main() {
24 var mirrors = currentMirrorSystem(); 24 var mirrors = currentMirrorSystem();
25 test("Test current library uri", () { 25 test("Test current library uri", () {
26 Uri uri = Uri.base.resolveUri(Platform.script); 26 String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
27 Uri cwd =
28 new Uri.file(appendSlash(new File('.').resolveSymbolicLinksSync()));
29 Uri uri = cwd.resolveUri(new Uri.file(Platform.script));
27 testLibraryUri(new Class(), uri); 30 testLibraryUri(new Class(), uri);
28 }); 31 });
29 } 32 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/unneeded_part_js_test.dart ('k') | tests/standalone/coverage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698