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

Side by Side Diff: test/testing.dart

Issue 1988503002: Move generated files to gen/. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Revise. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/codegen_test.dart ('k') | tool/README.md » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dev_compiler.src.testing; 5 library dev_compiler.src.testing;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:analyzer/file_system/file_system.dart'; 8 import 'package:analyzer/file_system/file_system.dart';
9 import 'package:analyzer/file_system/memory_file_system.dart'; 9 import 'package:analyzer/file_system/memory_file_system.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
11 import 'package:path/path.dart' as path; 11 import 'package:path/path.dart' as path;
12 12
13 final String testDirectory = 13 final String testDirectory =
14 path.dirname((reflectClass(_TestUtils).owner as LibraryMirror).uri.path); 14 path.dirname((reflectClass(_TestUtils).owner as LibraryMirror).uri.path);
15 15
16 /// The local path to the root directory of the dev_compiler repo.
17 final String repoDirectory = path.dirname(testDirectory);
18
16 class _TestUtils {} 19 class _TestUtils {}
17 20
18 class TestUriResolver extends ResourceUriResolver { 21 class TestUriResolver extends ResourceUriResolver {
19 final MemoryResourceProvider provider; 22 final MemoryResourceProvider provider;
20 TestUriResolver(provider) 23 TestUriResolver(provider)
21 : provider = provider, 24 : provider = provider,
22 super(provider); 25 super(provider);
23 26
24 @override 27 @override
25 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 28 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
26 if (uri.scheme == 'package') { 29 if (uri.scheme == 'package') {
27 return (provider.getResource('/packages/' + uri.path) as File) 30 return (provider.getResource('/packages/' + uri.path) as File)
28 .createSource(uri); 31 .createSource(uri);
29 } 32 }
30 return super.resolveAbsolute(uri, actualUri); 33 return super.resolveAbsolute(uri, actualUri);
31 } 34 }
32 } 35 }
OLDNEW
« no previous file with comments | « test/codegen_test.dart ('k') | tool/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698