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

Unified Diff: tests/compiler/dart2js/import_mirrors_test.dart

Issue 1247773002: Add access the Message in CompilerDiagnostics.report. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 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
« no previous file with comments | « tests/compiler/dart2js/duplicate_library_test.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/import_mirrors_test.dart
diff --git a/tests/compiler/dart2js/import_mirrors_test.dart b/tests/compiler/dart2js/import_mirrors_test.dart
index 1b16f762a1bdb680d986f0e5ba086f847da0c29d..1501d066421c30f43a82bfdd9232f75a340ad04b 100644
--- a/tests/compiler/dart2js/import_mirrors_test.dart
+++ b/tests/compiler/dart2js/import_mirrors_test.dart
@@ -342,7 +342,7 @@ import 'dart:mirrors';
Future test(Map sourceFiles,
{expectedPaths,
bool verbose: false,
- bool enableExperimentalMirrors: false}) {
+ bool enableExperimentalMirrors: false}) async {
if (expectedPaths is! List) {
expectedPaths = [expectedPaths];
}
@@ -354,24 +354,26 @@ Future test(Map sourceFiles,
if (enableExperimentalMirrors) {
options.add('--enable-experimental-mirrors');
}
- var compiler = compilerFor(sourceFiles, diagnosticHandler: collector,
- packageRoot: Uri.parse('memory:/pkg/'),
- options: options);
- return compiler.run(Uri.parse('memory:/main.dart')).then((_) {
- Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}');
- if (enableExperimentalMirrors) {
- Expect.equals(0, collector.warnings.length,
- 'Warnings: ${collector.errors}');
- } else {
- Expect.equals(1, collector.warnings.length,
- 'Warnings: ${collector.errors}');
- Expect.equals(
- MessageKind.IMPORT_EXPERIMENTAL_MIRRORS.message(
- {'importChain': expectedPaths.join(
- MessageKind.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)}).toString(),
- collector.warnings.first.message);
- }
- });
+ CompilationResult result = await runCompiler(
+ entryPoint: Uri.parse('memory:/main.dart'),
+ memorySourceFiles: sourceFiles,
+ diagnosticHandler: collector,
+ packageRoot: Uri.parse('memory:/pkg/'),
+ options: options);
+ Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}');
+ if (enableExperimentalMirrors) {
+ Expect.equals(0, collector.warnings.length,
+ 'Warnings: ${collector.errors}');
+ } else {
+ Expect.equals(1, collector.warnings.length,
+ 'Warnings: ${collector.errors}');
+ Expect.equals(
+ MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
+ collector.warnings.first.message.kind);
+ Expect.equals(
+ expectedPaths.join(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS_PADDING),
+ collector.warnings.first.message.arguments['importChain']);
+ }
}
Future checkPaths(Map sourceData) {
« no previous file with comments | « tests/compiler/dart2js/duplicate_library_test.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698