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

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

Issue 2614983004: Reapply 0c78abd0900d (Closed)
Patch Set: . Created 3 years, 11 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
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 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 7
8 import "memory_compiler.dart"; 8 import "memory_compiler.dart";
9 9
10 runTest(String source, String categories, int expectedErrors) async { 10 runTest(String source, String categories, int expectedErrors) async {
11 var collector = new DiagnosticCollector(); 11 var collector = new DiagnosticCollector();
12 await runCompiler( 12 await runCompiler(
13 memorySourceFiles: {"main.dart": source}, 13 memorySourceFiles: {"main.dart": source},
14 options: ["--categories=$categories"], 14 options: ["--categories=$categories"],
15 diagnosticHandler: collector); 15 diagnosticHandler: collector);
16 Expect.equals(expectedErrors, collector.errors.length); 16 Expect.equals(expectedErrors, collector.errors.length);
17 Expect.equals(0, collector.warnings.length); 17 Expect.equals(0, collector.warnings.length);
18 } 18 }
19 19
20 void main() { 20 void main() {
21 asyncTest(() async { 21 asyncTest(() async {
22 await runTest("import 'dart:async'; main() {}", "Client", 0); 22 await runTest("import 'dart:async'; main() {}", "Client", 0);
23 await runTest("import 'dart:async'; main() {}", "Server", 0); 23 await runTest("import 'dart:async'; main() {}", "Server", 0);
24 await runTest("import 'dart:html'; main() {}", "Client", 0); 24 await runTest("import 'dart:html'; main() {}", "Client", 0);
25 await runTest("import 'dart:html'; main() {}", "Server", 1); 25 await runTest("import 'dart:html'; main() {}", "Server", 1);
26 await runTest("import 'dart:io'; main() {}", "Client", 1); 26 await runTest("import 'dart:io'; main() {}", "Client", 1);
27 await runTest("import 'dart:io'; main() {}", "Server", 0); 27 await runTest("import 'dart:io'; main() {}", "Server", 0);
28 await runTest("import 'dart:_internal'; main() {}", "Client", 1);
29 await runTest("import 'dart:_internal'; main() {}", "Server", 1);
30 }); 28 });
31 } 29 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | tests/compiler/dart2js/kernel/constructors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698