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

Side by Side Diff: tests/compiler/dart2js/package_root_test.dart

Issue 53313007: Change dart:io Platform.script to return a URI. Change all uses of Platform.script to work with th… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dom.py docs 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
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 that the compiler can handle imports when package root has not been set. 5 // Test that the compiler can handle imports when package root has not been set.
6 6
7 library dart2js.test.package_root; 7 library dart2js.test.package_root;
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import "package:async_helper/async_helper.dart"; 10 import "package:async_helper/async_helper.dart";
(...skipping 13 matching lines...) Expand all
24 const MEMORY_SOURCE_FILES = const { 24 const MEMORY_SOURCE_FILES = const {
25 'main.dart': ''' 25 'main.dart': '''
26 26
27 import 'package:foo/foo.dart'; 27 import 'package:foo/foo.dart';
28 28
29 main() {} 29 main() {}
30 ''', 30 ''',
31 }; 31 };
32 32
33 void runCompiler(Uri main) { 33 void runCompiler(Uri main) {
34 Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script)); 34 Uri script = currentDirectory.resolveUri(Platform.script);
35 Uri libraryRoot = script.resolve('../../../sdk/'); 35 Uri libraryRoot = script.resolve('../../../sdk/');
36 36
37 var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES); 37 var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
38 var handler = new FormattingDiagnosticHandler(provider); 38 var handler = new FormattingDiagnosticHandler(provider);
39 var errors = []; 39 var errors = [];
40 40
41 void diagnosticHandler(Uri uri, int begin, int end, String message, 41 void diagnosticHandler(Uri uri, int begin, int end, String message,
42 Diagnostic kind) { 42 Diagnostic kind) {
43 if (kind == Diagnostic.ERROR) { 43 if (kind == Diagnostic.ERROR) {
44 errors.add(message); 44 errors.add(message);
(...skipping 19 matching lines...) Expand all
64 Expect.equals("Error: Cannot resolve 'package:foo/foo.dart'. " 64 Expect.equals("Error: Cannot resolve 'package:foo/foo.dart'. "
65 "Package root has not been set.", 65 "Package root has not been set.",
66 errors[0]); 66 errors[0]);
67 })); 67 }));
68 } 68 }
69 69
70 void main() { 70 void main() {
71 runCompiler(Uri.parse('memory:main.dart')); 71 runCompiler(Uri.parse('memory:main.dart'));
72 runCompiler(Uri.parse('package:foo/foo.dart')); 72 runCompiler(Uri.parse('package:foo/foo.dart'));
73 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698