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

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

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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 | Annotate | Revision Log
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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'mock_compiler.dart'; 7 import 'mock_compiler.dart';
8 8
9 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'; 9 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart';
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'; 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart';
(...skipping 27 matching lines...) Expand all
38 38
39 _PrivateClass get private => this; 39 _PrivateClass get private => this;
40 } 40 }
41 '''; 41 ''';
42 42
43 43
44 void analyze(String text, [expectedWarnings]) { 44 void analyze(String text, [expectedWarnings]) {
45 if (expectedWarnings == null) expectedWarnings = []; 45 if (expectedWarnings == null) expectedWarnings = [];
46 if (expectedWarnings is !List) expectedWarnings = [expectedWarnings]; 46 if (expectedWarnings is !List) expectedWarnings = [expectedWarnings];
47 47
48 MockCompiler compiler = new MockCompiler(analyzeOnly: true); 48 MockCompiler compiler = new MockCompiler.internal(analyzeOnly: true);
49 compiler.registerSource(Uri.parse(PRIVATE_SOURCE_URI), PRIVATE_SOURCE); 49 compiler.registerSource(Uri.parse(PRIVATE_SOURCE_URI), PRIVATE_SOURCE);
50 compiler.diagnosticHandler = (uri, int begin, int end, String message, kind) { 50 compiler.diagnosticHandler = (uri, int begin, int end, String message, kind) {
51 SourceFile sourceFile = compiler.sourceFiles[uri.toString()]; 51 SourceFile sourceFile = compiler.sourceFiles[uri.toString()];
52 if (sourceFile != null) { 52 if (sourceFile != null) {
53 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); 53 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
54 } else { 54 } else {
55 print(message); 55 print(message);
56 } 56 }
57 }; 57 };
58 58
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Call public getter on public class. 158 // Call public getter on public class.
159 analyze('var value = publicClass.publicGetter;'); 159 analyze('var value = publicClass.publicGetter;');
160 // Call public setter on public class. 160 // Call public setter on public class.
161 analyze('publicClass.publicSetter = 0;'); 161 analyze('publicClass.publicSetter = 0;');
162 // Access public method on public class. 162 // Access public method on public class.
163 analyze('var value = publicClass.publicMethod;'); 163 analyze('var value = publicClass.publicMethod;');
164 // Call public method on public class. 164 // Call public method on public class.
165 analyze('publicClass.publicMethod();'); 165 analyze('publicClass.publicMethod();');
166 } 166 }
167 167
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/pretty_parameter_test.dart ('k') | tests/compiler/dart2js/redundant_phi_eliminator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698