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

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

Issue 1415463022: Use DiagnosticMessage in MockCompiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind; 8 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
9 import 'package:compiler/src/io/source_file.dart'; 9 import 'package:compiler/src/io/source_file.dart';
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 import '$PRIVATE_SOURCE_URI'; 65 import '$PRIVATE_SOURCE_URI';
66 66
67 void main() { 67 void main() {
68 PublicClass publicClass; 68 PublicClass publicClass;
69 $text 69 $text
70 } 70 }
71 '''; 71 ''';
72 Uri uri = Uri.parse('src:public'); 72 Uri uri = Uri.parse('src:public');
73 compiler.registerSource(uri, source); 73 compiler.registerSource(uri, source);
74 return compiler.run(uri).then((_) { 74 return compiler.run(uri).then((_) {
75 compareWarningKinds(text, expectedWarnings, compiler.warnings); 75 DiagnosticCollector collector = compiler.diagnosticCollector;
76 compareWarningKinds(text, expectedWarnings, collector.warnings);
76 }); 77 });
77 }; 78 };
78 } 79 }
79 80
80 void main() { 81 void main() {
81 asyncTest(() => Future.forEach([ 82 asyncTest(() => Future.forEach([
82 // Read from private variable. 83 // Read from private variable.
83 analyze('var value = _privateVariable;', MessageKind.CANNOT_RESOLVE), 84 analyze('var value = _privateVariable;', MessageKind.CANNOT_RESOLVE),
84 // Write to private variable. 85 // Write to private variable.
85 analyze('_privateVariable = 0;', MessageKind.CANNOT_RESOLVE), 86 analyze('_privateVariable = 0;', MessageKind.CANNOT_RESOLVE),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 analyze('var value = publicClass.publicGetter;'), 165 analyze('var value = publicClass.publicGetter;'),
165 // Call public setter on public class. 166 // Call public setter on public class.
166 analyze('publicClass.publicSetter = 0;'), 167 analyze('publicClass.publicSetter = 0;'),
167 // Access public method on public class. 168 // Access public method on public class.
168 analyze('var value = publicClass.publicMethod;'), 169 analyze('var value = publicClass.publicMethod;'),
169 // Call public method on public class. 170 // Call public method on public class.
170 analyze('publicClass.publicMethod();'), 171 analyze('publicClass.publicMethod();'),
171 ], (f) => f())); 172 ], (f) => f()));
172 } 173 }
173 174
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698