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

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

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased 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 unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js/bad_loop_test.dart ('k') | tests/compiler/dart2js/codegen_helper.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 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.missing_file; 7 library dart2js.test.missing_file;
8 8
9 import 'dart:io' show exit; 9 import 'dart:io' show exit;
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 19 matching lines...) Expand all
30 30
31 final int FATAL = 0; 31 final int FATAL = 0;
32 final int INFO = 1; 32 final int INFO = 1;
33 33
34 final messages = []; 34 final messages = [];
35 35
36 void info(var message, [kind]) { 36 void info(var message, [kind]) {
37 messages.add([message, kind]); 37 messages.add([message, kind]);
38 } 38 }
39 39
40 void diagnosticHandler(Uri uri, int begin, int end, String message, kind) { 40 @override
41 void report(Uri uri, int begin, int end, String message, kind) {
41 messages.add([message, kind]); 42 messages.add([message, kind]);
42 } 43 }
43 44
45 @override
44 void call(Uri uri, int begin, int end, String message, kind) { 46 void call(Uri uri, int begin, int end, String message, kind) {
45 diagnosticHandler(uri, begin, end, message, kind); 47 report(uri, begin, end, message, kind);
46 } 48 }
47 49
48 String prefixMessage(String message, Diagnostic kind) { 50 String prefixMessage(String message, Diagnostic kind) {
49 return message; 51 return message;
50 } 52 }
51 53
52 int fatalCount; 54 int fatalCount;
53 55
54 int throwOnErrorCount; 56 int throwOnErrorCount;
55 } 57 }
(...skipping 11 matching lines...) Expand all
67 CollectingFormattingDiagnosticHandler handler = diagnosticHandler; 69 CollectingFormattingDiagnosticHandler handler = diagnosticHandler;
68 Expect.equals(1, handler.messages.length); 70 Expect.equals(1, handler.messages.length);
69 var message = handler.messages[0]; 71 var message = handler.messages[0];
70 Expect.isTrue(message[0].contains("Cannot open file")); 72 Expect.isTrue(message[0].contains("Cannot open file"));
71 Expect.equals(Diagnostic.ERROR, message[1]); 73 Expect.equals(Diagnostic.ERROR, message[1]);
72 Expect.equals(1, exitCode); 74 Expect.equals(1, exitCode);
73 exit(0); 75 exit(0);
74 }; 76 };
75 compile(["foo.dart", "--out=bar.dart"]); 77 compile(["foo.dart", "--out=bar.dart"]);
76 } 78 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/bad_loop_test.dart ('k') | tests/compiler/dart2js/codegen_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698